|
|
@@ -403,7 +403,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
//更新业务表
|
|
|
userBusiness.setId(ub.getBusinessId());
|
|
|
UserBusiness us=userBusinessMapper.selectByPrimaryKey(ub.getBusinessId());
|
|
|
- if (us.getFollowSituation()==5&& userBusiness.getFollowSituation()!=5) {//如果已签合同,则不允许变更
|
|
|
+ if (us.getFollowSituation()==5&& ub.getFollowSituation()!=5) {//如果已签合同,则不允许变更
|
|
|
throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_LOCKED,""));
|
|
|
}
|
|
|
//检查业务锁定情况
|
|
|
@@ -416,13 +416,14 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
}else{
|
|
|
if(!isUserOwner) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_LOCKED,businessName,""));
|
|
|
}
|
|
|
- if (userBusiness.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
+ if (ub.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
if(isBusinessOwner) releaseProject(businessLockedList);
|
|
|
- lockProject(fbb.getUserBusinessList());//锁定客户业务
|
|
|
+ lockProject(fbb);//锁定客户业务
|
|
|
}
|
|
|
userBusiness.setBusinessProjectId(ub.getBusinessProjectId());
|
|
|
userBusiness.setCustomerStatus(ub.getCustomerStatus());
|
|
|
userBusiness.setFollowSituation(ub.getFollowSituation());
|
|
|
+ userBusiness.setRemarks(ub.getRemarks());
|
|
|
userBusiness.setUid(fbb.getUid());
|
|
|
try {
|
|
|
userBusiness.setUpdateTime(format.parse(fbb.getFollowTime()));
|
|
|
@@ -455,10 +456,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
if(userBusinessMapper.judgeBusiness(fbb.getUid(), ub.getBusinessProjectId(), "")>0){
|
|
|
throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_EXIST,businessName,""));
|
|
|
}
|
|
|
- if (userBusiness.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
-
|
|
|
+ if (ub.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
if(isBusinessOwner) releaseProject(businessLockedList);
|
|
|
- lockProject(fbb.getUserBusinessList());//锁定客户业务
|
|
|
+ lockProject(fbb);//锁定客户业务
|
|
|
}
|
|
|
String ubId = UUID.randomUUID().toString();
|
|
|
//更新业务表
|
|
|
@@ -474,6 +474,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
userBusiness.setFollowSituation(ub.getFollowSituation());
|
|
|
userBusiness.setUid(fbb.getUid());
|
|
|
userBusiness.setAid(TokenManager.getAdminId());
|
|
|
+ userBusiness.setRemarks(ub.getRemarks());
|
|
|
userBusinessMapper.insert(userBusiness);
|
|
|
//更新业务中间表
|
|
|
userFollowBusiness.setBusinessId(ubId);
|
|
|
@@ -491,7 +492,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
- private void lockProject(List<BusinessListBo> userBusinessList) {
|
|
|
+ private void lockProject(FollowBusinessBo fb) {
|
|
|
+ List<BusinessListBo> userBusinessList=fb.getUserBusinessList();
|
|
|
UserLockRelease ulr = null;
|
|
|
for(BusinessListBo b : userBusinessList){
|
|
|
//新增锁定数据
|
|
|
@@ -502,12 +504,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
ulr.setBusinessProjectId(b.getBusinessProjectId());
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );
|
|
|
try {
|
|
|
- ulr.setLockTime(sdf.parse(b.getCreateTime()));
|
|
|
+ if (null==b.getCreateTime()) {
|
|
|
+ ulr.setLockTime(new Date());
|
|
|
+ }else {
|
|
|
+ ulr.setLockTime(sdf.parse(b.getCreateTime()));
|
|
|
+ }
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
ulr.setStatus(UserLockReleaseStatus.LOCKED.getCode());
|
|
|
- ulr.setUid(b.getUid());
|
|
|
+ ulr.setUid(fb.getUid());
|
|
|
userLockReleaseMapper.insert(ulr);
|
|
|
}
|
|
|
}
|