Explorar o código

购物车生成订单接口添加购物车id字段

hu %!s(int64=2) %!d(string=hai) anos
pai
achega
5c5d72eda2

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

@@ -225,11 +225,13 @@ public class Order extends Controller {
 
         JSONArray items = content.getJSONArray("items");
         ArrayList<Long> itemidids = new ArrayList();
+        ArrayList<Long> sa_shoppingcartids = new ArrayList();
         //判断是否是同一个品牌的商品
         for (Object obj : items) {
             JSONObject item = (JSONObject) obj;
             Long temp_sa_brandid = item.getLongValue("sa_brandid");
             itemidids.add(item.getLongValue("itemid"));
+            sa_shoppingcartids.add(item.getLongValue(" sa_shoppingcartid"));
             if (sa_brandid == 0) {
                 sa_brandid = temp_sa_brandid;
             }
@@ -344,7 +346,7 @@ public class Order extends Controller {
         ArrayList<String> sqlList = new ArrayList<>();
 
         //删除购物车中的数据
-        String sql = "DELETE from sa_shoppingcart WHERE sys_enterpriseid = " + sys_enterpriseid + " and itemid in " + itemidids + " AND siteid ='" + siteid + "'";
+        String sql = "DELETE from sa_shoppingcart WHERE sys_enterpriseid = " + sys_enterpriseid + " and sa_shoppingcartid in " + sa_shoppingcartids + " AND siteid ='" + siteid + "'";
         sql = sql.replace("[", "(").replace("]", ")");
         sqlList.add(sql);
 //        //清除多余的操作记录

+ 1 - 1
src/custom/restcontroller/webmanage/sale/promotion/promotion.java

@@ -493,7 +493,7 @@ public class promotion extends Controller {
     }
 
     @API(title = "结算", apiversion = R.ID20230826091303.v1.class)
-    @CACHEING_CLEAN(apiClass = {rebateaccounthead.class})
+    @CACHEING_CLEAN(apiClass = {promotionAuth.class,promotion.class})
     public String settlement() throws YosException {
         Long sa_promotion_authid = content.getLong("sa_promotion_authid");
         ArrayList<String> sqlList = new ArrayList<>();