Ver Fonte

目标管理导入优化

hu há 3 meses atrás
pai
commit
986383cbc0

+ 22 - 22
src/custom/restcontroller/webmanage/sale/salestarget/enterpriseexcel.java

@@ -74,7 +74,7 @@ public class enterpriseexcel {
         cellStyle2.setBorderRight(BorderStyle.THIN);//右边框
         cellStyle2.setWrapText(true);
         /*第一行*/
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 17));//2.申请年度单位
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 5));//2.申请年度单位
 
         /*第一行塞值*/
         row = sheet.createRow(0);
@@ -113,14 +113,14 @@ public class enterpriseexcel {
         cell.setCellStyle(cellStyle2);
         cell.setCellValue("4季度(基本)");
 
-
-        for (int i = 1; i < 13; i++) {
-            cell = row.createCell(i + 5);
-            cell.setCellStyle(cellStyle2);
-            cell.setCellValue(i + "月(基本)");
-
-        }
-
+//
+//        for (int i = 1; i < 13; i++) {
+//            cell = row.createCell(i + 5);
+//            cell.setCellStyle(cellStyle2);
+//            cell.setCellValue(i + "月(基本)");
+//
+//        }
+//
 
 
 
@@ -132,12 +132,12 @@ public class enterpriseexcel {
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("TEST0001");
 
-        for (int i = 1; i < 18; i++) {
-            cell = row.createCell(i);
-            cell.setCellStyle(cellStyle3);
-            cell.setCellValue("0");
-
-        }
+//        for (int i = 1; i < 18; i++) {
+//            cell = row.createCell(i);
+//            cell.setCellStyle(cellStyle3);
+//            cell.setCellValue("0");
+//
+//        }
 
 
     }
@@ -166,7 +166,7 @@ public class enterpriseexcel {
         cellStyle1.setWrapText(true);
 
         /*第一行*/
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 18));//2.提示信息
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));//2.提示信息
 
         /*第一行塞值*/
         row = sheet.createRow(0);
