Commit 35ca4637 by 王祖波

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

parent dda4cd96
......@@ -53,6 +53,8 @@ public class ContactLogServiceImpl implements ContactLogService {
private static final Logger logger = LogManager.getLogger(ContactFollowService.class);
private static final Date releaseDate = new Date("2025-05-29 00:00:00");
@Autowired
private TabContactLogMapper contactLogMapper;
@Autowired
......@@ -149,7 +151,8 @@ public class ContactLogServiceImpl implements ContactLogService {
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, clerkId,null,null);
if (lastContactLog != null) {
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;
}else {
contactCycle = lastContactLog.getContactCycle();
......@@ -189,6 +192,20 @@ public class ContactLogServiceImpl implements ContactLogService {
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
public void autoContactLog(ContactLogQDTO qdto) {
if (qdto == null) {
......@@ -287,7 +304,8 @@ public class ContactLogServiceImpl implements ContactLogService {
if (!Objects.equals(clerkId, memberStoreClerk.getClerkId())) {
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 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