diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java index 0a6facbc9..6b086f748 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; -import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon.CouponPageItemRespVO; import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon.CouponPageReqVO; import cn.iocoder.yudao.module.promotion.convert.coupon.CouponConvert; @@ -66,7 +66,7 @@ public class CouponController { } // 读取用户信息,进行拼接 Set userIds = convertSet(pageResult.getList(), CouponDO::getUserId); - Map userMap = memberUserApi.getUserMap(userIds); + Map userMap = memberUserApi.getUserMap(userIds); pageResulVO.getList().forEach(itemRespVO -> MapUtils.findAndThen(userMap, itemRespVO.getUserId(), userRespDTO -> itemRespVO.setNickname(userRespDTO.getNickname()))); return success(pageResulVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java index 55133cded..a573e0d9c 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; -import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon.CouponPageReqVO; import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponDO; import cn.iocoder.yudao.module.promotion.dal.mysql.coupon.CouponMapper; @@ -71,7 +71,7 @@ public class CouponServiceImpl implements CouponService { Set userIds = null; if (StrUtil.isNotEmpty(pageReqVO.getNickname())) { userIds = CollectionUtils.convertSet(memberUserApi.getUserListByNickname(pageReqVO.getNickname()), - UserRespDTO::getId); + MemberUserRespDTO::getId); if (CollUtil.isEmpty(userIds)) { return PageResult.empty(); } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java index 1d0d604b3..6582148cd 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java @@ -1,10 +1,13 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.api.user.MemberUserApi; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleDisagreeReqVO; import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSalePageReqVO; -import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleRespVO; +import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleRespPageItemVO; import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO; import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; @@ -18,8 +21,10 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +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; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @@ -33,12 +38,22 @@ public class TradeAfterSaleController { @Resource private TradeAfterSaleService afterSaleService; + @Resource + private MemberUserApi memberUserApi; + @GetMapping("/page") @ApiOperation("获得交易售后分页") @PreAuthorize("@ss.hasPermission('trade:after-sale:query')") - public CommonResult> getAfterSalePage(@Valid TradeAfterSalePageReqVO pageVO) { + public CommonResult> getAfterSalePage(@Valid TradeAfterSalePageReqVO pageVO) { PageResult pageResult = afterSaleService.getAfterSalePage(pageVO); - return success(TradeAfterSaleConvert.INSTANCE.convertPage(pageResult)); + if (CollUtil.isEmpty(pageResult.getList())) { + return success(PageResult.empty()); + } + + // 拼接数据 + Map memberUsers = memberUserApi.getUserMap( + convertSet(pageResult.getList(), TradeAfterSaleDO::getUserId)); + return success(TradeAfterSaleConvert.INSTANCE.convertPage(pageResult, memberUsers)); } @PutMapping("/agree") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java index f4b144e71..cd9846aa8 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; -import cn.iocoder.yudao.module.trade.controller.admin.base.property.ProductPropertyRespVO; +import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyRespVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java similarity index 63% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java index c15a1979c..1a683801c 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; +import cn.iocoder.yudao.module.trade.controller.admin.base.member.user.MemberUserRespVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -8,11 +9,11 @@ import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 交易售后 Response VO") +@ApiModel("管理后台 - 交易售后分页的每一条记录 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class TradeAfterSaleRespVO extends TradeAfterSaleBaseVO { +public class TradeAfterSaleRespPageItemVO extends TradeAfterSaleBaseVO { @ApiModelProperty(value = "售后编号", required = true, example = "27630") private Long id; @@ -20,4 +21,9 @@ public class TradeAfterSaleRespVO extends TradeAfterSaleBaseVO { @ApiModelProperty(value = "创建时间", required = true) private LocalDateTime createTime; + /** + * 用户信息 + */ + private MemberUserRespVO user; + } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/package-info.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/package-info.java new file mode 100644 index 000000000..f874e482d --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/package-info.java @@ -0,0 +1,4 @@ +/** + * 占位符,可忽略 + */ +package cn.iocoder.yudao.module.trade.controller.admin.base.member; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java new file mode 100644 index 000000000..4f3545a91 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.trade.controller.admin.base.member.user; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@ApiModel("管理后台 - 会员用户 Response VO") +@Data +public class MemberUserRespVO { + + @ApiModelProperty(value = "用户 ID", required = true, example = "1") + private Long id; + + @ApiModelProperty(value = "用户昵称", required = true, example = "芋道源码") + private String nickname; + + @ApiModelProperty(value = "用户头像", example = "https://www.iocoder.cn/xxx.png") + private String avatar; + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/property/ProductPropertyRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyRespVO.java similarity index 73% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/property/ProductPropertyRespVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyRespVO.java index 5e43d690d..bea9c8c79 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/property/ProductPropertyRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyRespVO.java @@ -1,10 +1,10 @@ -package cn.iocoder.yudao.module.trade.controller.admin.base.property; +package cn.iocoder.yudao.module.trade.controller.admin.base.product.property; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -@ApiModel("管理后台 - 商品规格 Request VO") +@ApiModel("管理后台 - 商品规格 Response VO") @Data public class ProductPropertyRespVO { diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java index d93eb9b58..ab7a879fb 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java @@ -1,8 +1,10 @@ package cn.iocoder.yudao.module.trade.convert.aftersale; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundCreateReqDTO; -import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleRespVO; +import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSaleRespPageItemVO; +import cn.iocoder.yudao.module.trade.controller.admin.base.member.user.MemberUserRespVO; import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleCreateReqVO; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; @@ -12,6 +14,8 @@ import org.mapstruct.Mapping; import org.mapstruct.Mappings; import org.mapstruct.factory.Mappers; +import java.util.Map; + @Mapper public interface TradeAfterSaleConvert { @@ -34,6 +38,15 @@ public interface TradeAfterSaleConvert { PayRefundCreateReqDTO convert(String userIp, TradeAfterSaleDO afterSale, TradeOrderProperties orderProperties); - PageResult convertPage(PageResult page); + MemberUserRespVO convert(MemberUserRespDTO bean); + + PageResult convertPage(PageResult page); + + default PageResult convertPage(PageResult pageResult, + Map memberUsers) { + PageResult pageVOResult = convertPage(pageResult); + pageVOResult.getList().forEach(item -> item.setUser(convert(memberUsers.get(item.getUserId())))); + return pageVOResult; + } } diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java index 235ebb2c4..2af5446d2 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.member.api.user; -import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import java.util.Collection; import java.util.List; @@ -21,7 +21,7 @@ public interface MemberUserApi { * @param id 用户编号 * @return 用户信息 */ - UserRespDTO getUser(Long id); + MemberUserRespDTO getUser(Long id); /** * 获得会员用户信息们 @@ -29,7 +29,7 @@ public interface MemberUserApi { * @param ids 用户编号的数组 * @return 用户信息们 */ - List getUsers(Collection ids); + List getUsers(Collection ids); /** * 获得会员用户 Map @@ -37,8 +37,8 @@ public interface MemberUserApi { * @param ids 用户编号的数组 * @return 会员用户 Map */ - default Map getUserMap(Collection ids) { - return convertMap(getUsers(ids), UserRespDTO::getId); + default Map getUserMap(Collection ids) { + return convertMap(getUsers(ids), MemberUserRespDTO::getId); } /** @@ -47,6 +47,6 @@ public interface MemberUserApi { * @param nickname 用户昵称,模糊匹配 * @return 用户信息的列表 */ - List getUserListByNickname(String nickname); + List getUserListByNickname(String nickname); } diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserRespDTO.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/MemberUserRespDTO.java similarity index 93% rename from yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserRespDTO.java rename to yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/MemberUserRespDTO.java index e7a5aba9a..7b2bac0c9 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserRespDTO.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/MemberUserRespDTO.java @@ -9,7 +9,7 @@ import lombok.Data; * @author 芋道源码 */ @Data -public class UserRespDTO { +public class MemberUserRespDTO { /** * 用户ID diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java index 0c3e616a0..3239d8931 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.member.api.user; -import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.convert.user.UserConvert; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.service.user.MemberUserService; @@ -24,18 +24,18 @@ public class MemberUserApiImpl implements MemberUserApi { private MemberUserService userService; @Override - public UserRespDTO getUser(Long id) { + public MemberUserRespDTO getUser(Long id) { MemberUserDO user = userService.getUser(id); return UserConvert.INSTANCE.convert2(user); } @Override - public List getUsers(Collection ids) { + public List getUsers(Collection ids) { return UserConvert.INSTANCE.convertList2(userService.getUserList(ids)); } @Override - public List getUserListByNickname(String nickname) { + public List getUserListByNickname(String nickname) { return UserConvert.INSTANCE.convertList2(userService.getUserListByNickname(nickname)); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java index c2128c104..805ade807 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.member.convert.user; -import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import org.mapstruct.Mapper; @@ -15,8 +15,8 @@ public interface UserConvert { AppUserInfoRespVO convert(MemberUserDO bean); - UserRespDTO convert2(MemberUserDO bean); + MemberUserRespDTO convert2(MemberUserDO bean); - List convertList2(List list); + List convertList2(List list); } diff --git a/yudao-ui-admin/src/views/mall/trade/afterSale/bak.vue b/yudao-ui-admin/src/views/mall/trade/afterSale/bak.vue deleted file mode 100644 index 5c49b1849..000000000 --- a/yudao-ui-admin/src/views/mall/trade/afterSale/bak.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - diff --git a/yudao-ui-admin/src/views/mall/trade/afterSale/index.vue b/yudao-ui-admin/src/views/mall/trade/afterSale/index.vue index d53164e78..adc3bb396 100644 --- a/yudao-ui-admin/src/views/mall/trade/afterSale/index.vue +++ b/yudao-ui-admin/src/views/mall/trade/afterSale/index.vue @@ -46,20 +46,28 @@ + + + + + - - - + + - - + + + +