@@ -208,13 +208,13 @@ public class enterpriseexcel {
         cell.setCellValue("4季度(基本)");
 
 
-        for (int i = 1; i < 13; i++) {
-            cell = row.createCell( i + 5);
-            cell.setCellStyle(cellStyle2);
-            cell.setCellValue(i + "月(基本)");
-        }
+//        for (int i = 1; i < 13; i++) {
+//            cell = row.createCell( i + 5);
+//            cell.setCellStyle(cellStyle2);
+//            cell.setCellValue(i + "月(基本)");
+//        }
 
-        cell = row.createCell(18);
+        cell = row.createCell(6);
         cell.setCellStyle(cellStyle2);
         cell.setCellValue("错误信息");
 

+ 3 - 33
src/custom/restcontroller/webmanage/sale/salestarget/enterprisetarget.java

@@ -513,12 +513,6 @@ public class enterprisetarget extends Controller {
                 cellMap.put(keyl, CellType.STRING);
             }
 
-            for (int i = 1; i < 13; i++) {
-                keyl = "m" + i + "l";
-                keys.add(keyl);
-                cellMap.put(keyl, CellType.STRING);
-            }
-
             cellMap.put("name", CellType.STRING);
             Rows rows = e.getSheetRows(0, keys,cellMap, 2);
             ArrayList<String> agentnumList = new ArrayList<>();
@@ -533,7 +527,7 @@ public class enterprisetarget extends Controller {
             String sql = sqlFactory.getSQL();
              System.out.println(sql);
             RowsMap agentRowsMap = dbConnect.runSqlQuery(sql).toRowsMap("agentnum");
-            String[] types = {"年", "季", "月"};
+            String[] types = {"年", "季"};
             boolean iserr = false;
             Rows rowserr = new Rows();
             Rows rowssuc = new Rows();
@@ -552,8 +546,6 @@ public class enterprisetarget extends Controller {
                                 point = 1;
                             } else if (type.equals("季")) {
                                 point = 4;
-                            } else if (type.equals("月")) {
-                                point = 12;
                             } else {
                                 point = 0;
                             }
@@ -580,15 +572,6 @@ public class enterprisetarget extends Controller {
                                         break;
                                     }
                                 }
-                                if (type.equals("月")) {
-                                    if(!isNumeric(row.getString("m" + (i + 1) + "l"))){
-                                        System.out.println("月");
-                                        iserr = true;
-                                        row.put("msg", "第"+(i + 1)+"月度目标不为数字格式,请检查");
-                                        rowserr.add(row);
-                                        break;
-                                    }
-                                }
                             }
                         }
                         if(StringUtils.isBlank(row.getString("msg"))){
@@ -625,8 +608,6 @@ public class enterprisetarget extends Controller {
                             point = 1;
                         } else if (type.equals("季")) {
                             point = 4;
-                        } else if (type.equals("月")) {
-                            point = 12;
                         } else {
                             point = 0;
                         }
@@ -642,10 +623,7 @@ public class enterprisetarget extends Controller {
                                 target_l = row.getDouble("s" + (i + 1) + "l");
                                 target_h = row.getDouble("s" + (i + 1) + "h");
                             }
-                            if (type.equals("月")) {
-                                target_l = row.getDouble("m" + (i + 1) + "l");
-                                target_h = row.getDouble("m" + (i + 1) + "h");
-                            }
+
 
 
                             SQLFactory targetFactory = new SQLFactory(this, "企业-目标明细新增");
@@ -691,10 +669,6 @@ public class enterprisetarget extends Controller {
                     key_l = "s" + a + "l";
                     colNameList.add(key_l);
                 }
-                for (int a = 1; a < 13; a++) {
-                    key_l = "m" + a + "l";
-                    colNameList.add(key_l);
-                }
                 colNameList.add("msg");
 
 
@@ -706,10 +680,6 @@ public class enterprisetarget extends Controller {
                     key_l = "s" + a + "l";
                     keytypemap.put(key_l, String.class);
                 }
-                for (int a = 1; a < 13; a++) {
-                    key_l = "m" + a + "l";
-                    keytypemap.put(key_l, String.class);
-                }
 
 
                 keytypemap.put("msg", String.class);
@@ -766,7 +736,7 @@ public class enterprisetarget extends Controller {
                 } else {
                     datarow.createCell(i1).setCellValue(row.getString(keylist.get(i1)));
                 }
-                if (i1 == 18) {
+                if (i1 == 6) {
                     datarow.getCell(i1).setCellStyle(xssfCellStyle1);
                 }
             }

+ 8 - 33
src/custom/restcontroller/webmanage/sale/salestarget/personnel.java

@@ -469,10 +469,10 @@ public class personnel extends Controller {
                 keys.add(keyl);
             }
 
-            for (int i = 1; i < 13; i++) {
-                keyl = "m" + i + "l";
-                keys.add(keyl);
-            }
+//            for (int i = 1; i < 13; i++) {
+//                keyl = "m" + i + "l";
+//                keys.add(keyl);
+//            }
             Rows rows = e.getSheetRows(0, keys, 2);
             ArrayList<String> areanameList = new ArrayList<>();
             for (Row row : rows) {
@@ -485,7 +485,7 @@ public class personnel extends Controller {
             sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
             String sql = sqlFactory.getSQL();
             RowsMap areaRowsMap = dbConnect.runSqlQuery(sql).toRowsMap("areaname");
-            String[] types = {"年", "季", "月"};
+            String[] types = {"年", "季"};
             boolean iserr = false;
             Rows rowserr = new Rows();
             Rows rowssuc = new Rows();
@@ -505,8 +505,6 @@ public class personnel extends Controller {
                                     point = 1;
                                 } else if (type.equals("季")) {
                                     point = 4;
-                                } else if (type.equals("月")) {
-                                    point = 12;
                                 } else {
                                     point = 0;
                                 }
@@ -530,14 +528,6 @@ public class personnel extends Controller {
                                             break;
                                         }
                                     }
-                                    if (type.equals("月")) {
-                                        if(!isNumeric(row.getString("m" + (i + 1) + "l"))){
-                                            iserr = true;
-                                            row.put("msg", "第"+(i + 1)+"月度目标不为数字格式,请检查");
-                                            rowserr.add(row);
-                                            break;
-                                        }
-                                    }
                                 }
 
                             }
