📖 CRM:code review 待提醒逻辑
This commit is contained in:
parent
51f52ff4b7
commit
1bfb406041
@ -24,73 +24,47 @@ public class CrmClueRespVO {
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "转化状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@ExcelProperty(value = "转化状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.BOOLEAN_STRING)
|
||||
private Boolean transformStatus;
|
||||
@Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx")
|
||||
@ExcelProperty("线索名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@ExcelProperty(value = "跟进状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.BOOLEAN_STRING)
|
||||
private Boolean followUpStatus;
|
||||
|
||||
@Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx")
|
||||
@ExcelProperty("线索名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "客户 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "520")
|
||||
// TODO 这里需要导出成客户名称
|
||||
@ExcelProperty("客户id")
|
||||
private Long customerId;
|
||||
@Schema(description = "最后跟进时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ExcelProperty("最后跟进时间")
|
||||
private LocalDateTime contactLastTime;
|
||||
|
||||
@Schema(description = "下次联系时间", example = "2023-10-18 01:00:00")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ExcelProperty("下次联系时间")
|
||||
private LocalDateTime contactNextTime;
|
||||
|
||||
@Schema(description = "电话", example = "18000000000")
|
||||
@ExcelProperty("电话")
|
||||
private String telephone;
|
||||
@Schema(description = "负责人编号")
|
||||
@ExcelProperty("负责人的用户编号")
|
||||
// TODO 这里需要导出成负责人的名字
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "转化状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@ExcelProperty(value = "转化状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.BOOLEAN_STRING)
|
||||
private Boolean transformStatus;
|
||||
|
||||
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "520")
|
||||
// TODO 这里需要导出成客户名称
|
||||
@ExcelProperty("客户编号")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "手机号", example = "18000000000")
|
||||
@ExcelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "地址", example = "北京市海淀区")
|
||||
@ExcelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "负责人编号")
|
||||
@ExcelProperty("负责人的用户编号")
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "最后跟进时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ExcelProperty("最后跟进时间")
|
||||
private LocalDateTime contactLastTime;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "所属行业", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
|
||||
@ExcelProperty(value = "所属行业", converter = DictConvert.class)
|
||||
@DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_INDUSTRY)
|
||||
private Integer industryId;
|
||||
|
||||
@Schema(description = "客户等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
|
||||
@ExcelProperty(value = "客户等级", converter = DictConvert.class)
|
||||
@DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_LEVEL)
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "客户来源", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
|
||||
@ExcelProperty(value = "客户来源", converter = DictConvert.class)
|
||||
@DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_SOURCE)
|
||||
private Integer source;
|
||||
@Schema(description = "电话", example = "18000000000")
|
||||
@ExcelProperty("电话")
|
||||
private String telephone;
|
||||
|
||||
@Schema(description = "网址", example = "25682")
|
||||
@ExcelProperty("网址")
|
||||
@ -108,8 +82,35 @@ public class CrmClueRespVO {
|
||||
@ExcelProperty("email")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "地址", example = "北京市海淀区")
|
||||
@ExcelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "所属行业", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
|
||||
@ExcelProperty(value = "所属行业", converter = DictConvert.class)
|
||||
@DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_INDUSTRY)
|
||||
private Integer industryId;
|
||||
|
||||
@Schema(description = "客户等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
|
||||
@ExcelProperty(value = "客户等级", converter = DictConvert.class)
|
||||
@DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_LEVEL)
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "客户来源", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
|
||||
@ExcelProperty(value = "客户来源", converter = DictConvert.class)
|
||||
@DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_SOURCE)
|
||||
private Integer source;
|
||||
|
||||
@Schema(description = "客户描述", example = "25682")
|
||||
@ExcelProperty("客户描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import java.time.LocalDateTime;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_INDUSTRY;
|
||||
|
||||
@Schema(description = "管理后台 - CRM 线索 创建/更新 Request VO")
|
||||
@Schema(description = "管理后台 - CRM 线索创建/更新 Request VO")
|
||||
@Data
|
||||
public class CrmClueSaveReqVO {
|
||||
|
||||
@ -33,50 +33,28 @@ public class CrmClueSaveReqVO {
|
||||
@NotEmpty(message = "线索名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "最后跟进时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DiffLogField(name = "最后跟进时间")
|
||||
private LocalDateTime contactLastTime;
|
||||
|
||||
@Schema(description = "下次联系时间", example = "2023-10-18 01:00:00")
|
||||
@DiffLogField(name = "下次联系时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime contactNextTime;
|
||||
|
||||
@Schema(description = "电话", example = "18000000000")
|
||||
@DiffLogField(name = "电话")
|
||||
@Telephone
|
||||
private String telephone;
|
||||
@Schema(description = "负责人编号", example = "2048")
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "手机号", example = "18000000000")
|
||||
@DiffLogField(name = "手机号")
|
||||
@Mobile
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "地址", example = "北京市海淀区")
|
||||
@DiffLogField(name = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "最后跟进时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DiffLogField(name = "最后跟进时间")
|
||||
private LocalDateTime contactLastTime;
|
||||
|
||||
@Schema(description = "负责人编号", example = "2048")
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@DiffLogField(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "所属行业", example = "1")
|
||||
@DiffLogField(name = "所属行业", function = CrmCustomerIndustryParseFunction.NAME)
|
||||
@DictFormat(CRM_CUSTOMER_INDUSTRY)
|
||||
private Integer industryId;
|
||||
|
||||
@Schema(description = "客户等级", example = "2")
|
||||
@DiffLogField(name = "客户等级", function = CrmCustomerLevelParseFunction.NAME)
|
||||
@InEnum(CrmCustomerLevelEnum.class)
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "客户来源", example = "3")
|
||||
@DiffLogField(name = "客户来源", function = CrmCustomerSourceParseFunction.NAME)
|
||||
private Integer source;
|
||||
@Schema(description = "电话", example = "18000000000")
|
||||
@DiffLogField(name = "电话")
|
||||
@Telephone
|
||||
private String telephone;
|
||||
|
||||
@Schema(description = "网址", example = "https://www.baidu.com")
|
||||
@DiffLogField(name = "网址")
|
||||
@ -98,8 +76,31 @@ public class CrmClueSaveReqVO {
|
||||
@Size(max = 255, message = "邮箱长度不能超过 255 个字符")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "地址", example = "北京市海淀区")
|
||||
@DiffLogField(name = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "所属行业", example = "1")
|
||||
@DiffLogField(name = "所属行业", function = CrmCustomerIndustryParseFunction.NAME)
|
||||
@DictFormat(CRM_CUSTOMER_INDUSTRY)
|
||||
private Integer industryId;
|
||||
|
||||
@Schema(description = "客户等级", example = "2")
|
||||
@DiffLogField(name = "客户等级", function = CrmCustomerLevelParseFunction.NAME)
|
||||
@InEnum(CrmCustomerLevelEnum.class)
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "客户来源", example = "3")
|
||||
@DiffLogField(name = "客户来源", function = CrmCustomerSourceParseFunction.NAME)
|
||||
private Integer source;
|
||||
|
||||
@Schema(description = "客户描述", example = "任意文字")
|
||||
@DiffLogField(name = "客户描述")
|
||||
@Size(max = 4096, message = "客户描述长度不能超过 4096 个字符")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@DiffLogField(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -191,7 +191,6 @@ public class CrmContractController {
|
||||
return success(contractService.getCheckContractCount(getLoginUserId()));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/end-contract-count")
|
||||
@Operation(summary = "获得即将到期的合同数量")
|
||||
@PreAuthorize("@ss.hasPermission('crm:contract:query')")
|
||||
|
@ -152,19 +152,17 @@ public class CrmCustomerController {
|
||||
@Operation(summary = "获得待进入公海客户数量")
|
||||
@PreAuthorize("@ss.hasPermission('crm:customer:query')")
|
||||
public CommonResult<Long> getPutInPoolRemindCustomerCount() {
|
||||
// 获取公海配置 TODO @dbh52:合并到 getPutInPoolRemindCustomerPage 会更合适哈;
|
||||
// 获取公海配置
|
||||
CrmCustomerPoolConfigDO poolConfigDO = customerPoolConfigService.getCustomerPoolConfig();
|
||||
if (ObjUtil.isNull(poolConfigDO)
|
||||
|| Boolean.FALSE.equals(poolConfigDO.getEnabled())
|
||||
|| Boolean.FALSE.equals(poolConfigDO.getNotifyEnabled())) {
|
||||
throw exception(CUSTOMER_POOL_CONFIG_NOT_EXISTS_OR_DISABLED);
|
||||
}
|
||||
|
||||
CrmCustomerPageReqVO pageVO = new CrmCustomerPageReqVO();
|
||||
pageVO.setPool(null);
|
||||
pageVO.setContactStatus(CrmCustomerPageReqVO.CONTACT_TODAY);
|
||||
pageVO.setSceneType(CrmSceneTypeEnum.OWNER.getType());
|
||||
|
||||
CrmCustomerPageReqVO pageVO = new CrmCustomerPageReqVO()
|
||||
.setPool(null)
|
||||
.setContactStatus(CrmCustomerPageReqVO.CONTACT_TODAY)
|
||||
.setSceneType(CrmSceneTypeEnum.OWNER.getType());
|
||||
return success(customerService.getPutInPoolRemindCustomerCount(pageVO, poolConfigDO, getLoginUserId()));
|
||||
}
|
||||
|
||||
@ -182,7 +180,6 @@ public class CrmCustomerController {
|
||||
return success(customerService.getFollowCustomerCount(getLoginUserId()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取距离进入公海的时间
|
||||
*
|
||||
|
@ -50,10 +50,7 @@ public class CrmCustomerPageReqVO extends PageParam {
|
||||
private Boolean pool; // null 则表示为不是公海数据
|
||||
|
||||
@Schema(description = "联系状态", example = "1")
|
||||
private Integer contactStatus; // backlog查询条件, null 则表示为不做查询
|
||||
|
||||
@Schema(description = "跟进状态", example = "true")
|
||||
private Boolean followUpStatus; // backlog查询条件, null 则表示为不做查询
|
||||
private Integer contactStatus; // backlog 查询条件
|
||||
|
||||
@Schema(description = "跟进状态", example = "true")
|
||||
private Boolean followUpStatus;
|
||||
|
@ -10,7 +10,6 @@ import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
// TODO 芋艿:字段的顺序,需要整理下;
|
||||
/**
|
||||
* 线索 DO
|
||||
*
|
||||
@ -32,67 +31,51 @@ public class CrmClueDO extends BaseDO {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 转化状态
|
||||
* 线索名称
|
||||
*/
|
||||
private Boolean transformStatus;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 跟进状态
|
||||
*/
|
||||
private Boolean followUpStatus;
|
||||
/**
|
||||
* 线索名称
|
||||
* 最后跟进时间 TODO 添加跟进记录时更新该值
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 客户 id
|
||||
*
|
||||
* 关联 {@link CrmCustomerDO#getId()}
|
||||
*/
|
||||
private Long customerId;
|
||||
private LocalDateTime contactLastTime;
|
||||
/**
|
||||
* 下次联系时间
|
||||
*/
|
||||
private LocalDateTime contactNextTime;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
* 负责人的用户编号
|
||||
*
|
||||
* 关联 AdminUserDO 的 id 字段
|
||||
*/
|
||||
private String telephone;
|
||||
private Long ownerUserId;
|
||||
|
||||
/**
|
||||
* 转化状态
|
||||
*
|
||||
* true 表示已转换,会更新 {@link #customerId} 字段
|
||||
*/
|
||||
private Boolean transformStatus;
|
||||
/**
|
||||
* 客户编号
|
||||
*
|
||||
* 关联 {@link CrmCustomerDO#getId()}
|
||||
*/
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 地址
|
||||
* 电话
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 最后跟进时间 TODO 添加跟进记录时更新该值
|
||||
*/
|
||||
private LocalDateTime contactLastTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 负责人的用户编号
|
||||
* 关联 AdminUserDO 的 id 字段
|
||||
*/
|
||||
private Long ownerUserId;
|
||||
/**
|
||||
* 所属行业
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_INDUSTRY}
|
||||
*/
|
||||
private Integer industryId;
|
||||
/**
|
||||
* 客户等级
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_LEVEL}
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 客户来源
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_SOURCE}
|
||||
*/
|
||||
private Integer source;
|
||||
private String telephone;
|
||||
/**
|
||||
* 网址
|
||||
*/
|
||||
@ -109,8 +92,35 @@ public class CrmClueDO extends BaseDO {
|
||||
* email
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 所属行业
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_INDUSTRY}
|
||||
*/
|
||||
private Integer industryId;
|
||||
/**
|
||||
* 客户等级
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_LEVEL}
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 客户来源
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_SOURCE}
|
||||
*/
|
||||
private Integer source;
|
||||
/**
|
||||
* 客户描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,6 @@ import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
// TODO 芋艿:调整下字段
|
||||
|
||||
/**
|
||||
* CRM 客户 DO
|
||||
*
|
||||
@ -35,10 +33,35 @@ public class CrmCustomerDO extends BaseDO {
|
||||
* 客户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 跟进状态
|
||||
*/
|
||||
private Boolean followUpStatus;
|
||||
/**
|
||||
* 最后跟进时间
|
||||
*/
|
||||
private LocalDateTime contactLastTime;
|
||||
/**
|
||||
* 最后跟进内容
|
||||
*/
|
||||
private String contactLastContent;
|
||||
/**
|
||||
* 下次联系时间
|
||||
*/
|
||||
private LocalDateTime contactNextTime;
|
||||
|
||||
/**
|
||||
* 负责人的用户编号
|
||||
*
|
||||
* 关联 AdminUserDO 的 id 字段
|
||||
*/
|
||||
private Long ownerUserId;
|
||||
/**
|
||||
* 最后接收时间
|
||||
*/
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
/**
|
||||
* 锁定状态
|
||||
*/
|
||||
@ -47,24 +70,7 @@ public class CrmCustomerDO extends BaseDO {
|
||||
* 成交状态
|
||||
*/
|
||||
private Boolean dealStatus;
|
||||
/**
|
||||
* 所属行业
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_INDUSTRY}
|
||||
*/
|
||||
private Integer industryId;
|
||||
/**
|
||||
* 客户等级
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_LEVEL}
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 客户来源
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_SOURCE}
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
@ -89,20 +95,6 @@ public class CrmCustomerDO extends BaseDO {
|
||||
* email
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 客户描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 负责人的用户编号
|
||||
*
|
||||
* 关联 AdminUserDO 的 id 字段
|
||||
*/
|
||||
private Long ownerUserId;
|
||||
/**
|
||||
* 所在地
|
||||
*
|
||||
@ -113,23 +105,31 @@ public class CrmCustomerDO extends BaseDO {
|
||||
* 详细地址
|
||||
*/
|
||||
private String detailAddress;
|
||||
|
||||
/**
|
||||
* 最后接收时间
|
||||
* 所属行业
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_INDUSTRY}
|
||||
*/
|
||||
private LocalDateTime receiveTime;
|
||||
private Integer industryId;
|
||||
/**
|
||||
* 最后跟进时间
|
||||
* 客户等级
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_LEVEL}
|
||||
*/
|
||||
private LocalDateTime contactLastTime;
|
||||
|
||||
private Integer level;
|
||||
/**
|
||||
* 最后跟进内容
|
||||
* 客户来源
|
||||
*
|
||||
* 对应字典 {@link DictTypeConstants#CRM_CUSTOMER_SOURCE}
|
||||
*/
|
||||
private String contactLastContent;
|
||||
private Integer source;
|
||||
/**
|
||||
* 下次联系时间
|
||||
* 客户描述
|
||||
*/
|
||||
private LocalDateTime contactNextTime;
|
||||
private String description;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -55,17 +55,16 @@ public interface CrmClueMapper extends BaseMapperX<CrmClueDO> {
|
||||
return selectJoinList(CrmClueDO.class, query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getFollowLeadsCount(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);
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO;
|
||||
import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum;
|
||||
import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum;
|
||||
@ -89,33 +88,31 @@ public interface CrmContractMapper extends BaseMapperX<CrmContractDO> {
|
||||
return selectCount(CrmContractDO::getBusinessId, businessId);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getCheckContractCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>();
|
||||
|
||||
// 我负责的, 非公海
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTRACT.getType(),
|
||||
CrmContractDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
|
||||
// 未提交 or 审核不通过
|
||||
query.in(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.DRAFT.getStatus(), CrmAuditStatusEnum.REJECT.getStatus());
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getEndContractCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmContractDO> query = new MPJLambdaWrapperX<>();
|
||||
|
||||
// 我负责的, 非公海
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTRACT.getType(),
|
||||
CrmContractDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
|
||||
// 即将到期
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
|
||||
// TODO: @芋艿 需要配置 提前提醒天数
|
||||
int REMIND_DAYS = 20;
|
||||
query.eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.APPROVE.getStatus())
|
||||
.between(CrmContractDO::getEndTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -99,8 +99,7 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> {
|
||||
|
||||
// backlog 查询
|
||||
if (ObjUtil.isNotNull(pageReqVO.getContactStatus())) {
|
||||
Assert.isNull(pageReqVO.getPool(), "[是否为公海数据]必须是null");
|
||||
|
||||
Assert.isNull(pageReqVO.getPool(), "pool 必须是 null");
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
|
||||
if (pageReqVO.getContactStatus().equals(CrmCustomerPageReqVO.CONTACT_TODAY)) { // 今天需联系
|
||||
@ -113,7 +112,6 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> {
|
||||
throw new IllegalArgumentException("未知联系状态:" + pageReqVO.getContactStatus());
|
||||
}
|
||||
}
|
||||
|
||||
return selectJoinPage(pageReqVO, CrmCustomerDO.class, query);
|
||||
}
|
||||
|
||||
@ -150,31 +148,28 @@ public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> {
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getTodayCustomerCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmCustomerDO> query = new MPJLambdaWrapperX<>();
|
||||
|
||||
// 我负责的, 非公海
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CUSTOMER.getType(),
|
||||
CrmCustomerDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
|
||||
// 今天需联系
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
|
||||
query.between(CrmCustomerDO::getContactNextTime, beginOfToday, endOfToday);
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getFollowCustomerCount(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);
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,16 +62,14 @@ public interface CrmReceivableMapper extends BaseMapperX<CrmReceivableDO> {
|
||||
return selectJoinList(CrmReceivableDO.class, query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getCheckReceivablesCount(Long userId) {
|
||||
MPJLambdaWrapperX<CrmReceivableDO> query = new MPJLambdaWrapperX<>();
|
||||
|
||||
// 我负责的, 非公海
|
||||
// 我负责的 + 非公海
|
||||
CrmQueryWrapperUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_RECEIVABLE.getType(),
|
||||
CrmReceivableDO::getId, userId, CrmSceneTypeEnum.OWNER.getType(), Boolean.FALSE);
|
||||
|
||||
// 未提交 or 审核不通过
|
||||
query.in(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.DRAFT.getStatus(), CrmAuditStatusEnum.REJECT.getStatus());
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
|
@ -79,19 +79,18 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO
|
||||
return selectJoinList(CrmReceivablePlanDO.class, query);
|
||||
}
|
||||
|
||||
// TODO @dhb52:db 统一都是 select 关键字;
|
||||
default Long getRemindReceivablePlanCount(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 看看怎么改成,不用数据库自己去计算这样的时间;
|
||||
LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
query.isNull(CrmReceivablePlanDO::getReceivableId)
|
||||
.gt(CrmReceivablePlanDO::getReturnTime, beginOfToday)
|
||||
.apply("to_days(return_time) <= to_days(now())+ remind_days");
|
||||
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -179,4 +179,5 @@ public interface CrmCustomerService {
|
||||
* @return 提醒数量
|
||||
*/
|
||||
Long getFollowCustomerCount(Long userId);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user