fix(征求意见流程): 设计工程师填写征求意见问题修复

This commit is contained in:
yjz
2024-01-11 14:38:31 +08:00
parent d52af10c78
commit e2e7a16c56
@@ -444,7 +444,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
});
setUserName(userLink);
processFbStandardConsultationVO.setProcessFbConsultationUserLink(userLink);
return processInfoVO;
}
@@ -618,27 +618,31 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
String userLinkId = task.getFormKey();
log.info("userLinkId: {}", userLinkId);
ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId);
processFbConsultationUserLinkService.update(
new LambdaUpdateWrapper<ProcessFbConsultationUserLink>()
.eq(ProcessFbConsultationUserLink::getId, userLinkId)
.set(ProcessFbConsultationUserLink::getDesignEngineerId, designEngineerId));
// ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId);
//
List<String> designEngineerIdList = Arrays.asList(designEngineerId.split(","));
List<ProcessFbConsultationUserLink> userLinkList = new ArrayList<>();
// List<ProcessFbConsultationUserLink> userLinkList = new ArrayList<>();
//
// designEngineerIdList.forEach(designEngineer -> {
// ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
// userLink.setUserType(FbCommon.USER_TYPE_MODULE_OWNER);
// userLink.setBusinessId(processFbConsultationUserLink.getBusinessId());
// userLink.setDepartLeaderId(processFbConsultationUserLink.getDepartLeaderId());
// userLink.setModuleOwnerId(processFbConsultationUserLink.getModuleOwnerId());
// userLink.setDesignEngineerId(designEngineer);
// userLinkList.add(userLink);
// });
//
// processFbConsultationUserLinkService.removeById(userLinkId); // 先删除
// processFbConsultationUserLinkService.saveBatch(userLinkList, userLinkList.size()); // 后新增
designEngineerIdList.forEach(designEngineer -> {
ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
userLink.setUserType(FbCommon.USER_TYPE_MODULE_OWNER);
userLink.setBusinessId(processFbConsultationUserLink.getBusinessId());
userLink.setDepartLeaderId(processFbConsultationUserLink.getDepartLeaderId());
userLink.setModuleOwnerId(processFbConsultationUserLink.getModuleOwnerId());
userLink.setDesignEngineerId(designEngineer);
userLinkList.add(userLink);
});
processFbConsultationUserLinkService.removeById(userLinkId); // 先删除
processFbConsultationUserLinkService.saveBatch(userLinkList, userLinkList.size()); // 后新增
List<String> idList = userLinkList.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
// List<String> idList = userLinkList.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
String processInstanceId = task.getProcessInstanceId();
runtimeService.setVariableLocal(processInstanceId, FbCommon.VARIABLE_DESIGN_ENGINEER_LIST, idList);
runtimeService.setVariableLocal(processInstanceId, FbCommon.VARIABLE_DESIGN_ENGINEER_LIST, designEngineerIdList);
saveNodeUserLink(processInstanceId, ConsultationNodeSort.DESIGN_ENGINEER_LIST, designEngineerIdList);
// 完成任务
@@ -660,26 +664,30 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String userLinkId = task.getFormKey();
ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId);
processFbConsultationUserLinkService.update(
new LambdaUpdateWrapper<ProcessFbConsultationUserLink>()
.eq(ProcessFbConsultationUserLink::getId, userLinkId)
.set(ProcessFbConsultationUserLink::getDesignEngineerId, designEngineerId));
// ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId);
// List<String> designEngineerIdList = Arrays.asList(designEngineerId.split(","));
// List<ProcessFbConsultationUserLink> userLinkList = new ArrayList<>();
List<String> designEngineerIdList = Arrays.asList(designEngineerId.split(","));
List<ProcessFbConsultationUserLink> userLinkList = new ArrayList<>();
designEngineerIdList.forEach(designEngineer -> {
ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
userLink.setUserType(FbCommon.USER_TYPE_MODULE_OWNER);
userLink.setBusinessId(processFbConsultationUserLink.getBusinessId());
userLink.setDepartLeaderId(processFbConsultationUserLink.getDepartLeaderId());
userLink.setModuleOwnerId(processFbConsultationUserLink.getModuleOwnerId());
userLink.setDesignEngineerId(designEngineer);
userLinkList.add(userLink);
});
int size = userLinkList.size();
if (size > 0) {
processFbConsultationUserLinkService.removeById(userLinkId); // 先删除
processFbConsultationUserLinkService.saveBatch(userLinkList, size); // 后新增
}
// designEngineerIdList.forEach(designEngineer -> {
// ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
// userLink.setUserType(FbCommon.USER_TYPE_MODULE_OWNER);
// userLink.setBusinessId(processFbConsultationUserLink.getBusinessId());
// userLink.setBusinessId(processInfoVO.getBusinessId());
// userLink.setDepartLeaderId(processFbConsultationUserLink.getDepartLeaderId());
// userLink.setModuleOwnerId(processFbConsultationUserLink.getModuleOwnerId());
// userLink.setDesignEngineerId(designEngineer);
// userLinkList.add(userLink);
// });
//
// int size = userLinkList.size();
// if (size > 0) {
// processFbConsultationUserLinkService.removeById(userLinkId); // 先删除
// processFbConsultationUserLinkService.saveBatch(userLinkList, size); // 后新增
// }
}