Browse Source

活动购物车完善与BUG修正

eganwu 1 year ago
parent
commit
a26a4db905

+ 34 - 0
src/custom/objectregister/sa_shoppingcart.java

@@ -0,0 +1,34 @@
+package objectregister;
+
+import common.YosException;
+import common.data.db.initialization.base.YosObject;
+import common.data.db.initialization.base.YosObjectCol;
+
+import java.util.ArrayList;
+
+public class sa_shoppingcart implements YosObject {
+    @Override
+    public String table_comment() {
+        return "购物车";
+    }
+
+    @Override
+    public UniqueCol uniquecolumn() {
+        return new UniqueCol("sa_shoppingcartid", "购物车ID");
+    }
+
+    @Override
+    public void DataInit() throws YosException {
+
+    }
+
+    @Override
+    public ArrayList<YosObjectCol> table_cols() {
+        ArrayList<YosObjectCol> arrayList = new ArrayList<>();
+        arrayList.add(new VarcharCol("customcheek", "工艺", "工艺", 100, true, false, false, "", 1));
+        arrayList.add(new VarcharCol("customcolors", "颜色", "颜色", 200, true, false, false, "", 2));
+        arrayList.add(new VarcharCol("custommaterial", "选项", "选项", 100, true, false, false, "", 3));
+
+        return arrayList;
+    }
+}

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

@@ -10,6 +10,9 @@ SELECT t1.sa_shoppingcartid,
        t1.qty,
        t1.length,
        t1.width,
+       t1.customcheek,
+       t1.customcolors,
+       t1.custommaterial,
        t3.model,
        t3.spec,
        t3.orderminqty,

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

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

+ 4 - 1
src/custom/restcontroller/sale/shoppingcart/SQL/购物车更新.sql

@@ -4,6 +4,9 @@ SET changeby=$username$,
     qty = qty + $qty$,
     tradefield = $tradefield$,
     length =$length$,
-    width=$width$
+    width=$width$,
+    customcheek=$customcheek$,
+    customcolors=$customcolors$,
+    custommaterial=$custommaterial$
 WHERE sa_shoppingcartid = $sa_shoppingcartid$
   and siteid = $siteid$

+ 8 - 0
src/custom/restcontroller/sale/shoppingcart/ShoppingCart.java

@@ -142,6 +142,14 @@ public class ShoppingCart extends Controller {
             sqlFactory.addParameter("sa_brandid", sa_brandid);
             sqlFactory.addParameter("qty", qty);
             sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
+
+            String customcheek = item.getStringValue("customcheek");
+            String customcolors = item.getStringValue("customcolors");
+            String custommaterial = item.getStringValue("custommaterial");
+
+            sqlFactory.addParameter("customcheek", customcheek.equals("0") ? "" : customcheek);
+            sqlFactory.addParameter("customcolors", customcolors.equals("0") ? "" : customcolors);
+            sqlFactory.addParameter("custommaterial", custommaterial.equals("0") ? "" : custommaterial);
             //System.out.println(sqlFactory.getSQL());
             sqlList.add(sqlFactory.getSQL());
         }

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

@@ -288,8 +288,10 @@ public class Order extends Controller {
             if (sa_brandid == 0) {
                 sa_brandid = temp_sa_brandid;
             }
-            if (!sa_brandid.equals(temp_sa_brandid)) {
-                return getErrReturnObject().setErrMsg("请添加同一品牌的商品").toString();
+            if (!type.equals("促销订单")) {
+                if (!sa_brandid.equals(temp_sa_brandid)) {
+                    return getErrReturnObject().setErrMsg("请添加同一品牌的商品").toString();
+                }
             }
         }