Browse Source

Merge branch 'develop' into develop-green

hu 3 months ago
parent
commit
7449865927
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

+ 9 - 0
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -798,6 +798,15 @@ public class dispatch extends Controller {
         Rows rowsDispatchDetailGroupByItem = dbConnect.runSqlQuery("select sum(t1.qty) qty,t2.itemno,ifnull(t1.batchno,'') batchno,0 invbalqty from sa_dispatch_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid  where t1.sa_dispatchid=" + sa_dispatchid + " group by t2.itemno,ifnull(t1.batchno,'')");
         RowsMap rowsMapDispatchDetailGroupByItem = rowsDispatchDetailGroupByItem.toRowsMap("itemno");
 
+        if( Parameter.get(siteid, "dispatch_strongbatch").equals("1")){
+            Rows rowsOrderDetailBatchcontrol = dbConnect.runSqlQuery("select t2.itemno,t1.batchno from sa_dispatch_items t1 left join plm_item t2 on t1.itemid = t2.itemid and t1.siteid = t2.siteid where t1.batchcontrol=1 and  t1.sa_dispatchid=" + sa_dispatchid);
+            for(Row row :rowsOrderDetailBatchcontrol){
+                if(StringUtils.isBlank(row.getString("batchno"))){
+                    return getErrReturnObject().setErrMsg("发货商品" + row.getString("itemno") + "为批次管理的商品,一定要填写批次信息!")
+                            .toString();
+                }
+            }
+        }
         if (siteid.equalsIgnoreCase("lsa") && Parameter.get(siteid, "dispatchinstock").equals("1")) {
             JSONObject object = new JSONObject();
             object.put("classname", "getIcinvbal");