@@ -557,7 +547,7 @@ public class personnel extends Controller {
 
 
             System.out.println("rowssuc"+rowssuc.size());
-            long[] ids = createTableID("sa_salestarget", rowssuc.size() * 17);
+            long[] ids = createTableID("sa_salestarget", rowssuc.size() * 5);
             int index = 1;
 
             if (!rowssuc.isEmpty()) {
@@ -582,9 +572,7 @@ public class personnel extends Controller {
                             point = 1;
                         } else if (type.equals("季")) {
                             point = 4;
-                        } else if (type.equals("月")) {
-                            point = 12;
-                        } else {
+                        }  else {
                             point = 0;
                         }
 
@@ -599,10 +587,6 @@ public class personnel extends Controller {
                                 target_l = row.getDouble("s" + (i + 1) + "l");
                                 target_h = row.getDouble("s" + (i + 1) + "h");
                             }
-                            if (type.equals("月")) {
-                                target_l = row.getDouble("m" + (i + 1) + "l");
-                                target_h = row.getDouble("m" + (i + 1) + "h");
-                            }
 
 
                             SQLFactory targetFactory = new SQLFactory(this, "人员-目标明细新增");
@@ -647,10 +631,6 @@ public class personnel extends Controller {
                     key_l = "s" + a + "l";
                     colNameList.add(key_l);
                 }
-                for (int a = 1; a < 13; a++) {
-                    key_l = "m" + a + "l";
-                    colNameList.add(key_l);
-                }
                 colNameList.add("msg");
 
 
@@ -662,11 +642,6 @@ public class personnel extends Controller {
                     key_l = "s" + a + "l";
                     keytypemap.put(key_l, String.class);
                 }
-                for (int a = 1; a < 13; a++) {
-                    key_l = "m" + a + "l";
-                    keytypemap.put(key_l, String.class);
-                }
-
 
                 keytypemap.put("msg", String.class);
                 rowserr.setFieldList(colNameList);
@@ -722,7 +697,7 @@ public class personnel extends Controller {
                 } else {
                     datarow.createCell(i1).setCellValue(row.getString(keylist.get(i1)));
                 }
-                if (i1 == 18) {
+                if (i1 == 6) {
                     datarow.getCell(i1).setCellStyle(xssfCellStyle1);
                 }
             }

+ 19 - 19
src/custom/restcontroller/webmanage/sale/salestarget/personnelexcel.java

@@ -79,7 +79,7 @@ public class personnelexcel {
         cellStyle2.setBorderRight(BorderStyle.THIN);//右边框
         cellStyle2.setWrapText(true);
         /*第一行*/
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 17));//2.申请年度单位
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 5));//2.申请年度单位
 
         /*第一行塞值*/
         row = sheet.createRow(0);
@@ -119,12 +119,12 @@ public class personnelexcel {
         cell.setCellValue("4季度(基本)");
 
 
-        for (int i = 1; i < 13; i++) {
-            cell = row.createCell(i + 5);
-            cell.setCellStyle(cellStyle2);
-            cell.setCellValue(i + "月(基本)");
-
-        }
+//        for (int i = 1; i < 13; i++) {
+//            cell = row.createCell(i + 5);
+//            cell.setCellStyle(cellStyle2);
+//            cell.setCellValue(i + "月(基本)");
+//
+//        }
 
 
 
@@ -137,12 +137,12 @@ public class personnelexcel {
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("区域名称");
 
-        for (int i = 1; i < 18; i++) {
-            cell = row.createCell(i);
-            cell.setCellStyle(cellStyle3);
-            cell.setCellValue("0");
-
-        }
+//        for (int i = 1; i < 18; i++) {
+//            cell = row.createCell(i);
+//            cell.setCellStyle(cellStyle3);
+//            cell.setCellValue("0");
+//
+//        }
 
 
     }
@@ -213,13 +213,13 @@ public class personnelexcel {
         cell.setCellValue("4季度(基本)");
 
 
-        for (int i = 1; i < 13; i++) {
-            cell = row.createCell( i + 5);
-            cell.setCellStyle(cellStyle2);
-            cell.setCellValue(i + "月(基本)");
-        }
+//        for (int i = 1; i < 13; i++) {
+//            cell = row.createCell( i + 5);
+//            cell.setCellStyle(cellStyle2);
+//            cell.setCellValue(i + "月(基本)");
+//        }
 
-        cell = row.createCell(18);
+        cell = row.createCell(6);
         cell.setCellStyle(cellStyle2);
         cell.setCellValue("错误信息");