Explorar o código

促销方案可售量更新逻辑变更

hu %!s(int64=2) %!d(string=hai) anos
pai
achega
7b73944971
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/custom/restcontroller/webmanage/sale/order/Order.java

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

@@ -1123,7 +1123,7 @@ public class Order extends Controller {
         String sonum = row.getString("sonum");
         String type = row.getString("type");
         if (type.equals("促销订单")) {
-            Rows orderdetails = dbConnect.runSqlQuery("select * from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid);
+            Rows orderdetails = dbConnect.runSqlQuery("select sa_promotion_itemsid,itemno,sum(qty) qty  from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid +" group by sa_promotion_itemsid,itemno");
             Rows promotionitems = dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='" + siteid + "' and sa_promotionid=" + row.getLong("sa_promotionid"));
             RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
             for (Row orderdetail : orderdetails) {
@@ -1599,7 +1599,7 @@ public class Order extends Controller {
 
         String type = row.getString("type");
         if (type.equals("促销订单")) {
-            Rows orderdetails = dbConnect.runSqlQuery("select * from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid);
+            Rows orderdetails = dbConnect.runSqlQuery("select sa_promotion_itemsid,itemno,sum(qty) qty  from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid +" group by sa_promotion_itemsid,itemno");
             Rows promotionitems = dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='" + siteid + "' and sa_promotionid=" + row.getLong("sa_promotionid"));
             RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
             for (Row orderdetail : orderdetails) {
@@ -1675,7 +1675,7 @@ public class Order extends Controller {
 
         String type = row.getString("type");
         if (type.equals("促销订单")) {
-            Rows orderdetails = dbConnect.runSqlQuery("select * from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid);
+            Rows orderdetails = dbConnect.runSqlQuery("select sa_promotion_itemsid,itemno,sum(qty) qty  from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid +" group by sa_promotion_itemsid,itemno");
             Rows promotionitems = dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='" + siteid + "' and sa_promotionid=" + row.getLong("sa_promotionid"));
             RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
             for (Row orderdetail : orderdetails) {