mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-12 01:01:53 +08:00
订单中心+营销活动:完善部分 TODO 提到的问题
This commit is contained in:
@@ -36,6 +36,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.AFTER_SALE_NOT_FOUND;
|
||||
|
||||
@Tag(name = "管理后台 - 售后订单")
|
||||
@RestController
|
||||
@@ -76,6 +77,9 @@ public class TradeAfterSaleController {
|
||||
public CommonResult<TradeAfterSaleDetailRespVO> getOrderDetail(@RequestParam("id") Long id) {
|
||||
// 查询订单
|
||||
TradeAfterSaleDO afterSale = afterSaleService.getAfterSale(id);
|
||||
if (afterSale == null) {
|
||||
return success(null, AFTER_SALE_NOT_FOUND.getMsg());
|
||||
}
|
||||
// 查询订单
|
||||
TradeOrderDO order = tradeOrderQueryService.getOrder(afterSale.getOrderId());
|
||||
// 查询订单项
|
||||
@@ -92,7 +96,11 @@ public class TradeAfterSaleController {
|
||||
TradeAfterSaleLogRespDTO respVO = new TradeAfterSaleLogRespDTO();
|
||||
respVO.setId((long) i);
|
||||
respVO.setUserId((long) i);
|
||||
respVO.setUserType(1);
|
||||
respVO.setUserType(i % 2 == 0 ? 2 : 1);
|
||||
// 模拟系统操作
|
||||
if (i == 2) {
|
||||
respVO.setUserType(3);
|
||||
}
|
||||
respVO.setAfterSaleId(id);
|
||||
respVO.setOrderId((long) i);
|
||||
respVO.setOrderItemId((long) i);
|
||||
|
@@ -35,7 +35,7 @@ public class TradeAfterSaleDetailRespVO extends TradeAfterSaleBaseVO {
|
||||
/**
|
||||
* 售后日志
|
||||
*/
|
||||
private List<TradeAfterSaleLogRespVO> afterSaleLog;
|
||||
private List<TradeAfterSaleLogRespVO> logs;
|
||||
|
||||
@Schema(description = "管理后台 - 交易订单的详情的订单项目")
|
||||
@Data
|
||||
|
@@ -26,24 +26,23 @@ public class TradeOrderDetailRespVO extends TradeOrderBaseVO {
|
||||
private MemberUserRespVO user;
|
||||
|
||||
/**
|
||||
* TODO 订单操作日志, 先模拟一波;返回 logs,简洁,然后复数哈
|
||||
* TODO 订单操作日志, 先模拟一波
|
||||
*/
|
||||
private List<OrderLog> orderLog;
|
||||
private List<OrderLog> logs;
|
||||
|
||||
// TODO @puhui999:swagger 注解
|
||||
@Schema(description = "管理后台 - 交易订单的操作日志")
|
||||
@Data
|
||||
public static class OrderLog {
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Schema(description = "操作详情", requiredMode = Schema.RequiredMode.REQUIRED, example = "订单发货")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2023-06-01 10:50:20")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer userType;
|
||||
|
||||
}
|
||||
|
||||
@Schema(description = "管理后台 - 交易订单的详情的订单项目")
|
||||
|
@@ -78,7 +78,7 @@ public interface TradeAfterSaleConvert {
|
||||
// 处理订单信息
|
||||
respVO.setOrder(convert(order));
|
||||
// 处理售后日志
|
||||
respVO.setAfterSaleLog(convertList1(logs));
|
||||
respVO.setLogs(convertList1(logs));
|
||||
return respVO;
|
||||
}
|
||||
List<TradeAfterSaleLogRespVO> convertList1(List<TradeAfterSaleLogRespDTO> list);
|
||||
|
@@ -93,6 +93,7 @@ public interface TradeOrderConvert {
|
||||
items.forEach(item -> item.setIncrCount(-item.getIncrCount()));
|
||||
return new ProductSkuUpdateStockReqDTO(items);
|
||||
}
|
||||
|
||||
List<ProductSkuUpdateStockReqDTO.Item> convertList(List<TradeOrderItemDO> list);
|
||||
|
||||
@Mappings({
|
||||
@@ -151,9 +152,10 @@ public interface TradeOrderConvert {
|
||||
TradeOrderDetailRespVO.OrderLog orderLog = new TradeOrderDetailRespVO.OrderLog();
|
||||
orderLog.setContent("订单操作" + i);
|
||||
orderLog.setCreateTime(LocalDateTime.now());
|
||||
orderLog.setUserType(i % 2 == 0 ? 2 : 1);
|
||||
orderLogs.add(orderLog);
|
||||
}
|
||||
orderVO.setOrderLog(orderLogs);
|
||||
orderVO.setLogs(orderLogs);
|
||||
return orderVO;
|
||||
}
|
||||
|
||||
|
@@ -90,12 +90,7 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa
|
||||
|
||||
@Override
|
||||
public TradeAfterSaleDO getAfterSale(Long id) {
|
||||
TradeAfterSaleDO afterSale = tradeAfterSaleMapper.selectById(id);
|
||||
// TODO @puhui999;读不到,不要这里报错哈;交给前端报错;一般是读取信息不到,message 提示,然后 close tab;
|
||||
if (afterSale == null) {
|
||||
throw exception(AFTER_SALE_NOT_FOUND);
|
||||
}
|
||||
return afterSale;
|
||||
return tradeAfterSaleMapper.selectById(id);
|
||||
}
|
||||
|
||||
// TODO 芋艿:拼团失败,要不要发起售后的方式退款?还是走取消逻辑?
|
||||
|
@@ -28,7 +28,6 @@ import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.bargain.BargainRecordApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.combination.CombinationRecordApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordUpdateStatusReqDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.CouponApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponUseReqDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum;
|
||||
@@ -352,8 +351,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
// 1、拼团活动
|
||||
if (Objects.equals(TradeOrderTypeEnum.COMBINATION.getType(), order.getType())) {
|
||||
// 更新拼团状态 TODO puhui999:订单支付失败或订单支付过期删除这条拼团记录
|
||||
combinationRecordApi.updateCombinationRecordStatus(new CombinationRecordUpdateStatusReqDTO().setUserId(order.getUserId())
|
||||
.setOrderId(order.getId()).setStatus(CombinationRecordStatusEnum.IN_PROGRESS.getStatus()).setStartTime(LocalDateTime.now()));
|
||||
combinationRecordApi.updateRecordStatusToInProgress(order.getUserId(), order.getId(), LocalDateTime.now());
|
||||
}
|
||||
// TODO 芋艿:发送订单变化的消息
|
||||
|
||||
|
Reference in New Issue
Block a user