Kaynağa Gözat

注册证号

wu 2 ay önce
ebeveyn
işleme
6a09e3cb51

+ 55 - 43
src/custom/restcontroller/webmanage/sale/item/ExportExcel.java

@@ -203,8 +203,8 @@ public class ExportExcel {
 
 
         /*第一行*/
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 12));
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 13, 14));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 13));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 14, 15));
 
         /*第一行塞值*/
         row = sheet.createRow(0);
@@ -217,15 +217,15 @@ public class ExportExcel {
             cell.setCellValue("商品档案更新");
         }
 
-        cell = row.createCell(13);// ID
+        cell = row.createCell(14);// ID
         cell.setCellStyle(cellStyle1);
 
         /*第二行*/
-        cell = row.createCell(13);// ID
+        cell = row.createCell(14);// ID
         cell.setCellStyle(cellStyle1);
         cell.setCellValue("商品营销分类列表");
 
-        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 14));
+        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 15));
         /*第二行塞值*/
         row = sheet.createRow(1);
         cell = row.createCell(0);// ID
@@ -237,7 +237,7 @@ public class ExportExcel {
 
         cell = row.createCell(0);
         cell.setCellStyle(cellStyle3);
-        cell.setCellValue("产品编(必填)");
+        cell.setCellValue("产品编(必填)");
 
         cell = row.createCell(1);
         cell.setCellStyle(cellStyle3);
@@ -257,13 +257,17 @@ public class ExportExcel {
 
         cell = row.createCell(4);
         cell.setCellStyle(cellStyle3);
+        cell.setCellValue("注册证号(必填)");
+
+        cell = row.createCell(5);
+        cell.setCellStyle(cellStyle3);
         if (isInsert) {
             cell.setCellValue("计量单位(必填)");
         } else {
             cell.setCellValue("计量单位");
         }
 
-        cell = row.createCell(5);
+        cell = row.createCell(6);
         cell.setCellStyle(cellStyle3);
         if (isInsert) {
             cell.setCellValue("品名(必填)");
@@ -271,7 +275,7 @@ public class ExportExcel {
             cell.setCellValue("品名");
         }
 
-        cell = row.createCell(6);
+        cell = row.createCell(7);
         cell.setCellStyle(cellStyle3);
         if (isInsert) {
             cell.setCellValue("品号(必填)");
@@ -279,35 +283,35 @@ public class ExportExcel {
             cell.setCellValue("品号");
         }
 
-        cell = row.createCell(7);
+        cell = row.createCell(8);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("辅助说明");
 
-        cell = row.createCell(8);
+        cell = row.createCell(9);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("俗称释义");
 
-        cell = row.createCell(9);
+        cell = row.createCell(10);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("备货分类");
 
-        cell = row.createCell(10);
+        cell = row.createCell(11);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("销售起订量(必填)");
 
-        cell = row.createCell(11);
+        cell = row.createCell(12);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("销售增量(必填)");
 
-        cell = row.createCell(12);
+        cell = row.createCell(13);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("备注");
 
-        cell = row.createCell(13);
+        cell = row.createCell(14);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("品牌");
 
-        cell = row.createCell(14);
+        cell = row.createCell(15);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("营销类别编码");
 
@@ -333,31 +337,31 @@ public class ExportExcel {
 
         cell = row.createCell(4);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("");
+        cell.setCellValue("123456789");
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("测试");
+        cell.setCellValue("");
 
         cell = row.createCell(6);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("NBNTO-28571530003");
+        cell.setCellValue("测试");
 
         cell = row.createCell(7);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("辅助说明");
+        cell.setCellValue("NBNTO-28571530003");
 
         cell = row.createCell(8);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("俗称释义");
+        cell.setCellValue("辅助说明");
 
         cell = row.createCell(9);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("常规备货");
+        cell.setCellValue("俗称释义");
 
         cell = row.createCell(10);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("1");
+        cell.setCellValue("常规备货");
 
         cell = row.createCell(11);
         cell.setCellStyle(cellStyle4);
@@ -365,14 +369,18 @@ public class ExportExcel {
 
         cell = row.createCell(12);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("备注");
+        cell.setCellValue("1");
 
         cell = row.createCell(13);
         cell.setCellStyle(cellStyle4);
-        cell.setCellValue("普瑞顺祥");
+        cell.setCellValue("备注");
 
         cell = row.createCell(14);
         cell.setCellStyle(cellStyle4);
+        cell.setCellValue("普瑞顺祥");
+
+        cell = row.createCell(15);
+        cell.setCellStyle(cellStyle4);
         cell.setCellValue("001/002");
 
     }
@@ -405,8 +413,8 @@ public class ExportExcel {
 
 
         /*第一行*/
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 12));
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 13, 14));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 13));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 14, 15));
         /*第一行塞值*/
         row = sheet.createRow(0);
         cell = row.createCell(0);// ID
