Ver Fonte

bugfix提交订单保存子订单付款状态

chao há 3 anos atrás
pai
commit
a1c4179757

+ 8 - 0
src/main/java/com/caimei365/order/model/po/OrderShopPo.java

@@ -114,4 +114,12 @@ public class OrderShopPo implements Serializable {
      * 订单能否拆分 1 为可拆分, 0为不可拆分
      */
     private Integer splitFlag;
+    /**
+     * (付款供应商)付款状态:1待付款、2部分付款、3已付款
+     */
+    private Integer payStatus;
+    /**
+     * 已付款金额
+     */
+    private Double payedShopAmount;
 }

+ 8 - 0
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -713,6 +713,10 @@ public class SubmitServiceImpl implements SubmitService {
             shopOrder.setShopTaxFee(shopTaxFee.get());
             // 付供应商 = 商品费 + 运费 + 税费
             shopOrder.setShouldPayShopAmount(MathUtil.add(shopProductAmount.get(), shopTaxFee.get()).doubleValue());
+            // 已付供应商金额
+            shopOrder.setPayedShopAmount(0d);
+            // (付款供应商)付款状态:1待付款、2部分付款、3已付款
+            shopOrder.setPayStatus(1);
 
             // 添加到子订单列表
             shopOrderList.add(shopOrder);
@@ -1038,6 +1042,10 @@ public class SubmitServiceImpl implements SubmitService {
             postageOrder.setOrderTime(mainOrder.getOrderTime());
             postageOrder.setCanRefundAmount(0d);
             postageOrder.setClubId(mainOrder.getClubId());
+            // 已付供应商金额
+            postageOrder.setPayedShopAmount(0d);
+            // (付款供应商)付款状态:1待付款、2部分付款、3已付款
+            postageOrder.setPayStatus(3);
             if (3 == orderParamBo.getCartType()) {
                 // 协销订单
                 postageOrder.setSpId(orderParamBo.getBuyUserId());

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

@@ -21,11 +21,11 @@
         INSERT INTO cm_shop_order (shopOrderNo, orderID, orderNo, shopID, note, userID, clubID,
                                    spID, orderPromotionsId, promotionFullReduction, brokerage, canRefundAmount, itemCount,
                                    totalAmount, productAmount, needPayAmount, shopProductAmount, shopPostFee, shopTaxFee,
-                                   shouldPayShopAmount, orderTime, orderSubmitType, splitFlag)
+                                   shouldPayShopAmount, orderTime, orderSubmitType, splitFlag, payStatus, payedShopAmount)
         VALUES (#{shopOrderNo},#{orderId},#{orderNo},#{shopId}, #{note},#{userId},#{clubId},
                 #{spId},#{orderPromotionsId},#{promotionFullReduction},#{brokerage},#{canRefundAmount},#{itemCount},
                 #{totalAmount},#{productAmount},#{needPayAmount},#{shopProductAmount},#{shopPostFee},#{shopTaxFee},
-                #{shouldPayShopAmount},#{orderTime},#{orderSubmitType},#{splitFlag})
+                #{shouldPayShopAmount},#{orderTime},#{orderSubmitType},#{splitFlag},#{payStatus},#{payedShopAmount})
     </insert>
     <insert id="insertOrderProduct" keyColumn="orderProductID" keyProperty="orderProductId" parameterType="com.caimei365.order.model.po.OrderProductPo" useGeneratedKeys="true">
         INSERT INTO cm_order_product (orderID, orderNo, shopOrderID, shopOrderNo, orderPromotionsId, productId, shopId, name,