浏览代码

修改删除协销购物车

plf 3 年之前
父节点
当前提交
d7b45a012c

+ 4 - 0
src/main/java/com/caimei365/order/model/bo/OrderParamBo.java

@@ -93,6 +93,10 @@ public class OrderParamBo implements Serializable {
      * 下单人
      */
     private Integer buyUserId;
+    /**
+     * 协销Id
+     */
+    private Integer serviceProviderId;
     /**
      * 订单来源:1WWW、2CRM、4客服[适用后台下单]、5外单[适用后台下单]、6小程序[采美,星范]、7呵呵商城小程序、8维沙小程序
      */

+ 4 - 0
src/main/java/com/caimei365/order/model/po/OrderPo.java

@@ -37,6 +37,10 @@ public class OrderPo implements Serializable {
      * 下单人Id(协销Id,或运营人Id,或用户Id)
      */
     private Integer buyUserId;
+    /**
+     * 协销Id
+     */
+    private Integer spId;
     /**
      * 订单提交时间
      */

+ 3 - 1
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -261,6 +261,7 @@ public class SubmitServiceImpl implements SubmitService {
             return ResponseJson.error("购买类型不正确!", null);
         }
         orderParamBo.setBuyUserId(buyUserId);
+        orderParamBo.setServiceProviderId(submitDto.getServiceProviderId());
         orderParamBo.setAddressId(submitDto.getAddressId());
         orderParamBo.setClubCouponId(submitDto.getClubCouponId());
         /*
@@ -292,6 +293,7 @@ public class SubmitServiceImpl implements SubmitService {
         // 订单状态 0 有效  其它无效
         mainOrder.setDelFlag(0);
         if (3 == orderParamBo.getCartType()) {
+            mainOrder.setSpId(orderParamBo.getServiceProviderId());
             // 协销订单
             mainOrder.setOrderType(0);
             // 3:协销帮会所下单
@@ -1233,7 +1235,7 @@ public class SubmitServiceImpl implements SubmitService {
          */
         if (3 == orderParamBo.getCartType()) {
             // 清理当前机构的协销购物车数据
-            cartSellerMapper.deleteSellerCartByProductIds(orderParamBo.getBuyUserId(), orderParamBo.getClubId(), productIdList);
+            cartSellerMapper.deleteSellerCartByProductIds(orderParamBo.getServiceProviderId(), orderParamBo.getClubId(), productIdList);
             log.info("【提交订单】>>>>删除当前机构的 协销 购物车数据!");
         } else {
             // 清理用户购物车

+ 2 - 2
src/main/resources/mapper/SubmitMapper.xml

@@ -2,14 +2,14 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.order.mapper.SubmitMapper">
     <insert id="insertMainOrder" keyColumn="orderID" keyProperty="orderId" parameterType="com.caimei365.order.model.po.OrderPo" useGeneratedKeys="true">
-        INSERT INTO cm_order (orderSource, orderNo, userID, clubID, buyUserID, orderTime, updateDate, delFlag,
+        INSERT INTO cm_order (orderSource, orderNo, userID, clubID, buyUserID, spID, orderTime, updateDate, delFlag,
                               userBeans, orderType, orderSubmitType, confirmFlag, onlinePayFlag, splitFlag, payFlag,
                               receiptStatus, payStatus, zeroCostFlag, sendOutStatus, refundType, affirmPaymentFlag,
                               productCount, presentCount, promotionalGiftsCount, hasActProduct, promotionFullReduction,
                               secondHandOrderFlag, invoiceFlag, freePostFlag, freight, productTotalFee, orderTotalFee,
                               payTotalFee, payableAmount, balancePayFee, status, confirmTime, payTime, rebateFlag,
                               clauseID, clauseName)
-        VALUES (#{orderSource},#{orderNo},#{userId},#{clubId},#{buyUserId},#{orderTime},#{updateDate},#{delFlag},
+        VALUES (#{orderSource},#{orderNo},#{userId},#{clubId},#{buyUserId},#{spId},#{orderTime},#{updateDate},#{delFlag},
                 #{userBeans},#{orderType},#{orderSubmitType},#{confirmFlag},#{onlinePayFlag},#{splitFlag},#{payFlag},
                 #{receiptStatus},#{payStatus},#{zeroCostFlag},#{sendOutStatus},#{refundType},#{affirmPaymentFlag},
                 #{productCount},#{presentCount},#{promotionalGiftsCount},#{hasActProduct},#{promotionFullReduction},