Commit 8e0dba37 by 王祖波

建联转化需再过滤单据时间

parent b73a37de
......@@ -35,7 +35,7 @@ public interface TabContactLogMapper {
* @param clerkId
* @return
*/
TabContactLog queryLastLog(@Param("memberId")String memberId, @Param("clerkId")String clerkId, @Param("beginTime")Date beginTime);
TabContactLog queryLastLog(@Param("memberId")String memberId, @Param("clerkId")String clerkId, @Param("beginTime")Date beginTime, @Param("endTime")Date endTime);
/**
* 统计总行数
......
......@@ -38,5 +38,5 @@ public interface ContactLogService {
* @param beginTime
* @return
*/
TabContactLog getLastByTime(String memberId, Date beginTime);
TabContactLog getLastByTime(String memberId, Date beginTime,Date endTime);
}
......@@ -74,7 +74,7 @@ public class ContactLogServiceImpl implements ContactLogService {
Integer contactCycle = 1;
// 建联周期 14天内同周期/14天以上周期+1
Integer contactCycleFirst = Constant.FLAG_TRUE;
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, clerkId,null);
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, clerkId,null,null);
if (lastContactLog != null) {
Date contactTime = lastContactLog.getContactTime();
if (DateUtil.between(date, contactTime, DateUnit.SECOND) > 14 * 24 * 60 * 60) {
......@@ -118,7 +118,7 @@ public class ContactLogServiceImpl implements ContactLogService {
@Override
public void clearContactLog(String memberId,Integer clearType) {
logger.info("清除建联状态:{},clearType:{}", memberId, clearType);
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, null,null);
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, null,null,null);
if (lastContactLog == null) {
return;
}
......@@ -150,7 +150,7 @@ public class ContactLogServiceImpl implements ContactLogService {
@Override
public TabContactLog getClerkContactTime(String memberId) {
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, null,null);
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, null,null,null);
if (lastContactLog == null) {
return null;
}
......@@ -175,7 +175,7 @@ public class ContactLogServiceImpl implements ContactLogService {
}
@Override
public TabContactLog getLastByTime(String memberId, Date beginTime) {
return contactLogMapper.queryLastLog(memberId, null,beginTime);
public TabContactLog getLastByTime(String memberId, Date beginTime,Date endTime) {
return contactLogMapper.queryLastLog(memberId, null,beginTime,endTime);
}
}
......@@ -73,7 +73,7 @@ public class ContactOrderServiceImpl implements ContactOrderService {
contactBeginTime = DateUtil.offsetDay(receiptsDate, -1);
}
TabContactLog lastContactLog = contactLogService.getLastByTime(orderInfoResp.getMemberId(), contactBeginTime);
TabContactLog lastContactLog = contactLogService.getLastByTime(orderInfoResp.getMemberId(), contactBeginTime,receiptsDate);
if (lastContactLog == null) {
return;
}
......
......@@ -48,6 +48,9 @@
<if test="beginTime!=null ">
and contact_time >= #{beginTime}
</if>
<if test="endTime!=null ">
and contact_time <![CDATA[<=]]> #{endTime}
</if>
order by contact_time desc,log_id desc limit 1
</select>
......
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