|
|
@@ -390,7 +390,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
uList = Arrays.asList(uid.split(","));
|
|
|
}
|
|
|
addUserLock(uid, TokenManager.getAdminId(), now, uList);
|
|
|
- addUserTransferLog(uid, TokenManager.getAdminId(), 0, null, now, uList);
|
|
|
+ addUserTransferLog(uid, TokenManager.getAdminId(), null,0, null, now, uList);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -1125,9 +1125,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int updateByOperatorType(String uid, String oldAid, Integer operatorType, Object... params) {
|
|
|
+ public int updateByOperatorType(String uid,String aid, String oldAid, Integer operatorType,Integer data) {
|
|
|
User user = new User();
|
|
|
Date now = new Date();
|
|
|
+ if(data==null)data=0;
|
|
|
// 是否多个客户
|
|
|
boolean isUs = false;
|
|
|
if (uid.contains(",")) {
|
|
|
@@ -1139,6 +1140,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}
|
|
|
user.setId(uid);
|
|
|
int flag = 0;
|
|
|
+ //领取
|
|
|
if (AFTConstants.USER_RECEIVE.equals(operatorType)) {
|
|
|
if (userMapper.UserReceiveCount(TokenManager.getAdminId()) >= USER_RECEIVE_MAX)
|
|
|
throw new BusinessException(new Error(ErrorConstants.CUSTOM_EREXCESS, "" + USER_RECEIVE_MAX, ""));
|
|
|
@@ -1148,13 +1150,17 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
user.setSource(2);// 客户来源设置为领取
|
|
|
user.setTransferTime(now);
|
|
|
flag = addUserLock(uid, TokenManager.getAdminId(), now, uList); // 指定用户锁定客户
|
|
|
- addUserTransferLog(uid, TokenManager.getAdminId(), 1, null, now, uList);
|
|
|
+ addUserTransferLog(uid, TokenManager.getAdminId(), null,1, null, now, uList);
|
|
|
if (flag <= 0)
|
|
|
throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_RECEIVE, ""));
|
|
|
+ //转交
|
|
|
} else if (AFTConstants.USER_TRANSFER_TO_OTHER.equals(operatorType)
|
|
|
|| AFTConstants.SIGN_USER_TRANSFER_TO_OTHER == operatorType) {
|
|
|
if (!isUs) {
|
|
|
- user.setAid(String.valueOf(params[0]));
|
|
|
+ user.setAid(aid);
|
|
|
+ if (data==1){
|
|
|
+ user.setInformationMaintainer(aid);
|
|
|
+ }
|
|
|
user.setSource(3);// 客户来源设置为转交
|
|
|
if (AFTConstants.USER_TRANSFER_TO_OTHER == operatorType) {
|
|
|
// 查询这个客户是否是登陆人的客户
|
|
|
@@ -1163,7 +1169,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
flag = updateUserLock(uid, oldAid, UserLockReleaseStatus.LOCKED.getCode(),
|
|
|
UserLockReleaseStatus.RELEASE.getCode()); // 原用户释放客户
|
|
|
if (flag > 0)
|
|
|
- flag = addUserLock(uid, String.valueOf(params[0]), now, uList); // 指定用户锁定客户
|
|
|
+ flag = addUserLock(uid,aid, now, uList); // 指定用户锁定客户
|
|
|
if (flag <= 0)
|
|
|
throw new BusinessException(new Error(ErrorConstants.CUSTOMER_TRANSFER_FAIL, ""));
|
|
|
}
|
|
|
@@ -1177,22 +1183,21 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
flag = updateUsersLock(uList, oldAid, UserLockReleaseStatus.LOCKED.getCode(),
|
|
|
UserLockReleaseStatus.RELEASE.getCode()); // 原用户释放客户
|
|
|
if (flag > 0)
|
|
|
- flag = addUserLock(uid, String.valueOf(params[0]), now, uList); // 指定用户锁定客户
|
|
|
+ flag = addUserLock(uid, aid, now, uList); // 指定用户锁定客户
|
|
|
if (flag <= 0)
|
|
|
throw new BusinessException(new Error(ErrorConstants.CUSTOMER_TRANSFER_FAIL, ""));
|
|
|
}
|
|
|
}
|
|
|
Integer type = 2;
|
|
|
- if (AFTConstants.SIGN_USER_TRANSFER_TO_OTHER == operatorType)
|
|
|
- type = 7;
|
|
|
+ if (AFTConstants.SIGN_USER_TRANSFER_TO_OTHER == operatorType)type = 7;
|
|
|
|
|
|
- addUserTransferLog(uid, String.valueOf(params[0]), type, null, now, uList);
|
|
|
+ addUserTransferLog(uid, aid,oldAid, type, null, now, uList);
|
|
|
}
|
|
|
if (isUs) {
|
|
|
if (AFTConstants.USER_RECEIVE == operatorType) {
|
|
|
- userMapper.updateList(String.valueOf(params[0]), null, 3, null, 2, uList);
|
|
|
+ userMapper.updateList(aid, null, 3, null, 2, uList,null);
|
|
|
} else {
|
|
|
- userMapper.updateList(String.valueOf(params[0]), null, 3, null, null, uList);
|
|
|
+ userMapper.updateList(aid, null, 3, null, null, uList,data);
|
|
|
}
|
|
|
} else {
|
|
|
userMapper.updateByPrimaryKeySelective(user);
|
|
|
@@ -1239,8 +1244,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
*
|
|
|
* @param type 0录入 1 领取 2 转交私有客户 3转交业务 4 未跟进丢失(30) 5未签单丢失(270天)6释放 7转交签单客户
|
|
|
*/
|
|
|
- private void addUserTransferLog(String uid, String aid, Integer type, String pid, Date lockTime,
|
|
|
- List<String> uList) {
|
|
|
+ private void addUserTransferLog(String uid, String aid,String oldAid, Integer type, String pid,
|
|
|
+ Date lockTime, List<String> uList) {
|
|
|
if (uList.isEmpty()) {
|
|
|
UserTransferLog utl = new UserTransferLog();
|
|
|
if (type == 0 || type == 1)
|
|
|
@@ -1249,8 +1254,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
utl.setAid(TokenManager.getAdminId());
|
|
|
utl.setTakeAid(aid);
|
|
|
}
|
|
|
- if (type == 3)
|
|
|
- utl.setPid(pid);
|
|
|
+ if (type == 3) utl.setPid(pid);
|
|
|
utl.setType(type);
|
|
|
utl.setCreateTime(lockTime);
|
|
|
utl.setUid(uid);
|
|
|
@@ -1261,15 +1265,14 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
for (String string : ulist) {
|
|
|
UserTransferLog utl = new UserTransferLog();
|
|
|
if (type == 0 || type == 1)
|
|
|
- utl.setAid(string);
|
|
|
+ utl.setAid(aid);
|
|
|
else if (type == 2 || type == 3 || type == 7) {
|
|
|
utl.setAid(TokenManager.getAdminId());
|
|
|
- utl.setTakeAid(string);
|
|
|
+ utl.setTakeAid(aid);
|
|
|
}
|
|
|
- if (type == 3)
|
|
|
- utl.setPid(pid);
|
|
|
+ if (type == 3) utl.setPid(pid);
|
|
|
utl.setCreateTime(lockTime);
|
|
|
- utl.setUid(uid);
|
|
|
+ utl.setUid(string);
|
|
|
utl.setType(type);
|
|
|
utlList.add(utl);
|
|
|
}
|
|
|
@@ -1852,7 +1855,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
userMapper.updateByPrimaryKeySelective(u);
|
|
|
} else {
|
|
|
List<String> ulist = Arrays.asList(u.getId().split(","));
|
|
|
- userMapper.updateList(null, u.getLevel(), null, null, null, ulist);
|
|
|
+ userMapper.updateList(null, u.getLevel(), null, null, null, ulist,null);
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
@@ -1980,7 +1983,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
ulList.add(utl);
|
|
|
}
|
|
|
userTransferLogMapper.insertList(ulList);
|
|
|
- userMapper.updateList(null, null, null, date, 1, list);
|
|
|
+ userMapper.updateList(null, null, null, date, 1, list,null);
|
|
|
userLockReleaseMapper.updateUserTypeLockList(list, TokenManager.getAdminId(), 0, 2, date);
|
|
|
}
|
|
|
return 1;
|