Explorar el Código

Merge branch 'dev/2024/0611/update-business-Y' of feifan/mall-backend-business into master

修改发货
Yangzw hace 9 meses
padre
commit
2c52e8d89d

+ 4 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/dataobject/order/TradeOrderItemDO.java

@@ -191,6 +191,10 @@ public class TradeOrderItemDO extends BaseDO {
      * 枚举 {@link TradeOrderItemAfterSaleStatusEnum}
      */
     private Integer afterSaleStatus;
+    /**
+     * 是否分配积分、身价权益,已分配是1,未分配为0
+     */
+    private Boolean distributeBenefit;
 
     /**
      * 商品属性

+ 6 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/order/TradeOrderUpdateServiceImpl.java

@@ -11,6 +11,7 @@ import cn.newfeifan.mall.framework.common.core.KeyValue;
 import cn.newfeifan.mall.framework.common.enums.UserTypeEnum;
 import cn.newfeifan.mall.framework.common.util.json.JsonUtils;
 import cn.newfeifan.mall.framework.common.util.number.MoneyUtils;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.module.member.api.address.MemberAddressApi;
 import cn.newfeifan.mall.module.member.api.address.dto.MemberAddressRespDTO;
 import cn.newfeifan.mall.module.pay.api.order.PayOrderApi;
@@ -393,6 +394,11 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
         if (deliveryReqVO.getAttachment() != null) {
             //如果是虚拟商品直接完成发货和签收
             updateOrderObj.setStatus(TradeOrderStatusEnum.COMPLETED.getStatus()).setDeliveryTime(LocalDateTime.now()).setReceivingTime(LocalDateTime.now());
+            TradeOrderItemDO tradeOrderItemDO = tradeOrderItemMapper.selectOne(new LambdaQueryWrapperX<TradeOrderItemDO>()
+                    .eq(TradeOrderItemDO::getOrderId, order.getId())
+            );
+            tradeOrderItemDO.setDistributeBenefit(true);
+            tradeOrderItemMapper.updateById(tradeOrderItemDO);
         } else {
             updateOrderObj.setStatus(TradeOrderStatusEnum.DELIVERED.getStatus()).setDeliveryTime(LocalDateTime.now());
         }