fix: 企标制修订流程删除无用引入
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
package com.jero.modules.activiti.process.esRevisionAdvice.common;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/12/19 15:14
|
||||
*/
|
||||
public class RevisionTaskNodeIdConstant {
|
||||
|
||||
/** 主起草人分发 */
|
||||
public static final String MAIN_DRAFT_USER_DISTRIBUTE = "Activity_0v98tow";
|
||||
/** 法规工程师确认是否开启征求意见 */
|
||||
public static final String CONFIRM_ADVISE = "Activity_1siuksf";
|
||||
/** 设计工程师填写意见 */
|
||||
public static final String ADVICE = "Activity_04m430n";
|
||||
/** 法规工程师汇总数据 */
|
||||
public static final String ADVICE_COLLECT = "Activity_1riqzkp";
|
||||
/** 法规工程师派号 */
|
||||
public static final String SET_STANDARD_NUMBER = "Activity_1ralk8e";
|
||||
|
||||
}
|
||||
-28
@@ -9,7 +9,6 @@ import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.esRevisionAdvice.entity.vo.ProcessRevisionVO;
|
||||
import com.jero.modules.activiti.process.esRevisionAdvice.service.EsRevisionService;
|
||||
import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.entity.vo.ProcessSccVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -71,31 +70,4 @@ public class ESRevisionController {
|
||||
}
|
||||
return Result.OK(revisionService.getHandleData(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意
|
||||
*
|
||||
* @param processInfoVO
|
||||
*/
|
||||
@AutoLog(value = "企标制修订流程-同意")
|
||||
@ApiOperation(value="企标制修订流程-同意", notes="企标制修订流程-同意")
|
||||
@PostMapping("/agree")
|
||||
public Result<?> agree(@RequestBody ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
||||
revisionService.approval(processInfoVO, true);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
*
|
||||
* @param processInfoVO
|
||||
*/
|
||||
@AutoLog(value = "企标制修订流程-驳回")
|
||||
@ApiOperation(value="企标制修订流程-驳回", notes="企标制修订流程-驳回")
|
||||
@PostMapping("/reject")
|
||||
public Result<?> reject(@RequestBody ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
||||
revisionService.approval(processInfoVO, false);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+167
-12
@@ -89,16 +89,9 @@ public class ProcessEsRevision implements Serializable {
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
private String releaseDate;
|
||||
|
||||
/**
|
||||
* 实施日期
|
||||
*/
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
private String implementDate;
|
||||
|
||||
/**
|
||||
* 征求意见截止日期
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见截止日期")
|
||||
@@ -122,12 +115,174 @@ public class ProcessEsRevision implements Serializable {
|
||||
private String onEditFile;
|
||||
|
||||
/**
|
||||
* 0无意见 1有意见
|
||||
* 企标编号
|
||||
*/
|
||||
@ApiModelProperty(value = "0无意见 1有意见")
|
||||
@TableField(exist = false)
|
||||
@Dict(dicCode = "yn")
|
||||
private String haveNoOpinion;
|
||||
@ApiModelProperty(value = "企标编号")
|
||||
private String standardNumber;
|
||||
|
||||
/**
|
||||
* 企标名称
|
||||
*/
|
||||
@ApiModelProperty(value = "企标名称")
|
||||
private String standardName;
|
||||
|
||||
/**
|
||||
* 企业标准代号
|
||||
*/
|
||||
@ApiModelProperty(value = "企业标准代号")
|
||||
private String standardCode;
|
||||
|
||||
/**
|
||||
* 企业名称代号
|
||||
*/
|
||||
@ApiModelProperty(value = "企业名称代号")
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 标准类别代号
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类别代号")
|
||||
private String categoryCode;
|
||||
|
||||
/**
|
||||
* 年代号
|
||||
*/
|
||||
@ApiModelProperty(value = "年代号")
|
||||
private String yearNumber;
|
||||
|
||||
/**
|
||||
* 企标英文名称
|
||||
*/
|
||||
@ApiModelProperty(value = "企标英文名称")
|
||||
private String standardEnglishName;
|
||||
|
||||
/**
|
||||
* 实施日期
|
||||
*/
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date implementationDate;
|
||||
|
||||
/**
|
||||
* 是否试行(0代表不试行,1代表试行)
|
||||
*/
|
||||
@ApiModelProperty(value = "是否试行(0代表不试行,1代表试行)")
|
||||
private String tryFlag;
|
||||
|
||||
/**
|
||||
* 试行周期
|
||||
*/
|
||||
@ApiModelProperty(value = "试行周期")
|
||||
private String trialPeriod;
|
||||
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
@Dict(dicCode = "enterprise_standard_state")
|
||||
@ApiModelProperty(value = "标准状态")
|
||||
private String standardState;
|
||||
|
||||
/**
|
||||
* 企标体系
|
||||
*/
|
||||
@ApiModelProperty(value = "企标体系")
|
||||
private String standardSystem;
|
||||
|
||||
/**
|
||||
* 主起草人
|
||||
*/
|
||||
@ApiModelProperty(value = "主起草人")
|
||||
private String mainDraftingUser;
|
||||
|
||||
/**
|
||||
* 主起草单位
|
||||
*/
|
||||
@ApiModelProperty(value = "主起草单位")
|
||||
private String mainDraftingUnit;
|
||||
|
||||
/**
|
||||
* 代替标准号
|
||||
*/
|
||||
@ApiModelProperty(value = "代替标准号")
|
||||
private String substituteStandardNumber;
|
||||
|
||||
/**
|
||||
* 被代替标准号
|
||||
*/
|
||||
@ApiModelProperty(value = "被代替标准号")
|
||||
private String replacedByStandardNumber;
|
||||
|
||||
/**
|
||||
* 引用标准
|
||||
*/
|
||||
@ApiModelProperty(value = "引用标准")
|
||||
private String referenceStandard;
|
||||
|
||||
/**
|
||||
* 被引用标准
|
||||
*/
|
||||
@ApiModelProperty(value = "被引用标准")
|
||||
private String referencedStandard;
|
||||
|
||||
/**
|
||||
* 涉及系统/部件
|
||||
*/
|
||||
@ApiModelProperty(value = "涉及系统/部件")
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 标准适用范围
|
||||
*/
|
||||
@ApiModelProperty(value = "标准适用范围")
|
||||
private String standardScope;
|
||||
|
||||
/**
|
||||
* 关联文件
|
||||
*/
|
||||
@ApiModelProperty(value = "关联文件")
|
||||
private String associatedFile;
|
||||
|
||||
/**
|
||||
* 发布稿(原文)
|
||||
*/
|
||||
@ApiModelProperty(value = "发布稿(原文)")
|
||||
private String publishOfOriginal;
|
||||
|
||||
/**
|
||||
* 征求意见稿
|
||||
*/
|
||||
@ApiModelProperty(value = "征求意见稿")
|
||||
private String draftForComment;
|
||||
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
@ApiModelProperty(value = "顺序号")
|
||||
private String standardNumberTemp;
|
||||
|
||||
/**
|
||||
* 专业领域
|
||||
*/
|
||||
@ApiModelProperty(value = "专业领域")
|
||||
private String professionalField;
|
||||
|
||||
/**
|
||||
* 专业模块
|
||||
*/
|
||||
@ApiModelProperty(value = "专业模块")
|
||||
private String specializedModule;
|
||||
|
||||
/**
|
||||
* 法规工程师
|
||||
*/
|
||||
@ApiModelProperty(value = "法规工程师")
|
||||
private String standardEngineer;
|
||||
|
||||
/**
|
||||
* 设计工程师
|
||||
*/
|
||||
@ApiModelProperty(value = "设计工程师")
|
||||
private String adviceUsers;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
package com.jero.modules.activiti.process.esRevisionAdvice.entity;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/12/19 15:14
|
||||
*/
|
||||
public class RevisionTaskNodeIdConstant {
|
||||
|
||||
/** 主起草人分发 */
|
||||
public static final String MAIN_DRAFT_USER_DISTRIBUTE = "Activity_0v98tow";
|
||||
/** 其他起草人上传企标 */
|
||||
public static final String OTHER_DRAFT_USER_UPLOAD = "Activity_1d2la4l";
|
||||
/** 主起草人汇总 */
|
||||
public static final String MAIN_DRAFT_USER_COLLECT_FIRST = "Activity_1dz3u0m";
|
||||
/** 标准化审批 */
|
||||
public static final String STANDARDIZATION_CHECK = "Activity_0m576ex";
|
||||
/** 评分人评分 */
|
||||
public static final String RATER_RATE = "Activity_1qhpnpa";
|
||||
/** 标准化确认是否开启征求意见 */
|
||||
public static final String CONFIRM_ADVISE = "Activity_1siuksf";
|
||||
/** 部门联络人下发 */
|
||||
public static final String CONTACT_USER_DISTRIBUTE = "Activity_1ns6olf";
|
||||
/** 征求意见对象填写意见 */
|
||||
public static final String ADVICE = "Activity_04m430n";
|
||||
/** 部门联络人汇总数据 */
|
||||
public static final String CONTACT_USER_COLLECT = "Activity_1riqzkp";
|
||||
/** 部所联络人主管级领导审批 */
|
||||
public static final String CONTACT_USER_LEADER_APPROVAL = "Activity_1ralk8e";
|
||||
/** 主起草人汇总 */
|
||||
public static final String MAIN_DRAFT_USER_COLLECT_SECOND = "Activity_1hb9aun";
|
||||
/** 主起草人上传会议纪要 */
|
||||
public static final String MAIN_DRAFT_USER_UPLOAD = "Activity_11uuyg0";
|
||||
/** 其它起草人校对 */
|
||||
public static final String OTHER_DRAFT_USER_CHECK = "Activity_1seways";
|
||||
/** 主管级领导审批 */
|
||||
public static final String LEADER_APPROVAL = "Activity_1l028rz";
|
||||
/** 标准化审批 */
|
||||
public static final String STANDARDIZATION_APPROVAL = "Activity_0uxua0b";
|
||||
/** 相关部门领导会签 */
|
||||
public static final String RELATED_LEADER_APPROVAL = "Activity_05pybsc";
|
||||
/** 总工程师审批 */
|
||||
public static final String CHIEF_ENGINEER_APPROVAL = "Activity_1yr56ac";
|
||||
/** 主起草人发布 */
|
||||
public static final String MAIN_DRAFT_USER_RELEASE = "Activity_0n0h60s";
|
||||
|
||||
}
|
||||
-2
@@ -18,7 +18,5 @@ public interface EsRevisionService extends IService<ProcessEsRevision> {
|
||||
|
||||
void startProcess(ProcessInfoVO<ProcessRevisionVO> processInfoVO);
|
||||
|
||||
void approval(ProcessInfoVO<ProcessRevisionVO> processInfoVO, boolean pass);
|
||||
|
||||
void submit(ProcessInfoVO<ProcessRevisionVO> processInfoVO);
|
||||
}
|
||||
|
||||
+103
-400
@@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.dto.message.SendMessageDTO;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.TranslationAspect;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
||||
import com.jero.modules.activiti.enums.ProcessStatusEnum;
|
||||
import com.jero.modules.activiti.enums.ProcessTypeEnum;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
@@ -27,7 +29,6 @@ import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO;
|
||||
import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||
import com.jero.modules.laws.common.util.CurrentUserUtil;
|
||||
import com.jero.modules.laws.enterprise.entity.ESPProjectStatus;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
|
||||
@@ -46,6 +47,9 @@ import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.jero.modules.activiti.common.ActivitiCommon.MAIN_INSTANCE_ID;
|
||||
import static com.jero.modules.activiti.common.ActivitiCommon.PASS;
|
||||
import static com.jero.modules.activiti.process.esRevisionAdvice.common.RevisionTaskNodeIdConstant.*;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
@@ -103,11 +107,10 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
@Resource
|
||||
private ProcessDraftService prcDraftService;
|
||||
|
||||
@Resource
|
||||
private CurrentUserUtil currentUserUtil;
|
||||
|
||||
@Override
|
||||
public void startProcess(ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
||||
// 第一个节点业务数据处理
|
||||
this.startNodeBusProcess(processInfoVO);
|
||||
// 流程Key
|
||||
String processDefinitionKey = ProcessType.ES_REVISION_ADVICE.getProcessKey();
|
||||
// 流程信息
|
||||
@@ -130,8 +133,6 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
processInfo.setProcessInstanceId(processInstanceId);
|
||||
processInfo.setProcessDefinitionId(processDefinitionId);
|
||||
processInfo.setProcessType(ProcessTypeEnum.ES_REVISION_ADVICE.getValue());
|
||||
// 第一个节点业务数据处理
|
||||
this.startNodeBusProcess(processInfoVO);
|
||||
// 保存选人信息
|
||||
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, userInfoMap);
|
||||
// 获取第一个任务的taskId
|
||||
@@ -171,228 +172,41 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
return new HashMap<>(userInfoMap);
|
||||
}
|
||||
|
||||
private Map<String, Object> getUserMap(Map<String, Object> variables) {
|
||||
// 转成逗号拼接
|
||||
variables.put("otherDraftUserList", Optional.ofNullable((ArrayList<String>) variables.get("otherDraftUserList"))
|
||||
.map(list -> String.join(",", list))
|
||||
.orElse(""));
|
||||
variables.remove("distribute");
|
||||
return variables;
|
||||
}
|
||||
|
||||
public void startRunTask(ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
||||
// 检查企标计划是否已被删除
|
||||
// String espId = revisionData.getData().getEspId();
|
||||
// EnterpriseStandardPlan esp = espService.getById(espId);
|
||||
// if (esp == null) {
|
||||
// throw new JeroBootException(ResultCommon.INVALID_ESP);
|
||||
// }
|
||||
// // 设置状态为运行中
|
||||
// espService.changeProjectStatus(espId, ESPProjectStatus.IN_PROGRESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessInfoVO<ProcessRevisionVO> getHandleData(String taskId) {
|
||||
if (!actFlowCommonService.taskExists(taskId)) {
|
||||
throw new JeroBootException("任务不存在");
|
||||
throw new JeroBootException(ResultCommon.TASK_NOT_EXISTS);
|
||||
}
|
||||
// String userId = actFlowCommonService.getOriginTaskAssignee(taskId);
|
||||
// String executionId = taskService.createTaskQuery().taskId(taskId).singleResult().getExecutionId();
|
||||
// // 根据当前执行Id获取所有子执行Id
|
||||
// List<String> executionIdList = actFlowCommonService.getAllChildExecutionIds(executionId);
|
||||
// executionIdList.add(executionId);
|
||||
// ESRevisionDataVO revisionDataVO = new ESRevisionDataVO();
|
||||
// // 使用流程引擎根据taskId找到流程实例Id
|
||||
// String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
||||
// // 获取流程通用数据
|
||||
// ProcessAll process = processAllService.getByProcessInstanceId(processInstanceId);
|
||||
// CommonVO commonVO = new CommonVO();
|
||||
// commonVO.setPrcName(process.getPrcName());
|
||||
// commonVO.setTaskId(process.getTaskId());
|
||||
// commonVO.setPrcMes(process.getPrcMes());
|
||||
// commonVO.setDueTime(process.getDueTime());
|
||||
// commonVO.setNodeId(process.getNodeId());
|
||||
// revisionDataVO.setCommon(commonVO);
|
||||
// ProcessApprovalRecord record = actFlowCommonService.getNodeIdByTaskId(taskId);
|
||||
// // 获取流程实例数据
|
||||
// LambdaQueryWrapper<ProcessEsRevision> wrapper = new LambdaQueryWrapper<>();
|
||||
// LambdaQueryWrapper<EsRevisionAdvice> advicesWrapper = new LambdaQueryWrapper<>();
|
||||
// advicesWrapper.eq(EsRevisionAdvice::getProcessInstanceId, processInstanceId);
|
||||
// wrapper.eq(ProcessEsRevision::getProcessInstanceId, processInstanceId);
|
||||
// ProcessEsRevision data = getOne(wrapper);
|
||||
// List<EsRevisionAdvice> adviceList = new ArrayList<>();
|
||||
// List<OtherDraftUserVO> otherDraftUserVOS = data.parseOtherDraftUserVOS();
|
||||
// List<InspectContentVO> inspectContentVOS = data.parseInspectContents();
|
||||
// String xmlNodeId = record.getNodeId();
|
||||
// Object passObject = taskService.getVariable(taskId, "pass");
|
||||
// boolean pass = true;
|
||||
// if (passObject != null) {
|
||||
// pass = (boolean) passObject;
|
||||
// }
|
||||
// // 某些节点需要对数据进行特殊处理
|
||||
// switch (xmlNodeId) {
|
||||
// case OTHER_DRAFT_USER_UPLOAD:
|
||||
// otherDraftUserVOS = otherDraftUserVOS.stream()
|
||||
// .filter(o -> o.getTaskId().equals(taskId)).collect(Collectors.toList());
|
||||
// break;
|
||||
// case CONTACT_USER_DISTRIBUTE:
|
||||
// if (pass) {
|
||||
// data.setWorkGroup(null);
|
||||
// data.setAuthDept(null);
|
||||
// data.setReviewUser(null);
|
||||
// }
|
||||
// case CONTACT_USER_COLLECT:
|
||||
// // 根据联络人找到部门联络人主管级领导
|
||||
// LambdaQueryWrapper<LawsContactManage> contactWrapper = new LambdaQueryWrapper<>();
|
||||
// advicesWrapper.eq(EsRevisionAdvice::getExecutionId, executionId);
|
||||
// contactWrapper.eq(LawsContactManage::getContactId, userId);
|
||||
// List<LawsContactManage> list = contactManageService.list(contactWrapper);
|
||||
// if (list != null && list.size() == 1) {
|
||||
// data.setContactUserLeader(list.get(0).getLeaderId());
|
||||
// }
|
||||
// case CONTACT_USER_LEADER_APPROVAL:
|
||||
// advicesWrapper.eq(EsRevisionAdvice::getExecutionId, executionId);
|
||||
// adviceList = adviceService.list(advicesWrapper);
|
||||
// break;
|
||||
// case MAIN_DRAFT_USER_COLLECT_SECOND:
|
||||
// adviceList = adviceService.list(advicesWrapper);
|
||||
// break;
|
||||
// }
|
||||
// data.setAdvices(adviceList);
|
||||
// data.setOtherDraftUserVOS(otherDraftUserVOS);
|
||||
// data.setInspectContents(inspectContentVOS);
|
||||
// revisionDataVO.setData(data);
|
||||
// return revisionDataVO;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approval(ProcessInfoVO<ProcessRevisionVO> processInfoVO, boolean pass) {
|
||||
// CommonVO commonVO = revisionData.getCommon();
|
||||
// String taskId = commonVO.getTaskId();
|
||||
// 获取task
|
||||
// if (StrUtil.isBlank(taskId) || !actFlowCommonService.taskExists(taskId)) {
|
||||
// throw new JeroBootException("taskId为空或任务不存在");
|
||||
// }
|
||||
// String userId = actFlowCommonService.getOriginTaskAssignee(taskId);
|
||||
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
// // 获取执行id
|
||||
// String executionId = task.getExecutionId();
|
||||
// // 获取当前节点的id
|
||||
// ProcessApprovalRecord record = actFlowCommonService.getNodeIdByTaskId(taskId);
|
||||
// String xmlNodeId = record.getNodeId();
|
||||
// String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
||||
// LambdaQueryWrapper<ProcessEsRevision> wrapper = new LambdaQueryWrapper<>();
|
||||
// LambdaUpdateWrapper<ProcessEsRevision> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
// LambdaUpdateWrapper<EsRevisionAdvice> adviceWrapper = new LambdaUpdateWrapper<>();
|
||||
// wrapper.eq(ProcessEsRevision::getProcessInstanceId, processInstanceId);
|
||||
// wrapper.eq(ProcessEsRevision::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
// adviceWrapper.eq(EsRevisionAdvice::getProcessInstanceId, processInstanceId);
|
||||
// ProcessEsRevision dataDb = getOne(wrapper);
|
||||
// updateWrapper.eq(ProcessEsRevision::getProcessInstanceId, processInstanceId);
|
||||
// updateWrapper.eq(ProcessEsRevision::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
// // 获取当前流程
|
||||
// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
// String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
// Map<String, Object> userMap = new HashMap<>();
|
||||
// List<EsRevisionAdvice> advices;
|
||||
// ProcessEsRevision data;
|
||||
// Map<String, Object> flowUser;
|
||||
// 更新审批表为完成,填充数据
|
||||
// actFlowCommonService.updateApprovalInfo(commonVO, taskId, pass);
|
||||
// String curUserId;
|
||||
// switch (xmlNodeId) {
|
||||
// case MAIN_DRAFT_USER_DISTRIBUTE:
|
||||
// // 判断是否分发 设置流程变量
|
||||
// data = revisionData.getData();
|
||||
// flowUser = revisionData.getFlowUser();
|
||||
// List<OtherDraftUserVO> otherDraftUserVOS = data.getOtherDraftUserVOS();
|
||||
// if (otherDraftUserVOS == null || otherDraftUserVOS.isEmpty()) {
|
||||
// taskService.setVariable(taskId, "distribute", false);
|
||||
// } else {
|
||||
// taskService.setVariable(taskId, "distribute", true);
|
||||
// taskService.setVariable(taskId, "otherDraftUserList", otherDraftUserVOS.stream().map(OtherDraftUserVO::getUser)
|
||||
// .collect(Collectors.toList()));
|
||||
// otherDraftUserVOS.forEach(o -> o.setFinishFlag(YesOrNoEnum.NO.getValue()));
|
||||
// data.setProofreader(otherDraftUserVOS.stream()
|
||||
// .map(OtherDraftUserVO::getUser)
|
||||
// .distinct()
|
||||
// .collect(Collectors.joining(",")));
|
||||
// data.setOtherDraftUserVOS(otherDraftUserVOS);
|
||||
// data.setOtherDrafterUploadFileJson(otherDraftUserVOS);
|
||||
// }
|
||||
// saveOrUpdate(data);
|
||||
// String standardizationUser = (String) flowUser.get("standardizationUser");
|
||||
// taskService.setVariable(taskId, "standardizationUser", standardizationUser);
|
||||
// // 保存人员信息
|
||||
// Map<String, Object> actVariables = this.setVariables(revisionData);
|
||||
// processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, this.getUserMap(actVariables));
|
||||
// // 替换草稿数据
|
||||
// this.replaceAutoStartDraft(revisionData, processInstanceId);
|
||||
// break;
|
||||
// case OTHER_DRAFT_USER_UPLOAD:
|
||||
// List<OtherDraftUserVO> otherDraftUserVODbList = dataDb.parseOtherDraftUserVOS();
|
||||
// data = revisionData.getData();
|
||||
// List<OtherDraftUserVO> otherDraftUserVOList = data.getOtherDraftUserVOS();
|
||||
// otherDraftUserVODbList.forEach(o -> {
|
||||
// if (o.getTaskId().equals(taskId)) {
|
||||
// o.setFileId(otherDraftUserVOList.get(0).getFileId());
|
||||
// }
|
||||
// });
|
||||
// dataDb.setOtherDrafterUploadFileJson(otherDraftUserVODbList);
|
||||
// saveOrUpdate(dataDb);
|
||||
// break;
|
||||
// case MAIN_DRAFT_USER_COLLECT_FIRST:
|
||||
// // 判断是否需要稽查 设置流程变量 保存稽查列表
|
||||
// data = revisionData.getData();
|
||||
// boolean inspectFlag = !data.getInspectFlag().equals(YesOrNoEnum.NO.getValue());
|
||||
// if (inspectFlag) {
|
||||
// List<InspectContentVO> inspectContents = data.getInspectContents();
|
||||
// data.setInspectContentJson(inspectContents);
|
||||
// }
|
||||
// // 保存流程数据
|
||||
// saveOrUpdate(data);
|
||||
// break;
|
||||
// case STANDARDIZATION_CHECK:
|
||||
// // 判断是否可以评审
|
||||
// if (pass) {
|
||||
// data = revisionData.getData();
|
||||
// List<String> raterList = Arrays.asList(data.getRaters().split(","));
|
||||
// taskService.setVariable(taskId, "raterList", raterList);
|
||||
// // 保存流程数据
|
||||
// saveOrUpdate(data);
|
||||
// userMap.put("raterList", data.getRaters());
|
||||
// processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, userMap);
|
||||
// }
|
||||
// break;
|
||||
// case RATER_RATE:
|
||||
// // 保存打分记录
|
||||
// data = revisionData.getData();
|
||||
// List<ReviewMeetingDetailVO> reviewMeetingDetails = data.getReviewMeetingDetails();
|
||||
// // 设置当前评分人
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// String finalCurUserId = curUserId;
|
||||
// reviewMeetingDetails.forEach(reviewMeetingDetail -> reviewMeetingDetail.setAdjudicatorId(finalCurUserId));
|
||||
// ProcessEsRevision revisionDb = getById(dataDb.getId());
|
||||
// List<ReviewMeetingDetailVO> reviewMeetingDetailsDb = revisionDb.parseReviewMeetingDetails();
|
||||
// if (reviewMeetingDetailsDb == null) {
|
||||
// reviewMeetingDetailsDb = new ArrayList<>();
|
||||
// }
|
||||
// reviewMeetingDetailsDb.addAll(reviewMeetingDetails);
|
||||
// revisionDb.setReviewMeetingDetailJson(reviewMeetingDetailsDb);
|
||||
// saveOrUpdate(revisionDb);
|
||||
// break;
|
||||
// case CONFIRM_ADVISE:
|
||||
// // 判断是否开启征求意见子流程 设置流程变量
|
||||
// data = revisionData.getData();
|
||||
// boolean adviceFlag = !data.getAdviceFlag().equals("0");
|
||||
ProcessInfoVO<ProcessRevisionVO> result = new ProcessInfoVO<>();
|
||||
ProcessRevisionVO processVo = new ProcessRevisionVO();
|
||||
// 使用流程引擎根据taskId找到流程实例Id
|
||||
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
||||
result.setBasicProcessInfoDTO(actFlowCommonService.getProcessInfo(processInstanceId));
|
||||
// 获取流程通用数据
|
||||
ProcessApprovalRecord record = actFlowCommonService.getNodeIdByTaskId(taskId);
|
||||
// 获取当前流程数据
|
||||
LambdaQueryWrapper<ProcessEsRevision> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProcessEsRevision::getProcessInstanceId, processInstanceId);
|
||||
ProcessEsRevision data = getOne(queryWrapper);
|
||||
LambdaQueryWrapper<EsRevisionAdvice> detailQueryWrapper = new LambdaQueryWrapper<>();
|
||||
List<EsRevisionAdvice> adviceList = null;
|
||||
if (Objects.nonNull(data)) {
|
||||
detailQueryWrapper.eq(EsRevisionAdvice::getProcessInstanceId, processInstanceId);
|
||||
adviceList = adviceService.list(detailQueryWrapper);
|
||||
}
|
||||
// 获取当前流程
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
String xmlNodeId = record.getNodeId();
|
||||
// 设置流程信息
|
||||
switch (xmlNodeId) {
|
||||
case CONFIRM_ADVISE:
|
||||
// 判断是否开启征求意见子流程 设置流程变量
|
||||
// boolean adviceFlag = !data.getAdviceFlag().equals(YesOrNoEnum.NO.getValue());
|
||||
// if (adviceFlag) {
|
||||
// // 保存征求意见截止时间
|
||||
// saveOrUpdate(data);
|
||||
// List<String> contactUserList = Arrays.asList(data.getContactUser().split(","));
|
||||
// taskService.setVariable(taskId, "contactUserList", contactUserList);
|
||||
// List<String> adviceUserList = Arrays.asList(data.getAdviceUsers().split(","));
|
||||
// taskService.setVariable(taskId, "adviceUserList", adviceUserList);
|
||||
// taskService.setVariable(taskId, "open", true);
|
||||
// String mainDraftUser = (String) taskService.getVariable(taskId, "mainDraftUser");
|
||||
// // 保存流程数据
|
||||
// saveOrUpdate(data);
|
||||
// userMap.put("mainDraftCollectUser", mainDraftUser);
|
||||
@@ -401,189 +215,78 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
// } else {
|
||||
// taskService.setVariable(taskId, "open", false);
|
||||
// }
|
||||
// break;
|
||||
// case CONTACT_USER_DISTRIBUTE:
|
||||
// data = revisionData.getData();
|
||||
// Date totalAdviceDeadline = data.getTotalAdviceDeadline();
|
||||
// Date adviceDeadline = data.getAdviceDeadline();
|
||||
// // 征求意见截至日期不能晚于总截止时间
|
||||
// if (totalAdviceDeadline != null) {
|
||||
// if (adviceDeadline.getTime() > totalAdviceDeadline.getTime()) {
|
||||
// log.error("总截止时间:{} 当前提交征求意见截止时间{}", totalAdviceDeadline, adviceDeadline);
|
||||
// throw new JeroBootException("各部门联络人设置的截止时间不能晚于标准化设置的征求意见截止时间!");
|
||||
// }
|
||||
// }
|
||||
// String workGroup = data.getWorkGroup();
|
||||
// List<String> adviceUserList = Arrays.asList(workGroup.split(","));
|
||||
// // 如果人员超过600则提示
|
||||
// if (adviceUserList.size() > 600) {
|
||||
// log.error("当前提交人员超过600人");
|
||||
// throw new JeroBootException("当前提交人员超过600人,请重新选择!");
|
||||
// }
|
||||
// runtimeService.setVariableLocal(executionId, "adviceUserList", adviceUserList);
|
||||
// runtimeService.setVariable(executionId, executionId + "-adviceDeadline", adviceDeadline);
|
||||
// runtimeService.setVariable(executionId, "contactExecutionId", executionId);
|
||||
// userMap.put("adviceUserList", workGroup);
|
||||
// processNodeLinkService.incrementSaveNodeUserLink(processDefinitionId, processInstanceId, userMap);
|
||||
// // 设置截止时间
|
||||
// saveOrUpdate(data);
|
||||
// break;
|
||||
// case ADVICE:
|
||||
// data = revisionData.getData();
|
||||
// String haveNoOpinion = data.getHaveNoOpinion();
|
||||
// advices = data.getAdvices();
|
||||
// if (YesOrNoEnum.NO.getValue().equals(data.getHaveNoOpinion())) {
|
||||
// EsRevisionAdvice advice = new EsRevisionAdvice();
|
||||
// advice.setClauseName("无");
|
||||
// advice.setClauseNum("无");
|
||||
// advice.setEditAdvice("无");
|
||||
// advices = new ArrayList<>(Collections.singletonList(advice));
|
||||
// }
|
||||
// String contactUserExecutionId = (String) runtimeService.getVariable(executionId, executionId + "-ContactExecutionId");
|
||||
// advices.forEach(advice -> {
|
||||
// advice.setCreateUserId(userId);
|
||||
// advice.setProcessInstanceId(processInstanceId);
|
||||
// advice.setExecutionId(contactUserExecutionId);
|
||||
// advice.setHaveNoOpinion(haveNoOpinion);
|
||||
// });
|
||||
// adviceService.saveBatch(advices);
|
||||
// break;
|
||||
// case CONTACT_USER_COLLECT:
|
||||
// data = revisionData.getData();
|
||||
// // 先删后增
|
||||
// String contactUserLeader = data.getContactUserLeader();
|
||||
// runtimeService.setVariable(executionId, "contactUserLeader", contactUserLeader);
|
||||
// runtimeService.setVariable(executionId, executionId + "-ContactUserLeader", contactUserLeader);
|
||||
// userMap.put("contactUserLeader", data.getContactUserLeader());
|
||||
// advices = data.getAdvices();
|
||||
// adviceWrapper.eq(EsRevisionAdvice::getExecutionId, executionId);
|
||||
// adviceService.remove(adviceWrapper);
|
||||
// advices.forEach(advice -> {
|
||||
// advice.setProcessInstanceId(processInstanceId);
|
||||
// advice.setExecutionId(executionId);
|
||||
// if (StrUtil.isBlank(advice.getCreateUserId())) {
|
||||
// advice.setCreateUserId(UserUtils.getUserId());
|
||||
// }
|
||||
// });
|
||||
// adviceService.saveBatch(advices);
|
||||
// processNodeLinkService.incrementSaveNodeUserLink(processDefinitionId, processInstanceId, userMap);
|
||||
// break;
|
||||
// case CONTACT_USER_LEADER_APPROVAL:
|
||||
// // 保存流程数据
|
||||
// if (pass) {
|
||||
// data = revisionData.getData();
|
||||
// // 保存征求意见记录 先删后增
|
||||
// adviceService.remove(new LambdaQueryWrapper<EsRevisionAdvice>()
|
||||
// .eq(EsRevisionAdvice::getProcessInstanceId, processInstanceId)
|
||||
// .eq(EsRevisionAdvice::getExecutionId, executionId));
|
||||
// advices = data.getAdvices();
|
||||
// adviceWrapper.eq(EsRevisionAdvice::getExecutionId, executionId);
|
||||
// adviceService.remove(adviceWrapper);
|
||||
// advices.forEach(advice -> advice.setProcessInstanceId(processInstanceId));
|
||||
// advices.forEach(advice -> advice.setExecutionId(executionId));
|
||||
// advices.forEach(advice -> {
|
||||
// if (StrUtil.isBlank(advice.getCreateUserId())) {
|
||||
// advice.setCreateUserId(UserUtils.getUserId());
|
||||
// }
|
||||
// });
|
||||
// adviceService.saveBatch(advices);
|
||||
// }
|
||||
// break;
|
||||
// case MAIN_DRAFT_USER_COLLECT_SECOND:
|
||||
// // 保存流程数据
|
||||
// data = revisionData.getData();
|
||||
// // 更改保存征求意见记录
|
||||
// advices = data.getAdvices();
|
||||
// // 如果没有创建人的记录说明是主起草人新增的 需要设置创建人
|
||||
// advices.forEach(advice -> {
|
||||
// if (StrUtil.isBlank(advice.getCreateUserId())) {
|
||||
// advice.setCreateUserId(UserUtils.getUserId());
|
||||
// }
|
||||
// });
|
||||
// adviceService.saveOrUpdateBatch(advices);
|
||||
// if (StrUtil.isNotBlank(data.getId())) {
|
||||
// updateById(data);
|
||||
// }
|
||||
// // 给所有意见提出人发送意见反馈消息
|
||||
// this.sendMessageToAdviceUser(data, processInstanceId);
|
||||
// break;
|
||||
// case MAIN_DRAFT_USER_UPLOAD:
|
||||
// // 设置后续节点的办理人
|
||||
// data = revisionData.getData();
|
||||
// List<String> proofreaderList = Arrays.asList(data.getProofreader().split(","));
|
||||
// List<String> approvalUserList = Arrays.asList(data.getApprovalUser().split(","));
|
||||
// String approvalUserStandard = data.getApprovalUserStandard();
|
||||
// List<String> relatedLeaderList = Arrays.asList(data.getRelatedLeader().split(","));
|
||||
// String chiefEngineer = data.getChiefEngineer();
|
||||
// flowUser = new HashMap<>();
|
||||
// flowUser.put("otherDraftCheckUserList", proofreaderList);
|
||||
// flowUser.put("mainDraftUserLeaderList", approvalUserList);
|
||||
// flowUser.put("standardizationUser", approvalUserStandard);
|
||||
// flowUser.put("relatedDeptLeaderList", relatedLeaderList);
|
||||
// flowUser.put("chiefEngineer", chiefEngineer);
|
||||
// taskService.setVariables(taskId, flowUser);
|
||||
// userMap.put("otherDraftCheckUserList", data.getProofreader());
|
||||
// userMap.put("mainDraftUserLeaderList", data.getApprovalUser());
|
||||
// userMap.put("standardizationUserFinal", approvalUserStandard);
|
||||
// userMap.put("relatedDeptLeaderList", data.getRelatedLeader());
|
||||
// userMap.put("chiefEngineer", chiefEngineer);
|
||||
// saveOrUpdate(data);
|
||||
// processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, userMap);
|
||||
// break;
|
||||
// case MAIN_DRAFT_USER_RELEASE:
|
||||
// data = revisionData.getData();
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// data.setMainDraftUser(curUserId);
|
||||
// saveOrUpdate(data);
|
||||
// // 给授权部门的所有人员发送消息
|
||||
// this.sendMessageToAuthDeptUser(processInstanceId);
|
||||
// break;
|
||||
// }
|
||||
// // 转办修改流程变量逻辑
|
||||
// switch (xmlNodeId) {
|
||||
// case MAIN_DRAFT_USER_COLLECT_FIRST:
|
||||
// case MAIN_DRAFT_USER_COLLECT_SECOND:
|
||||
// case MAIN_DRAFT_USER_UPLOAD:
|
||||
// // 获取当前节点的id
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// taskService.setVariable(taskId, "mainDraftUser", curUserId);
|
||||
// break;
|
||||
// case STANDARDIZATION_CHECK:
|
||||
// case CONFIRM_ADVISE:
|
||||
// // 获取当前节点的id
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// taskService.setVariable(taskId, "standardizationUser", curUserId);
|
||||
// break;
|
||||
// case CONTACT_USER_DISTRIBUTE:
|
||||
// case CONTACT_USER_COLLECT:
|
||||
// // 获取当前节点的id
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// runtimeService.setVariable(executionId, "contactUser", curUserId);
|
||||
// runtimeService.setVariable(executionId, curUserId + "-ExecutionId", executionId);
|
||||
// break;
|
||||
// case CONTACT_USER_LEADER_APPROVAL:
|
||||
// // 获取当前节点的id
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// runtimeService.setVariable(executionId, "contactUserLeader", curUserId);
|
||||
// runtimeService.setVariable(executionId, executionId + "-ContactUserLeader", curUserId);
|
||||
// break;
|
||||
// case LEADER_APPROVAL:
|
||||
// // 根据流程实例Id修改审批人字段
|
||||
// // 获取当前节点的id
|
||||
// curUserId = UserUtils.getUserId();
|
||||
// runtimeService.setVariable(executionId, "contactUserLeader", curUserId);
|
||||
// }
|
||||
// runtimeService.setVariable(processInstanceId, "pass", pass);
|
||||
// // 审批节点
|
||||
// actFlowCommonService.completeTask(taskId, userId);
|
||||
// if (xmlNodeId.equals(MAIN_DRAFT_USER_DISTRIBUTE)) {
|
||||
// this.processOtherDraftUploadTask(processInstanceId);
|
||||
// }
|
||||
break;
|
||||
case ADVICE:
|
||||
|
||||
case ADVICE_COLLECT:
|
||||
|
||||
case SET_STANDARD_NUMBER:
|
||||
|
||||
}
|
||||
// 设置流程变量等相关信息
|
||||
processVo.setProcessInfo(data);
|
||||
result.setBusinessInfoDTO(processVo);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submit(ProcessInfoVO<ProcessRevisionVO> processInfoVO) {
|
||||
BasicTaskInfoDTO processTask = processInfoVO.getBasicTaskInfoDTO();
|
||||
String taskId = processTask.getTaskId();
|
||||
// 校验是否有权限操作此待办
|
||||
processHandleService.validTask(taskId);
|
||||
// 获取当前节点的id
|
||||
ProcessApprovalRecord record = actFlowCommonService.getNodeIdByTaskId(taskId);
|
||||
String xmlNodeId = record.getNodeId();
|
||||
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
||||
BasicProcessInfoDTO processInfo = new BasicProcessInfoDTO();
|
||||
// 使用流程引擎根据taskId找到流程实例Id
|
||||
String mainInstanceId = (String) taskService.getVariable(taskId, MAIN_INSTANCE_ID);
|
||||
processInfo.setProcessInstanceId(mainInstanceId);
|
||||
processInfoVO.setBasicProcessInfoDTO(processInfo);
|
||||
// 更新审批表为完成,填充数据
|
||||
actFlowCommonService.updateApprovalInfo(processTask, taskId);
|
||||
String curUserId = UserUtils.getUserId();
|
||||
ProcessRevisionVO businessInfoDTO = processInfoVO.getBusinessInfoDTO();
|
||||
ProcessEsRevision data = businessInfoDTO.getProcessInfo();
|
||||
List<EsRevisionAdvice> adviceList = businessInfoDTO.getAdviceList();
|
||||
// 根据流程实例Id获取流程定义ID
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
// 获取流程实例ID
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
Map<String, Object> userMap = new HashMap<>();
|
||||
switch (xmlNodeId) {
|
||||
case CONFIRM_ADVISE:
|
||||
// 判断是否开启征求意见子流程 设置流程变量
|
||||
boolean adviceFlag = !data.getAdviceFlag().equals(YesOrNoEnum.NO.getValue());
|
||||
if (adviceFlag) {
|
||||
List<String> adviceUserList = Arrays.asList(data.getAdviceUsers().split(","));
|
||||
taskService.setVariable(taskId, "adviceUserList", adviceUserList);
|
||||
taskService.setVariable(taskId, "open", true);
|
||||
// 保存流程数据
|
||||
saveOrUpdate(data);
|
||||
// userMap.put("mainDraftCollectUser", mainDraftUser);
|
||||
// userMap.put("contactUser", data.getContactUser());
|
||||
processNodeLinkService.incrementSaveNodeUserLink(processDefinitionId, processInstanceId, userMap);
|
||||
} else {
|
||||
taskService.setVariable(taskId, "open", false);
|
||||
}
|
||||
break;
|
||||
case ADVICE:
|
||||
|
||||
case ADVICE_COLLECT:
|
||||
|
||||
case SET_STANDARD_NUMBER:
|
||||
}
|
||||
runtimeService.setVariable(processInstanceId, PASS, true);
|
||||
// 审批节点
|
||||
actFlowCommonService.completeTask(taskId, curUserId);
|
||||
// 更新审批表为完成,填充数据
|
||||
actFlowCommonService.updateApprovalInfo(processTask, taskId);
|
||||
// 删除草稿
|
||||
actFlowCommonService.removeDraft(curUserId, taskId, processInstanceId);
|
||||
// 保存快照
|
||||
processHandleService.saveToSnapshot(processInfoVO, curUserId);
|
||||
}
|
||||
|
||||
private void sendMessageToMainDraftUser(ProcessEsRevision revision, String processInstanceId) {
|
||||
|
||||
+1
-1
@@ -995,7 +995,7 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
@Override
|
||||
public ProcessInfoVO<ProcessSccVO> getHandleData(String taskId) {
|
||||
if (!actFlowCommonService.taskExists(taskId)) {
|
||||
throw new JeroBootException("任务不存在");
|
||||
throw new JeroBootException(ResultCommon.TASK_NOT_EXISTS);
|
||||
}
|
||||
ProcessInfoVO<ProcessSccVO> result = new ProcessInfoVO<>();
|
||||
ProcessSccVO processSccVO = new ProcessSccVO();
|
||||
|
||||
Reference in New Issue
Block a user