Commit 23ef3c8ae00076fa711ab4daed8c96064b605f0c
1 parent
d7f04c94
📖 CRM:code review 跟进记录
Showing
15 changed files
with
27 additions
and
16 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
| ... | ... | @@ -182,6 +182,7 @@ public class CrmCustomerController { |
| 182 | 182 | return success(true); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | + // TODO @puhui999:要不搞个通用的 CrmOperateLogController,之后所有业务都调用它? | |
| 185 | 186 | @GetMapping("/operate-log-page") |
| 186 | 187 | @Operation(summary = "获得客户操作日志") |
| 187 | 188 | @Parameter(name = "id", description = "客户编号", required = true) | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/permission/CrmPermissionController.java
| ... | ... | @@ -104,12 +104,8 @@ public class CrmPermissionController { |
| 104 | 104 | // 拼接数据 |
| 105 | 105 | List<AdminUserRespDTO> userList = adminUserApi.getUserList(convertSet(permission, CrmPermissionDO::getUserId)); |
| 106 | 106 | Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(userList, AdminUserRespDTO::getDeptId)); |
| 107 | - Set<Long> postIds = CollectionUtils.convertSetByFlatMap(userList, AdminUserRespDTO::getPostIds, item -> { | |
| 108 | - if (item == null) { | |
| 109 | - return Stream.empty(); | |
| 110 | - } | |
| 111 | - return item.stream(); | |
| 112 | - }); | |
| 107 | + Set<Long> postIds = CollectionUtils.convertSetByFlatMap(userList, AdminUserRespDTO::getPostIds, | |
| 108 | + item -> item != null ? item.stream() : Stream.empty()); | |
| 113 | 109 | Map<Long, PostRespDTO> postMap = postApi.getPostMap(postIds); |
| 114 | 110 | return success(CrmPermissionConvert.INSTANCE.convert(permission, userList, deptMap, postMap)); |
| 115 | 111 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/permission/CrmPermissionConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.convert.permission; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 4 | 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 5 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.permission.vo.CrmPermissionCreateReqVO; |
| ... | ... | @@ -48,12 +49,12 @@ public interface CrmPermissionConvert { |
| 48 | 49 | findAndThen(userMap, item.getUserId(), user -> { |
| 49 | 50 | item.setNickname(user.getNickname()); |
| 50 | 51 | findAndThen(deptMap, user.getDeptId(), deptRespDTO -> item.setDeptName(deptRespDTO.getName())); |
| 51 | - if (user.getPostIds() == null) { | |
| 52 | + if (CollUtil.isEmpty(user.getPostIds())) { | |
| 52 | 53 | item.setPostNames(Collections.emptySet()); |
| 53 | 54 | return; |
| 54 | 55 | } |
| 55 | - List<PostRespDTO> postRespList = MapUtils.getList(Multimaps.forMap(postMap), user.getPostIds()); | |
| 56 | - item.setPostNames(CollectionUtils.convertSet(postRespList, PostRespDTO::getName)); | |
| 56 | + List<PostRespDTO> postList = MapUtils.getList(Multimaps.forMap(postMap), user.getPostIds()); | |
| 57 | + item.setPostNames(CollectionUtils.convertSet(postList, PostRespDTO::getName)); | |
| 57 | 58 | }); |
| 58 | 59 | return item; |
| 59 | 60 | }); |
| ... | ... | @@ -64,6 +65,7 @@ public interface CrmPermissionConvert { |
| 64 | 65 | id -> new CrmPermissionDO().setId(id).setLevel(updateReqVO.getLevel())); |
| 65 | 66 | } |
| 66 | 67 | |
| 68 | + // TODO @puhui999:搞成 BeanUtils | |
| 67 | 69 | List<CrmPermissionDO> convertList(List<CrmPermissionCreateReqBO> list); |
| 68 | 70 | |
| 69 | 71 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/followup/CrmFollowUpRecordDO.java
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/business/CrmBusinessMapper.java
| ... | ... | @@ -58,6 +58,7 @@ public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> { |
| 58 | 58 | MPJLambdaWrapperX<CrmBusinessDO> query = new MPJLambdaWrapperX<>(); |
| 59 | 59 | // 拼接数据权限的查询条件 |
| 60 | 60 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_BUSINESS.getType(), ids, userId); |
| 61 | + // 拼接自身的查询条件 | |
| 61 | 62 | query.selectAll(CrmBusinessDO.class).in(CrmBusinessDO::getId, ids).orderByDesc(CrmBusinessDO::getId); |
| 62 | 63 | return selectJoinList(CrmBusinessDO.class, query); |
| 63 | 64 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/clue/CrmClueMapper.java
| ... | ... | @@ -46,6 +46,7 @@ public interface CrmClueMapper extends BaseMapperX<CrmClueDO> { |
| 46 | 46 | // 拼接数据权限的查询条件 |
| 47 | 47 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_LEADS.getType(), ids, userId); |
| 48 | 48 | query.selectAll(CrmClueDO.class).in(CrmClueDO::getId, ids).orderByDesc(CrmClueDO::getId); |
| 49 | + // 拼接自身的查询条件 | |
| 49 | 50 | return selectJoinList(CrmClueDO.class, query); |
| 50 | 51 | } |
| 51 | 52 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contact/CrmContactMapper.java
| ... | ... | @@ -67,6 +67,7 @@ public interface CrmContactMapper extends BaseMapperX<CrmContactDO> { |
| 67 | 67 | MPJLambdaWrapperX<CrmContactDO> query = new MPJLambdaWrapperX<>(); |
| 68 | 68 | // 拼接数据权限的查询条件 |
| 69 | 69 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId); |
| 70 | + // 拼接自身的查询条件 | |
| 70 | 71 | query.selectAll(CrmContactDO.class).in(CrmContactDO::getId, ids).orderByDesc(CrmContactDO::getId); |
| 71 | 72 | return selectJoinList(CrmContactDO.class, query); |
| 72 | 73 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java
| ... | ... | @@ -57,6 +57,7 @@ public interface CrmContractMapper extends BaseMapperX<CrmContractDO> { |
| 57 | 57 | MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>(); |
| 58 | 58 | // 构建数据权限连表条件 |
| 59 | 59 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId); |
| 60 | + // 拼接自身的查询条件 | |
| 60 | 61 | query.selectAll(CrmContractDO.class).in(CrmContractDO::getId, ids).orderByDesc(CrmContractDO::getId); |
| 61 | 62 | return selectJoinList(CrmContractDO.class, query); |
| 62 | 63 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/CrmCustomerMapper.java
| ... | ... | @@ -64,6 +64,7 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> { |
| 64 | 64 | MPJLambdaWrapperX<CrmCustomerDO> query = new MPJLambdaWrapperX<>(); |
| 65 | 65 | // 拼接数据权限的查询条件 |
| 66 | 66 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CUSTOMER.getType(), ids, userId); |
| 67 | + // 拼接自身的查询条件 | |
| 67 | 68 | query.selectAll(CrmCustomerDO.class).in(CrmCustomerDO::getId, ids).orderByDesc(CrmCustomerDO::getId); |
| 68 | 69 | return selectJoinList(CrmCustomerDO.class, query); |
| 69 | 70 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/permission/CrmPermissionMapper.java
| ... | ... | @@ -49,13 +49,13 @@ public interface CrmPermissionMapper extends BaseMapperX<CrmPermissionDO> { |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | default CrmPermissionDO selectByIdAndUserId(Long id, Long userId) { |
| 52 | - return selectOne(new LambdaQueryWrapperX<CrmPermissionDO>() | |
| 53 | - .eq(CrmPermissionDO::getId, id).eq(CrmPermissionDO::getUserId, userId)); | |
| 52 | + return selectOne(CrmPermissionDO::getId, id, | |
| 53 | + CrmPermissionDO::getUserId, userId); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - default CrmPermissionDO selectByBizIdAndUserId(Long id, Long userId) { | |
| 57 | - return selectOne(new LambdaQueryWrapperX<CrmPermissionDO>() | |
| 58 | - .eq(CrmPermissionDO::getBizId, id).eq(CrmPermissionDO::getUserId, userId)); | |
| 56 | + default CrmPermissionDO selectByBizIdAndUserId(Long bizId, Long userId) { | |
| 57 | + return selectOne(CrmPermissionDO::getBizId, bizId, | |
| 58 | + CrmPermissionDO::getUserId, userId); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | default int deletePermission(Integer bizType, Long bizId) { | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java
| ... | ... | @@ -53,6 +53,7 @@ public interface CrmReceivableMapper extends BaseMapperX<CrmReceivableDO> { |
| 53 | 53 | MPJLambdaWrapperX<CrmReceivableDO> query = new MPJLambdaWrapperX<>(); |
| 54 | 54 | // 拼接数据权限的查询条件 |
| 55 | 55 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE.getType(), ids, userId); |
| 56 | + // 拼接自身的查询条件 | |
| 56 | 57 | query.selectAll(CrmReceivableDO.class).in(CrmReceivableDO::getId, ids).orderByDesc(CrmReceivableDO::getId); |
| 57 | 58 | return selectJoinList(CrmReceivableDO.class, query); |
| 58 | 59 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java
| ... | ... | @@ -52,6 +52,7 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO |
| 52 | 52 | MPJLambdaWrapperX<CrmReceivablePlanDO> query = new MPJLambdaWrapperX<>(); |
| 53 | 53 | // 拼接数据权限的查询条件 |
| 54 | 54 | CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE_PLAN.getType(), ids, userId); |
| 55 | + // 拼接自身的查询条件 | |
| 55 | 56 | query.selectAll(CrmReceivablePlanDO.class).in(CrmReceivablePlanDO::getId, ids).orderByDesc(CrmReceivablePlanDO::getId); |
| 56 | 57 | return selectJoinList(CrmReceivablePlanDO.class, query); |
| 57 | 58 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java
| ... | ... | @@ -126,7 +126,6 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { |
| 126 | 126 | return crmFollowUpRecordMapper.selectById(id); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - | |
| 130 | 129 | @Override |
| 131 | 130 | @CrmPermission(bizTypeValue = "#pageReqVO.bizType", bizId = "#pageReqVO.bizId", level = CrmPermissionLevelEnum.READ) |
| 132 | 131 | public PageResult<CrmFollowUpRecordDO> getFollowUpRecordPage(CrmFollowUpRecordPageReqVO pageReqVO) { | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponDO.java
| ... | ... | @@ -48,8 +48,11 @@ public class CouponDO extends BaseDO { |
| 48 | 48 | * |
| 49 | 49 | * 枚举 {@link CouponStatusEnum} |
| 50 | 50 | */ |
| 51 | + // TODO 芋艿:已作废? | |
| 51 | 52 | private Integer status; |
| 52 | 53 | |
| 54 | + // TODO 芋艿:发放 adminid? | |
| 55 | + | |
| 53 | 56 | // ========== 基本信息 END ========== |
| 54 | 57 | |
| 55 | 58 | // ========== 领取情况 BEGIN ========== | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponTemplateDO.java
| ... | ... | @@ -45,6 +45,7 @@ public class CouponTemplateDO extends BaseDO { |
| 45 | 45 | * |
| 46 | 46 | * 枚举 {@link CommonStatusEnum} |
| 47 | 47 | */ |
| 48 | + // TODO 芋艿:要不要改成 3 个状态?? | |
| 48 | 49 | private Integer status; |
| 49 | 50 | |
| 50 | 51 | // ========== 基本信息 END ========== |
| ... | ... | @@ -159,4 +160,7 @@ public class CouponTemplateDO extends BaseDO { |
| 159 | 160 | private Integer useCount; |
| 160 | 161 | // ========== 统计信息 END ========== |
| 161 | 162 | |
| 163 | + // TODO 芋艿:领取开始时间、领取结束时间 | |
| 164 | + | |
| 165 | + // TODO 芋艿:要不要加描述 | |
| 162 | 166 | } | ... | ... |