Просмотр исходного кода

经销商出入库可以不指定表体id直接新增序列号,代码自动判断生成表体明细

shenjingwei 2 дней назад
Родитель
Сommit
ca771e884e
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      src/custom/restcontroller/crm/agent/stock/stockbill.java

+ 1 - 2
src/custom/restcontroller/crm/agent/stock/stockbill.java

@@ -359,6 +359,7 @@ public class stockbill extends Controller {
             return getErrReturnObject().setErrCode(2).setErrMsg("序列号" + sku + "当前归属经销商错误,是否申请调拨?").toString();
         }
         long itemid = skuRows.get(0).getLong("itemid");
+        Enterprise.addSiteItems(dbConnect, siteid, sys_enterpriseid, itemid);//判断并生成商品档案
         long sys_enterprise_itemid = 0;
         QuerySQL sys_enterprise_itemQuery = SQLFactory.createQuerySQL(dbConnect, "sys_enterprise_item", "sys_enterprise_itemid");
         sys_enterprise_itemQuery.setSiteid(siteid);
@@ -374,8 +375,6 @@ public class stockbill extends Controller {
         if (SQLFactory.createQuerySQL(this, "sys_enterprise_stockbill_skus").setWhere("sku", sku).setWhere("sys_enterprise_stockbillid", sys_enterprise_stockbillid).query().isEmpty()) {
             SQLList sqlList = new SQLList();
             if (sys_enterprise_stockbill_itemsid == 0) {//如果没有指定货品明细ID,则自动生成
-                Enterprise.addSiteItems(dbConnect, siteid, sys_enterpriseid, itemid);//判断并生成商品档案
-
                 Rows stockbill_itemsRows = SQLFactory.createQuerySQL(this, "sys_enterprise_stockbill_items", "sys_enterprise_stockbill_itemsid").setWhere("sys_enterprise_stockbillid", sys_enterprise_stockbillid).setWhere("sys_enterprise_itemid", sys_enterprise_itemid).query();
                 if (stockbill_itemsRows.isEmpty()) {//如果出入库表体不存在,则新增
                     long sa_custorderid = rows.get(0).getLong("sa_custorderid");