Sfoglia il codice sorgente

订单商品范围调整

eganwu 3 anni fa
parent
commit
41b28a90f5

+ 3 - 3
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -395,9 +395,9 @@ public class OrderItems extends Controller {
         }
         }
         SQLFactory sqlFactory = new SQLFactory(this, "查询可添加商品列表", pageSize, pageNumber, pageSorting);
         SQLFactory sqlFactory = new SQLFactory(this, "查询可添加商品列表", pageSize, pageNumber, pageSorting);
         switch (type) {
         switch (type) {
-            case "工具订单":
-                sqlFactory = new SQLFactory(this, "查询可添加商品列表_工具订单", pageSize, pageNumber, pageSorting);
-                break;
+//            case "工具订单":
+//                sqlFactory = new SQLFactory(this, "查询可添加商品列表_工具订单", pageSize, pageNumber, pageSorting);
+//                break;
             case "特殊订单":
             case "特殊订单":
                 sqlFactory = new SQLFactory(this, "查询可添加商品列表_特殊订单", pageSize, pageNumber, pageSorting);
                 sqlFactory = new SQLFactory(this, "查询可添加商品列表_特殊订单", pageSize, pageNumber, pageSorting);
                 sqlFactory.addParameter("tradefield", tradefield);
                 sqlFactory.addParameter("tradefield", tradefield);

+ 21 - 26
src/custom/restcontroller/webmanage/sale/order/SQL/促销方案商品列表.sql

@@ -1,30 +1,25 @@
-select t1.*
-from (
-         SELECT distinct t1.itemid,
-                         t1.itemno,
-                         t1.itemname,
-                         t1.model,
-                         t1.batchcontrol,
-                         t1.orderminqty_auxunit,
-                         t1.orderminqty,
-                         t1.orderaddqty_auxunit,
-                         t1.orderaddqty,
-                         t1.spec,
-                         t1.marketprice,
-                         (SELECT unitname FROM plm_unit WHERE unitid = t1.unitid and siteid = t1.siteid)    unit,
-                         (SELECT unitname FROM plm_unit WHERE unitid = t2.auxunitid and siteid = t1.siteid) auxunit,
-                         t2.conversionrate,
-                         t5.oldprice,
-                         t5.pricegrade,
-                         t5.price
-         from plm_item t1
-                  LEFT JOIN plm_unitgroup t2 ON t2.unitgroupid = t1.unitgroupid and t2.siteid = t1.siteid
-                  LEFT JOIN sa_itemsaleclass t3 ON t3.itemid = t1.itemid and t3.siteid = t1.siteid
-                  LEFT JOIN plm_itemclass t4 ON t4.itemclassid = t3.itemclassid and t4.siteid = t3.siteid
-                  LEFT JOIN sa_promotion_itemprice t5 ON t5.itemid = t1.itemid and t5.siteid = t1.siteid
+SELECT t1.itemid,
+       t1.itemno,
+       t1.itemname,
+       t1.model,
+       t1.batchcontrol,
+       t1.orderminqty_auxunit,
+       t1.orderminqty,
+       t1.orderaddqty_auxunit,
+       t1.orderaddqty,
+       t1.spec,
+       t1.marketprice,
+       (SELECT unitname FROM plm_unit WHERE unitid = t1.unitid and siteid = t1.siteid)    unit,
+       (SELECT unitname FROM plm_unit WHERE unitid = t2.auxunitid and siteid = t1.siteid) auxunit,
+       t2.conversionrate,
+       t5.oldprice,
+       t5.pricegrade,
+       t5.price
+from plm_item t1
+         LEFT JOIN plm_unitgroup t2 ON t2.unitgroupid = t1.unitgroupid and t2.siteid = t1.siteid
+         LEFT JOIN sa_promotion_itemprice t5 ON t5.itemid = t1.itemid and t5.siteid = t1.siteid
 
 
-         WHERE t1.itemid  in $itemid$
+WHERE t1.itemid in $itemid$
            and t1.siteid = $siteid$
            and t1.siteid = $siteid$
            and t1.status = '审核' and t5.sa_promotionid = $sa_promotionid$  and t5.pricegrade = (SELECT grade FROM sys_enterprise WHERE sys_enterpriseid = $sys_enterpriseid$ and siteid = $siteid$ )
            and t1.status = '审核' and t5.sa_promotionid = $sa_promotionid$  and t5.pricegrade = (SELECT grade FROM sys_enterprise WHERE sys_enterpriseid = $sys_enterpriseid$ and siteid = $siteid$ )
            and $where$
            and $where$
-     ) t1