|
|
@@ -399,10 +399,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
userFollowBusiness = new UserFollowBusiness();
|
|
|
ufbId = UUID.randomUUID().toString();
|
|
|
businessName = businessProjectMapper.selectByPrimaryKey(ub.getBusinessProjectId()).getBname();
|
|
|
+ UserBusiness us=userBusinessMapper.selectByPrimaryKey(ub.getBusinessId());
|
|
|
if(StringUtils.isNotBlank(ub.getBusinessId())){
|
|
|
//更新业务表
|
|
|
userBusiness.setId(ub.getBusinessId());
|
|
|
- UserBusiness us=userBusinessMapper.selectByPrimaryKey(ub.getBusinessId());
|
|
|
if (us.getFollowSituation()==5&& ub.getFollowSituation()!=5) {//如果已签合同,则不允许变更
|
|
|
throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_LOCKED,""));
|
|
|
}
|
|
|
@@ -416,9 +416,12 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
}else{
|
|
|
if(!isUserOwner) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_LOCKED,businessName,""));
|
|
|
}
|
|
|
- if (ub.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
- if(isBusinessOwner) releaseProject(businessLockedList);
|
|
|
- lockProject(fbb);//锁定客户业务
|
|
|
+
|
|
|
+
|
|
|
+ //releaseProject(businessLockedList);
|
|
|
+ if (us.getFollowSituation()!=5&&ub.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
+ if (StringUtils.isNotBlank(fbb.getUid())) ub.setUid(fbb.getUid());
|
|
|
+ lockProject(ub);//锁定客户业务
|
|
|
}
|
|
|
userBusiness.setBusinessProjectId(ub.getBusinessProjectId());
|
|
|
userBusiness.setCustomerStatus(ub.getCustomerStatus());
|
|
|
@@ -457,8 +460,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_EXIST,businessName,""));
|
|
|
}
|
|
|
if (ub.getFollowSituation()==5) {//如果改成已签合同,则锁定业务
|
|
|
- if(isBusinessOwner) releaseProject(businessLockedList);
|
|
|
- lockProject(fbb);//锁定客户业务
|
|
|
+ if (StringUtils.isNotBlank(fbb.getUid())) ub.setUid(fbb.getUid());
|
|
|
+ lockProject(ub);//锁定客户业务
|
|
|
}
|
|
|
String ubId = UUID.randomUUID().toString();
|
|
|
//更新业务表
|
|
|
@@ -492,31 +495,27 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
- private void lockProject(FollowBusinessBo fb) {
|
|
|
- List<BusinessListBo> userBusinessList=fb.getUserBusinessList();
|
|
|
- UserLockRelease ulr = null;
|
|
|
- for(BusinessListBo b : userBusinessList){
|
|
|
- //新增锁定数据
|
|
|
- ulr = new UserLockRelease();
|
|
|
+ private void lockProject(BusinessListBo ub) {
|
|
|
+ UserLockRelease ulr= new UserLockRelease();
|
|
|
ulr.setId(UUID.randomUUID().toString());
|
|
|
ulr.setType(1);
|
|
|
ulr.setAid(TokenManager.getAdminId());
|
|
|
- ulr.setBusinessProjectId(b.getBusinessProjectId());
|
|
|
+ ulr.setBusinessProjectId(ub.getBusinessProjectId());
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );
|
|
|
try {
|
|
|
- if (null==b.getCreateTime()) {
|
|
|
+ if (null==ub.getCreateTime()) {
|
|
|
ulr.setLockTime(new Date());
|
|
|
}else {
|
|
|
- ulr.setLockTime(sdf.parse(b.getCreateTime()));
|
|
|
+ ulr.setLockTime(sdf.parse(ub.getCreateTime()));
|
|
|
}
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
ulr.setStatus(UserLockReleaseStatus.LOCKED.getCode());
|
|
|
- ulr.setUid(fb.getUid());
|
|
|
+ ulr.setUid(ub.getUid());
|
|
|
userLockReleaseMapper.insert(ulr);
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
private void releaseProject(List<LockingReleaseBo> businessLockedList) {
|
|
|
if(businessLockedList != null && businessLockedList.size()>0){
|
|
|
@@ -1256,4 +1255,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements
|
|
|
userLockReleaseMapper.updateReleaseLock(lockIds,releaseTime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int updateAgainProjectTask(String uid, String projectId,String aid) {
|
|
|
+ //List<LockingReleaseBo> businessLockedList = userMapper.selectLockedProject(uid, TokenManager.getAdminId(), projectId, 1, UserLockReleaseStatus.LOCKED.getCode());
|
|
|
+ List<LockingReleaseBo> businessLockedList = userMapper.selectLockedProject(uid, aid, projectId, 1, UserLockReleaseStatus.LOCKED.getCode());
|
|
|
+ UserLockRelease u= new UserLockRelease();
|
|
|
+ if (businessLockedList.size()==1) {
|
|
|
+ for (LockingReleaseBo l : businessLockedList) {
|
|
|
+ u.setId(l.getId());
|
|
|
+ u.setLockTime(new Date());
|
|
|
+ }
|
|
|
+ return userLockReleaseMapper.updateByPrimaryKeySelective(u);
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|