zhijiezhao 1 year ago
parent
commit
156bf5b0bb

+ 2 - 2
src/main/java/com/caimei365/order/service/impl/ReceiptServiceImpl.java

@@ -1588,7 +1588,6 @@ public class ReceiptServiceImpl implements ReceiptService {
         crr.setReceiptId(receiptPo.getId());
         crr.setRebateAmount(receiptOperateDto.getVerbalAmount());
         crr.setShopOrderId(receiptOperateDto.getShopOrderIds());
-        crr.setOperateTime(date);
         receiptMapper.insertRebateRecord(crr);
         // 更新供应商欠款金额
         receiptMapper.updateShopRebateAmount(shopId, receiptOperateDto.getVerbalAmount());
@@ -2141,7 +2140,6 @@ public class ReceiptServiceImpl implements ReceiptService {
         crr.setReceiptId(receiptUser.getId());
         crr.setRebateAmount(cmCost);
         crr.setShopOrderId(shopOrderById.getShopOrderId().toString());
-        crr.setOperateTime(DateUtils.getTime());
         receiptMapper.insertRebateRecord(crr);
         // 修改该供应商的欠款金额
         receiptMapper.updateShopRebateAmount(shopOrderById.getShopId(), cmCost);
@@ -2168,12 +2166,14 @@ public class ReceiptServiceImpl implements ReceiptService {
             shopOrderList = receiptMapper.getPlatformOrderByReceiptId(id);
             for (ShopOrderVo shopOrder : shopOrderList) {
                 setReceiptedAmount(shopOrder);
+                orderCommonService.setShopOrderStatus(shopOrder);
             }
         } else {
             // shopName或者是shopOrderId
             shopOrderList = receiptMapper.getPlatformOrderByName(shopName);
             for (ShopOrderVo shopOrder : shopOrderList) {
                 setReceiptedAmount(shopOrder);
+                orderCommonService.setShopOrderStatus(shopOrder);
             }
         }
         PageInfo<ShopOrderVo> pageInfo = new PageInfo(shopOrderList);

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

@@ -766,11 +766,13 @@ public class SubmitServiceImpl implements SubmitService {
                                             Double floor = Math.floor(MathUtil.div(productFee, promotions.getTouchPrice()).doubleValue());
                                             promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                             productFee = MathUtil.sub(productFee, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue();
+                                            shopOrder.setPromotionFullReduction(MathUtil.mul(promotions.getReducedPrice(), floor).doubleValue());
                                         } else {
                                             // 统计订单总满减金额
                                             promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), promotions.getReducedPrice()).doubleValue());
                                             // 统计单个商品的折后金额
                                             productFee = MathUtil.sub(productFee, promotions.getReducedPrice()).doubleValue();
+                                            shopOrder.setPromotionFullReduction(promotions.getReducedPrice());
                                         }
                                     }
                                     // 添加到总促销
@@ -1109,11 +1111,23 @@ public class SubmitServiceImpl implements SubmitService {
                                         promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                         // 统计商品总金额
                                         productTotalFee.set(MathUtil.sub(productTotalFee.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
+                                        // 当前版本凑单促销仅支持综合供应商 ,shopid 1161
+                                        shopOrderList.forEach(s -> {
+                                            if (1161 == s.getShopId()) {
+                                                s.setPromotionFullReduction(MathUtil.mul(promotions.getReducedPrice(), floor).doubleValue());
+                                            }
+                                        });
                                     } else {
                                         // 满减
                                         promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), promotions.getReducedPrice()).doubleValue());
                                         // 统计商品总金额
                                         productTotalFee.set(MathUtil.sub(productTotalFee.get(), promotions.getReducedPrice()).doubleValue());
+                                        // 当前版本凑单促销仅支持综合供应商 ,shopid 1161
+                                        shopOrderList.forEach(s -> {
+                                            if (1161 == s.getShopId()) {
+                                                s.setPromotionFullReduction(promotions.getReducedPrice());
+                                            }
+                                        });
                                     }
                                 }
                             } else {

+ 11 - 1
src/main/resources/mapper/ReceiptMapper.xml

@@ -1099,7 +1099,7 @@
     <insert id="insertRebateRecord" keyColumn="id" keyProperty="id"
             parameterType="com.caimei365.order.model.po.RebateRecordPo" useGeneratedKeys="true">
         INSERT INTO cm_rebate_record(type, shopId, receiptID, shopOrderId, rebateAmount, operatTime)
-        VALUES (#{type}, #{shopId}, #{receiptId}, #{shopOrderId}, #{rebateAmount}, #{operateTime})
+        VALUES (#{type}, #{shopId}, #{receiptId}, #{shopOrderId}, #{rebateAmount}, now())
     </insert>
     <insert id="insertPutAwayFeeRecordForNew">
         INSERT INTO cm_receipt (validityDate, dateStrings, receiptID)
@@ -1249,8 +1249,13 @@
                         cso.sendOutStatus,
                         cso.splitFlag,
                         cso.shopOtherFee,
+                        cso.orderType,
+                        cso.organizeId,
+                        cso.shopStatus as status,
                         s.name                            AS shopName,
                         (SELECT SUM(cmCostPrice*(num+presentnum) )FROM cm_order_product WHERE shopOrderId = cso.shopOrderId) AS cmCostPrice,
+                        (select userName from user where userID = cso.userId LIMIT 1) as userName,
+                        sum(cror.associateAmount) as receiptAmount,
                         IFNULL((SELECT SUM(refundAmount)
                                 FROM cm_refund_shop_record
                                 WHERE shopOrderID = cso.shopOrderID
@@ -1291,6 +1296,11 @@
         cso.orderTime,
         cso.orderSubmitType,
         cso.payStatus,
+        cso.orderType,
+        cso.organizeId,
+        cso.shopStatus as status,
+        (select userName from user where userID = cso.userId LIMIT 1) as userName,
+        sum(cror.associateAmount) as receiptAmount,
         ifnull(cso.sendOutStatus, 1) as sendOutStatus,
         ifnull(cso.receiptStatus, 1) as receiptStatus,
         cso.splitFlag,