fix: 制修订流程其他起草人上传节点

This commit is contained in:
2024-08-16 15:24:30 +08:00
parent d1c570f989
commit abaf6bb5d8
2 changed files with 38 additions and 26 deletions
+2 -2
View File
@@ -210,6 +210,6 @@ ALTER TABLE `laws_overseas_standard`
INSERT INTO `laws_tag` (`id`, `table_name`, `db_field_name`, `db_field_en_name`, `db_field_txt`, `order_num`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_show_form_create`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`, `show_area`, `is_show_laws_list`, `is_show_search`, `del_flag`, `is_model`, `dict_id`, `home_search_context_order`, `home_search_file_order`, `dict_field_search`, `dict_table_search`, `dict_text_search`, `usable_range`, `tree_first_href`) VALUES ('1722802933703528452', 'laws_overseas_standard', 'associated_domestic_standards', 'Associated domestic standards', '关联国内标准', 28, 'associated_domestic_standards', 0, 1, 'String', 1, NULL, NULL, NULL, NULL, NULL, '6', NULL, NULL, NULL, '0', NULL, NULL, 1, 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, '2023-11-10 10:26:42', 'zx-test', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '1694630711725498369', NULL, 1, 0, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-- 2024-08-16 回答模板
INSERT INTO sys_sms_template (id, template_code, template_name, template_content, template_type, create_by, create_time) VALUES ('1824272435207028738', 'laws_problem_library_answer', '【问答库】新回答', '您好,在 ${standardNumber} ${standardName} 的 ${title} 中有新回答,请前往标准法规管理系统或研发大前台标准法规管理模块问答库进行查看。', '5,4,6', 'admin', '2024-08-16 10:30:16')
INSERT INTO sys_sms_template (id, template_code, template_name, template_content, template_type, create_by, create_time) VALUES ('1824275060971274242', 'laws_problem_library_answer_top', '【问答库】有新的回答被置顶', '您好,在 ${standardNumber} ${standardName} 的 ${title} 中,有新的回答已被置顶,请前往标准法规管理系统或研发大前台标准法规管理模块问答库进行查看。', '4,5,6', 'admin', '2024-08-16 10:40:42')
INSERT INTO sys_sms_template (id, template_code, template_name, template_content, template_type, create_by, create_time) VALUES ('1824272435207028738', 'laws_problem_library_answer', '【问答库】新回答', '您好,在 ${standardNumber} ${standardName} 的 ${title} 中有新回答,请前往标准法规管理系统或研发大前台标准法规管理模块问答库进行查看。', '5,4,6', 'admin', '2024-08-16 10:30:16');
INSERT INTO sys_sms_template (id, template_code, template_name, template_content, template_type, create_by, create_time) VALUES ('1824275060971274242', 'laws_problem_library_answer_top', '【问答库】有新的回答被置顶', '您好,在 ${standardNumber} ${standardName} 的 ${title} 中,有新的回答已被置顶,请前往标准法规管理系统或研发大前台标准法规管理模块问答库进行查看。', '4,5,6', 'admin', '2024-08-16 10:40:42');
@@ -180,6 +180,8 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
actFlowCommonService.updateApprovalInfo(commonVO, taskId, true);
// 自动完成第一个任务
actFlowCommonService.completeTask(taskId, userId);
// 处理其他起草人上传节点
this.processOtherDraftUploadTask(processInstanceId);
}
private Map<String, Object> setVariables(ESRevisionDataVO revisionData) {
@@ -337,30 +339,8 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
// 某些节点需要对数据进行特殊处理
switch (xmlNodeId) {
case OTHER_DRAFT_USER_UPLOAD:
boolean findFlag = false;
otherDraftUserVOS.forEach(o -> o.setOperateType(null));
for (OtherDraftUserVO o : otherDraftUserVOS) {
if (findFlag) {
o.setOperateType(OperateTypeEnum.CANNOT_OPERATE.getValue());
continue;
}
if (o.getUser().equals(userId)) {
if (StrUtil.isBlank(o.getTaskId())) {
o.setOperateType(OperateTypeEnum.UPLOAD.getValue());
o.setTaskId(taskId);
findFlag = true;
} else {
if (!taskId.equals(o.getTaskId())) {
o.setOperateType(OperateTypeEnum.CANNOT_OPERATE.getValue());
}
}
} else {
o.setOperateType(OperateTypeEnum.CANNOT_OPERATE.getValue());
}
}
data.setOtherDraftUserVOS(otherDraftUserVOS);
data.setOtherDrafterUploadFileJson(otherDraftUserVOS);
updateById(data);
otherDraftUserVOS = otherDraftUserVOS.stream()
.filter(o -> o.getTaskId().equals(taskId)).collect(Collectors.toList());
break;
case CONTACT_USER_DISTRIBUTE:
if (pass) {
@@ -680,6 +660,38 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
runtimeService.setVariable(processInstanceId, "pass", pass);
// 审批节点
actFlowCommonService.completeTask(taskId, userId);
if (xmlNodeId.equals(MAIN_DRAFT_USER_DISTRIBUTE)) {
this.processOtherDraftUploadTask(processInstanceId);
}
}
private void processOtherDraftUploadTask(String prcId) {
LambdaQueryWrapper<ProcessEsRevision> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ProcessEsRevision::getProcessInstanceId, prcId);
ProcessEsRevision data = getOne(queryWrapper);
// 判断是否分发 设置流程变量
List<OtherDraftUserVO> otherDraftUserVOS = data.parseOtherDraftUserVOS();
if (otherDraftUserVOS == null || otherDraftUserVOS.isEmpty()) {
return;
}
// 获取所有分发节点
LambdaQueryWrapper<ProcessApprovalRecord> parWrapper = new LambdaQueryWrapper<>();
parWrapper.eq(ProcessApprovalRecord::getProcessInstanceId, prcId);
parWrapper.eq(ProcessApprovalRecord::getNodeId, OTHER_DRAFT_USER_UPLOAD);
List<ProcessApprovalRecord> processApprovalRecords = parService.list(parWrapper);
Map<String, List<ProcessApprovalRecord>> map =
processApprovalRecords.stream().collect(Collectors.groupingBy(ProcessApprovalRecord::getUserId));
otherDraftUserVOS.forEach(o -> {
List<ProcessApprovalRecord> list = map.get(o.getUser());
if (list != null && !list.isEmpty()) {
o.setTaskId(list.get(0).getTaskId());
list.remove(0);
}
map.put(o.getUser(), list);
});
data.setOtherDraftUserVOS(otherDraftUserVOS);
data.setOtherDrafterUploadFileJson(otherDraftUserVOS);
updateById(data);
}
private void replaceAutoStartDraft(ESRevisionDataVO revisionData, String processInstanceId) {