Commit 35ca4637 by 王祖波

建联天数变更历史天数逻辑调整

parent dda4cd96
...@@ -53,6 +53,8 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -53,6 +53,8 @@ public class ContactLogServiceImpl implements ContactLogService {
private static final Logger logger = LogManager.getLogger(ContactFollowService.class); private static final Logger logger = LogManager.getLogger(ContactFollowService.class);
private static final Date releaseDate = new Date("2025-05-29 00:00:00");
@Autowired @Autowired
private TabContactLogMapper contactLogMapper; private TabContactLogMapper contactLogMapper;
@Autowired @Autowired
...@@ -149,7 +151,8 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -149,7 +151,8 @@ public class ContactLogServiceImpl implements ContactLogService {
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, clerkId,null,null); TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, clerkId,null,null);
if (lastContactLog != null) { if (lastContactLog != null) {
Date contactTime = lastContactLog.getContactTime(); Date contactTime = lastContactLog.getContactTime();
if (DateUtil.between(date, contactTime, DateUnit.SECOND) > Manage3Constants.CONTACT_ORDER_LIMIT_DAY * 24 * 60 * 60) { Integer contactOrderLimitDay = getContactOrderLimitDay(contactTime);
if (DateUtil.between(date, contactTime, DateUnit.SECOND) > contactOrderLimitDay * 24 * 60 * 60) {
contactCycle = lastContactLog.getContactCycle() + 1; contactCycle = lastContactLog.getContactCycle() + 1;
}else { }else {
contactCycle = lastContactLog.getContactCycle(); contactCycle = lastContactLog.getContactCycle();
...@@ -189,6 +192,20 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -189,6 +192,20 @@ public class ContactLogServiceImpl implements ContactLogService {
return contactLog; return contactLog;
} }
/**
* 历史数据超过14天建联未转化的按14天周期
* @param contactTime
* @return
*/
private Integer getContactOrderLimitDay(Date contactTime) {
Integer contactOrderLimitDay = Manage3Constants.CONTACT_ORDER_LIMIT_DAY;
if (DateUtil.compare(releaseDate, contactTime) > 0 && DateUtil.between(releaseDate, contactTime, DateUnit.DAY) > 14) {
contactOrderLimitDay = 14;
}
logger.info("建联未转化计算天数:{}",contactOrderLimitDay);
return contactOrderLimitDay;
}
@Override @Override
public void autoContactLog(ContactLogQDTO qdto) { public void autoContactLog(ContactLogQDTO qdto) {
if (qdto == null) { if (qdto == null) {
...@@ -287,7 +304,8 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -287,7 +304,8 @@ public class ContactLogServiceImpl implements ContactLogService {
if (!Objects.equals(clerkId, memberStoreClerk.getClerkId())) { if (!Objects.equals(clerkId, memberStoreClerk.getClerkId())) {
return null; return null;
} }
if (DateUtil.compare(contactTime, DateUtil.date().offset(DateField.DAY_OF_MONTH, -Manage3Constants.CONTACT_ORDER_LIMIT_DAY)) < 0) { Integer contactOrderLimitDay = getContactOrderLimitDay(contactTime);
if (DateUtil.compare(contactTime, DateUtil.date().offset(DateField.DAY_OF_MONTH, -contactOrderLimitDay)) < 0) {
return null; return null;
} }
return lastContactLog; return lastContactLog;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment