diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderLogisticsController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderLogisticsController.java index 132d94a60..b5caefa19 100644 --- a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderLogisticsController.java +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderLogisticsController.java @@ -6,6 +6,7 @@ import cn.iocoder.mall.admin.api.DataDictService; import cn.iocoder.mall.admin.api.bo.DataDictBO; import cn.iocoder.mall.order.api.OrderLogisticsService; import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; +import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; import cn.iocoder.mall.order.api.constant.DictKeyConstants; import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; @@ -39,14 +40,20 @@ public class OrderLogisticsController { @Reference(validation = "true") private DataDictService dataDictService; - @GetMapping("logistics_info") - @ApiOperation("物流详细 - 返回订单所关联的所有物流信息") - public CommonResult logisticsInfo(@RequestParam("orderId") Integer orderId) { + @GetMapping("info") + @ApiOperation("物流详细 - 物流通用") + public CommonResult logistics(@RequestParam("logisticsId") Integer logisticsId) { + return orderLogisticsService.getLogisticsInfo(logisticsId); + } + + @GetMapping("info_order") + @ApiOperation("物流详细 - 返回订单所关联的所有物流信息(订单用的)") + public CommonResult logisticsInfoWithOrder(@RequestParam("orderId") Integer orderId) { Integer userId = UserSecurityContextHolder.getContext().getUserId(); - CommonResult commonResult = orderLogisticsService.logisticsInfo(userId, orderId); + CommonResult commonResult = orderLogisticsService.getOrderLogisticsInfo(userId, orderId); if (commonResult.isSuccess()) { - OrderLogisticsInfoBO orderLogisticsInfoBO = commonResult.getData(); - List logisticsList = orderLogisticsInfoBO.getLogistics(); + OrderLogisticsInfoWithOrderBO orderLogisticsInfoBO = commonResult.getData(); + List logisticsList = orderLogisticsInfoBO.getLogistics(); // 获取字典值 Set dictValues = logisticsList.stream().map(o -> o.getLogistics()).collect(Collectors.toSet()); @@ -72,7 +79,6 @@ public class OrderLogisticsController { }).collect(Collectors.toList()); } } - return commonResult; } } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java index 00428eb51..18f6c72c1 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java @@ -1,10 +1,9 @@ package cn.iocoder.mall.order.api; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.bo.OrderLogisticsBO; +import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; - -import java.util.List; +import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; /** * 订单物流信息 @@ -14,13 +13,31 @@ import java.util.List; */ public interface OrderLogisticsService { + /** - * 物流信息 + * 获取物流信息 - 根据id + * + * @param id + * @return + */ + CommonResult getLogisticsInfo(Integer id); + + + /** + * 获取 last 物流信息 - 根据id + * + * @param id + * @return + */ + CommonResult getLastLogisticsInfo(Integer id); + + /** + * 获取物流信息 - 根据 orderId * * @param userId * @param orderId * @return */ - CommonResult logisticsInfo(Integer userId, Integer orderId); + CommonResult getOrderLogisticsInfo(Integer userId, Integer orderId); } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java index 7d143a428..c47afa054 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java @@ -1,6 +1,7 @@ package cn.iocoder.mall.order.api; import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO; import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; /** @@ -38,5 +39,5 @@ public interface OrderReturnService { * @param orderId * @return */ - CommonResult orderApplyInfo(Integer orderId); + CommonResult orderApplyInfo(Integer orderId); } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java index b2fdce3a5..74059aa81 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java @@ -18,60 +18,42 @@ import java.util.List; public class OrderLogisticsInfoBO implements Serializable { /** - * 订单id + * id */ - private Integer orderId; + private Integer id; /** - * 订单编号 + * 收件区域编号 */ - private String orderNo; + private String areaNo; /** - * 物流信息 + * 收件人名称 */ - private List logistics; + private String name; + /** + * 收件手机号 + */ + private String mobile; + /** + * 收件详细地址 + */ + private String address; + /** + * 物流 (字典) + */ + private Integer logistics; + /** + * 物流 (字典) 转换后的值 + */ + private String logisticsText; + /** + * 物流编号 + */ + private String logisticsNo; - @Data - @Accessors(chain = true) - public static class Logistics { + /// + /// 物流信息 - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流 (字典) - */ - private Integer logistics; - /** - * 物流 (字典) 转换后的值 - */ - private String logisticsText; - /** - * 物流编号 - */ - private String logisticsNo; - - /// - /// 物流信息 - - private List details; - } + private List details; @Data @Accessors(chain = true) diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java index c9efa015d..c63a4fdaf 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java @@ -25,6 +25,10 @@ public class OrderReturnInfoBO implements Serializable { * 订单 item */ private List orderItems; + /** + * 最后一个物流信息/最新物流信息 + */ + private OrderLastLogisticsInfoBO lastLogisticsInfo; @Data @Accessors(chain = true) @@ -80,6 +84,10 @@ public class OrderReturnInfoBO implements Serializable { /// /// 退货原因 + /** + * 退货金额 + */ + private Integer refundPrice; /** * 退货原因(字典值) */ diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderErrorCodeEnum.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderErrorCodeEnum.java index 263b1ac1d..15b616bd5 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderErrorCodeEnum.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderErrorCodeEnum.java @@ -42,6 +42,7 @@ public enum OrderErrorCodeEnum { // 工具类服务 1008004000 DICT_SERVER_INVOKING_FAIL(1008004000, "字典服务调用失败!"), + ORDER_LOGISTICS_INVOKING_FAIL(1008004001, "订单物流调用失败!"), ; diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java index d297a39f1..2ae2db9d0 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java @@ -1,14 +1,16 @@ package cn.iocoder.mall.order.biz.convert; -import cn.iocoder.mall.order.api.bo.OrderLogisticsBO; +import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; -import cn.iocoder.mall.order.api.dto.OrderCreateDTO; +import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; import cn.iocoder.mall.order.api.dto.OrderDeliveryDTO; import cn.iocoder.mall.order.api.dto.OrderLogisticsUpdateDTO; import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO; +import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; import cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO; import org.mapstruct.Mapper; import org.mapstruct.Mappings; +import org.mapstruct.Named; import org.mapstruct.factory.Mappers; import java.util.List; @@ -34,5 +36,21 @@ public interface OrderLogisticsConvert { OrderLogisticsDO convert(OrderRecipientDO orderRecipientDO); @Mappings({}) - List convertLogistics(List orderLogisticsDOList); + List convertLogistics(List orderLogisticsDOList); + + @Mappings({}) + List convertLogisticsDetail(List orderLogisticsDOList); + + @Mappings({}) + OrderLogisticsInfoBO convert(OrderLogisticsDO orderLogisticsDO); + + @Mappings({}) + List convert(List orderLogisticsDetailDOList); + + @Mappings({}) + @Named(value = "orderLastLogisticsInfoBO") + OrderLastLogisticsInfoBO convertOrderLastLogisticsInfoBO(OrderLogisticsDO orderLogisticsDO); + + @Mappings({}) + OrderLastLogisticsInfoBO.LogisticsDetail convertLastLogisticsDetail(OrderLogisticsDetailDO orderLogisticsDetailDO); } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java index e2b90e637..8a0235cf5 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java @@ -1,7 +1,7 @@ package cn.iocoder.mall.order.biz.convert; import cn.iocoder.mall.order.api.bo.OrderInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; +import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; import org.mapstruct.Mapper; import org.mapstruct.Mappings; @@ -20,9 +20,6 @@ public interface OrderLogisticsDetailConvert { OrderLogisticsDetailConvert INSTANCE = Mappers.getMapper(OrderLogisticsDetailConvert.class); - @Mappings({}) - List convertLogisticsDetail(List orderLogisticsDOList); - @Mappings({}) OrderInfoBO.LogisticsDetail convertLogisticsDetail(OrderLogisticsDetailDO orderLogisticsDetailDO); } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java index 8851f7383..bf2525fb3 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java @@ -50,7 +50,17 @@ public interface OrderLogisticsDetailMapper { * @param orderLogisticsIds * @return */ - OrderLogisticsDetailDO selectLatest( + OrderLogisticsDetailDO selectLast( @Param("orderLogisticsIds") Collection orderLogisticsIds ); + + /** + * 查询 - 根据 last 根据物理id + * + * @param orderLogisticsId + * @return + */ + OrderLogisticsDetailDO selectLastByLogisticsId( + @Param("orderLogisticsId") Integer orderLogisticsId + ); } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java index 3e1f7932f..f1442a023 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java @@ -30,6 +30,16 @@ public interface OrderLogisticsMapper { */ void updateById(OrderLogisticsDO orderLogisticsDO); + /** + * 查询 - 根据 ids + * + * @param id + * @return + */ + OrderLogisticsDO selectById( + @Param("id") Integer id + ); + /** * 查询 - 根据 ids * diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java index e65bc06e7..ac138ac77 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java @@ -41,6 +41,10 @@ public class OrderReturnDO extends BaseDO { /// /// 退货原因 + /** + * 退货金额 + */ + private Integer refundPrice; /** * 退货原因(字典值) * diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java index bfe47518b..07542769c 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java @@ -1,12 +1,13 @@ package cn.iocoder.mall.order.biz.service; import cn.iocoder.common.framework.constant.DeletedStatusEnum; -import cn.iocoder.common.framework.util.CollectionUtil; import cn.iocoder.common.framework.util.DateUtil; import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.order.api.OrderLogisticsService; +import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; +import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum; import cn.iocoder.mall.order.biz.convert.OrderLogisticsConvert; import cn.iocoder.mall.order.biz.convert.OrderLogisticsDetailConvert; @@ -46,7 +47,46 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService { private OrderLogisticsDetailMapper orderLogisticsDetailMapper; @Override - public CommonResult logisticsInfo(Integer userId, Integer orderId) { + public CommonResult getLogisticsInfo(Integer id) { + OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id); + if (orderLogisticsDO == null) { + return CommonResult.success(null); + } + + List orderLogisticsDetailDOList = orderLogisticsDetailMapper + .selectByOrderLogisticsId(orderLogisticsDO.getId()); + + // 转换数据结构 + List logisticsDetails + = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDetailDOList); + + OrderLogisticsInfoBO orderLogisticsInfo2BO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDO); + orderLogisticsInfo2BO.setDetails(logisticsDetails); + return CommonResult.success(orderLogisticsInfo2BO); + } + + @Override + public CommonResult getLastLogisticsInfo(Integer id) { + OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id); + if (orderLogisticsDO == null) { + return CommonResult.success(null); + } + + OrderLogisticsDetailDO orderLastLogisticsDetailDO = orderLogisticsDetailMapper.selectLastByLogisticsId(id); + + // 转换数据结构 + OrderLastLogisticsInfoBO.LogisticsDetail lastLogisticsDetail + = OrderLogisticsConvert.INSTANCE.convertLastLogisticsDetail(orderLastLogisticsDetailDO); + + OrderLastLogisticsInfoBO lastLogisticsInfoBO = OrderLogisticsConvert + .INSTANCE.convertOrderLastLogisticsInfoBO(orderLogisticsDO); + + lastLogisticsInfoBO.setLastLogisticsDetail(lastLogisticsDetail); + return CommonResult.success(lastLogisticsInfoBO); + } + + @Override + public CommonResult getOrderLogisticsInfo(Integer userId, Integer orderId) { OrderDO orderDO = orderMapper.selectById(orderId); if (orderDO == null) { @@ -75,18 +115,18 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService { } // 转换 return 的数据 - List logistics + List logistics = OrderLogisticsConvert.INSTANCE.convertLogistics(orderLogisticsDOList); - List logisticsDetails - = OrderLogisticsDetailConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDOList); + List logisticsDetails + = OrderLogisticsConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDOList); logisticsDetails.stream().map(o -> { o.setLogisticsTimeText(DateUtil.format(o.getLogisticsTime(), "yyyy-MM-dd HH:mm")); return o; }).collect(Collectors.toList()); - Map> logisticsDetailMultimap + Map> logisticsDetailMultimap = logisticsDetails.stream().collect( Collectors.toMap( o -> o.getOrderLogisticsId(), @@ -106,7 +146,7 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService { }).collect(Collectors.toList()); return CommonResult.success( - new OrderLogisticsInfoBO() + new OrderLogisticsInfoWithOrderBO() .setOrderId(orderId) .setOrderNo(orderDO.getOrderNo()) .setLogistics(logistics) diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java index 7888190da..a56a23ef2 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java @@ -4,18 +4,22 @@ import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.exception.ServiceException; import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.order.api.OrderLogisticsService; import cn.iocoder.mall.order.api.OrderReturnService; +import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO; import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum; import cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum; import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; import cn.iocoder.mall.order.biz.convert.OrderReturnConvert; import cn.iocoder.mall.order.biz.dao.OrderItemMapper; +import cn.iocoder.mall.order.biz.dao.OrderLogisticsMapper; import cn.iocoder.mall.order.biz.dao.OrderMapper; import cn.iocoder.mall.order.biz.dao.OrderReturnMapper; import cn.iocoder.mall.order.biz.dataobject.OrderDO; import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO; +import com.alibaba.dubbo.config.annotation.Reference; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -41,6 +45,9 @@ public class OrderReturnServiceImpl implements OrderReturnService { @Autowired private OrderReturnMapper orderReturnMapper; + @Reference(validation = "true") + private OrderLogisticsService orderLogisticsService; + @Override public CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnDTO) { OrderDO checkOrder = orderMapper.selectById(orderReturnDTO.getOrderId()); @@ -71,7 +78,7 @@ public class OrderReturnServiceImpl implements OrderReturnService { } @Override - public CommonResult orderApplyInfo(Integer orderId) { + public CommonResult orderApplyInfo(Integer orderId) { // 检查订单是否退货 OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId); @@ -91,9 +98,19 @@ public class OrderReturnServiceImpl implements OrderReturnService { OrderReturnInfoBO.ReturnInfo returnInfo = OrderReturnConvert.INSTANCE.convert(orderReturnDO); List itemList = OrderReturnConvert.INSTANCE.convert(orderItemDOList); + // 物流信息 + CommonResult lastLogisticsCommonResult = orderLogisticsService + .getLastLogisticsInfo(orderReturnDO.getOrderLogisticsId()); + + if (lastLogisticsCommonResult.isError()) { + return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_LOGISTICS_INVOKING_FAIL.getCode()); + } + + OrderLastLogisticsInfoBO lastLogisticsInfoBO = lastLogisticsCommonResult.getData(); OrderReturnInfoBO orderReturnInfoBO = new OrderReturnInfoBO() .setOrderItems(itemList) - .setReturnInfo(returnInfo); + .setReturnInfo(returnInfo) + .setLastLogisticsInfo(lastLogisticsInfoBO); return CommonResult.success(orderReturnInfoBO); } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java index 277bbd4ac..c5d5266bc 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java @@ -184,7 +184,7 @@ public class OrderServiceImpl implements OrderService { // 订单物流信息 OrderLogisticsDetailDO orderLogisticsDetailDO = null; if (!CollectionUtils.isEmpty(orderLogisticsIds)) { - orderLogisticsDetailDO = orderLogisticsDetailMapper.selectLatest(orderLogisticsIds); + orderLogisticsDetailDO = orderLogisticsDetailMapper.selectLast(orderLogisticsIds); } // 检查是否申请退货 diff --git a/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml index 4e8836b70..83dbfed4b 100644 --- a/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml +++ b/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml @@ -50,7 +50,7 @@ - SELECT FROM order_logistics_detail @@ -61,4 +61,17 @@ ORDER BY create_time DESC LIMIT 0, 1 + + + diff --git a/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml index 90f86c340..84de53114 100644 --- a/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml +++ b/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml @@ -66,4 +66,15 @@ #{id} + + + \ No newline at end of file diff --git a/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml index 2b6e82601..b3b043ebf 100644 --- a/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml +++ b/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml @@ -8,6 +8,7 @@ order_id, order_no, order_logistics_id, + refund_price, reason, `describe`, approval_time, @@ -26,13 +27,13 @@ INSERT INTO `order_return` ( service_number, order_id, order_no, order_logistics_id, - reason, `describe`, + refund_price, reason, `describe`, approval_time, logistics_time, receiver_time, closing_time, service_type, status, create_time, update_time) VALUES ( #{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId}, - #{reason}, #{describe}, + ${refundPrice}, #{reason}, #{describe}, #{approvalTime}, #{logisticsTime}, #{receiverTime}, #{closingTime}, #{serviceType}, #{status}, #{createTime}, #{updateTime}) @@ -45,6 +46,9 @@ , order_logistics_id = #{orderLogisticsId} + + , refund_price = #{refundPrice} + , reason = #{reason}