From 6b3af71735ba48bd1e744313df86707adecf5c3f Mon Sep 17 00:00:00 2001 From: xiaobai <2511883673@qq.com> Date: Mon, 19 Jun 2023 12:50:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B920230619?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp.json | 0 .../admin/order/TradeOrderController.java | 7 ++++++- .../admin/order/vo/TradeOrderBaseVO.java | 6 +++--- .../admin/order/vo/TradeOrderPageItemRespVO.java | 6 ++++++ .../admin/order/vo/TradeOrderPageReqVO.java | 5 +++++ .../trade/convert/order/TradeOrderConvert.java | 16 +++++++++++++++- .../trade/dal/mysql/order/TradeOrderMapper.java | 1 + 7 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 tmp.json diff --git a/tmp.json b/tmp.json new file mode 100644 index 000000000..e69de29bb diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java index 75f05ff86..741f187f3 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; +import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; @@ -54,6 +55,10 @@ public class TradeOrderController { if (CollUtil.isEmpty(pageResult.getList())) { return success(PageResult.empty()); } + + //查询用户信息 mod by 矿泉水 20230614 begin + Map userRespVOMap = memberUserApi.getUserMap(convertSet(pageResult.getList(),TradeOrderDO::getUserId));; + // end // 查询订单项 List orderItems = tradeOrderService.getOrderItemListByOrderId( convertSet(pageResult.getList(), TradeOrderDO::getId)); @@ -61,7 +66,7 @@ public class TradeOrderController { List propertyValueDetails = productPropertyValueApi .getPropertyValueDetailList(TradeOrderConvert.INSTANCE.convertPropertyValueIds(orderItems)); // 最终组合 - return success(TradeOrderConvert.INSTANCE.convertPage(pageResult, orderItems, propertyValueDetails)); + return success(TradeOrderConvert.INSTANCE.convertPage(pageResult, orderItems, propertyValueDetails, userRespVOMap)); } @GetMapping("/get-detail") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java index 3453a3c2e..fd643921d 100755 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java @@ -70,10 +70,10 @@ public class TradeOrderBaseVO { @Schema(description = "支付渠道", required = true, example = "wx_lite") private String payChannelCode; - @Schema(description = "商品原价(总)", required = true, example = "1000") - private Integer originalPrice; + @Schema(description = "商品原价(总),单位:分", required = true, example = "1000") + private Integer totalPrice; - @Schema(description = "订单优惠(总)", required = true, example = "100") + @Schema(description = "订单优惠(总),单位:分", required = true, example = "100") private Integer discountPrice; @Schema(description = "运费金额", required = true, example = "100") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java index fc02acbc5..a6751b2d0 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -18,6 +19,11 @@ public class TradeOrderPageItemRespVO extends TradeOrderBaseVO { */ private List items; + /** + * 用户信息 + */ + private MemberUserRespDTO user; + @Schema(description = "管理后台 - 交易订单的分页项的订单项目") @Data public static class Item extends TradeOrderItemBaseVO { diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java index a09e15271..9b0b577cf 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; +import cn.iocoder.yudao.framework.common.enums.TerminalEnum; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; @@ -50,4 +51,8 @@ public class TradeOrderPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; + @Schema(description = "订单来源", example = "10") + @InEnum(value = TerminalEnum.class, message = "订单来源 {value}") + private Integer terminal; + } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java index 8c5501b53..d262ab954 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java @@ -115,8 +115,18 @@ public interface TradeOrderConvert { } // TODO 芋艿:可简化 + + /** + * + * @param pageResult + * @param orderItems + * @param propertyValueDetails + * @param memberUserRespDTOMap 新增参数会员DTO + * @return + */ default PageResult convertPage(PageResult pageResult, List orderItems, - List propertyValueDetails) { + List propertyValueDetails, + Map memberUserRespDTOMap) { Map> orderItemMap = convertMultiMap(orderItems, TradeOrderItemDO::getOrderId); Map propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId); // 转化 List @@ -144,6 +154,10 @@ public interface TradeOrderConvert { } // 处理收货地址 orderVO.setReceiverAreaName(AreaUtils.format(order.getReceiverAreaId())); + + // 增加用户昵称 + orderVO.setUser(memberUserRespDTOMap.get(orderVO.getUserId())); + return orderVO; }); return new PageResult<>(orderVOs, pageResult.getTotal()); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/order/TradeOrderMapper.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/order/TradeOrderMapper.java index 265450fbd..e52dc65dc 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/order/TradeOrderMapper.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/order/TradeOrderMapper.java @@ -33,6 +33,7 @@ public interface TradeOrderMapper extends BaseMapperX { .eqIfPresent(TradeOrderDO::getType, reqVO.getType()) .eqIfPresent(TradeOrderDO::getStatus, reqVO.getStatus()) .eqIfPresent(TradeOrderDO::getPayChannelCode, reqVO.getPayChannelCode()) + .eqIfPresent(TradeOrderDO::getTerminal,reqVO.getTerminal()) //add by 矿泉水 20230615 .betweenIfPresent(TradeOrderDO::getCreateTime, reqVO.getCreateTime())); } From d6bd4be8b09a82b9202096618aed3b5f4d54c461 Mon Sep 17 00:00:00 2001 From: xiaobai <2511883673@qq.com> Date: Mon, 19 Jun 2023 13:10:50 +0800 Subject: [PATCH 2/2] '' --- tmp.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tmp.json diff --git a/tmp.json b/tmp.json deleted file mode 100644 index e69de29bb..000000000