Commit 8e0dba37 by 王祖波

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

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