📖 CRM:code review 跟进记录
This commit is contained in:
parent
d7f04c94bb
commit
23ef3c8ae0
|
@ -182,6 +182,7 @@ public class CrmCustomerController {
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @puhui999:要不搞个通用的 CrmOperateLogController,之后所有业务都调用它?
|
||||||
@GetMapping("/operate-log-page")
|
@GetMapping("/operate-log-page")
|
||||||
@Operation(summary = "获得客户操作日志")
|
@Operation(summary = "获得客户操作日志")
|
||||||
@Parameter(name = "id", description = "客户编号", required = true)
|
@Parameter(name = "id", description = "客户编号", required = true)
|
||||||
|
|
|
@ -104,12 +104,8 @@ public class CrmPermissionController {
|
||||||
// 拼接数据
|
// 拼接数据
|
||||||
List<AdminUserRespDTO> userList = adminUserApi.getUserList(convertSet(permission, CrmPermissionDO::getUserId));
|
List<AdminUserRespDTO> userList = adminUserApi.getUserList(convertSet(permission, CrmPermissionDO::getUserId));
|
||||||
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(userList, AdminUserRespDTO::getDeptId));
|
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(userList, AdminUserRespDTO::getDeptId));
|
||||||
Set<Long> postIds = CollectionUtils.convertSetByFlatMap(userList, AdminUserRespDTO::getPostIds, item -> {
|
Set<Long> postIds = CollectionUtils.convertSetByFlatMap(userList, AdminUserRespDTO::getPostIds,
|
||||||
if (item == null) {
|
item -> item != null ? item.stream() : Stream.empty());
|
||||||
return Stream.empty();
|
|
||||||
}
|
|
||||||
return item.stream();
|
|
||||||
});
|
|
||||||
Map<Long, PostRespDTO> postMap = postApi.getPostMap(postIds);
|
Map<Long, PostRespDTO> postMap = postApi.getPostMap(postIds);
|
||||||
return success(CrmPermissionConvert.INSTANCE.convert(permission, userList, deptMap, postMap));
|
return success(CrmPermissionConvert.INSTANCE.convert(permission, userList, deptMap, postMap));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.crm.convert.permission;
|
package cn.iocoder.yudao.module.crm.convert.permission;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||||
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
||||||
import cn.iocoder.yudao.module.crm.controller.admin.permission.vo.CrmPermissionCreateReqVO;
|
import cn.iocoder.yudao.module.crm.controller.admin.permission.vo.CrmPermissionCreateReqVO;
|
||||||
|
@ -48,12 +49,12 @@ public interface CrmPermissionConvert {
|
||||||
findAndThen(userMap, item.getUserId(), user -> {
|
findAndThen(userMap, item.getUserId(), user -> {
|
||||||
item.setNickname(user.getNickname());
|
item.setNickname(user.getNickname());
|
||||||
findAndThen(deptMap, user.getDeptId(), deptRespDTO -> item.setDeptName(deptRespDTO.getName()));
|
findAndThen(deptMap, user.getDeptId(), deptRespDTO -> item.setDeptName(deptRespDTO.getName()));
|
||||||
if (user.getPostIds() == null) {
|
if (CollUtil.isEmpty(user.getPostIds())) {
|
||||||
item.setPostNames(Collections.emptySet());
|
item.setPostNames(Collections.emptySet());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<PostRespDTO> postRespList = MapUtils.getList(Multimaps.forMap(postMap), user.getPostIds());
|
List<PostRespDTO> postList = MapUtils.getList(Multimaps.forMap(postMap), user.getPostIds());
|
||||||
item.setPostNames(CollectionUtils.convertSet(postRespList, PostRespDTO::getName));
|
item.setPostNames(CollectionUtils.convertSet(postList, PostRespDTO::getName));
|
||||||
});
|
});
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
@ -64,6 +65,7 @@ public interface CrmPermissionConvert {
|
||||||
id -> new CrmPermissionDO().setId(id).setLevel(updateReqVO.getLevel()));
|
id -> new CrmPermissionDO().setId(id).setLevel(updateReqVO.getLevel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @puhui999:搞成 BeanUtils
|
||||||
List<CrmPermissionDO> convertList(List<CrmPermissionCreateReqBO> list);
|
List<CrmPermissionDO> convertList(List<CrmPermissionCreateReqBO> list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,6 @@ public class CrmFollowUpRecordDO extends BaseDO {
|
||||||
*/
|
*/
|
||||||
@TableField(typeHandler = StringListTypeHandler.class)
|
@TableField(typeHandler = StringListTypeHandler.class)
|
||||||
private List<String> picUrls;
|
private List<String> picUrls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附件
|
* 附件
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -58,6 +58,7 @@ public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> {
|
||||||
MPJLambdaWrapperX<CrmBusinessDO> query = new MPJLambdaWrapperX<>();
|
MPJLambdaWrapperX<CrmBusinessDO> query = new MPJLambdaWrapperX<>();
|
||||||
// 拼接数据权限的查询条件
|
// 拼接数据权限的查询条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_BUSINESS.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_BUSINESS.getType(), ids, userId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
query.selectAll(CrmBusinessDO.class).in(CrmBusinessDO::getId, ids).orderByDesc(CrmBusinessDO::getId);
|
query.selectAll(CrmBusinessDO.class).in(CrmBusinessDO::getId, ids).orderByDesc(CrmBusinessDO::getId);
|
||||||
return selectJoinList(CrmBusinessDO.class, query);
|
return selectJoinList(CrmBusinessDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ public interface CrmClueMapper extends BaseMapperX<CrmClueDO> {
|
||||||
// 拼接数据权限的查询条件
|
// 拼接数据权限的查询条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_LEADS.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_LEADS.getType(), ids, userId);
|
||||||
query.selectAll(CrmClueDO.class).in(CrmClueDO::getId, ids).orderByDesc(CrmClueDO::getId);
|
query.selectAll(CrmClueDO.class).in(CrmClueDO::getId, ids).orderByDesc(CrmClueDO::getId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
return selectJoinList(CrmClueDO.class, query);
|
return selectJoinList(CrmClueDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ public interface CrmContactMapper extends BaseMapperX<CrmContactDO> {
|
||||||
MPJLambdaWrapperX<CrmContactDO> query = new MPJLambdaWrapperX<>();
|
MPJLambdaWrapperX<CrmContactDO> query = new MPJLambdaWrapperX<>();
|
||||||
// 拼接数据权限的查询条件
|
// 拼接数据权限的查询条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
query.selectAll(CrmContactDO.class).in(CrmContactDO::getId, ids).orderByDesc(CrmContactDO::getId);
|
query.selectAll(CrmContactDO.class).in(CrmContactDO::getId, ids).orderByDesc(CrmContactDO::getId);
|
||||||
return selectJoinList(CrmContactDO.class, query);
|
return selectJoinList(CrmContactDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public interface CrmContractMapper extends BaseMapperX<CrmContractDO> {
|
||||||
MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>();
|
MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>();
|
||||||
// 构建数据权限连表条件
|
// 构建数据权限连表条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
query.selectAll(CrmContractDO.class).in(CrmContractDO::getId, ids).orderByDesc(CrmContractDO::getId);
|
query.selectAll(CrmContractDO.class).in(CrmContractDO::getId, ids).orderByDesc(CrmContractDO::getId);
|
||||||
return selectJoinList(CrmContractDO.class, query);
|
return selectJoinList(CrmContractDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> {
|
||||||
MPJLambdaWrapperX<CrmCustomerDO> query = new MPJLambdaWrapperX<>();
|
MPJLambdaWrapperX<CrmCustomerDO> query = new MPJLambdaWrapperX<>();
|
||||||
// 拼接数据权限的查询条件
|
// 拼接数据权限的查询条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CUSTOMER.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CUSTOMER.getType(), ids, userId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
query.selectAll(CrmCustomerDO.class).in(CrmCustomerDO::getId, ids).orderByDesc(CrmCustomerDO::getId);
|
query.selectAll(CrmCustomerDO.class).in(CrmCustomerDO::getId, ids).orderByDesc(CrmCustomerDO::getId);
|
||||||
return selectJoinList(CrmCustomerDO.class, query);
|
return selectJoinList(CrmCustomerDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,13 +49,13 @@ public interface CrmPermissionMapper extends BaseMapperX<CrmPermissionDO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
default CrmPermissionDO selectByIdAndUserId(Long id, Long userId) {
|
default CrmPermissionDO selectByIdAndUserId(Long id, Long userId) {
|
||||||
return selectOne(new LambdaQueryWrapperX<CrmPermissionDO>()
|
return selectOne(CrmPermissionDO::getId, id,
|
||||||
.eq(CrmPermissionDO::getId, id).eq(CrmPermissionDO::getUserId, userId));
|
CrmPermissionDO::getUserId, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
default CrmPermissionDO selectByBizIdAndUserId(Long id, Long userId) {
|
default CrmPermissionDO selectByBizIdAndUserId(Long bizId, Long userId) {
|
||||||
return selectOne(new LambdaQueryWrapperX<CrmPermissionDO>()
|
return selectOne(CrmPermissionDO::getBizId, bizId,
|
||||||
.eq(CrmPermissionDO::getBizId, id).eq(CrmPermissionDO::getUserId, userId));
|
CrmPermissionDO::getUserId, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
default int deletePermission(Integer bizType, Long bizId) {
|
default int deletePermission(Integer bizType, Long bizId) {
|
||||||
|
|
|
@ -53,6 +53,7 @@ public interface CrmReceivableMapper extends BaseMapperX<CrmReceivableDO> {
|
||||||
MPJLambdaWrapperX<CrmReceivableDO> query = new MPJLambdaWrapperX<>();
|
MPJLambdaWrapperX<CrmReceivableDO> query = new MPJLambdaWrapperX<>();
|
||||||
// 拼接数据权限的查询条件
|
// 拼接数据权限的查询条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE.getType(), ids, userId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
query.selectAll(CrmReceivableDO.class).in(CrmReceivableDO::getId, ids).orderByDesc(CrmReceivableDO::getId);
|
query.selectAll(CrmReceivableDO.class).in(CrmReceivableDO::getId, ids).orderByDesc(CrmReceivableDO::getId);
|
||||||
return selectJoinList(CrmReceivableDO.class, query);
|
return selectJoinList(CrmReceivableDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO
|
||||||
MPJLambdaWrapperX<CrmReceivablePlanDO> query = new MPJLambdaWrapperX<>();
|
MPJLambdaWrapperX<CrmReceivablePlanDO> query = new MPJLambdaWrapperX<>();
|
||||||
// 拼接数据权限的查询条件
|
// 拼接数据权限的查询条件
|
||||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE_PLAN.getType(), ids, userId);
|
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE_PLAN.getType(), ids, userId);
|
||||||
|
// 拼接自身的查询条件
|
||||||
query.selectAll(CrmReceivablePlanDO.class).in(CrmReceivablePlanDO::getId, ids).orderByDesc(CrmReceivablePlanDO::getId);
|
query.selectAll(CrmReceivablePlanDO.class).in(CrmReceivablePlanDO::getId, ids).orderByDesc(CrmReceivablePlanDO::getId);
|
||||||
return selectJoinList(CrmReceivablePlanDO.class, query);
|
return selectJoinList(CrmReceivablePlanDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,6 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService {
|
||||||
return crmFollowUpRecordMapper.selectById(id);
|
return crmFollowUpRecordMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@CrmPermission(bizTypeValue = "#pageReqVO.bizType", bizId = "#pageReqVO.bizId", level = CrmPermissionLevelEnum.READ)
|
@CrmPermission(bizTypeValue = "#pageReqVO.bizType", bizId = "#pageReqVO.bizId", level = CrmPermissionLevelEnum.READ)
|
||||||
public PageResult<CrmFollowUpRecordDO> getFollowUpRecordPage(CrmFollowUpRecordPageReqVO pageReqVO) {
|
public PageResult<CrmFollowUpRecordDO> getFollowUpRecordPage(CrmFollowUpRecordPageReqVO pageReqVO) {
|
||||||
|
|
|
@ -48,8 +48,11 @@ public class CouponDO extends BaseDO {
|
||||||
*
|
*
|
||||||
* 枚举 {@link CouponStatusEnum}
|
* 枚举 {@link CouponStatusEnum}
|
||||||
*/
|
*/
|
||||||
|
// TODO 芋艿:已作废?
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
// TODO 芋艿:发放 adminid?
|
||||||
|
|
||||||
// ========== 基本信息 END ==========
|
// ========== 基本信息 END ==========
|
||||||
|
|
||||||
// ========== 领取情况 BEGIN ==========
|
// ========== 领取情况 BEGIN ==========
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class CouponTemplateDO extends BaseDO {
|
||||||
*
|
*
|
||||||
* 枚举 {@link CommonStatusEnum}
|
* 枚举 {@link CommonStatusEnum}
|
||||||
*/
|
*/
|
||||||
|
// TODO 芋艿:要不要改成 3 个状态??
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
// ========== 基本信息 END ==========
|
// ========== 基本信息 END ==========
|
||||||
|
@ -159,4 +160,7 @@ public class CouponTemplateDO extends BaseDO {
|
||||||
private Integer useCount;
|
private Integer useCount;
|
||||||
// ========== 统计信息 END ==========
|
// ========== 统计信息 END ==========
|
||||||
|
|
||||||
|
// TODO 芋艿:领取开始时间、领取结束时间
|
||||||
|
|
||||||
|
// TODO 芋艿:要不要加描述
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue