From 71d6311bd4aa4a547ac7f882c59044031325c6a1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 23 Sep 2023 09:27:29 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E6=8B=BC=E5=9B=A2?= =?UTF-8?q?=E3=80=81=E7=A7=92=E6=9D=80=E7=AD=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/enums/ErrorCodeConstants.java | 2 - .../AppCombinationActivityController.java | 22 +++---- .../seckill/AppSeckillActivityController.java | 19 +++--- .../seckill/AppSeckillConfigController.java | 3 +- .../bargain/BargainActivityConvert.java | 8 +-- .../CombinationActivityConvert.java | 8 +-- .../SeckillActivityConvert.java | 8 +-- .../CombinationActivityMapper.java | 16 +---- .../CombinationActivityService.java | 11 ++++ .../CombinationActivityServiceImpl.java | 2 +- .../aftersale/TradeAfterSaleController.java | 2 +- .../aftersale/TradeAfterSaleConvert.java | 6 +- .../core/dto/TradeAfterSaleLogRespVO.java | 58 ------------------- .../core/service/AfterSaleLogService.java | 2 +- .../aftersale/TradeAfterSaleServiceImpl.java | 3 +- 15 files changed, 46 insertions(+), 124 deletions(-) delete mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/dto/TradeAfterSaleLogRespVO.java diff --git a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java index 798e59851..4fc58004a 100644 --- a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java +++ b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java @@ -56,7 +56,6 @@ public interface ErrorCodeConstants { ErrorCode SECKILL_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED_OR_END = new ErrorCode(1013008004, "秒杀活动未关闭或未结束,不能删除"); ErrorCode SECKILL_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED = new ErrorCode(1013008005, "秒杀活动已关闭,不能重复关闭"); ErrorCode SECKILL_ACTIVITY_UPDATE_STOCK_FAIL = new ErrorCode(1013008006, "秒杀失败,原因秒杀库存不足"); - ErrorCode SECKILL_ACTIVITY_APP_STATUS_CLOSED = new ErrorCode(1013008007, "秒杀活动已关闭"); // ========== 秒杀时段 1013009000 ========== ErrorCode SECKILL_CONFIG_NOT_EXISTS = new ErrorCode(1013009000, "秒杀时段不存在"); @@ -69,7 +68,6 @@ public interface ErrorCodeConstants { ErrorCode COMBINATION_ACTIVITY_STATUS_DISABLE_NOT_UPDATE = new ErrorCode(1013010002, "拼团活动已关闭不能修改"); ErrorCode COMBINATION_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED_OR_END = new ErrorCode(1013010003, "拼团活动未关闭或未结束,不能删除"); ErrorCode COMBINATION_ACTIVITY_STATUS_DISABLE = new ErrorCode(1013010004, "拼团失败,原因:拼团活动已关闭"); - ErrorCode COMBINATION_ACTIVITY_APP_STATUS_DISABLE = new ErrorCode(1013010005, "拼团活动已关闭"); // ========== 拼团记录 1013011000 ========== ErrorCode COMBINATION_RECORD_NOT_EXISTS = new ErrorCode(1013011000, "拼团不存在"); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java index d09292de9..ee1d5ed17 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java @@ -24,14 +24,12 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.Arrays; +import java.util.Collections; import java.util.List; import static cn.hutool.core.util.ObjectUtil.defaultIfNull; -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; -import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COMBINATION_ACTIVITY_APP_STATUS_DISABLE; @Tag(name = "用户 APP - 拼团活动") @RestController @@ -44,7 +42,7 @@ public class AppCombinationActivityController { @Resource private ProductSpuApi spuApi; - + // TODO 芋艿:增加 Spring Cache @GetMapping("/list") @Operation(summary = "获得拼团活动列表", description = "用于小程序首页") @Parameter(name = "count", description = "需要展示的数量", example = "6") @@ -52,11 +50,10 @@ public class AppCombinationActivityController { @RequestParam(name = "count", defaultValue = "6") Integer count) { List list = activityService.getCombinationActivityListByCount(defaultIfNull(count, 6)); if (CollUtil.isEmpty(list)) { - return success(CombinationActivityConvert.INSTANCE.convertAppList(list)); + return success(Collections.emptyList()); } - + // 拼接返回 List spuList = spuApi.getSpuList(convertList(list, CombinationActivityDO::getSpuId)); - // TODO 芋艿:增加 Spring Cache return success(CombinationActivityConvert.INSTANCE.convertAppList(list, spuList)); } @@ -67,7 +64,7 @@ public class AppCombinationActivityController { if (CollUtil.isEmpty(result.getList())) { return success(PageResult.empty(result.getTotal())); } - + // 拼接返回 List spuList = spuApi.getSpuList(convertList(result.getList(), CombinationActivityDO::getSpuId)); return success(CombinationActivityConvert.INSTANCE.convertAppPage(result, spuList)); } @@ -78,15 +75,12 @@ public class AppCombinationActivityController { public CommonResult getCombinationActivityDetail(@RequestParam("id") Long id) { // 1、获取活动 CombinationActivityDO combinationActivity = activityService.getCombinationActivity(id); - if (combinationActivity == null) { + if (combinationActivity == null + || ObjectUtil.equal(combinationActivity.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { return success(null); } - if (ObjectUtil.equal(combinationActivity.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { - throw exception(COMBINATION_ACTIVITY_APP_STATUS_DISABLE); - } - // 2、获取活动商品 - List products = activityService.getCombinationProductsByActivityIds(Arrays.asList(combinationActivity.getId())); + List products = activityService.getCombinationProductsByActivityId(combinationActivity.getId()); return success(CombinationActivityConvert.INSTANCE.convert3(combinationActivity, products)); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java index 7ee0027ed..a83b87ae2 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.app.seckill; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -29,10 +30,8 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; -import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.SECKILL_ACTIVITY_APP_STATUS_CLOSED; @Tag(name = "用户 App - 秒杀活动") @RestController @@ -48,6 +47,7 @@ public class AppSeckillActivityController { @Resource private ProductSpuApi spuApi; + // TODO 芋艿:需要增加 spring cache @GetMapping("/get-now") @Operation(summary = "获得当前秒杀活动", description = "获取当前正在进行的活动,提供给首页使用") public CommonResult getNowSeckillActivity() { @@ -61,7 +61,6 @@ public class AppSeckillActivityController { List activityList = activityService.getSeckillActivityListByConfigIdAndStatus(configList.getId(), CommonStatusEnum.ENABLE.getStatus()); // 3 获取 spu 信息 List spuList = spuApi.getSpuList(convertList(activityList, SeckillActivityDO::getSpuId)); - // TODO 芋艿:需要增加 spring cache return success(SeckillActivityConvert.INSTANCE.convert(configList, activityList, spuList)); } @@ -70,7 +69,9 @@ public class AppSeckillActivityController { public CommonResult> getSeckillActivityPage(AppSeckillActivityPageReqVO pageReqVO) { // 1. 查询满足当前阶段的活动 PageResult pageResult = activityService.getSeckillActivityAppPageByConfigId(pageReqVO); - + if (CollUtil.isEmpty(pageResult.getList())) { + return success(PageResult.empty(pageResult.getTotal())); + } // 2. 拼接数据 List spuList = spuApi.getSpuList(convertList(pageResult.getList(), SeckillActivityDO::getSpuId)); return success(SeckillActivityConvert.INSTANCE.convertPage(pageResult, spuList)); @@ -88,16 +89,14 @@ public class AppSeckillActivityController { // 2. 获取活动 SeckillActivityDO seckillActivity = activityService.getSeckillActivity(id); - if (seckillActivity == null) { + if (seckillActivity == null + || ObjectUtil.equal(seckillActivity.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { return success(null); } - if (ObjectUtil.equal(seckillActivity.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { - throw exception(SECKILL_ACTIVITY_APP_STATUS_CLOSED); - } // 3. 拼接数据 - List products = activityService.getSeckillProductListByActivityId(seckillActivity.getId()); - return success(SeckillActivityConvert.INSTANCE.convert3(seckillActivity, products, configList)); + List productList = activityService.getSeckillProductListByActivityId(seckillActivity.getId()); + return success(SeckillActivityConvert.INSTANCE.convert3(seckillActivity, productList, configList)); } } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillConfigController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillConfigController.java index 2795ca9a4..ec60b2141 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillConfigController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillConfigController.java @@ -28,7 +28,8 @@ public class AppSeckillConfigController { @GetMapping("/list") @Operation(summary = "获得秒杀时间段列表") public CommonResult> getSeckillConfigList() { - return success(SeckillConfigConvert.INSTANCE.convertList2(configService.getSeckillConfigListByStatus(CommonStatusEnum.ENABLE.getStatus()))); + return success(SeckillConfigConvert.INSTANCE.convertList2( + configService.getSeckillConfigListByStatus(CommonStatusEnum.ENABLE.getStatus()))); } } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/bargain/BargainActivityConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/bargain/BargainActivityConvert.java index 954558b01..92791ed76 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/bargain/BargainActivityConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/bargain/BargainActivityConvert.java @@ -73,9 +73,7 @@ public interface BargainActivityConvert { // 拼接关联属性 Map spuMap = convertMap(spuList, ProductSpuRespDTO::getId); List list = CollectionUtils.convertList(result.getList(), item -> { - findAndThen(spuMap, item.getSpuId(), spu -> { - item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()); - }); + findAndThen(spuMap, item.getSpuId(), spu -> item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); return item; }); result.setList(list); @@ -88,9 +86,7 @@ public interface BargainActivityConvert { List activityList = convertAppList(list); Map spuMap = convertMap(spuList, ProductSpuRespDTO::getId); return CollectionUtils.convertList(activityList, item -> { - findAndThen(spuMap, item.getSpuId(), spu -> { - item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()); - }); + findAndThen(spuMap, item.getSpuId(), spu -> item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); return item; }); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java index 07a9c4df3..f92dbef59 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java @@ -61,9 +61,7 @@ public interface CombinationActivityConvert { Map spuMap = convertMap(spuList, ProductSpuRespDTO::getId); PageResult pageResult = convertPage(page); pageResult.getList().forEach(item -> { - MapUtils.findAndThen(spuMap, item.getSpuId(), spu -> { - item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()); - }); + MapUtils.findAndThen(spuMap, item.getSpuId(), spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl())); item.setProducts(convertList2(productList)); }); return pageResult; @@ -118,9 +116,7 @@ public interface CombinationActivityConvert { List activityList = convertAppList(list); Map spuMap = convertMap(spuList, ProductSpuRespDTO::getId); return CollectionUtils.convertList(activityList, item -> { - findAndThen(spuMap, item.getSpuId(), spu -> { - item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()); - }); + findAndThen(spuMap, item.getSpuId(), spu -> item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); return item; }); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java index f0da88cbc..e1fcc35d8 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java @@ -113,11 +113,8 @@ public interface SeckillActivityConvert { PageResult result = convertPage1(pageResult); Map spuMap = convertMap(spuList, ProductSpuRespDTO::getId); List list = CollectionUtils.convertList(result.getList(), item -> { - findAndThen(spuMap, item.getSpuId(), spu -> { - item.setPicUrl(spu.getPicUrl()) - .setMarketPrice(spu.getMarketPrice()) - .setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit())); - }); + findAndThen(spuMap, item.getSpuId(), spu -> item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()) + .setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit()))); return item; }); result.setList(list); @@ -131,6 +128,7 @@ public interface SeckillActivityConvert { default AppSeckillActivityDetailRespVO convert3(SeckillActivityDO seckillActivity, List products, SeckillConfigDO filteredConfig) { return convert2(seckillActivity) .setProducts(convertList1(products)) + // TODO @puhui999:要不要在里面 default 一个方法,处理这个事件;简洁一点; .setStartTime(LocalDateTimeUtil.parse(LocalDateTimeUtil.format(seckillActivity.getStartTime(), "yyyy-MM-dd") + " " + filteredConfig.getStartTime(), "yyyy-MM-dd HH:mm:ss")) // 活动开始日期和时段结合 .setEndTime(LocalDateTimeUtil.parse(LocalDateTimeUtil.format(seckillActivity.getEndTime(), "yyyy-MM-dd") + " " + filteredConfig.getEndTime(), diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java index 0dce45a28..5672c34dc 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java @@ -29,26 +29,12 @@ public interface CombinationActivityMapper extends BaseMapperX selectPage(PageParam pageParam, Integer status) { return selectPage(pageParam, new LambdaQueryWrapperX() .eq(CombinationActivityDO::getStatus, status)); } - /** - * 查询 status 状态的活动分页 - * - * @param status 状态 - * @param count 限制条数 - * @return 活动分页 - */ - default List selectList(Integer status, Integer count) { + default List selectListByStatus(Integer status, Integer count) { return selectList(new LambdaQueryWrapperX() .eq(CombinationActivityDO::getStatus, status) .last("LIMIT " + count)); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityService.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityService.java index c2a090b72..c5f72e6a6 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityService.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityService.java @@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationP import javax.validation.Valid; import java.util.Collection; +import java.util.Collections; import java.util.List; /** @@ -65,6 +66,16 @@ public interface CombinationActivityService { */ PageResult getCombinationActivityPage(CombinationActivityPageReqVO pageReqVO); + /** + * 获得拼团活动商品列表 + * + * @param activityId 拼团活动 id + * @return 拼团活动的商品列表 + */ + default List getCombinationProductsByActivityId(Long activityId) { + return getCombinationProductsByActivityIds(Collections.singletonList(activityId)); + } + /** * 获得拼团活动商品列表 * diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityServiceImpl.java index 87a633064..2dc715039 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityServiceImpl.java @@ -247,7 +247,7 @@ public class CombinationActivityServiceImpl implements CombinationActivityServic @Override public List getCombinationActivityListByCount(Integer count) { - return combinationActivityMapper.selectList(CommonStatusEnum.ENABLE.getStatus(), count); + return combinationActivityMapper.selectListByStatus(CommonStatusEnum.ENABLE.getStatus(), count); } @Override diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java index a3fcfae40..3b438568b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java @@ -8,11 +8,11 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.pay.api.notify.dto.PayRefundNotifyReqDTO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.*; +import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; -import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.service.AfterSaleLogService; import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; import cn.iocoder.yudao.module.trade.service.order.TradeOrderQueryService; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java index dc220ad31..9faaefb5d 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundCreateReqDTO; import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleDetailRespVO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleRespPageItemVO; +import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.controller.admin.base.member.user.MemberUserRespVO; import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderBaseVO; @@ -15,7 +16,6 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleLogDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; -import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties; import org.mapstruct.Mapper; import org.mapstruct.Mapping; @@ -68,7 +68,7 @@ public interface TradeAfterSaleConvert { PageResult convertPage02(PageResult page); List convertList(List list); - + default TradeAfterSaleDetailRespVO convert(TradeAfterSaleDO afterSale, TradeOrderDO order, List orderItems, MemberUserRespDTO user, List logs) { TradeAfterSaleDetailRespVO respVO = convert(afterSale, orderItems); @@ -81,7 +81,7 @@ public interface TradeAfterSaleConvert { return respVO; } - List convertList1(List list); + List convertList1(List list); @Mapping(target = "id", source = "afterSale.id") TradeAfterSaleDetailRespVO convert(TradeAfterSaleDO afterSale, List orderItems); TradeOrderBaseVO convert(TradeOrderDO order); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/dto/TradeAfterSaleLogRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/dto/TradeAfterSaleLogRespVO.java deleted file mode 100644 index 328aab944..000000000 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/dto/TradeAfterSaleLogRespVO.java +++ /dev/null @@ -1,58 +0,0 @@ -package cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; -import java.time.LocalDateTime; - -/** - * 贸易售后日志详情 DTO - * - * @author HUIHUI - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class TradeAfterSaleLogRespVO { - - @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20669") - private Long id; - - @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22634") - @NotNull(message = "用户编号不能为空") - private Long userId; - - @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotNull(message = "用户类型不能为空") - private Integer userType; - - @Schema(description = "售后编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3023") - @NotNull(message = "售后编号不能为空") - private Long afterSaleId; - - @Schema(description = "订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "25870") - @NotNull(message = "订单编号不能为空") - private Long orderId; - - @Schema(description = "订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23154") - @NotNull(message = "订单项编号不能为空") - private Long orderItemId; - - @Schema(description = "售后状态(之前)", example = "2") - private Integer beforeStatus; - - @Schema(description = "售后状态(之后)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "售后状态(之后)不能为空") - private Integer afterStatus; - - @Schema(description = "操作明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "维权完成,退款金额:¥37776.00") - @NotNull(message = "操作明细不能为空") - private String content; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - private LocalDateTime createTime; - -} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/service/AfterSaleLogService.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/service/AfterSaleLogService.java index 2f9245c01..53019a30b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/service/AfterSaleLogService.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/service/AfterSaleLogService.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.trade.framework.aftersalelog.core.service; +import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto.TradeAfterSaleLogCreateReqDTO; -import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto.TradeAfterSaleLogRespVO; import java.util.List; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java index 1b7866da8..80acf9b99 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundCreateReqDTO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleDisagreeReqVO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSalePageReqVO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleRefuseReqVO; +import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleDeliveryReqVO; import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; @@ -26,7 +27,6 @@ import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleWayEnum; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderItemAfterSaleStatusEnum; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum; import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto.TradeAfterSaleLogCreateReqDTO; -import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.dto.TradeAfterSaleLogRespVO; import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.service.AfterSaleLogService; import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties; import cn.iocoder.yudao.module.trade.service.order.TradeOrderQueryService; @@ -449,6 +449,7 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa } } + // TODO @puhui999:应该返回 do 哈。 @Override public List getLog(Long afterSaleId) { // TODO 不熟悉流程先这么滴