|
@@ -539,11 +539,14 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
* @param flowId
|
|
* @param flowId
|
|
* @param crmDetailId
|
|
* @param crmDetailId
|
|
* @param engineerUserIdList
|
|
* @param engineerUserIdList
|
|
|
|
+ * @param regionCoordinatorUserId
|
|
|
|
+ * @param projectManagerUserId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
- public Boolean updateFlowSetupOne(Long flowId, Long crmDetailId, List<String> engineerUserIdList) {
|
|
|
|
|
|
+ public Boolean updateFlowSetupOne(Long flowId, Long crmDetailId, List<String> engineerUserIdList,
|
|
|
|
+ String regionCoordinatorUserId, String projectManagerUserId) {
|
|
boolean lock = memoryLock.lock(SystemConstant.LOCK_FLOW_PROPERTIES_PREFIX + crmDetailId, crmDetailId,
|
|
boolean lock = memoryLock.lock(SystemConstant.LOCK_FLOW_PROPERTIES_PREFIX + crmDetailId, crmDetailId,
|
|
SystemConstant.LOCK_FLOW_TIME_OUT);
|
|
SystemConstant.LOCK_FLOW_TIME_OUT);
|
|
if (!lock) {
|
|
if (!lock) {
|
|
@@ -562,7 +565,14 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, engineerUserIdList);
|
|
jsonObject.put(SystemConstant.VALUE, engineerUserIdList);
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- break;
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.PROJECT_MANAGER_ID.getKey())) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put(SystemConstant.VALUE, projectManagerUserId);
|
|
|
|
+ f.setValue(jsonObject.toJSONString());
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.REGION_COORDINATOR_ID.getKey())) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put(SystemConstant.VALUE, regionCoordinatorUserId);
|
|
|
|
+ f.setValue(jsonObject.toJSONString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -578,7 +588,19 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put(SystemConstant.VALUE, list);
|
|
jsonObject.put(SystemConstant.VALUE, list);
|
|
f.setValue(jsonObject.toJSONString());
|
|
f.setValue(jsonObject.toJSONString());
|
|
- break;
|
|
|
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.PROJECT_MANAGER_ID.getKey())) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put(SystemConstant.VALUE,
|
|
|
|
+ crmProjectResult.getProjectManagerList().get(0).getUserId().toString());
|
|
|
|
+ f.setValue(jsonObject.toJSONString());
|
|
|
|
+ }
|
|
|
|
+ if (f.getFormId().contains(ProcessLimitedEnum.REGION_COORDINATOR_ID.getKey())) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put(SystemConstant.VALUE,
|
|
|
|
+ !CollectionUtils.isEmpty(crmProjectResult.getRegionCoordinatorList()) ?
|
|
|
|
+ crmProjectResult.getRegionCoordinatorList().get(0).getUserId().toString() :
|
|
|
|
+ null);
|
|
|
|
+ f.setValue(jsonObject.toJSONString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -621,8 +643,12 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
throw ExceptionResultEnum.FLOW_TASK_NO_DATA.exception();
|
|
throw ExceptionResultEnum.FLOW_TASK_NO_DATA.exception();
|
|
}
|
|
}
|
|
if (!CollectionUtils.isEmpty(allocationParamList)) {
|
|
if (!CollectionUtils.isEmpty(allocationParamList)) {
|
|
|
|
+ List<String> engineerUserIdList = new ArrayList<>();
|
|
|
|
+ String regionCoordinatorUserId = null, projectManagerUserId = null;
|
|
for (AllocationParam a : allocationParamList) {
|
|
for (AllocationParam a : allocationParamList) {
|
|
if (a.getSopRoleType() == SopRoleTypeEnum.PROJECT_MANAGER) {
|
|
if (a.getSopRoleType() == SopRoleTypeEnum.PROJECT_MANAGER) {
|
|
|
|
+ //修改流程里面的工程师
|
|
|
|
+ projectManagerUserId = a.getUserIdList().get(0).toString();
|
|
if (taskList.size() == 1) {
|
|
if (taskList.size() == 1) {
|
|
activitiService.taskApproverExchange(a.getUserIdList().get(0),
|
|
activitiService.taskApproverExchange(a.getUserIdList().get(0),
|
|
Long.parseLong(taskList.get(0).getId()));
|
|
Long.parseLong(taskList.get(0).getId()));
|
|
@@ -639,13 +665,17 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
Long.parseLong(taskTempList.get(0).getId()));
|
|
Long.parseLong(taskTempList.get(0).getId()));
|
|
}
|
|
}
|
|
} else if (a.getSopRoleType() == SopRoleTypeEnum.ENGINEER) {
|
|
} else if (a.getSopRoleType() == SopRoleTypeEnum.ENGINEER) {
|
|
- //修改流程one里面的工程师
|
|
|
|
- List<String> engineerUserIdList = a.getUserIdList().stream().map(s -> s.toString())
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- tbSopInfoService.updateFlowSetupOne(tfCustomFlowEntity.getFlowId(), tbCrmDetail.getId(),
|
|
|
|
- engineerUserIdList);
|
|
|
|
|
|
+ //修改流程里面的工程师
|
|
|
|
+ engineerUserIdList = a.getUserIdList().stream().map(s -> s.toString()).collect(Collectors.toList());
|
|
|
|
+ } else if (a.getSopRoleType() == SopRoleTypeEnum.REGION_COORDINATOR) {
|
|
|
|
+ //修改流程里面的区域协调人
|
|
|
|
+ if (!CollectionUtils.isEmpty(a.getUserIdList())) {
|
|
|
|
+ regionCoordinatorUserId = a.getUserIdList().get(0).toString();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ tbSopInfoService.updateFlowSetupOne(tfCustomFlowEntity.getFlowId(), tbCrmDetail.getId(), engineerUserIdList,
|
|
|
|
+ regionCoordinatorUserId, projectManagerUserId);
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|