From 71fb4b2b2b8251952f77ac8b27dfe87f3ca808fd Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Thu, 18 Nov 2021 19:26:47 +0800 Subject: [PATCH 01/11] =?UTF-8?q?'=E5=A4=9A=E6=95=B0=E9=87=8F=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=94=AE=E5=90=8E=E5=8A=9F=E8=83=BD'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listener/AfterSaleMessageListener.java | 1 - .../java/cn/lili/common/enums/ResultCode.java | 1 + .../order/order/entity/dos/OrderItem.java | 6 ++ .../enums/OrderItemAfterSaleStatusEnum.java | 4 +- .../order/entity/vo/AfterSaleApplyVO.java | 5 ++ .../serviceimpl/AfterSaleServiceImpl.java | 68 +++++++++++++++++-- .../serviceimpl/StoreFlowServiceImpl.java | 3 +- .../modules/payment/kit/RefundSupport.java | 30 ++++++++ .../modules/store/entity/dos/StoreDetail.java | 19 ------ .../serviceimpl/StoreDetailServiceImpl.java | 3 +- .../store/serviceimpl/StoreServiceImpl.java | 1 + 11 files changed, 111 insertions(+), 30 deletions(-) diff --git a/consumer/src/main/java/cn/lili/listener/AfterSaleMessageListener.java b/consumer/src/main/java/cn/lili/listener/AfterSaleMessageListener.java index d950ac59..21af1ac3 100644 --- a/consumer/src/main/java/cn/lili/listener/AfterSaleMessageListener.java +++ b/consumer/src/main/java/cn/lili/listener/AfterSaleMessageListener.java @@ -17,7 +17,6 @@ import java.util.List; * 售后通知 * * @author paulG - * @since 2020/12/9 */ @Slf4j @Component diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index d08ca88f..b8d30c8c 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -209,6 +209,7 @@ public enum ResultCode { AFTER_STATUS_ERROR(33006, "售后状态错误,请刷新页面"), RETURN_MONEY_OFFLINE_BANK_ERROR(33007, "当账号类型为银行转账时,银行信息不能为空"), AFTER_SALES_PRICE_ERROR(33004, "申请退款金额错误"), + AFTER_GOODS_NUMBER_ERROR(33008, "申请售后商品数量错误"), /** * 投诉 diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java index 631bc5fe..e5bcb029 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java @@ -112,6 +112,12 @@ public class OrderItem extends BaseEntity { @ApiModelProperty(value = "交易投诉id") private String complainId; + @ApiModelProperty(value = "已退货商品数量") + private Integer returnGoodsNumber; + + @ApiModelProperty(value = "正在进行退货中的商品数量") + private Integer isGoodsNumber; + public OrderItem(CartSkuVO cartSkuVO, CartVO cartVO, TradeDTO tradeDTO) { String oldId = this.getId(); BeanUtil.copyProperties(cartSkuVO.getGoodsSku(), this); diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderItemAfterSaleStatusEnum.java b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderItemAfterSaleStatusEnum.java index 00a34619..88f752c5 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderItemAfterSaleStatusEnum.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderItemAfterSaleStatusEnum.java @@ -14,7 +14,9 @@ public enum OrderItemAfterSaleStatusEnum { NEW("新订单,不能申请售后"), NOT_APPLIED("未申请"), ALREADY_APPLIED("已申请"), - EXPIRED("已失效不允许申请售后"); + EXPIRED("已失效不允许申请售后"), + PART_AFTER_SALE("部分售后"); + private final String description; diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AfterSaleApplyVO.java b/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AfterSaleApplyVO.java index a05a416f..9bd5ee45 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AfterSaleApplyVO.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AfterSaleApplyVO.java @@ -54,5 +54,10 @@ public class AfterSaleApplyVO { @ApiModelProperty(value = "是否支持退款") private Boolean returnMoney; + @ApiModelProperty(value = "会员ID") + private String memberId; + + + } diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 0c60b475..3df6954f 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -12,6 +12,7 @@ import cn.lili.common.security.enums.UserEnums; import cn.lili.common.utils.BeanUtil; import cn.lili.common.utils.CurrencyUtil; import cn.lili.common.utils.SnowFlake; +import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.order.order.aop.AfterSaleLogPoint; import cn.lili.modules.order.order.entity.dos.AfterSale; @@ -156,6 +157,8 @@ public class AfterSaleServiceImpl extends ServiceImpl() + .eq(OrderItem::getOrderSn, afterSale.getOrderSn()) + .eq(OrderItem::getGoodsId, afterSale.getGoodsId())); + + //判断当前售后的状态---申请中 + if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.APPLY.name())) { + orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber()+afterSale.getNum()); + } + //判断当前售后的状态---已拒绝 + if(afterSale.getServiceStatus().equals(AfterSaleStatusEnum.REFUSE.name())){ + orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber()-afterSale.getNum()); + } + //正在售后商品总数等于商品总数,修改订单售后状态为已申请 + if (orderItem.getIsGoodsNumber().equals(orderItem.getNum())) { + //修改订单的售后状态--已申请 + orderItem.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.ALREADY_APPLIED.name()); + } else { + //修改订单的售后状态--部分售后 + orderItem.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.PART_AFTER_SALE.name()); + } + orderItemService.update(new LambdaUpdateWrapper() + .eq(OrderItem::getSn, orderItem.getSn()) + .set(OrderItem::getIsGoodsNumber, orderItem.getIsGoodsNumber()) + .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus())); + } + + /** * 检查当前订单状态是否为可申请当前售后类型的状态 * @@ -465,11 +510,17 @@ public class AfterSaleServiceImpl extends ServiceImpl (orderItem.getNum() - orderItem.getIsGoodsNumber())) { + throw new ServiceException(ResultCode.AFTER_GOODS_NUMBER_ERROR); + } + + //获取售后类型 Order order = orderService.getBySn(orderItem.getOrderSn()); AfterSaleTypeEnum afterSaleTypeEnum = AfterSaleTypeEnum.valueOf(afterSaleDTO.getServiceType()); @@ -531,11 +582,16 @@ public class AfterSaleServiceImpl extends ServiceImpl queryWrapper = Wrappers.lambdaUpdate(); queryWrapper.eq(AfterSale::getSn, afterSaleSn); this.update(afterSale, queryWrapper); } + private void updateOrderItemAfterSaleStatus() { + + } + /** * 发送售后消息 * diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java index 4659197d..9b9474b5 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java @@ -139,7 +139,8 @@ public class StoreFlowServiceImpl extends ServiceImpl().eq(StoreFlow::getOrderItemSn, afterSale.getOrderItemSn())); + StoreFlow payStoreFlow = this.getOne(new LambdaUpdateWrapper().eq(StoreFlow::getOrderItemSn, afterSale.getOrderItemSn()) + .eq(StoreFlow::getFlowType,FlowTypeEnum.PAY)); storeFlow.setNum(afterSale.getNum()); storeFlow.setCategoryId(payStoreFlow.getCategoryId()); //佣金 diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/RefundSupport.java b/framework/src/main/java/cn/lili/modules/payment/kit/RefundSupport.java index 07045e98..df3a3602 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/RefundSupport.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/RefundSupport.java @@ -4,11 +4,14 @@ import cn.lili.common.utils.SnowFlake; import cn.lili.common.utils.SpringContextUtil; import cn.lili.modules.order.order.entity.dos.AfterSale; import cn.lili.modules.order.order.entity.dos.Order; +import cn.lili.modules.order.order.entity.dos.OrderItem; import cn.lili.modules.order.order.service.AfterSaleService; +import cn.lili.modules.order.order.service.OrderItemService; import cn.lili.modules.order.order.service.OrderService; import cn.lili.modules.order.order.service.StoreFlowService; import cn.lili.modules.payment.entity.RefundLog; import cn.lili.modules.payment.entity.enums.PaymentMethodEnum; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -41,6 +44,11 @@ public class RefundSupport { */ @Autowired private OrderService orderService; + /** + * 子订单 + */ + @Autowired + private OrderItemService orderItemService; /** * 售后退款 @@ -69,10 +77,32 @@ public class RefundSupport { afterSaleService.update(new LambdaUpdateWrapper() .eq(AfterSale::getId, afterSale.getId()) .set(AfterSale::getRefundTime, new Date())); + this.updateReturnGoodsNumber(afterSale); + //记录退款流水 storeFlowService.refundOrder(afterSale); } + /** + * 功能描述: 修改子订单中已售后退款商品数量 + * @Author ftyy + * @Description //TODO + * @Date 17:33 2021/11/18 + * @Param [afterSale] + * @return void + **/ + private void updateReturnGoodsNumber(AfterSale afterSale){ + //根据商品id及订单sn获取子订单 + OrderItem orderItem = orderItemService.getOne(new LambdaQueryWrapper() + .eq(OrderItem::getOrderSn, afterSale.getOrderSn()) + .eq(OrderItem::getGoodsId, afterSale.getGoodsId())); + //修改子订单订单中的退货数量 + orderItemService.update(new LambdaUpdateWrapper() + .eq(OrderItem::getOrderSn,afterSale.getOrderSn()) + .eq(OrderItem::getGoodsId,afterSale.getGoodsId()) + .set(OrderItem::getReturnGoodsNumber,(afterSale.getNum()+orderItem.getReturnGoodsNumber()))); + } + /** * 订单取消 * diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java b/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java index 27948bd5..c9e4c359 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java @@ -183,28 +183,9 @@ public class StoreDetail extends BaseIdEntity { public StoreDetail(Store store, AdminStoreApplyDTO adminStoreApplyDTO) { this.storeId = store.getId(); - //过滤字段值 - isNotNull(adminStoreApplyDTO); //设置店铺公司信息、设置店铺银行信息、设置店铺其他信息 BeanUtil.copyProperties(adminStoreApplyDTO, this); this.settlementDay = DateUtil.date(); this.stockWarning = 10; } - - public void isNotNull(AdminStoreApplyDTO adminStoreApplyDTO){ - if("null".equals(adminStoreApplyDTO.getSalesConsigneeName())){ - adminStoreApplyDTO.setSalesConsigneeName(""); - } - if("null".equals(adminStoreApplyDTO.getSalesConsigneeMobile())){ - adminStoreApplyDTO.setSalesConsigneeMobile(""); - } - if("null".equals(adminStoreApplyDTO.getSalesConsigneeDetail())){ - adminStoreApplyDTO.setSalesConsigneeDetail(""); - } - if("null".equals(adminStoreApplyDTO.getDdCode())){ - adminStoreApplyDTO.setDdCode(""); - } - } - - } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java index 5c752d51..956a8bb9 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java @@ -75,8 +75,7 @@ public class StoreDetailServiceImpl extends ServiceImpl implements if (Boolean.TRUE.equals(member.getHaveStore())) { throw new ServiceException(ResultCode.STORE_APPLY_DOUBLE_ERROR); } + //添加店铺 Store store = new Store(member, adminStoreApplyDTO); this.save(store); From f2be8e6abdad0088ad759c769c41ab919dcb2189 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Fri, 19 Nov 2021 09:26:14 +0800 Subject: [PATCH 02/11] =?UTF-8?q?'DB-=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/version4.2.2to4.2.4.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 DB/version4.2.2to4.2.4.sql diff --git a/DB/version4.2.2to4.2.4.sql b/DB/version4.2.2to4.2.4.sql new file mode 100644 index 00000000..0faa9742 --- /dev/null +++ b/DB/version4.2.2to4.2.4.sql @@ -0,0 +1,3 @@ +/** 新增已退货数量 **/ +ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '已退货数量 '; +ALTER TABLE li_order_item ADD is_goods_number int DEFAULT 0 COMMENT '正在进行售后的商品数量 '; \ No newline at end of file From 840a2eabdbf27d044baf1224f3ad0bcfb789cee1 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Fri, 19 Nov 2021 11:24:50 +0800 Subject: [PATCH 03/11] =?UTF-8?q?'=E4=B9=B0=E5=AE=B6=E7=AB=AF=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=94=AE=E5=90=8E=E5=8F=8A=E7=AE=A1=E7=90=86=E7=AB=AF?= =?UTF-8?q?=E7=BB=88=E6=AD=A2=E5=94=AE=E5=90=8E,=E4=B9=B0=E5=AE=B6?= =?UTF-8?q?=E7=AB=AF=E9=87=8D=E6=96=B0=E5=8F=91=E8=B5=B7=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/AfterSaleServiceImpl.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 3df6954f..187f6b88 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -228,7 +228,7 @@ public class AfterSaleServiceImpl extends ServiceImpl() @@ -480,6 +483,15 @@ public class AfterSaleServiceImpl extends ServiceImpl Date: Fri, 19 Nov 2021 11:41:31 +0800 Subject: [PATCH 04/11] =?UTF-8?q?'=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=A7=84=E8=8C=83'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/AfterSaleServiceImpl.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 187f6b88..9b351ed8 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -227,7 +227,7 @@ public class AfterSaleServiceImpl extends ServiceImpl Date: Fri, 19 Nov 2021 18:42:47 +0800 Subject: [PATCH 05/11] =?UTF-8?q?'=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E5=AF=B94.2.4=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=89=88=E6=9C=ACorderItem=E8=AE=A2=E5=8D=95=E5=A4=84=E7=90=86?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/order/entity/dos/OrderItem.java | 3 + .../enums/IdentificationStatusEnum.java | 25 ++++ .../serviceimpl/AfterSaleServiceImpl.java | 119 +++++++++++++++--- 3 files changed, 127 insertions(+), 20 deletions(-) create mode 100644 framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java index e5bcb029..b1994b99 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java @@ -118,6 +118,9 @@ public class OrderItem extends BaseEntity { @ApiModelProperty(value = "正在进行退货中的商品数量") private Integer isGoodsNumber; + @ApiModelProperty(value = "标识是否被4.2.4版本处理过的订单") + private String identificationStatus; + public OrderItem(CartSkuVO cartSkuVO, CartVO cartVO, TradeDTO tradeDTO) { String oldId = this.getId(); BeanUtil.copyProperties(cartSkuVO.getGoodsSku(), this); diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java new file mode 100644 index 00000000..7993eeb1 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java @@ -0,0 +1,25 @@ +package cn.lili.modules.order.order.entity.enums; + +/** + * 标识是否被4.2.4版本处理过的订单 + * @author: ftyy + * @Date: 2021-11-19 18:29 + */ +public enum IdentificationStatusEnum { + /** + * 订单处理状态 + **/ + + NOT_HANDLE("未处理过的订单"), + ALREADY_NOT_HANDLE("已处理过的订单"); + + private final String description; + + IdentificationStatusEnum(String description) { + this.description = description; + } + + public String description() { + return this.description; + } +} diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 9b351ed8..312306aa 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -12,17 +12,13 @@ import cn.lili.common.security.enums.UserEnums; import cn.lili.common.utils.BeanUtil; import cn.lili.common.utils.CurrencyUtil; import cn.lili.common.utils.SnowFlake; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.order.order.aop.AfterSaleLogPoint; import cn.lili.modules.order.order.entity.dos.AfterSale; import cn.lili.modules.order.order.entity.dos.Order; import cn.lili.modules.order.order.entity.dos.OrderItem; import cn.lili.modules.order.order.entity.dto.AfterSaleDTO; -import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum; -import cn.lili.modules.order.order.entity.enums.OrderStatusEnum; -import cn.lili.modules.order.order.entity.enums.OrderTypeEnum; -import cn.lili.modules.order.order.entity.enums.PayStatusEnum; +import cn.lili.modules.order.order.entity.enums.*; import cn.lili.modules.order.order.entity.vo.AfterSaleApplyVO; import cn.lili.modules.order.order.entity.vo.AfterSaleSearchParams; import cn.lili.modules.order.order.entity.vo.AfterSaleVO; @@ -58,9 +54,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.PostConstruct; import java.util.Date; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** * 售后业务层实现 @@ -466,8 +465,7 @@ public class AfterSaleServiceImpl extends ServiceImpl() - .eq(OrderItem::getSn, orderItem.getSn()) - .set(OrderItem::getIsGoodsNumber, orderItem.getIsGoodsNumber()) - .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus())); + //修改orderItem订单 + this.updateOrderItem(orderItem); } @@ -611,4 +598,96 @@ public class AfterSaleServiceImpl extends ServiceImpl orderItemList = orderItemService.list(new LambdaQueryWrapper() + .eq(OrderItem::getAfterSaleStatus, OrderItemAfterSaleStatusEnum.ALREADY_APPLIED)); + + //不为空时对订单数据进行部分售后逻辑处理 + if (!orderItemList.isEmpty()) { + + //遍历订单查询每一个订单下的售后记录 + orderItemList.forEach(orderItem -> { + + //标识为已处理过的订单 + orderItem.setIdentificationStatus(IdentificationStatusEnum.ALREADY_NOT_HANDLE.name()); + + //订单状态不能为新订单,已失效订单或未申请订单才可以去修改订单信息 + if (!orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NEW.name()) + && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.EXPIRED.name()) + && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NOT_APPLIED.name())) { + + //查询订单下的售后记录 + List afterSaleList = this.list(new LambdaQueryWrapper() + .eq(AfterSale::getOrderSn, orderItem.getOrderSn()) + .eq(AfterSale::getGoodsId, orderItem.getGoodsId())); + + //获取售后商品数量及已完成售后商品数量修改orderItem订单 + this.updateOrderItemGoodsNumber(orderItem, afterSaleList); + } + }); + } + + } + + /** + * 功能描述: 获取售后商品数量及已完成售后商品数量修改orderItem订单 + * + * @param orderItem,afterSaleList + * @author ftyy + **/ + private void updateOrderItemGoodsNumber(OrderItem orderItem, List afterSaleList) { + //根据售后状态获取不是已结束的售后记录 + List implementList = afterSaleList.stream() + .filter(afterSale -> afterSale.getServiceStatus().equals(AfterSaleStatusEnum.APPLY.name()) + || afterSale.getServiceStatus().equals(AfterSaleStatusEnum.PASS.name()) + || afterSale.getServiceStatus().equals(AfterSaleStatusEnum.BUYER_RETURN.name()) + || afterSale.getServiceStatus().equals(AfterSaleStatusEnum.SELLER_CONFIRM.name()) + || afterSale.getServiceStatus().equals(AfterSaleStatusEnum.WAIT_REFUND.name()) + || afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) + .collect(Collectors.toList()); + + if (!implementList.isEmpty()) { + //遍历售后记录获取售后商品数量 + implementList.forEach(a -> orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber() + a.getNum())); + } + + //获取已完成售后订单数量 + List completeList = afterSaleList.stream() + .filter(afterSale -> afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) + .collect(Collectors.toList()); + + if (!completeList.isEmpty()) { + //遍历售后记录获取已完成售后商品数量 + completeList.forEach(a -> orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() + a.getNum())); + } + //修改orderItem订单 + this.updateOrderItem(orderItem); + + } + + /** + * 功能描述: 修改orderItem订单 + * + * @param orderItem + * @return void + * @author ftyy + **/ + private void updateOrderItem(OrderItem orderItem) { + //正在售后商品总数等于商品总数,修改订单售后状态为已申请 + if (orderItem.getIsGoodsNumber().equals(orderItem.getNum())) { + //修改订单的售后状态--已申请 + orderItem.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.ALREADY_APPLIED.name()); + } else { + //修改订单的售后状态--部分售后 + orderItem.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.PART_AFTER_SALE.name()); + } + orderItemService.update(new LambdaUpdateWrapper() + .eq(OrderItem::getSn, orderItem.getSn()) + .set(OrderItem::getIsGoodsNumber, orderItem.getIsGoodsNumber()) + .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus())); + } + } \ No newline at end of file From b80aa487359f1ae1881b64a7a98d934abdd733ac Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Mon, 22 Nov 2021 15:24:23 +0800 Subject: [PATCH 06/11] =?UTF-8?q?'=E9=A1=B9=E7=9B=AE=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=A4=84=E7=90=864.24=E7=89=88=E6=9C=AC=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/version4.2.2to4.2.4.sql | 3 +- .../order/cart/render/TradeBuilder.java | 2 +- .../order/order/entity/dos/OrderItem.java | 2 + .../serviceimpl/AfterSaleServiceImpl.java | 45 ++++++++++++------- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/DB/version4.2.2to4.2.4.sql b/DB/version4.2.2to4.2.4.sql index 0faa9742..3884ad6e 100644 --- a/DB/version4.2.2to4.2.4.sql +++ b/DB/version4.2.2to4.2.4.sql @@ -1,3 +1,4 @@ /** 新增已退货数量 **/ ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '已退货数量 '; -ALTER TABLE li_order_item ADD is_goods_number int DEFAULT 0 COMMENT '正在进行售后的商品数量 '; \ No newline at end of file +ALTER TABLE li_order_item ADD is_goods_number int DEFAULT 0 COMMENT '正在进行售后的商品数量 '; +ALTER TABLE li_order_item ADD is_goods_number varchar(255) COMMENT '标识是否被4.2.4版本处理过的订单'; \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java b/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java index 75cfa3bd..dd15fbb8 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/TradeBuilder.java @@ -97,7 +97,7 @@ public class TradeBuilder { renderCartBySteps(tradeDTO, RenderStepStatement.tradeRender); } - + //添加order订单及order_item子订单并返回 return tradeService.createTrade(tradeDTO); } diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java index b1994b99..bbb39a32 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java @@ -9,6 +9,7 @@ import cn.lili.modules.order.cart.entity.vo.CartSkuVO; import cn.lili.modules.order.cart.entity.vo.CartVO; import cn.lili.modules.order.order.entity.dto.PriceDetailDTO; import cn.lili.modules.order.order.entity.enums.CommentStatusEnum; +import cn.lili.modules.order.order.entity.enums.IdentificationStatusEnum; import cn.lili.modules.order.order.entity.enums.OrderComplaintStatusEnum; import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum; import cn.lili.modules.promotion.entity.vos.PromotionSkuVO; @@ -134,6 +135,7 @@ public class OrderItem extends BaseEntity { this.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.NEW.name()); this.setCommentStatus(CommentStatusEnum.NEW.name()); this.setComplainStatus(OrderComplaintStatusEnum.NEW.name()); + this.setIdentificationStatus(IdentificationStatusEnum.ALREADY_NOT_HANDLE.name()); this.setPriceDetailDTO(cartSkuVO.getPriceDetailDTO()); this.setOrderSn(cartVO.getSn()); this.setTradeSn(tradeDTO.getSn()); diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 312306aa..6cbca96c 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -599,11 +599,18 @@ public class AfterSaleServiceImpl extends ServiceImpl orderItemList = orderItemService.list(new LambdaQueryWrapper() - .eq(OrderItem::getAfterSaleStatus, OrderItemAfterSaleStatusEnum.ALREADY_APPLIED)); + .isNull(OrderItem::getIdentificationStatus).or() + .eq(OrderItem::getIdentificationStatus, IdentificationStatusEnum.NOT_HANDLE.name())); //不为空时对订单数据进行部分售后逻辑处理 if (!orderItemList.isEmpty()) { @@ -611,9 +618,6 @@ public class AfterSaleServiceImpl extends ServiceImpl { - //标识为已处理过的订单 - orderItem.setIdentificationStatus(IdentificationStatusEnum.ALREADY_NOT_HANDLE.name()); - //订单状态不能为新订单,已失效订单或未申请订单才可以去修改订单信息 if (!orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NEW.name()) && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.EXPIRED.name()) @@ -627,7 +631,11 @@ public class AfterSaleServiceImpl extends ServiceImpl orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() + a.getNum())); } - //修改orderItem订单 - this.updateOrderItem(orderItem); - } /** @@ -676,18 +681,26 @@ public class AfterSaleServiceImpl extends ServiceImpl() .eq(OrderItem::getSn, orderItem.getSn()) .set(OrderItem::getIsGoodsNumber, orderItem.getIsGoodsNumber()) - .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus())); + .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus()) + .set(OrderItem::getIdentificationStatus,IdentificationStatusEnum.ALREADY_NOT_HANDLE.name())); } } \ No newline at end of file From e9c18935c501930ed8973cd4d827e37b448bc466 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Mon, 22 Nov 2021 15:29:27 +0800 Subject: [PATCH 07/11] =?UTF-8?q?'=E4=BF=AE=E6=94=B9DBsql=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=94=99=E8=AF=AF=E5=AD=97=E6=AE=B5'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/version4.2.2to4.2.4.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DB/version4.2.2to4.2.4.sql b/DB/version4.2.2to4.2.4.sql index 3884ad6e..a0494786 100644 --- a/DB/version4.2.2to4.2.4.sql +++ b/DB/version4.2.2to4.2.4.sql @@ -1,4 +1,4 @@ /** 新增已退货数量 **/ ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '已退货数量 '; ALTER TABLE li_order_item ADD is_goods_number int DEFAULT 0 COMMENT '正在进行售后的商品数量 '; -ALTER TABLE li_order_item ADD is_goods_number varchar(255) COMMENT '标识是否被4.2.4版本处理过的订单'; \ No newline at end of file +ALTER TABLE li_order_item ADD identification_status varchar(255) COMMENT '标识是否被4.2.4版本处理过的订单'; \ No newline at end of file From aee5d4be2ed290329572d0656a83417f8b36f0df Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Mon, 22 Nov 2021 15:35:40 +0800 Subject: [PATCH 08/11] =?UTF-8?q?'=E4=BF=AE=E6=94=B9DBsql=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=89=88=E6=9C=AC=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/{version4.2.2to4.2.4.sql => version4.2.3to4.2.4.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename DB/{version4.2.2to4.2.4.sql => version4.2.3to4.2.4.sql} (100%) diff --git a/DB/version4.2.2to4.2.4.sql b/DB/version4.2.3to4.2.4.sql similarity index 100% rename from DB/version4.2.2to4.2.4.sql rename to DB/version4.2.3to4.2.4.sql From 5f90e422e629f3bf71de527018c4671357959cfc Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Mon, 29 Nov 2021 17:43:17 +0800 Subject: [PATCH 09/11] =?UTF-8?q?'=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=8A=E5=8E=BB=E9=99=A4orderItem=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E5=AD=97=E6=AE=B5'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/version4.2.3to4.2.4.sql | 3 +- .../order/order/entity/dos/OrderItem.java | 5 +- .../serviceimpl/AfterSaleServiceImpl.java | 77 ++++++++++--------- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/DB/version4.2.3to4.2.4.sql b/DB/version4.2.3to4.2.4.sql index a0494786..d9a266fc 100644 --- a/DB/version4.2.3to4.2.4.sql +++ b/DB/version4.2.3to4.2.4.sql @@ -1,4 +1,3 @@ /** 新增已退货数量 **/ -ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '已退货数量 '; -ALTER TABLE li_order_item ADD is_goods_number int DEFAULT 0 COMMENT '正在进行售后的商品数量 '; +ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; ALTER TABLE li_order_item ADD identification_status varchar(255) COMMENT '标识是否被4.2.4版本处理过的订单'; \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java index bbb39a32..b711a8a7 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java @@ -113,12 +113,9 @@ public class OrderItem extends BaseEntity { @ApiModelProperty(value = "交易投诉id") private String complainId; - @ApiModelProperty(value = "已退货商品数量") + @ApiModelProperty(value = "退货商品数量") private Integer returnGoodsNumber; - @ApiModelProperty(value = "正在进行退货中的商品数量") - private Integer isGoodsNumber; - @ApiModelProperty(value = "标识是否被4.2.4版本处理过的订单") private String identificationStatus; diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 6cbca96c..7e00780b 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -156,8 +156,6 @@ public class AfterSaleServiceImpl extends ServiceImpl() .eq(OrderItem::getOrderSn, afterSale.getOrderSn()) - .eq(OrderItem::getGoodsId, afterSale.getGoodsId())); + .eq(OrderItem::getSkuId, afterSale.getSkuId())); + AfterSaleStatusEnum afterSaleStatusEnum = AfterSaleStatusEnum.valueOf(afterSale.getServiceStatus()); + switch (afterSaleStatusEnum){ + //判断当前售后的状态---申请中 + case APPLY:{ + orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() + afterSale.getNum()); + break; + } + + //判断当前售后的状态---已拒绝,买家取消售后,卖家终止售后 + case REFUSE: + case BUYER_CANCEL: + case SELLER_TERMINATION: { + orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() - afterSale.getNum()); + break; + } + default: - //判断当前售后的状态---申请中 - if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.APPLY.name())) { - orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber() + afterSale.getNum()); - } - //判断当前售后的状态---已拒绝 - if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.REFUSE.name())) { - orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber() - afterSale.getNum()); - } - //判断当前售后的状态---买家取消售后 - if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.BUYER_CANCEL.name())) { - orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber() - afterSale.getNum()); - } - //判断当前售后的状态---卖家终止售后 - if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.SELLER_TERMINATION.name())) { - orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber() - afterSale.getNum()); } //修改orderItem订单 this.updateOrderItem(orderItem); @@ -514,8 +513,8 @@ public class AfterSaleServiceImpl extends ServiceImpl (orderItem.getNum() - orderItem.getIsGoodsNumber())) { + //申请商品数量不能超过商品总数量-售后商品数量 + if (afterSaleDTO.getNum() > (orderItem.getNum() - orderItem.getReturnGoodsNumber())) { throw new ServiceException(ResultCode.AFTER_GOODS_NUMBER_ERROR); } @@ -659,7 +658,7 @@ public class AfterSaleServiceImpl extends ServiceImpl orderItem.setIsGoodsNumber(orderItem.getIsGoodsNumber() + a.getNum())); + implementList.forEach(a -> orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() + a.getNum())); } //获取已完成售后订单数量 @@ -682,25 +681,33 @@ public class AfterSaleServiceImpl extends ServiceImpl() .eq(OrderItem::getSn, orderItem.getSn()) - .set(OrderItem::getIsGoodsNumber, orderItem.getIsGoodsNumber()) .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus()) - .set(OrderItem::getIdentificationStatus,IdentificationStatusEnum.ALREADY_NOT_HANDLE.name())); + .set(OrderItem::getReturnGoodsNumber,orderItem.getReturnGoodsNumber()) + .set(OrderItem::getIdentificationStatus, IdentificationStatusEnum.ALREADY_NOT_HANDLE.name())); } } \ No newline at end of file From 96cc2bd37fc7068d7d41333059d7271e7d326f70 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Tue, 30 Nov 2021 14:54:05 +0800 Subject: [PATCH 10/11] =?UTF-8?q?'=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/order/order/serviceimpl/AfterSaleServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index 7e00780b..2dc37ff6 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -486,7 +486,7 @@ public class AfterSaleServiceImpl extends ServiceImpl() .eq(OrderItem::getSn, orderItem.getSn()) From 3e10c891abf3e4d0026c6b7bda8903faea06a330 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Tue, 30 Nov 2021 15:19:42 +0800 Subject: [PATCH 11/11] =?UTF-8?q?'=E5=8E=BB=E9=99=A4=E5=A4=84=E7=90=864.24?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B9=8B=E5=89=8D=E8=AE=A2=E5=8D=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/version4.2.3to4.2.4.sql | 3 +- .../serviceimpl/AfterSaleServiceImpl.java | 47 ++----------------- .../order/order/entity/dos/OrderItem.java | 4 -- .../enums/IdentificationStatusEnum.java | 25 ---------- 4 files changed, 4 insertions(+), 75 deletions(-) delete mode 100644 framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java diff --git a/DB/version4.2.3to4.2.4.sql b/DB/version4.2.3to4.2.4.sql index d9a266fc..78764222 100644 --- a/DB/version4.2.3to4.2.4.sql +++ b/DB/version4.2.3to4.2.4.sql @@ -1,3 +1,2 @@ /** 新增已退货数量 **/ -ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; -ALTER TABLE li_order_item ADD identification_status varchar(255) COMMENT '标识是否被4.2.4版本处理过的订单'; \ No newline at end of file +ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java index 4e6f3180..46bdc735 100644 --- a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java @@ -464,7 +464,7 @@ public class AfterSaleServiceImpl extends ServiceImpl orderItemList = orderItemService.list(new LambdaQueryWrapper() - .isNull(OrderItem::getIdentificationStatus).or() - .eq(OrderItem::getIdentificationStatus, IdentificationStatusEnum.NOT_HANDLE.name())); - - //不为空时对订单数据进行部分售后逻辑处理 - if (!orderItemList.isEmpty()) { - - //遍历订单查询每一个订单下的售后记录 - orderItemList.forEach(orderItem -> { - - //订单状态不能为新订单,已失效订单或未申请订单才可以去修改订单信息 - if (!orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NEW.name()) - && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.EXPIRED.name()) - && !orderItem.getAfterSaleStatus().equals(OrderItemAfterSaleStatusEnum.NOT_APPLIED.name())) { - - //查询订单下的售后记录 - List afterSaleList = this.list(new LambdaQueryWrapper() - .eq(AfterSale::getOrderSn, orderItem.getOrderSn()) - .eq(AfterSale::getGoodsId, orderItem.getGoodsId())); - - //获取售后商品数量及已完成售后商品数量修改orderItem订单 - this.updateOrderItemGoodsNumber(orderItem, afterSaleList); - } - - //修改orderItem订单 - this.updateOrderItem(orderItem); - }); - - } - - } - /** * 功能描述: 获取售后商品数量及已完成售后商品数量修改orderItem订单 * @@ -711,8 +671,7 @@ public class AfterSaleServiceImpl extends ServiceImpl() .eq(OrderItem::getSn, orderItem.getSn()) .set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus()) - .set(OrderItem::getReturnGoodsNumber,orderItem.getReturnGoodsNumber()) - .set(OrderItem::getIdentificationStatus, IdentificationStatusEnum.ALREADY_NOT_HANDLE.name())); + .set(OrderItem::getReturnGoodsNumber,orderItem.getReturnGoodsNumber())); } } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java index b711a8a7..ae8c270f 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/OrderItem.java @@ -9,7 +9,6 @@ import cn.lili.modules.order.cart.entity.vo.CartSkuVO; import cn.lili.modules.order.cart.entity.vo.CartVO; import cn.lili.modules.order.order.entity.dto.PriceDetailDTO; import cn.lili.modules.order.order.entity.enums.CommentStatusEnum; -import cn.lili.modules.order.order.entity.enums.IdentificationStatusEnum; import cn.lili.modules.order.order.entity.enums.OrderComplaintStatusEnum; import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum; import cn.lili.modules.promotion.entity.vos.PromotionSkuVO; @@ -116,8 +115,6 @@ public class OrderItem extends BaseEntity { @ApiModelProperty(value = "退货商品数量") private Integer returnGoodsNumber; - @ApiModelProperty(value = "标识是否被4.2.4版本处理过的订单") - private String identificationStatus; public OrderItem(CartSkuVO cartSkuVO, CartVO cartVO, TradeDTO tradeDTO) { String oldId = this.getId(); @@ -132,7 +129,6 @@ public class OrderItem extends BaseEntity { this.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.NEW.name()); this.setCommentStatus(CommentStatusEnum.NEW.name()); this.setComplainStatus(OrderComplaintStatusEnum.NEW.name()); - this.setIdentificationStatus(IdentificationStatusEnum.ALREADY_NOT_HANDLE.name()); this.setPriceDetailDTO(cartSkuVO.getPriceDetailDTO()); this.setOrderSn(cartVO.getSn()); this.setTradeSn(tradeDTO.getSn()); diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java deleted file mode 100644 index 7993eeb1..00000000 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/IdentificationStatusEnum.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.lili.modules.order.order.entity.enums; - -/** - * 标识是否被4.2.4版本处理过的订单 - * @author: ftyy - * @Date: 2021-11-19 18:29 - */ -public enum IdentificationStatusEnum { - /** - * 订单处理状态 - **/ - - NOT_HANDLE("未处理过的订单"), - ALREADY_NOT_HANDLE("已处理过的订单"); - - private final String description; - - IdentificationStatusEnum(String description) { - this.description = description; - } - - public String description() { - return this.description; - } -}