瀏覽代碼

同步出库单时发货单可关闭条件判断更新

hu 2 年之前
父節點
當前提交
27cf37c8f2

+ 2 - 2
src/custom/restcontroller/webmanage/lsak3/stockbill/stockbill.java

@@ -317,8 +317,8 @@ public class stockbill extends Controller {
             Rows stockbillrows =dbConnect.runSqlQuery("select st_stockbillid,status,rb from st_stockbill where billno='"+fbillnum+"' and siteid='lsa1986'");
             if(frb.equals("蓝")){
                 //查询可关闭的发货单
-                Rows dispatchrows =dbConnect.runSqlQuery( "select t.sa_dispatchid from (select t2.sa_dispatchid,sum(t2.qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid where t1.st_stockbillid = "+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986' group by t2.sa_dispatchid) t where t.sumqty=t.sumoutwarehouseqty");
-                Rows undispatchrows =dbConnect.runSqlQuery( "select t.sa_dispatchid from (select t2.sa_dispatchid,sum(t2.qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid where t1.st_stockbillid = "+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986' group by t2.sa_dispatchid) t where t.sumqty!=t.sumoutwarehouseqty");
+                Rows dispatchrows =dbConnect.runSqlQuery("select t.sa_dispatchid from (select sa_dispatchid,sum(qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items where sa_dispatchid in(select sa_dispatchid from sa_dispatch_items where sa_dispatch_itemsid in(select t1.sa_dispatch_itemsid from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986')) group by sa_dispatchid)t where t.sumqty=t.sumoutwarehouseqty");
+                Rows undispatchrows =dbConnect.runSqlQuery("select t.sa_dispatchid from (select sa_dispatchid,sum(qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items where sa_dispatchid in(select sa_dispatchid from sa_dispatch_items where sa_dispatch_itemsid in(select t1.sa_dispatch_itemsid from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986')) group by sa_dispatchid)t where t.sumqty!=t.sumoutwarehouseqty");
                 ArrayList<String>  sqldispatch =new ArrayList<>();
                 for (Row row:dispatchrows) {
                     sqldispatch.add("update sa_dispatch set status='关闭',closedate=current_time,closeby='admin' where sa_dispatchid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa1986'");

+ 1 - 1
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -1234,7 +1234,7 @@ public class Order extends Controller {
             return getErrReturnObject().setErrMsg("订单表体行号为【" + orderitems.get(0).getLong("rowno") + "】的商品数量为0无法提交").toString();
         }
         String type = row.getString("type");
-        if (!type.equals("促销订单")) {
+        if (type.equals("标准订单")) {
             Rows iteminfos = dbConnect.runSqlQuery("select t2.itemno from sa_orderitems t1 inner join plm_item t2 on t1.siteid=t2.siteid and t1.itemid=t2.itemid where t1.sa_orderid=" + sa_orderid + " and t1.siteid='" + siteid + "' and t2.isonsale!=1");
             if (iteminfos.isNotEmpty()) {
                 return getErrReturnObject().setErrMsg("检测到品号"+iteminfos.get(0).getLong("itemno") + "未上架,请删除后重试").toString();