Forráskód Böngészése

发货单所有明细查询优化

hu 2 éve
szülő
commit
cb8d639df8

+ 1 - 0
src/custom/restcontroller/webmanage/sale/dispatch/SQL/发货单明细所有列表查询.sql

@@ -3,6 +3,7 @@ SELECT t1.sa_dispatch_itemsid,
        t1.sa_orderitemsid,
        t4.billno,
        t4.status,
+       t8.sa_orderid,
        t8.sonum,
        t10.enterprisename,
        t9.agentnum,

+ 1 - 1
src/custom/restcontroller/webmanage/sale/dispatch/dispatchItems.java

@@ -310,7 +310,7 @@ public class dispatchItems extends Controller {
             if (whereObject.containsKey("isnotsent") && !"".equals(whereObject.getString("isnotsent"))) {
                 if(whereObject.getBooleanValue("isnotsent")){
                     //System.out.println(" and t4.status ='复核' and  ifnull(t1.outwarehouseqty, 0)< ifnull(t1.qty, 0)");
-                    where.append(" and t1.sa_dispatchid in(select t1.sa_dispatchid from sa_dispatch_items t1  LEFT JOIN sa_dispatch t4 ON t4.sa_dispatchid = t1.sa_dispatchid AND t4.siteid = t1.siteid where  t4.status ='复核' and  ifnull(t1.outwarehouseqty, 0)< ifnull(t1.qty, 0) and ifnull(t1.outwarehouseqty, 0)>0)");
+                    where.append(" and  ifnull(t1.qty, 0)> ifnull(t1.outwarehouseqty, 0) and  t1.sa_dispatchid in(select t1.sa_dispatchid from sa_dispatch_items t1  LEFT JOIN sa_dispatch t4 ON t4.sa_dispatchid = t1.sa_dispatchid AND t4.siteid = t1.siteid where  t4.status ='复核' and  ifnull(t1.outwarehouseqty, 0)< ifnull(t1.qty, 0) and ifnull(t1.outwarehouseqty, 0)>0)");
                 }
 
             }