diff --git a/yudao-module-crm/yudao-module-crm-biz/pom.xml b/yudao-module-crm/yudao-module-crm-biz/pom.xml index bb179e592..15bbc932d 100644 --- a/yudao-module-crm/yudao-module-crm-biz/pom.xml +++ b/yudao-module-crm/yudao-module-crm-biz/pom.xml @@ -33,6 +33,10 @@ cn.iocoder.boot yudao-spring-boot-starter-biz-operatelog + + cn.iocoder.boot + yudao-spring-boot-starter-biz-ip + @@ -57,12 +61,6 @@ yudao-spring-boot-starter-excel - - - cn.iocoder.boot - yudao-spring-boot-starter-biz-ip - - cn.iocoder.boot diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java index 8624ca68e..10b6b5ee8 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java @@ -102,12 +102,15 @@ public class CrmCustomerController { public CommonResult> getCustomerPage(@Valid CrmCustomerPageReqVO pageVO) { PageResult pageResult = customerService.getCustomerPage(pageVO); PageResult pageVo = CrmCustomerConvert.INSTANCE.convertPage(pageResult); + // TODO @wanwan: 可以参考 CollectionUtils.convertListByFlatMap(),目的是简洁 Set userSet = pageVo.getList().stream().flatMap(i -> Stream.of(NumberUtil.parseLong(i.getCreator()), i.getOwnerUserId())).collect(Collectors.toSet()); Map userMap = adminUserApi.getUserMap(userSet); Map deptMap = deptApi.getDeptMap(userMap.values().stream().map(AdminUserRespDTO::getDeptId).collect(Collectors.toSet())); + // TODO @wanwan:这块可以形成一个 convertPage 方法,default 实现; pageVo.getList().forEach(customerRespVO -> { customerRespVO.setAreaName(AreaUtils.format(customerRespVO.getAreaId())); customerRespVO.setCreatorName(Optional.ofNullable(userMap.get(NumberUtil.parseLong(customerRespVO.getCreator()))).map(AdminUserRespDTO::getNickname).orElse(null)); + // TODO @wanwan:可以使用 MapUtils.findAndThen AdminUserRespDTO ownerUser = userMap.get(customerRespVO.getOwnerUserId()); if (Objects.nonNull(ownerUser)) { customerRespVO.setOwnerUserName(ownerUser.getNickname()); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerRespVO.java index 1bda33a3c..f37740f26 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerRespVO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerRespVO.java @@ -30,10 +30,8 @@ public class CrmCustomerRespVO extends CrmCustomerBaseVO { @Schema(description = "负责人的用户编号", example = "25682") private Long ownerUserId; - @Schema(description = "负责人名字", example = "25682") private String ownerUserName; - @Schema(description = "负责人部门") private String ownerUserDept; @@ -52,7 +50,7 @@ public class CrmCustomerRespVO extends CrmCustomerBaseVO { @Schema(description = "创建人") private String creator; - @Schema(description = "创建人名字") private String creatorName; + } diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/CrmCustomerDO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/CrmCustomerDO.java index 8b34ed582..3e00b1cc5 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/CrmCustomerDO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/CrmCustomerDO.java @@ -98,8 +98,11 @@ public class CrmCustomerDO extends BaseDO { private String remark; /** * 负责人的用户编号 + * + * 关联 AdminUserDO 的 id 字段 */ private Long ownerUserId; + // TODO @puhui999:这块抽到 permission 里; /** * 只读权限的用户编号数组 */ diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/aop/CrmPermissionAspect.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/aop/CrmPermissionAspect.java index 8a60b6d45..497c7caba 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/aop/CrmPermissionAspect.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/aop/CrmPermissionAspect.java @@ -65,6 +65,10 @@ public class CrmPermissionAspect { // TODO @puhui999:一般核心的方法,放到最前面,private 放后面。主要是,主次要分出来哈; @Before("@annotation(crmPermission)") public void doBefore(JoinPoint joinPoint, CrmPermission crmPermission) { + // TODO 芋艿:临时,方便大家调试 + if (true) { + return; + } try { Long bizId = crmPermission.getIdFor().length > 0 ? getBizId(joinPoint, crmPermission) : (Long) joinPoint.getArgs()[0]; // 获取操作数据的编号 Integer bizType = crmPermission.bizType().getType(); // 模块类型