Commit e5f1d1ed by 王志超

feat: 子单变更节点同步主单

parent 91e55714
Pipeline #86912 passed with stages
in 1 minute 25 seconds
...@@ -738,7 +738,7 @@ public class ChangeFlowBiz { ...@@ -738,7 +738,7 @@ public class ChangeFlowBiz {
log.info("[NEW_CHANGE_FLOW_ADMIN_APPROVE] 重要变更,需要质量部负责人审批"); log.info("[NEW_CHANGE_FLOW_ADMIN_APPROVE] 重要变更,需要质量部负责人审批");
} else { } else {
// 一般变更:跳过质量部负责人审批,下一个审批人为变更负责人 // 一般变更:跳过质量部负责人审批,下一个审批人为变更负责人
adminApproveParamMap.put("type", FlowTransitionType.TYPE_SKIP_QUALITY_APPROVE); adminApproveParamMap.put("type", FlowTransitionType.TYPE_SKIP);
nextApproverForAdmin = changeRecord.getChangeCommander(); nextApproverForAdmin = changeRecord.getChangeCommander();
nextStatusForAdmin = ChangeStatusEnum.WAIT_EXEC_CHANGE_PLAN; nextStatusForAdmin = ChangeStatusEnum.WAIT_EXEC_CHANGE_PLAN;
log.info("[NEW_CHANGE_FLOW_ADMIN_APPROVE] 一般变更,跳过质量部负责人审批,下一个审批人为变更负责人:{}", nextApproverForAdmin); log.info("[NEW_CHANGE_FLOW_ADMIN_APPROVE] 一般变更,跳过质量部负责人审批,下一个审批人为变更负责人:{}", nextApproverForAdmin);
...@@ -859,7 +859,7 @@ public class ChangeFlowBiz { ...@@ -859,7 +859,7 @@ public class ChangeFlowBiz {
// 工单流转:使用 paramMap 方式,type=2 表示回退 // 工单流转:使用 paramMap 方式,type=2 表示回退
Map<String, Object> content = buildFlowContent(FlowOperationTypeEnum.REFUSE); Map<String, Object> content = buildFlowContent(FlowOperationTypeEnum.REFUSE);
Map<String, Object> cancelParamMap = new HashMap<>(); Map<String, Object> cancelParamMap = new HashMap<>();
cancelParamMap.put("type", FlowTransitionType.TYPE_REJECTED); cancelParamMap.put("type", FlowTransitionType.TYPE_CANCEL);
String nextNodeId = flowService.submitFlowWithParamMap(String.valueOf(flowId), flowDataDTO, uid, String nextNodeId = flowService.submitFlowWithParamMap(String.valueOf(flowId), flowDataDTO, uid,
ChangeFlowEnum.NEW_CHANGE_FLOW.getTopoId(), JSON.toJSONString(content), cancelParamMap, ChangeFlowEnum.NEW_CHANGE_FLOW.getTopoId(), JSON.toJSONString(content), cancelParamMap,
FlowxOperationEnum.CANCEL.getName(), "取消变更", changeRecord.getCreateTime()); FlowxOperationEnum.CANCEL.getName(), "取消变更", changeRecord.getCreateTime());
...@@ -1831,7 +1831,7 @@ public class ChangeFlowBiz { ...@@ -1831,7 +1831,7 @@ public class ChangeFlowBiz {
} }
Map<String, Object> rejectParamMap = new HashMap<>(); Map<String, Object> rejectParamMap = new HashMap<>();
rejectParamMap.put("type", FlowTransitionType.TYPE_BACK_TO_CONFIRM_PLAN); rejectParamMap.put("type", FlowTransitionType.TYPE_BACK);
nextNodeId = flowService.submitFlowWithParamMap(flowId.toString(), flowDataDTO, uid, nextNodeId = flowService.submitFlowWithParamMap(flowId.toString(), flowDataDTO, uid,
ChangeFlowEnum.NEW_CHANGE_FLOW.getTopoId(), JSON.toJSONString(content), rejectParamMap, ChangeFlowEnum.NEW_CHANGE_FLOW.getTopoId(), JSON.toJSONString(content), rejectParamMap,
...@@ -2029,9 +2029,9 @@ public class ChangeFlowBiz { ...@@ -2029,9 +2029,9 @@ public class ChangeFlowBiz {
String currentUid = RequestLocalBean.getUid(); String currentUid = RequestLocalBean.getUid();
Map<String, Object> subFlowContent = buildFlowContent(currentUid); Map<String, Object> subFlowContent = buildFlowContent(currentUid);
// 使用 paramMap 流转子单工单(type=2 回到初始节点) // 使用 paramMap 流转子单工单(type=3 回退到初始节点)
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("type", FlowTransitionType.TYPE_REJECTED); paramMap.put("type", FlowTransitionType.TYPE_BACK);
String operateDesc = String.format("变更工单,%s审批不通过,驳回行动工单", rejectNodeName); String operateDesc = String.format("变更工单,%s审批不通过,驳回行动工单", rejectNodeName);
String startNodeId = flowService.submitFlowWithParamMap(subFlowId, subFlowDataDTO, String startNodeId = flowService.submitFlowWithParamMap(subFlowId, subFlowDataDTO,
......
...@@ -256,7 +256,7 @@ public class ChangeSubFlowBiz { ...@@ -256,7 +256,7 @@ public class ChangeSubFlowBiz {
} else { } else {
// 不需要审批:直接跳到审批变更方案节点,审批人保持为行动人自己 // 不需要审批:直接跳到审批变更方案节点,审批人保持为行动人自己
log.info("[CHANGE_SUB_FLOW_START] 部门[{}]不需要审批,自动跳过审批", expectedDepartment); log.info("[CHANGE_SUB_FLOW_START] 部门[{}]不需要审批,自动跳过审批", expectedDepartment);
paramMap.put("type", FlowTransitionType.TYPE_REJECTED); paramMap.put("type", FlowTransitionType.TYPE_SKIP);
// 提交到审批变更方案节点 // 提交到审批变更方案节点
nextNodeId = flowService.submitFlowWithParamMap(subFlowId, flowDataDTO, uid, nextNodeId = flowService.submitFlowWithParamMap(subFlowId, flowDataDTO, uid,
...@@ -295,7 +295,7 @@ public class ChangeSubFlowBiz { ...@@ -295,7 +295,7 @@ public class ChangeSubFlowBiz {
// 使用paramMap控制流转方向(通过/不通过) // 使用paramMap控制流转方向(通过/不通过)
Map<String, Object> approveParamMap = new HashMap<>(); Map<String, Object> approveParamMap = new HashMap<>();
approveParamMap.put("type", approved ? FlowTransitionType.TYPE_APPROVED : FlowTransitionType.TYPE_REJECTED); approveParamMap.put("type", approved ? FlowTransitionType.TYPE_APPROVED : FlowTransitionType.TYPE_BACK);
String remark = approved ? "审批通过" : "审批不通过"; String remark = approved ? "审批通过" : "审批不通过";
String approveNodeId = flowService.submitFlowWithParamMap(subFlowId, flowDataDTO, uid, String approveNodeId = flowService.submitFlowWithParamMap(subFlowId, flowDataDTO, uid,
...@@ -357,7 +357,7 @@ public class ChangeSubFlowBiz { ...@@ -357,7 +357,7 @@ public class ChangeSubFlowBiz {
} }
subFlowRecord.setRejectReason(execRejectReason); subFlowRecord.setRejectReason(execRejectReason);
log.info("[CHANGE_SUB_FLOW_EXE] 审批不通过,subFlowId:{}, rejectReason:{}", subFlowId, execRejectReason); log.info("[CHANGE_SUB_FLOW_EXE] 审批不通过,subFlowId:{}, rejectReason:{}", subFlowId, execRejectReason);
execParamMap.put("type", FlowTransitionType.TYPE_REJECTED); execParamMap.put("type", FlowTransitionType.TYPE_BACK);
// 提交到确认行动方案节点 // 提交到确认行动方案节点
execNodeId = flowService.submitFlowWithParamMap(subFlowId, flowDataDTO, uid, execNodeId = flowService.submitFlowWithParamMap(subFlowId, flowDataDTO, uid,
......
...@@ -3,6 +3,7 @@ package com.netease.mail.yanxuan.change.common.constants; ...@@ -3,6 +3,7 @@ package com.netease.mail.yanxuan.change.common.constants;
/** /**
* 工单流转类型常量 * 工单流转类型常量
* 用于 paramMap 中的 type 参数,控制 topo 图的流转方向 * 用于 paramMap 中的 type 参数,控制 topo 图的流转方向
* 统一规则:1=通过,2=取消,3=回退,4=跳过
* *
* @Author AI Assistant * @Author AI Assistant
* @Date 2025/01/04 * @Date 2025/01/04
...@@ -10,24 +11,24 @@ package com.netease.mail.yanxuan.change.common.constants; ...@@ -10,24 +11,24 @@ package com.netease.mail.yanxuan.change.common.constants;
public class FlowTransitionType { public class FlowTransitionType {
/** /**
* 类型1:审批通过/前进到下一节点/需要审批 * 类型1:通过/前进到下一节点
*/ */
public static final Integer TYPE_APPROVED = 1; public static final Integer TYPE_APPROVED = 1;
/** /**
* 类型2:审批不通过/回退/不需要审批(跳过) * 类型2:取消
*/ */
public static final Integer TYPE_REJECTED = 2; public static final Integer TYPE_CANCEL = 2;
/** /**
* 类型3:回退到确认变更方案节点(主单审批不通过专用) * 类型3:回退
*/ */
public static final Integer TYPE_BACK_TO_CONFIRM_PLAN = 3; public static final Integer TYPE_BACK = 3;
/** /**
* 类型4:跳过质量部负责人审批,直接到执行变更方案节点(一般变更专用) * 类型4:跳过
*/ */
public static final Integer TYPE_SKIP_QUALITY_APPROVE = 4; public static final Integer TYPE_SKIP = 4;
private FlowTransitionType() { private FlowTransitionType() {
// 工具类,禁止实例化 // 工具类,禁止实例化
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment