mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 17:40:05 +08:00
code review:拼团、秒杀等逻辑
This commit is contained in:
parent
54fe0174bc
commit
71d6311bd4
@ -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, "拼团不存在");
|
||||
|
@ -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<CombinationActivityDO> list = activityService.getCombinationActivityListByCount(defaultIfNull(count, 6));
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return success(CombinationActivityConvert.INSTANCE.convertAppList(list));
|
||||
return success(Collections.emptyList());
|
||||
}
|
||||
|
||||
// 拼接返回
|
||||
List<ProductSpuRespDTO> 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<ProductSpuRespDTO> spuList = spuApi.getSpuList(convertList(result.getList(), CombinationActivityDO::getSpuId));
|
||||
return success(CombinationActivityConvert.INSTANCE.convertAppPage(result, spuList));
|
||||
}
|
||||
@ -78,15 +75,12 @@ public class AppCombinationActivityController {
|
||||
public CommonResult<AppCombinationActivityDetailRespVO> 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<CombinationProductDO> products = activityService.getCombinationProductsByActivityIds(Arrays.asList(combinationActivity.getId()));
|
||||
List<CombinationProductDO> products = activityService.getCombinationProductsByActivityId(combinationActivity.getId());
|
||||
return success(CombinationActivityConvert.INSTANCE.convert3(combinationActivity, products));
|
||||
}
|
||||
|
||||
|
@ -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<AppSeckillActivityNowRespVO> getNowSeckillActivity() {
|
||||
@ -61,7 +61,6 @@ public class AppSeckillActivityController {
|
||||
List<SeckillActivityDO> activityList = activityService.getSeckillActivityListByConfigIdAndStatus(configList.getId(), CommonStatusEnum.ENABLE.getStatus());
|
||||
// 3 获取 spu 信息
|
||||
List<ProductSpuRespDTO> 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<PageResult<AppSeckillActivityRespVO>> getSeckillActivityPage(AppSeckillActivityPageReqVO pageReqVO) {
|
||||
// 1. 查询满足当前阶段的活动
|
||||
PageResult<SeckillActivityDO> pageResult = activityService.getSeckillActivityAppPageByConfigId(pageReqVO);
|
||||
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return success(PageResult.empty(pageResult.getTotal()));
|
||||
}
|
||||
// 2. 拼接数据
|
||||
List<ProductSpuRespDTO> 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<SeckillProductDO> products = activityService.getSeckillProductListByActivityId(seckillActivity.getId());
|
||||
return success(SeckillActivityConvert.INSTANCE.convert3(seckillActivity, products, configList));
|
||||
List<SeckillProductDO> productList = activityService.getSeckillProductListByActivityId(seckillActivity.getId());
|
||||
return success(SeckillActivityConvert.INSTANCE.convert3(seckillActivity, productList, configList));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,8 @@ public class AppSeckillConfigController {
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得秒杀时间段列表")
|
||||
public CommonResult<List<AppSeckillConfigRespVO>> getSeckillConfigList() {
|
||||
return success(SeckillConfigConvert.INSTANCE.convertList2(configService.getSeckillConfigListByStatus(CommonStatusEnum.ENABLE.getStatus())));
|
||||
return success(SeckillConfigConvert.INSTANCE.convertList2(
|
||||
configService.getSeckillConfigListByStatus(CommonStatusEnum.ENABLE.getStatus())));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,9 +73,7 @@ public interface BargainActivityConvert {
|
||||
// 拼接关联属性
|
||||
Map<Long, ProductSpuRespDTO> spuMap = convertMap(spuList, ProductSpuRespDTO::getId);
|
||||
List<AppBargainActivityRespVO> 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<AppBargainActivityRespVO> activityList = convertAppList(list);
|
||||
Map<Long, ProductSpuRespDTO> 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;
|
||||
});
|
||||
}
|
||||
|
@ -61,9 +61,7 @@ public interface CombinationActivityConvert {
|
||||
Map<Long, ProductSpuRespDTO> spuMap = convertMap(spuList, ProductSpuRespDTO::getId);
|
||||
PageResult<CombinationActivityRespVO> 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<AppCombinationActivityRespVO> activityList = convertAppList(list);
|
||||
Map<Long, ProductSpuRespDTO> 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;
|
||||
});
|
||||
}
|
||||
|
@ -113,11 +113,8 @@ public interface SeckillActivityConvert {
|
||||
PageResult<AppSeckillActivityRespVO> result = convertPage1(pageResult);
|
||||
Map<Long, ProductSpuRespDTO> spuMap = convertMap(spuList, ProductSpuRespDTO::getId);
|
||||
List<AppSeckillActivityRespVO> 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<SeckillProductDO> 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(),
|
||||
|
@ -29,26 +29,12 @@ public interface CombinationActivityMapper extends BaseMapperX<CombinationActivi
|
||||
return selectList(CombinationActivityDO::getStatus, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 status 状态的活动分页
|
||||
*
|
||||
* @param pageParam 分页参数
|
||||
* @param status 状态
|
||||
* @return 活动分页
|
||||
*/
|
||||
default PageResult<CombinationActivityDO> selectPage(PageParam pageParam, Integer status) {
|
||||
return selectPage(pageParam, new LambdaQueryWrapperX<CombinationActivityDO>()
|
||||
.eq(CombinationActivityDO::getStatus, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 status 状态的活动分页
|
||||
*
|
||||
* @param status 状态
|
||||
* @param count 限制条数
|
||||
* @return 活动分页
|
||||
*/
|
||||
default List<CombinationActivityDO> selectList(Integer status, Integer count) {
|
||||
default List<CombinationActivityDO> selectListByStatus(Integer status, Integer count) {
|
||||
return selectList(new LambdaQueryWrapperX<CombinationActivityDO>()
|
||||
.eq(CombinationActivityDO::getStatus, status)
|
||||
.last("LIMIT " + count));
|
||||
|
@ -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<CombinationActivityDO> getCombinationActivityPage(CombinationActivityPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得拼团活动商品列表
|
||||
*
|
||||
* @param activityId 拼团活动 id
|
||||
* @return 拼团活动的商品列表
|
||||
*/
|
||||
default List<CombinationProductDO> getCombinationProductsByActivityId(Long activityId) {
|
||||
return getCombinationProductsByActivityIds(Collections.singletonList(activityId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得拼团活动商品列表
|
||||
*
|
||||
|
@ -247,7 +247,7 @@ public class CombinationActivityServiceImpl implements CombinationActivityServic
|
||||
|
||||
@Override
|
||||
public List<CombinationActivityDO> getCombinationActivityListByCount(Integer count) {
|
||||
return combinationActivityMapper.selectList(CommonStatusEnum.ENABLE.getStatus(), count);
|
||||
return combinationActivityMapper.selectListByStatus(CommonStatusEnum.ENABLE.getStatus(), count);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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;
|
||||
|
@ -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<AppTradeAfterSaleRespVO> convertPage02(PageResult<TradeAfterSaleDO> page);
|
||||
|
||||
List<TradeAfterSaleLogRespVO> convertList(List<TradeAfterSaleLogDO> list);
|
||||
|
||||
|
||||
default TradeAfterSaleDetailRespVO convert(TradeAfterSaleDO afterSale, TradeOrderDO order, List<TradeOrderItemDO> orderItems,
|
||||
MemberUserRespDTO user, List<TradeAfterSaleLogRespVO> logs) {
|
||||
TradeAfterSaleDetailRespVO respVO = convert(afterSale, orderItems);
|
||||
@ -81,7 +81,7 @@ public interface TradeAfterSaleConvert {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
List<cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log.TradeAfterSaleLogRespVO> convertList1(List<TradeAfterSaleLogRespVO> list);
|
||||
List<TradeAfterSaleLogRespVO> convertList1(List<TradeAfterSaleLogRespVO> list);
|
||||
@Mapping(target = "id", source = "afterSale.id")
|
||||
TradeAfterSaleDetailRespVO convert(TradeAfterSaleDO afterSale, List<TradeOrderItemDO> orderItems);
|
||||
TradeOrderBaseVO convert(TradeOrderDO order);
|
||||
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
@ -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<TradeAfterSaleLogRespVO> getLog(Long afterSaleId) {
|
||||
// TODO 不熟悉流程先这么滴
|
||||
|
Loading…
Reference in New Issue
Block a user