|
|
@@ -127,7 +127,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
Map<String,Object> params = disposeParams(cli);
|
|
|
Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivatePersonalCustomerList","selectPrivatePersonalCustomerCount",params,pageNo,pageSize);
|
|
|
List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
|
|
|
- setCustomerList(tmpList);
|
|
|
+ setCustomerList(tmpList,0);
|
|
|
list.setList(tmpList);
|
|
|
return list;
|
|
|
}
|
|
|
@@ -172,7 +172,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
params.put("sortType",sortType);
|
|
|
Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivateOrganizationCustomerList","selectPrivateOrganizationCustomerCount",params,pageNo,pageSize);
|
|
|
List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
|
|
|
- setCustomerList(tmpList);
|
|
|
+ setCustomerList(tmpList,0);
|
|
|
list.setList(tmpList);
|
|
|
return list;
|
|
|
}
|
|
|
@@ -509,10 +509,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
//更新业务表
|
|
|
userBusiness.setId(ub.getBusinessId());
|
|
|
if (us.getFollowSituation()==5) {//如果已签合同,则不允许变更
|
|
|
- /*if (ub.getFollowSituation()!=5&&checkCustomerInformation(uid)) {
|
|
|
- throw new BusinessException(new Error("","请到客户资料-客户资料维护模块完善您的客户信息!"));
|
|
|
- }*/
|
|
|
- if (ub.getCustomerStatus()!=us.getCustomerStatus()|| ub.getFollowSituation()!=5) {
|
|
|
+ if (ub.getCustomerStatus()!=us.getCustomerStatus()&& ub.getFollowSituation()!=5) {
|
|
|
throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_LOCKED,""));
|
|
|
}
|
|
|
}
|
|
|
@@ -941,7 +938,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
user.setShareType(AFTConstants.USER_SHARE_PRIVATE);
|
|
|
user.setInformationMaintainer(TokenManager.getAdminId());
|
|
|
user.setSource(2);//客户来源设置为领取
|
|
|
- user.setTransferTime(now);
|
|
|
+// 转换不重置时间
|
|
|
+// user.setTransferTime(now);
|
|
|
flag = addUserLock(uid,TokenManager.getAdminId(),0,null,now); //指定用户锁定客户
|
|
|
if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_RECEIVE,""));
|
|
|
if(userMapper.UserReceiveCount(TokenManager.getAdminId())>AFTConstants.USER_RCEIVE_MAX)
|
|
|
@@ -950,7 +948,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}else if(operatorType.equals(AFTConstants.USER_TRANSFER_TO_OTHER)){
|
|
|
user.setAid(String.valueOf(params[0]));
|
|
|
user.setSource(3);//客户来源设置为转交
|
|
|
- user.setTransferTime(now);
|
|
|
+// 转换不重置时间
|
|
|
+// user.setTransferTime(now);
|
|
|
//查询这个客户是否是登陆人的客户
|
|
|
if(userMapper.getAidAndUser(uid,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
|
|
|
flag = updateUserLock(uid,oldAid,UserLockReleaseStatus.LOCKED.getCode(),UserLockReleaseStatus.RELEASE.getCode()); //原用户释放客户
|
|
|
@@ -1277,15 +1276,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
return userMapper.updateRefusedCustomer(id, nickname, mobile, societyTag);
|
|
|
}
|
|
|
|
|
|
- private void setCustomerList(List<CustomerListOut> tmpList){
|
|
|
+ private void setCustomerList(List<CustomerListOut> tmpList,int i){
|
|
|
Date now = new Date();
|
|
|
String s1,s2;
|
|
|
Long l1,l2;
|
|
|
- int diff1,diff2;
|
|
|
+ int diff1=0,diff2=0;
|
|
|
for(CustomerListOut clo: tmpList){
|
|
|
- //s1 = StringUtils.isBlank(clo.getLastFollowTime()) ? clo.getTransferTime() : clo.getLastFollowTime();
|
|
|
try {
|
|
|
+ //如果最近跟进为空直接取转换时间
|
|
|
if (StringUtils.isNotBlank(clo.getLastFollowTime())){
|
|
|
+ //如果最近跟进小于转换取转换时间
|
|
|
if(DateUtils.parseDate(clo.getLastFollowTime(), AFTConstants.YYYYMMDDHHMMSS).getTime()>DateUtils.parseDate(clo.getTransferTime(), AFTConstants.YYYYMMDDHHMMSS).getTime()) {
|
|
|
s1=clo.getLastFollowTime();
|
|
|
}else {
|
|
|
@@ -1294,11 +1294,17 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}else {
|
|
|
s1=clo.getTransferTime();
|
|
|
}
|
|
|
- s2 = StringUtils.isBlank(clo.getLastSignTime()) ? clo.getTransferTime() : clo.getLastSignTime();
|
|
|
+ //另外一个时间取转换时间
|
|
|
+ s2 = clo.getTransferTime();
|
|
|
l1 = DateUtils.parseDate(s1, AFTConstants.YYYYMMDDHHMMSS).getTime();
|
|
|
l2 = DateUtils.parseDate(s2, AFTConstants.YYYYMMDDHHMMSS).getTime();
|
|
|
- diff1 = (int)((l1 + AFTConstants.USER_FOLLOW_LIMIT_MS - now.getTime())/(24*3600*1000));
|
|
|
- diff2 = (int)((l2 + AFTConstants.USER_SIGN_LIMIT_MS - now.getTime())/(24*3600*1000));
|
|
|
+ if(i==0) {
|
|
|
+ diff1 = (int)((l1 + AFTConstants.USER_FOLLOW_LIMIT_MS - now.getTime())/(24*3600*1000));
|
|
|
+ diff2 = (int)((l2 + AFTConstants.USER_SIGN_LIMIT_MS - now.getTime())/(24*3600*1000));
|
|
|
+ }else if (i==1) {
|
|
|
+ diff1 = (int)((l1 + AFTConstants.PROJECT_FOLLOW_LIMIT_MS - now.getTime())/(24*3600*1000));
|
|
|
+ diff2 = (int)((l2 + AFTConstants.PROJECT_SIGN_LIMIT_MS - now.getTime())/(24*3600*1000));
|
|
|
+ }
|
|
|
clo.setSurplusFollowTime(diff1 + "");
|
|
|
clo.setSurplusSignTime(diff2 + "");
|
|
|
} catch (ParseException e) {
|
|
|
@@ -1316,7 +1322,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
Map<String,Object> params = disposeParams(cli);
|
|
|
Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignOrganizationCustomerList","selectSignOrganizationCustomerCount",params,pageNo,pageSize);
|
|
|
List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
|
|
|
- setCustomerList(tmpList);
|
|
|
+ setCustomerList(tmpList,1);
|
|
|
list.setList(tmpList);
|
|
|
return list;
|
|
|
}
|
|
|
@@ -1329,7 +1335,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
Map<String,Object> params = disposeParams(cli);
|
|
|
Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignPersonalCustomerList","selectSignPersonalCustomerCount",params,pageNo,pageSize);
|
|
|
List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
|
|
|
- setCustomerList(tmpList);
|
|
|
+ setCustomerList(tmpList,0);
|
|
|
list.setList(tmpList);
|
|
|
return list;
|
|
|
}
|
|
|
@@ -1492,7 +1498,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
params.put("sort", sort);
|
|
|
params.put("sortType",sortType);
|
|
|
List<CustomerListOut> list= userMapper.privateUnitCustomerList(params);
|
|
|
- setCustomerList(list);
|
|
|
+ setCustomerList(list,0);
|
|
|
if (list==null || list.size()==0) return null;
|
|
|
String[] comment = {"客户名称","地区","联系人","联系电话","社会性质","客户初始时间","剩余私有天数","最新跟进时间","客户等级"};
|
|
|
String filePath = uploadPath + "/privateUnitCustomer";
|
|
|
@@ -1524,11 +1530,14 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
LockingReleaseBo l=list.get(0);
|
|
|
UserLockRelease ul=new UserLockRelease();
|
|
|
ul.setId(l.getId());
|
|
|
- ul.setStatus(2);
|
|
|
- ul.setReleaseTime(now);
|
|
|
+// 不做释放与锁定的动作
|
|
|
+// ul.setStatus(2);
|
|
|
+ ul.setAid(inputId);
|
|
|
+// 不修改时间
|
|
|
+// ul.setReleaseTime(now);
|
|
|
userLockReleaseMapper.updateByPrimaryKeySelective(ul);
|
|
|
addtransferLog(uid,pid,TokenManager.getAdminId(),inputId,1);
|
|
|
- addUserLock(uid,inputId,1,pid,now); //指定用户锁定客户
|
|
|
+// addUserLock(uid,inputId,1,pid,now); //指定用户锁定客户
|
|
|
List<BusinessListBo> bl=userBusinessMapper.selectBusinessProjectByUAPid(uid, TokenManager.getAdminId(), pid);
|
|
|
if (bl.size()==1) {
|
|
|
UserBusiness ub=new UserBusiness();
|