@@ -417,15 +425,15 @@ public class ExportExcel {
             cell.setCellValue("商品档案更新");
         }
         /*第二行*/
-        cell = row.createCell(13);// ID
-        cell.setCellStyle(cellStyle1);
-        cell.setCellValue("商品营销分类列表");
         cell = row.createCell(14);// ID
         cell.setCellStyle(cellStyle1);
+        cell.setCellValue("商品营销分类列表");
         cell = row.createCell(15);// ID
         cell.setCellStyle(cellStyle1);
+        cell = row.createCell(16);// ID
+        cell.setCellStyle(cellStyle1);
 
-        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 15));
+        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 16));
         /*第二行塞值*/
         row = sheet.createRow(1);
         cell = row.createCell(0);// ID
@@ -437,7 +445,7 @@ public class ExportExcel {
 
         cell = row.createCell(0);
         cell.setCellStyle(cellStyle3);
-        cell.setCellValue("产品编(必填)");
+        cell.setCellValue("产品编(必填)");
 
         cell = row.createCell(1);
         cell.setCellStyle(cellStyle3);
@@ -457,13 +465,17 @@ public class ExportExcel {
 
         cell = row.createCell(4);
         cell.setCellStyle(cellStyle3);
+        cell.setCellValue("注册证号(必填)");
+
+        cell = row.createCell(5);
+        cell.setCellStyle(cellStyle3);
         if (isInsert) {
             cell.setCellValue("计量单位(必填)");
         } else {
             cell.setCellValue("计量单位");
         }
 
-        cell = row.createCell(5);
+        cell = row.createCell(6);
         cell.setCellStyle(cellStyle3);
         if (isInsert) {
             cell.setCellValue("品名(必填)");
@@ -471,7 +483,7 @@ public class ExportExcel {
             cell.setCellValue("品名");
         }
 
-        cell = row.createCell(6);
+        cell = row.createCell(7);
         cell.setCellStyle(cellStyle3);
         if (isInsert) {
             cell.setCellValue("品号(必填)");
@@ -479,39 +491,39 @@ public class ExportExcel {
             cell.setCellValue("品号");
         }
 
-        cell = row.createCell(7);
+        cell = row.createCell(8);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("辅助说明");
 
-        cell = row.createCell(8);
+        cell = row.createCell(9);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("俗称释义");
 
-        cell = row.createCell(9);
+        cell = row.createCell(10);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("备货分类");
 
-        cell = row.createCell(10);
+        cell = row.createCell(11);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("销售起订量(必填)");
 
-        cell = row.createCell(11);
+        cell = row.createCell(12);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("销售增量(必填)");
 
-        cell = row.createCell(12);
+        cell = row.createCell(13);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("特殊说明");
 
-        cell = row.createCell(13);
+        cell = row.createCell(14);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("品牌");
 
-        cell = row.createCell(14);
+        cell = row.createCell(15);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("营销类别编码");
 
-        cell = row.createCell(15);
+        cell = row.createCell(16);
         cell.setCellStyle(cellStyle3);
         cell.setCellValue("错误信息");
     }

+ 18 - 19
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -49,32 +49,19 @@ public class Item extends Controller {
         boolean isauxunit = content.getBoolean("isauxunit");
         String itemname = content.getString("itemname");
         Long plm_itemextendid = content.getLongValue("plm_itemextendid");
-        Rows rows = dbConnect.runSqlQuery("SELECT * from plm_item WHERE (itemtype='成品' or isshow=1 ) and itemno='" + itemno + "' and siteid='" + siteid + "'");
-
-        if (rows.isNotEmpty()) {
-            long tempitemid = rows.get(0).getLong("itemid");
-            if (itemid > 0 && itemid != tempitemid) {
-                return getErrReturnObject().setErrMsg("当前料号已存在").toString();
-            }
-            itemid = tempitemid;
-            Rows itemextendrows = dbConnect.runSqlQuery("select * from plm_itemextend WHERE itemid='" + itemid + "' and siteid='" + siteid + "'");
-            if (itemextendrows.isNotEmpty()) {
-                plm_itemextendid = itemextendrows.get(0).getLong("plm_itemextendid");
-            }
-        }
 
         ArrayList<String> sqlList = new ArrayList<>();
 
 
         SQLFactory sqlFactory = new SQLFactory(this, "货品档案新增");
         if (itemid <= 0) {
-            if (dbConnect.runSqlQuery("SELECT 1 from plm_item  WHERE itemno='" + itemno + "' and siteid='" + siteid + "' and (itemtype='成品' or isshow=1 )").isNotEmpty()) {
+            if (dbConnect.runSqlQuery("SELECT 1 from plm_item  WHERE itemno='" + itemno + "' and siteid='" + siteid + "'").isNotEmpty()) {
                 return getErrReturnObject().setErrMsg("商品编号已存在").toString();
             }
             itemid = createTableID("plm_item");
             sqlList.add(DataContrlLog.createLog(this, "plm_item", itemid, "新增", "新建商品:" + itemname).getSQL());
         } else {
-            if (dbConnect.runSqlQuery("SELECT 1 from plm_item WHERE itemid=" + itemid + " and siteid ='" + siteid + "' and (itemtype='成品' or isshow=1 )")
+            if (dbConnect.runSqlQuery("SELECT 1 from plm_item WHERE itemid=" + itemid + " and siteid ='" + siteid + "'")
                     .isEmpty()) {
                 return getReturnObject().setCode("0132", new String[0]).toString();//数据不存在
 
@@ -147,6 +134,7 @@ public class Item extends Controller {
         sqlFactory.addParameter("goodstype", content.getStringValue("goodstype"));
         sqlFactory.addParameter("explains", content.getStringValue("explains"));
         sqlFactory.addParameter("assistance", content.getStringValue("assistance"));
+        sqlFactory.addParameter("registration_number", content.getStringValue("registration_number"));
         sqlList.add(sqlFactory.getSQL());
         // 货品档案扩展属性字段表
 
@@ -704,6 +692,7 @@ public class Item extends Controller {
             keys.add("itemname");
             keys.add("spec");
             keys.add("model");
+            keys.add("registration_number");
             keys.add("unitname");
             keys.add("erpitemname");
             keys.add("erpitemno");
@@ -747,6 +736,7 @@ public class Item extends Controller {
                     insertSQL.setValue("goodstype", row.getString("goodstype"));
                     insertSQL.setValue("orderminqty", row.getString("orderminqty"));
                     insertSQL.setValue("orderaddqty", row.getString("orderaddqty"));
+                    insertSQL.setValue("registration_number", row.getString("registration_number"));
                     insertSQL.setValue("status", "新建");
                     sqlList.add(insertSQL.getSQL());
                     // 货品档案扩展属性字段表
@@ -830,7 +820,7 @@ public class Item extends Controller {
                 } else {
                     datarow.createCell(i1).setCellValue(row.getString(keylist.get(i1)));
                 }
-                if (i1 == 15) {
+                if (i1 == 16) {
                     datarow.getCell(i1).setCellStyle(xssfCellStyle1);
                 }
             }
@@ -1219,7 +1209,7 @@ public class Item extends Controller {
             if (iserr) {
                 ExcelFactory excelFactory = new ExcelFactory("货品档案图片导入错误信息");
                 HashMap<String, String> map = new HashMap<String, String>();
-                map.put("itemno", "产品编");
+                map.put("itemno", "产品编");
                 map.put("attionfosName", "图片名称");
                 map.put("msg", "错误信息");
                 ArrayList<String> colNameList = new ArrayList<String>();
@@ -1318,6 +1308,7 @@ public class Item extends Controller {
             keys.add("itemname");
             keys.add("spec");
             keys.add("model");
+            keys.add("registration_number");
             keys.add("unitname");
             keys.add("erpitemname");
             keys.add("erpitemno");
@@ -1430,9 +1421,14 @@ public class Item extends Controller {
             String goodstype = row.getString("goodstype");
             String erpitemname = row.getString("erpitemname");
             String erpitemno = row.getString("erpitemno");
+            String registration_number = row.getString("registration_number");
+            if (StringUtils.isEmpty(registration_number)) {
+                iserr = true;
+                errmsg.append("注册证号未填写;");
+            }
             if (StringUtils.isEmpty(itemno)) {
                 iserr = true;
-                errmsg.append("产品编码必填;");
+                errmsg.append("产品编必填;");
             }
             if (StringUtils.isEmpty(itemname) && isInsert) {
                 iserr = true;
@@ -1560,10 +1556,11 @@ public class Item extends Controller {
     public String errImport(Rows rowserr, Boolean isInsert) throws YosException {
         ExcelFactory excelFactory = new ExcelFactory("货品档案导入错误信息");
         HashMap<String, String> map = new HashMap<String, String>();
-        map.put("itemno", "产品编");
+        map.put("itemno", "产品编");
         map.put("itemname", "产品名称");
         map.put("spec", "型号");
         map.put("model", "规格");
+        map.put("registration_number", "注册证号");
         map.put("unitname", "计量单位");
         map.put("erpitemname", "品名");
         map.put("erpitemno", "品号");
@@ -1583,6 +1580,7 @@ public class Item extends Controller {
         colNameList.add("itemname");
         colNameList.add("spec");
         colNameList.add("model");
+        colNameList.add("registration_number");
         colNameList.add("unitname");
         colNameList.add("erpitemname");
         colNameList.add("erpitemno");
@@ -1600,6 +1598,7 @@ public class Item extends Controller {
         keytypemap.put("itemname", String.class);
         keytypemap.put("spec", String.class);
         keytypemap.put("model", String.class);
+        keytypemap.put("registration_number", String.class);
         keytypemap.put("unitname", String.class);
         keytypemap.put("erpitemname", String.class);
         keytypemap.put("erpitemno", String.class);

+ 2 - 2
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案新增.sql

@@ -2,9 +2,9 @@ insert into plm_item (siteid, itemid, createby, createdate, changeuserid, change
                       isauxunit, unitgroupid, itemname, isonsale, status, model, spec, orderminqty, orderaddqty,
                       orderminqty_auxunit, orderaddqty_auxunit, remarks, barcode, skucontrol, batchcontrol, grossweight,
                       weight, height, width, length, delivery, istool, marketprice, standards,standardsmx, stockstatus2,
-                      stockstatus1, warrantyday, iswuliao, isservice,packqty,isshow,explains,goodstype,assistance)
+                      stockstatus1, warrantyday, iswuliao, isservice,packqty,isshow,explains,goodstype,assistance,registration_number)
 values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURRENT_TIME, $itemno$, $unitid$,
         $isauxunit$, $unitgroupid$, $itemname$, $isonsale$, '新建', $model$, $spec$, $orderminqty$, $orderaddqty$,
         $orderminqty_auxunit$, $orderaddqty_auxunit$, $remarks$, $barcode$, $skucontrol$, $batchcontrol$, $grossweight$,
         $weight$, $height$, $width$, $length$, $delivery$, $istool$, $marketprice$, $standards$,$standardsmx$,
-        $stockstatus2$, $stockstatus1$, $warrantyday$, $iswuliao$, $isservice$,$packqty$,1,$explains$,$goodstype$,$assistance$)
+        $stockstatus2$, $stockstatus1$, $warrantyday$, $iswuliao$, $isservice$,$packqty$,1,$explains$,$goodstype$,$assistance$,$registration_number$)

+ 2 - 1
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案更新.sql

@@ -37,7 +37,8 @@ SET changeuserid=$userid$,
     isshow=1,
     explains = $explains$,
     goodstype=$goodstype$,
-    assistance=$assistance$
+    assistance=$assistance$,
+    registration_number=$registration_number$
 WHERE itemid = $itemid$
   and siteid = $siteid$