diff --git a/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderOperateTypeEnum.java b/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderOperateTypeEnum.java index 2e0c06f2c..bc2287572 100644 --- a/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderOperateTypeEnum.java +++ b/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderOperateTypeEnum.java @@ -16,6 +16,7 @@ public enum TradeOrderOperateTypeEnum { MEMBER_CREATE(1, "用户下单"), ADMIN_UPDATE_PRICE(2, "订单价格 {oldPayPrice} 修改,实际支付金额为 {newPayPrice} 元"), MEMBER_PAY(10, "用户付款成功"), + SYSTEM_UP_ADDRESS(11, "订单 {orderId} 收货地址修改"), ADMIN_DELIVERY(20, "已发货,快递公司:{deliveryName},快递单号:{logisticsNo}"), MEMBER_RECEIVE(30, "用户已收货"), SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"), diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java index 1e9ce4c6b..df6767a05 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java @@ -738,16 +738,19 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { } @Override + @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.SYSTEM_UP_ADDRESS) public void updateOrderAddress(TradeOrderUpdateAddressReqVO reqVO) { // 校验交易订单 - validateOrderExists(reqVO.getId()); + TradeOrderDO order = validateOrderExists(reqVO.getId()); // TODO @puhui999:是否需要校验订单是否发货 // TODO 发货后是否支持修改收货地址 // 更新 tradeOrderMapper.updateById(TradeOrderConvert.INSTANCE.convert(reqVO)); - // TODO @puhui999:操作日志 + // 记录订单日志 + TradeOrderLogUtils.setOrderInfo(order.getId(), order.getStatus(), order.getStatus(), + MapUtil.builder().put("orderId", order.getId()).build()); } @Override