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 | package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 6 | import lombok.Data; |
| 5 | import lombok.EqualsAndHashCode; | 7 | import lombok.EqualsAndHashCode; |
| 6 | import lombok.ToString; | 8 | import lombok.ToString; |
| 7 | 9 | ||
| 8 | import java.time.LocalDateTime; | 10 | import java.time.LocalDateTime; |
| 11 | +import java.util.List; | ||
| 9 | 12 | ||
| 10 | @Schema(description = "管理后台 - 客户限制配置 Response VO") | 13 | @Schema(description = "管理后台 - 客户限制配置 Response VO") |
| 11 | @Data | 14 | @Data |
| @@ -17,10 +20,10 @@ public class CrmCustomerLimitConfigRespVO extends CrmCustomerLimitConfigBaseVO { | @@ -17,10 +20,10 @@ public class CrmCustomerLimitConfigRespVO extends CrmCustomerLimitConfigBaseVO { | ||
| 17 | private Long id; | 20 | private Long id; |
| 18 | 21 | ||
| 19 | @Schema(description = "规则适用人群名称") | 22 | @Schema(description = "规则适用人群名称") |
| 20 | - private String userNames; | 23 | + private List<AdminUserRespDTO> users; |
| 21 | 24 | ||
| 22 | @Schema(description = "规则适用部门名称") | 25 | @Schema(description = "规则适用部门名称") |
| 23 | - private String deptNames; | 26 | + private List<DeptRespDTO> depts; |
| 24 | 27 | ||
| 25 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | 28 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 26 | private LocalDateTime createTime; | 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
| @@ -5,7 +5,6 @@ import lombok.Data; | @@ -5,7 +5,6 @@ import lombok.Data; | ||
| 5 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 6 | import lombok.ToString; | 6 | import lombok.ToString; |
| 7 | 7 | ||
| 8 | -// TODO @wanwan:vo 下,可以新建一个 poolconfig,放它的 vo; | ||
| 9 | @Schema(description = "管理后台 - CRM 客户公海规则 Response VO") | 8 | @Schema(description = "管理后台 - CRM 客户公海规则 Response VO") |
| 10 | @Data | 9 | @Data |
| 11 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/customer/CrmCustomerLimitConfigConvert.java
| 1 | package cn.iocoder.yudao.module.crm.convert.customer; | 1 | package cn.iocoder.yudao.module.crm.convert.customer; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 4 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigCreateReqVO; | 5 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigCreateReqVO; |
| 5 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigRespVO; | 6 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigRespVO; |
| 6 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigUpdateReqVO; | 7 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigUpdateReqVO; |
| @@ -12,8 +13,6 @@ import org.mapstruct.factory.Mappers; | @@ -12,8 +13,6 @@ import org.mapstruct.factory.Mappers; | ||
| 12 | 13 | ||
| 13 | import java.util.List; | 14 | import java.util.List; |
| 14 | import java.util.Map; | 15 | import java.util.Map; |
| 15 | -import java.util.Objects; | ||
| 16 | -import java.util.stream.Collectors; | ||
| 17 | 16 | ||
| 18 | /** | 17 | /** |
| 19 | * 客户限制配置 Convert | 18 | * 客户限制配置 Convert |
| @@ -54,14 +53,11 @@ public interface CrmCustomerLimitConfigConvert { | @@ -54,14 +53,11 @@ public interface CrmCustomerLimitConfigConvert { | ||
| 54 | * | 53 | * |
| 55 | * @param userMap 用户映射 | 54 | * @param userMap 用户映射 |
| 56 | * @param deptMap 部门映射 | 55 | * @param deptMap 部门映射 |
| 57 | - * @param respVo 响应实体 | 56 | + * @param respVo 响应实体 |
| 58 | */ | 57 | */ |
| 59 | static void fillNameField(Map<Long, AdminUserRespDTO> userMap, Map<Long, DeptRespDTO> deptMap, CrmCustomerLimitConfigRespVO respVo) { | 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 | } |