mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
commit
b92ed60136
@ -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<Long, MemberUserRespDTO> userRespVOMap = memberUserApi.getUserMap(convertSet(pageResult.getList(),TradeOrderDO::getUserId));;
|
||||
// end
|
||||
// 查询订单项
|
||||
List<TradeOrderItemDO> orderItems = tradeOrderService.getOrderItemListByOrderId(
|
||||
convertSet(pageResult.getList(), TradeOrderDO::getId));
|
||||
@ -61,7 +66,7 @@ public class TradeOrderController {
|
||||
List<ProductPropertyValueDetailRespDTO> 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")
|
||||
|
@ -71,7 +71,7 @@ public class TradeOrderBaseVO {
|
||||
private String payChannelCode;
|
||||
|
||||
@Schema(description = "商品原价(总)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
|
||||
private Integer originalPrice;
|
||||
private Integer totalPrice;
|
||||
|
||||
@Schema(description = "订单优惠(总)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer discountPrice;
|
||||
|
@ -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<Item> items;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
private MemberUserRespDTO user;
|
||||
|
||||
@Schema(description = "管理后台 - 交易订单的分页项的订单项目")
|
||||
@Data
|
||||
public static class Item extends TradeOrderItemBaseVO {
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -119,8 +119,18 @@ public interface TradeOrderConvert {
|
||||
}
|
||||
|
||||
// TODO 芋艿:可简化
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pageResult
|
||||
* @param orderItems
|
||||
* @param propertyValueDetails
|
||||
* @param memberUserRespDTOMap 新增参数会员DTO
|
||||
* @return
|
||||
*/
|
||||
default PageResult<TradeOrderPageItemRespVO> convertPage(PageResult<TradeOrderDO> pageResult, List<TradeOrderItemDO> orderItems,
|
||||
List<ProductPropertyValueDetailRespDTO> propertyValueDetails) {
|
||||
List<ProductPropertyValueDetailRespDTO> propertyValueDetails,
|
||||
Map<Long,MemberUserRespDTO> memberUserRespDTOMap) {
|
||||
Map<Long, List<TradeOrderItemDO>> orderItemMap = convertMultiMap(orderItems, TradeOrderItemDO::getOrderId);
|
||||
Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId);
|
||||
// 转化 List
|
||||
@ -148,6 +158,10 @@ public interface TradeOrderConvert {
|
||||
}
|
||||
// 处理收货地址
|
||||
orderVO.setReceiverAreaName(AreaUtils.format(order.getReceiverAreaId()));
|
||||
|
||||
// 增加用户昵称
|
||||
orderVO.setUser(memberUserRespDTOMap.get(orderVO.getUserId()));
|
||||
|
||||
return orderVO;
|
||||
});
|
||||
return new PageResult<>(orderVOs, pageResult.getTotal());
|
||||
|
@ -33,6 +33,7 @@ public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> {
|
||||
.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()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user