浏览代码

购物车新增促销方案id

hu 1 年之前
父节点
当前提交
7ebd5001dc

+ 1 - 0
src/custom/restcontroller/sale/shoppingcart/SQL/购物车列表.sql

@@ -3,6 +3,7 @@ SELECT t1.sa_shoppingcartid,
        t1.itemid,
        t3.itemname,
        t1.itemno,
+       t1.sa_promotionid,
        t1.tradefield tradefield_shoppingcart,
        t2.brandname,
        t1.qty,

+ 2 - 2
src/custom/restcontroller/sale/shoppingcart/SQL/购物车新增.sql

@@ -1,4 +1,4 @@
 insert into sa_shoppingcart (siteid, sa_shoppingcartid, createuserid, createby, createdate, changeby, changedate,
-                             sa_brandid, itemid, qty, itemno, sys_enterpriseid,tradefield,length,width)
+                             sa_brandid, itemid, qty, itemno, sys_enterpriseid,tradefield,length,width,sa_promotionid)
 values ($siteid$, $sa_shoppingcartid$, $userid$, $username$, current_time, $username$, current_time, $sa_brandid$,
-        $itemid$, $qty$, $itemno$, $sys_enterpriseid$,$tradefield$,$length$,$width$);
+        $itemid$, $qty$, $itemno$, $sys_enterpriseid$,$tradefield$,$length$,$width$,$sa_promotionid$);

+ 1 - 0
src/custom/restcontroller/sale/shoppingcart/SQL/购物车详情.sql

@@ -6,6 +6,7 @@ SELECT t1.sa_shoppingcartid,
        t1.width,
        t1.itemno,
        t1.tradefield,
+       t1.sa_promotionid,
        t2.brandname,
        t3.itemname,
        t3.model,

+ 7 - 1
src/custom/restcontroller/sale/shoppingcart/ShoppingCart.java

@@ -4,6 +4,7 @@ import beans.datacontrllog.DataContrlLog;
 import beans.itemprice.ItemPrice;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.sun.jdi.LongValue;
 import common.Controller;
 import common.YosException;
 import common.annotation.API;
@@ -40,6 +41,7 @@ public class ShoppingCart extends Controller {
         BigDecimal width = content.getBigDecimal("width");
         String itemno = content.getString("itemno");
         String tradefield = content.getStringValue("tradefield");
+        long sa_promotionid =content.getLongValue("sa_promotionid");
         SQLFactory sqlFactory = new SQLFactory(this, "购物车新增");
         Long sa_shoppingcartid = 0L;
         Rows rows = dbConnect.runSqlQuery("SELECT sa_shoppingcartid FROM sa_shoppingcart WHERE siteid = '" + siteid +
@@ -47,7 +49,7 @@ public class ShoppingCart extends Controller {
                 " and length="+length+" and width="+width+" AND itemid = " + itemid +
                 " AND sys_enterpriseid = " + sys_enterpriseid +
                 " AND tradefield = '" + tradefield +
-                "' AND itemno = '" + itemno + "'");
+                "' AND itemno = '" + itemno + "' and sa_promotionid="+sa_promotionid);
         if (rows.isNotEmpty()) {
             sa_shoppingcartid = rows.get(0).getLong("sa_shoppingcartid");
         }
@@ -69,6 +71,7 @@ public class ShoppingCart extends Controller {
         sqlFactory.addParameter("itemno", itemno);
         sqlFactory.addParameter("length", length);
         sqlFactory.addParameter("width", width);
+        sqlFactory.addParameter("sa_promotionid", sa_promotionid);
         sqlFactory.addParameter("tradefield", tradefield);
         sqlFactory.addParameter("sa_shoppingcartid", sa_shoppingcartid);
         sqlFactory.addParameter("sa_brandid", sa_brandid);
@@ -147,6 +150,7 @@ public class ShoppingCart extends Controller {
                 where.append("or t3.spec like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
+
         }
 
         boolean isExport = content.getBooleanValue("isExport");
@@ -157,6 +161,8 @@ public class ShoppingCart extends Controller {
         }
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
+        sqlFactory.addParameter("sa_promotionid", content.getLongValue("sa_promotionid"));
+
         sqlFactory.addParameter("istool", istool);
         sqlFactory.addParameter_SQL("where", where);
         String sql = sqlFactory.getSQL();