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

This commit is contained in:
yjz
2024-01-11 16:05:50 +08:00
parent e96a84d3cd
commit a29007a5ee
@@ -3,6 +3,7 @@ package com.jero.modules.activiti.process.fb.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.common.api.vo.ResultCommon;
import com.jero.common.util.SnowflakeUtils;
import com.jero.common.util.UUIDUtils;
import com.jero.modules.activiti.entity.ProcessAll;
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
@@ -618,31 +619,36 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
String userLinkId = task.getFormKey();
log.info("userLinkId: {}", userLinkId);
processFbConsultationUserLinkService.update(
new LambdaUpdateWrapper<ProcessFbConsultationUserLink>()
.eq(ProcessFbConsultationUserLink::getId, userLinkId)
.set(ProcessFbConsultationUserLink::getDesignEngineerId, designEngineerId));
// ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId);
// processFbConsultationUserLinkService.update(
// new LambdaUpdateWrapper<ProcessFbConsultationUserLink>()
// .eq(ProcessFbConsultationUserLink::getId, userLinkId)
// .set(ProcessFbConsultationUserLink::getDesignEngineerId, designEngineerId));
ProcessFbConsultationUserLink processFbConsultationUserLink =
processFbConsultationUserLinkService.listByIds(Arrays.asList(userLinkId.split(","))).get(0);
//
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);
// });
//
// processFbConsultationUserLinkService.removeById(userLinkId); // 先删除
// processFbConsultationUserLinkService.saveBatch(userLinkList, userLinkList.size()); // 后新增
List<ProcessFbConsultationUserLink> userLinkList = new ArrayList<>();
List<String> idList =new ArrayList<>();
// List<String> idList = userLinkList.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
designEngineerIdList.forEach(designEngineer -> {
ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
userLink.setId(String.valueOf(SnowflakeUtils.snowflake()));
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);
idList.add(userLink.getId());
});
task.setFormKey(String.join(",", idList));
processFbConsultationUserLinkService.removeByIds(Arrays.asList(userLinkId.split(","))); // 先删除
processFbConsultationUserLinkService.saveBatch(userLinkList, userLinkList.size()); // 后新增
List<String> ids = userLinkList.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
String processInstanceId = task.getProcessInstanceId();
runtimeService.setVariableLocal(processInstanceId, FbCommon.VARIABLE_DESIGN_ENGINEER_LIST, designEngineerIdList);
runtimeService.setVariableLocal(processInstanceId, FbCommon.VARIABLE_DESIGN_ENGINEER_LIST, ids);
saveNodeUserLink(processInstanceId, ConsultationNodeSort.DESIGN_ENGINEER_LIST, designEngineerIdList);
// 完成任务
@@ -664,30 +670,37 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String userLinkId = task.getFormKey();
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<>();
// processFbConsultationUserLinkService.update(
// new LambdaUpdateWrapper<ProcessFbConsultationUserLink>()
// .eq(ProcessFbConsultationUserLink::getId, userLinkId)
// .set(ProcessFbConsultationUserLink::getDesignEngineerId, designEngineerId));
ProcessFbConsultationUserLink processFbConsultationUserLink =
processFbConsultationUserLinkService.listByIds(Arrays.asList(userLinkId.split(","))).get(0);
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.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); // 后新增
// }
List<String> idList =new ArrayList<>();
designEngineerIdList.forEach(designEngineer -> {
ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
userLink.setId(String.valueOf(SnowflakeUtils.snowflake()));
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);
userLink.setParentExecutionId(processFbConsultationUserLink.getParentExecutionId());
userLinkList.add(userLink);
idList.add(userLink.getId());
});
int size = userLinkList.size();
if (size > 0) {
task.setFormKey(String.join(",", idList));
taskService.saveTask(task);
processFbConsultationUserLinkService.removeByIds(Arrays.asList(userLinkId.split(","))); // 先删除
processFbConsultationUserLinkService.saveBatch(userLinkList, size); // 后新增
}
}