From d4d3f7770cc5891ec9e2250422bde3ea25cb4793 Mon Sep 17 00:00:00 2001 From: 邓实川 <544939826@qq.com> Date: Mon, 15 Jun 2020 08:55:14 +0800 Subject: [PATCH] 扫描判空 --- src/main/java/cn/timer/api/bean/crm/CrmSeaRule.java | 10 +++++----- src/main/java/cn/timer/api/controller/crm/CrmRuleController.java | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/timer/api/bean/crm/CrmSeaRule.java b/src/main/java/cn/timer/api/bean/crm/CrmSeaRule.java index a1dad38..e90be68 100644 --- a/src/main/java/cn/timer/api/bean/crm/CrmSeaRule.java +++ b/src/main/java/cn/timer/api/bean/crm/CrmSeaRule.java @@ -53,17 +53,17 @@ public class CrmSeaRule extends Model<CrmSeaRule> { private Integer gid; @ApiModelProperty(value = "添加客户之后(one)天没有跟进 (以跟进记录为准)") - private Integer one; + private int one; @ApiModelProperty(value = "距上次跟进(two)天没有再次跟进 (以跟进记录为准)") - private Integer two; + private int two; @ApiModelProperty(value = "添加客户之后(three)天没有成交 (天数必须大于规则1)") - private Integer three; + private int three; @ApiModelProperty(value = "系统提前(four)天自动提醒业务员客户将被回收") - private Integer four; + private int four; // @ApiModelProperty(value = "我的客户数量最多(five)人(合作中的不算)") -// private Integer five; +// private int five; } diff --git a/src/main/java/cn/timer/api/controller/crm/CrmRuleController.java b/src/main/java/cn/timer/api/controller/crm/CrmRuleController.java index 207d172..3620928 100644 --- a/src/main/java/cn/timer/api/controller/crm/CrmRuleController.java +++ b/src/main/java/cn/timer/api/controller/crm/CrmRuleController.java @@ -65,22 +65,24 @@ public class CrmRuleController { Date now = new Date(); // 客户创建时间+ x天 = 过期释放时间 DateTime overDate1 = DateUtil.offsetDay(createTime, one); - Long compare2 = null; + long compare2 = 0; if (lastFollowTime != null) { DateTime overDate2 = DateUtil.offsetDay(lastFollowTime, two); - compare2 = DateUtil.between(overDate2, now, DateUnit.DAY, false); + compare2 = DateUtil.between(overDate2, now, DateUnit.DAY, false); + if (compare2 == -four) + remind(belongUserName, clientName, four); } DateTime overDate3 = DateUtil.offsetDay(createTime, three); // 时间比较 long compare1 = DateUtil.between(overDate1, now, DateUnit.DAY, false); - + long compare3 = DateUtil.between(overDate3, now, DateUnit.DAY, false); // 判断1和2和3 if ((lastFollowTime == null && compare1 >= 0) || (lastFollowTime != null && compare2 >= 0) || (compare3 >= 0 && status != 3 && status != 4)) release(crmClientData); // 判断4 - if (compare1 == -four || compare2 == -four || compare3 == -four) // TODO + if (compare1 == -four || compare3 == -four) remind(belongUserName, clientName, four); } } -- libgit2 0.26.0