mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
!871 fix: 根据code-review修改Crm Backlog
Merge pull request !871 from dhb52/develop
This commit is contained in:
commit
bac476c131
@ -56,15 +56,14 @@ public interface CrmClueMapper extends BaseMapperX<CrmClueDO> {
|
||||
return selectJoinList(CrmClueDO.class, query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getFollowLeadsCount(Long userId) {
|
||||
default Long selectFollowLeadsCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmClueDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_LEADS.getType(),
|
||||
CrmClueDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
// 未跟进 + 未转化 TODO @dhb52:是不是 eq 会更好哈;mysql 不等于,对索引不友好
|
||||
query.ne(CrmClueDO::getFollowUpStatus, true)
|
||||
.ne(CrmClueDO::getTransformStatus, true);
|
||||
// 未跟进 + 未转化
|
||||
query.eq(CrmClueDO::getFollowUpStatus, false)
|
||||
.eq(CrmClueDO::getTransformStatus, false);
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,7 @@ public interface CrmContractMapper extends BaseMapperX<CrmContractDO> {
|
||||
return selectCount(CrmContractDO::getBusinessId, businessId);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getCheckContractCount(Long userId) {
|
||||
default Long selectCheckContractCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTRACT.getType(),
|
||||
@ -99,8 +98,7 @@ public interface CrmContractMapper extends BaseMapperX<CrmContractDO> {
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getEndContractCount(Long userId) {
|
||||
default Long selectEndContractCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTRACT.getType(),
|
||||
@ -108,7 +106,7 @@ public interface CrmContractMapper extends BaseMapperX<CrmContractDO> {
|
||||
// 即将到期
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
|
||||
// TODO: @芋艿 需要配置 提前提醒天数
|
||||
// TODO: @dhb52 需要配置 提前提醒天数
|
||||
int REMIND_DAYS = 20;
|
||||
query.eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.APPROVE.getStatus())
|
||||
.between(CrmContractDO::getEndTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));
|
||||
|
@ -148,8 +148,7 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> {
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getTodayCustomerCount(Long userId) {
|
||||
default Long selectTodayCustomerCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmCustomerDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CUSTOMER.getType(),
|
||||
@ -161,14 +160,13 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> {
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getFollowCustomerCount(Long userId) {
|
||||
default Long selectFollowCustomerCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmCustomerDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CUSTOMER.getType(),
|
||||
CrmCustomerDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
// 未跟进 TODO @dhb52:是不是 eq 会更好哈;mysql 不等于,对索引不友好
|
||||
query.ne(CrmClueDO::getFollowUpStatus, true);
|
||||
// 未跟进
|
||||
query.eq(CrmClueDO::getFollowUpStatus, false);
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
|
@ -62,8 +62,7 @@ public interface CrmReceivableMapper extends BaseMapperX<CrmReceivableDO> {
|
||||
return selectJoinList(CrmReceivableDO.class, query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getCheckReceivablesCount(Long userId) {
|
||||
default Long selectCheckReceivablesCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmReceivableDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE.getType(),
|
||||
|
@ -50,21 +50,19 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO
|
||||
.orderByDesc(CrmReceivablePlanDO::getId);
|
||||
|
||||
// Backlog: 回款提醒类型
|
||||
// TODO: @dhb52 需要配置 提前提醒天数
|
||||
int REMIND_DAYS = 20;
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
|
||||
if (CrmReceivablePlanPageReqVO.REMIND_TYPE_NEEDED.equals(pageReqVO.getRemindType())) { // 待回款
|
||||
query.isNull(CrmReceivablePlanDO::getReceivableId)
|
||||
.gt(CrmReceivablePlanDO::getReturnTime, beginOfToday)
|
||||
// TODO @dhb52:这里看看怎么改成不要使用 to_days
|
||||
.apply("to_days(return_time) <= to_days(now())+ remind_days");
|
||||
.between(CrmReceivablePlanDO::getReturnTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));
|
||||
} else if (CrmReceivablePlanPageReqVO.REMIND_TYPE_EXPIRED.equals(pageReqVO.getRemindType())) { // 已逾期
|
||||
query.isNull(CrmReceivablePlanDO::getReceivableId)
|
||||
.lt(CrmReceivablePlanDO::getReturnTime, endOfToday);
|
||||
} else if (CrmReceivablePlanPageReqVO.REMIND_TYPE_RECEIVED.equals(pageReqVO.getRemindType())) { // 已回款
|
||||
query.isNotNull(CrmReceivablePlanDO::getReceivableId)
|
||||
.gt(CrmReceivablePlanDO::getReturnTime, beginOfToday)
|
||||
// TODO @dhb52:这里看看怎么改成不要使用 to_days
|
||||
.apply("to_days(return_time) <= to_days(now()) + remind_days");
|
||||
.between(CrmReceivablePlanDO::getReturnTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));;
|
||||
}
|
||||
|
||||
return selectJoinPage(pageReqVO, CrmReceivablePlanDO.class, query);
|
||||
@ -79,17 +77,17 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO
|
||||
return selectJoinList(CrmReceivablePlanDO.class, query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getRemindReceivablePlanCount(Long userId) {
|
||||
default Long selectRemindReceivablePlanCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmReceivablePlanDO> query = new MPJLambdaWrapperX<>();
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE_PLAN.getType(),
|
||||
CrmReceivablePlanDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
// 待回款 TODO @dhb52:to_days(return_time) <= to_days(now())+ remind_days 看看怎么改成,不用数据库自己去计算这样的时间;
|
||||
// TODO: @dhb52 需要配置 提前提醒天数
|
||||
int REMIND_DAYS = 20;
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
|
||||
query.isNull(CrmReceivablePlanDO::getReceivableId)
|
||||
.gt(CrmReceivablePlanDO::getReturnTime, beginOfToday)
|
||||
.apply("to_days(return_time) <= to_days(now())+ remind_days");
|
||||
.between(CrmReceivablePlanDO::getReturnTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ public class CrmClueServiceImpl implements CrmClueService {
|
||||
|
||||
@Override
|
||||
public Long getFollowLeadsCount(Long userId) {
|
||||
return clueMapper.getFollowLeadsCount(userId);
|
||||
return clueMapper.selectFollowLeadsCount(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -364,12 +364,12 @@ public class CrmContractServiceImpl implements CrmContractService {
|
||||
|
||||
@Override
|
||||
public Long getCheckContractCount(Long userId) {
|
||||
return contractMapper.getCheckContractCount(userId);
|
||||
return contractMapper.selectCheckContractCount(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getEndContractCount(Long userId) {
|
||||
return contractMapper.getEndContractCount(userId);
|
||||
return contractMapper.selectEndContractCount(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -482,12 +482,12 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
|
||||
|
||||
@Override
|
||||
public Long getTodayCustomerCount(Long userId) {
|
||||
return customerMapper.getTodayCustomerCount(userId);
|
||||
return customerMapper.selectTodayCustomerCount(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getFollowCustomerCount(Long userId) {
|
||||
return customerMapper.getFollowCustomerCount(userId);
|
||||
return customerMapper.selectFollowCustomerCount(userId);
|
||||
}
|
||||
|
||||
// ======================= 校验相关 =======================
|
||||
|
@ -164,7 +164,7 @@ public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
|
||||
|
||||
@Override
|
||||
public Long getRemindReceivablePlanCount(Long userId) {
|
||||
return receivablePlanMapper.getRemindReceivablePlanCount(userId);
|
||||
return receivablePlanMapper.selectRemindReceivablePlanCount(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class CrmReceivableServiceImpl implements CrmReceivableService {
|
||||
|
||||
@Override
|
||||
public Long getCheckReceivablesCount(Long userId) {
|
||||
return receivableMapper.getCheckReceivablesCount(userId);
|
||||
return receivableMapper.selectCheckReceivablesCount(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user