Commit 033f13c6ada4d3b4f31acda30d90d652b3595ea8
1 parent
ab3748d1
feat: 客户配置 review 修改
Showing
3 changed files
with
9 additions
and
11 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/limitconfig/CrmCustomerLimitConfigRespVO.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; | |
| 4 | +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | |
| 3 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 6 | import lombok.Data; |
| 5 | 7 | import lombok.EqualsAndHashCode; |
| 6 | 8 | import lombok.ToString; |
| 7 | 9 | |
| 8 | 10 | import java.time.LocalDateTime; |
| 11 | +import java.util.List; | |
| 9 | 12 | |
| 10 | 13 | @Schema(description = "管理后台 - 客户限制配置 Response VO") |
| 11 | 14 | @Data |
| ... | ... | @@ -17,10 +20,10 @@ public class CrmCustomerLimitConfigRespVO extends CrmCustomerLimitConfigBaseVO { |
| 17 | 20 | private Long id; |
| 18 | 21 | |
| 19 | 22 | @Schema(description = "规则适用人群名称") |
| 20 | - private String userNames; | |
| 23 | + private List<AdminUserRespDTO> users; | |
| 21 | 24 | |
| 22 | 25 | @Schema(description = "规则适用部门名称") |
| 23 | - private String deptNames; | |
| 26 | + private List<DeptRespDTO> depts; | |
| 24 | 27 | |
| 25 | 28 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 26 | 29 | private LocalDateTime createTime; | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/poolconfig/CrmCustomerPoolConfigRespVO.java
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/customer/CrmCustomerLimitConfigConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.convert.customer; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 4 | 5 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigCreateReqVO; |
| 5 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigRespVO; |
| 6 | 7 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigUpdateReqVO; |
| ... | ... | @@ -12,8 +13,6 @@ import org.mapstruct.factory.Mappers; |
| 12 | 13 | |
| 13 | 14 | import java.util.List; |
| 14 | 15 | import java.util.Map; |
| 15 | -import java.util.Objects; | |
| 16 | -import java.util.stream.Collectors; | |
| 17 | 16 | |
| 18 | 17 | /** |
| 19 | 18 | * 客户限制配置 Convert |
| ... | ... | @@ -54,14 +53,11 @@ public interface CrmCustomerLimitConfigConvert { |
| 54 | 53 | * |
| 55 | 54 | * @param userMap 用户映射 |
| 56 | 55 | * @param deptMap 部门映射 |
| 57 | - * @param respVo 响应实体 | |
| 56 | + * @param respVo 响应实体 | |
| 58 | 57 | */ |
| 59 | 58 | static void fillNameField(Map<Long, AdminUserRespDTO> userMap, Map<Long, DeptRespDTO> deptMap, CrmCustomerLimitConfigRespVO respVo) { |
| 60 | - // TODO wanwan:返回 list,具体怎么拼接叫给前端; | |
| 61 | - respVo.setUserNames(respVo.getUserIds().stream().map(userMap::get) | |
| 62 | - .filter(Objects::nonNull).map(AdminUserRespDTO::getNickname).collect(Collectors.joining(","))); | |
| 63 | - respVo.setDeptNames(respVo.getDeptIds().stream().map(deptMap::get) | |
| 64 | - .filter(Objects::nonNull).map(DeptRespDTO::getName).collect(Collectors.joining(","))); | |
| 59 | + respVo.setUsers(CollectionUtils.convertList(respVo.getUserIds(), userMap::get)); | |
| 60 | + respVo.setDepts(CollectionUtils.convertList(respVo.getDeptIds(), deptMap::get)); | |
| 65 | 61 | } |
| 66 | 62 | |
| 67 | 63 | } | ... | ... |