Commit b2724f97 by 王祖波

Merge branch 'feature-recommend' into 'developer'

最后一次建联和换绑导购一致则不清除建联

See merge request !2831
parents 6a97b715 025d1eab
...@@ -22,7 +22,7 @@ public interface ContactLogService { ...@@ -22,7 +22,7 @@ public interface ContactLogService {
* @param memberId * @param memberId
* @param clearType 1 消费清除 2 换绑主导购 * @param clearType 1 消费清除 2 换绑主导购
*/ */
void clearContactLog(String memberId, Integer clearType); void clearContactLog(String memberId, Integer clearType,String clerkId);
/** /**
* 获取最近一条有效建联记录 * 获取最近一条有效建联记录
......
...@@ -116,8 +116,8 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -116,8 +116,8 @@ public class ContactLogServiceImpl implements ContactLogService {
} }
@Override @Override
public void clearContactLog(String memberId,Integer clearType) { public void clearContactLog(String memberId,Integer clearType,String clerkId) {
logger.info("清除建联状态:{},clearType:{}", memberId, clearType); logger.info("清除建联状态:{},clearType:{},clerkId:{}", memberId, clearType,clerkId);
TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, null,null,null); TabContactLog lastContactLog = contactLogMapper.queryLastLog(memberId, null,null,null);
if (lastContactLog == null) { if (lastContactLog == null) {
return; return;
...@@ -128,6 +128,12 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -128,6 +128,12 @@ public class ContactLogServiceImpl implements ContactLogService {
update.setLogId(lastContactLog.getLogId()); update.setLogId(lastContactLog.getLogId());
update.setContactStatus(Constant.FLAG_FALSE); update.setContactStatus(Constant.FLAG_FALSE);
contactLogMapper.update(update); contactLogMapper.update(update);
}else if (Objects.equals(clearType, 2)) {
String lastClerkId = lastContactLog.getClerkId();
if (Objects.equals(lastClerkId, clerkId)) {
logger.info("最后一次建联和换绑导购一致则不清除建联");
return;
}
} }
// 清除es建联时间 -1 // 清除es建联时间 -1
refreshContactTime(lastContactLog.getEnterpriseId(), memberId, -1L); refreshContactTime(lastContactLog.getEnterpriseId(), memberId, -1L);
......
...@@ -33,9 +33,10 @@ public class RouterApiServiceImpl implements RouterApiService { ...@@ -33,9 +33,10 @@ public class RouterApiServiceImpl implements RouterApiService {
ClerkAddEventParam clerkAddEventParam = JSONObject.parseObject(params, ClerkAddEventParam.class); ClerkAddEventParam clerkAddEventParam = JSONObject.parseObject(params, ClerkAddEventParam.class);
String memberId = clerkAddEventParam.getMemberId(); String memberId = clerkAddEventParam.getMemberId();
Integer changeType = clerkAddEventParam.getChangeType(); Integer changeType = clerkAddEventParam.getChangeType();
String clerkId = clerkAddEventParam.getClerkId();
if (Objects.equals(changeType, 1)) { if (Objects.equals(changeType, 1)) {
// 换绑主导购清除建联状态 // 换绑主导购清除建联状态
contactLogService.clearContactLog(memberId, 2); contactLogService.clearContactLog(memberId, 2, clerkId);
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -41,7 +41,7 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService { ...@@ -41,7 +41,7 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService {
OrderInfoResp result = serviceResponse.getResult(); OrderInfoResp result = serviceResponse.getResult();
boolean contactOrder = contactOrderService.saveContactOrder(result); boolean contactOrder = contactOrderService.saveContactOrder(result);
if (contactOrder) { if (contactOrder) {
contactLogService.clearContactLog(memberId, 1); contactLogService.clearContactLog(memberId, 1,"");
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -98,7 +98,7 @@ public class ContactTest { ...@@ -98,7 +98,7 @@ public class ContactTest {
@Test @Test
public void clearContactLog() throws Exception { public void clearContactLog() throws Exception {
contactLogService.clearContactLog(memberId, 1); contactLogService.clearContactLog(memberId, 1,"");
} }
@Test @Test
......
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