feat: 客户配置 review 修改

This commit is contained in:
Wanwan 2023-11-26 00:27:09 +08:00
parent ab3748d102
commit 033f13c6ad
3 changed files with 9 additions and 11 deletions

View File

@ -1,11 +1,14 @@
package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 客户限制配置 Response VO")
@Data
@ -17,10 +20,10 @@ public class CrmCustomerLimitConfigRespVO extends CrmCustomerLimitConfigBaseVO {
private Long id;
@Schema(description = "规则适用人群名称")
private String userNames;
private List<AdminUserRespDTO> users;
@Schema(description = "规则适用部门名称")
private String deptNames;
private List<DeptRespDTO> depts;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;

View File

@ -5,7 +5,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
// TODO @wanwanvo 可以新建一个 poolconfig放它的 vo
@Schema(description = "管理后台 - CRM 客户公海规则 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.crm.convert.customer;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigCreateReqVO;
import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigRespVO;
import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigUpdateReqVO;
@ -12,8 +13,6 @@ import org.mapstruct.factory.Mappers;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 客户限制配置 Convert
@ -54,14 +53,11 @@ public interface CrmCustomerLimitConfigConvert {
*
* @param userMap 用户映射
* @param deptMap 部门映射
* @param respVo 响应实体
* @param respVo 响应实体
*/
static void fillNameField(Map<Long, AdminUserRespDTO> userMap, Map<Long, DeptRespDTO> deptMap, CrmCustomerLimitConfigRespVO respVo) {
// TODO wanwan返回 list具体怎么拼接叫给前端
respVo.setUserNames(respVo.getUserIds().stream().map(userMap::get)
.filter(Objects::nonNull).map(AdminUserRespDTO::getNickname).collect(Collectors.joining("")));
respVo.setDeptNames(respVo.getDeptIds().stream().map(deptMap::get)
.filter(Objects::nonNull).map(DeptRespDTO::getName).collect(Collectors.joining("")));
respVo.setUsers(CollectionUtils.convertList(respVo.getUserIds(), userMap::get));
respVo.setDepts(CollectionUtils.convertList(respVo.getDeptIds(), deptMap::get));
}
}