Browse Source

bug修复

wu 1 week ago
parent
commit
76a1bc443c

+ 2 - 2
src/custom/restcontroller/webmanage/sale/toolscode/SQL/商品序列号档案新增.sql

@@ -1,2 +1,2 @@
-insert into sa_itemsku (siteid, sa_itemskuid,createuserid,createby,createdate,changeuserid,changeby, changedate,sku,islimit,isused,itemid,sa_agentsid,stockid,status,changenotes,mono,isyj)
-values ($siteid$, $sa_itemskuid$,$userid$,$username$, CURRENT_TIME,$userid$, $username$, CURRENT_TIME, $sku$,$islimit$,0,$itemid$,$sa_agentsid$,$stockid$,'在库','','',$isyj$);
+insert into sa_itemsku (siteid, sa_itemskuid,createuserid,createby,createdate,changeuserid,changeby, changedate,sku,islimit,isused,itemid,sa_agentsid,stockid,status,changenotes,mono,isyj,sys_enterpriseid)
+values ($siteid$, $sa_itemskuid$,$userid$,$username$, CURRENT_TIME,$userid$, $username$, CURRENT_TIME, $sku$,$islimit$,0,$itemid$,$sa_agentsid$,$stockid$,'在库','','',$isyj$,$sys_enterpriseid$);

+ 2 - 1
src/custom/restcontroller/webmanage/sale/toolscode/SQL/商品序列号档案更新.sql

@@ -8,7 +8,8 @@ SET
     itemid=$itemid$,
     stockid=$stockid$,
     sa_agentsid = $sa_agentsid$,
-    isyj=$isyj$
+    isyj=$isyj$,
+    sys_enterpriseid=$sys_enterpriseid$
 WHERE sa_itemskuid = $sa_itemskuid$ and siteid=$siteid$
 
 

+ 10 - 5
src/custom/restcontroller/webmanage/sale/toolscode/toolscode.java

@@ -214,13 +214,20 @@ public class toolscode extends Controller {
         Long sa_itemskuid = content.getLong("sa_itemskuid");
         Long sa_agentsid = content.getLong("sa_agentsid");
         Long stockid = content.getLong("stockid");
-        // Long sys_enterpriseid = content.getLong("sys_enterpriseid");
+        Long sys_enterpriseid = 0L;
         // Long sa_logiscompid = content.getLong("sa_logiscompid");
         // Long rec_contactsid = content.getLongValue("rec_contactsid");
         long itemid = content.getLong("itemid");
         String sku = content.getString("sku");
         boolean islimit = content.getBooleanValue("islimit");
         boolean isyj = content.getBooleanValue("isyj");
+
+        Rows agentsrows = dbConnect.runSqlQuery("SELECT sys_enterpriseid,sa_agentsid from sa_agents WHERE sa_agentsid=" + sa_agentsid);
+        if (agentsrows.isNotEmpty()) {
+            sys_enterpriseid = agentsrows.get(0).getLong("sys_enterpriseid");
+        }
+
+
         SQLFactory sqlFactory = new SQLFactory(this, "商品序列号档案新增");
 
         if (sa_itemskuid <= 0 || dbConnect.runSqlQuery("select sa_itemskuid from sa_itemsku where sa_itemskuid=" + sa_itemskuid).isEmpty()) {
@@ -290,10 +297,7 @@ public class toolscode extends Controller {
 
                         insertSQL.setValue("stockid", oldstockid);
                         insertSQL.setValue("stockidnew", newstockid);
-                        insertSQL.setValue("changenotes", "");
-                        if (newitemid != 0) {
-                            insertSQL.setValue("changenotes", content.getStringValue("changenotes"));
-                        }
+                        insertSQL.setValue("changenotes", content.getStringValue("changenotes"));
 
                         insertSQL.setDateValue("changedate");
                         insertSQL.setValue("changeby", username);
@@ -314,6 +318,7 @@ public class toolscode extends Controller {
         sqlFactory.addParameter("userid", userid);
         sqlFactory.addParameter("username", username);
         sqlFactory.addParameter("sa_itemskuid", sa_itemskuid);
+        sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
         sqlList.add(sqlFactory.getSQL());
         dbConnect.runSqlUpdate(sqlList);