Commit e7026e77 by “zcwang”

modify:工单提交

parent 8da827c6
...@@ -239,7 +239,8 @@ public class ChangeFlowBiz { ...@@ -239,7 +239,8 @@ public class ChangeFlowBiz {
if (changeCommander.equals(uid)) { if (changeCommander.equals(uid)) {
log.debug("[createAndSubmit] changeCommander:{}, uid:{}", changeCommander, uid); log.debug("[createAndSubmit] changeCommander:{}, uid:{}", changeCommander, uid);
String nextNodeId = flowService.submitFlow(flowId, flowDataDTO, uid, String nextNodeId = flowService.submitFlow(flowId, flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content), true); ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content), true,
FlowxOperationEnum.SUBMIT.getName(), "提交工单");
if (null == nextNodeId) { if (null == nextNodeId) {
throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "首次提交节点失败"); throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "首次提交节点失败");
} }
...@@ -494,7 +495,8 @@ public class ChangeFlowBiz { ...@@ -494,7 +495,8 @@ public class ChangeFlowBiz {
changeRecord.setUpdateTime(DateUtils.getCurrentTime()); changeRecord.setUpdateTime(DateUtils.getCurrentTime());
// 提交工单 // 提交工单
String submitNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid, String submitNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content), true); ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content), true,
FlowxOperationEnum.SUBMIT.getName(), "提交工单");
// 更新工单数据 // 更新工单数据
changeRecord.setFlowNode(submitNode); changeRecord.setFlowNode(submitNode);
changeRecord.setState(ChangeStatusEnum.IN.getStatus()); changeRecord.setState(ChangeStatusEnum.IN.getStatus());
...@@ -555,7 +557,8 @@ public class ChangeFlowBiz { ...@@ -555,7 +557,8 @@ public class ChangeFlowBiz {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 完成直接完结 // 完成直接完结
String confirmNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid, String confirmNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getTopoId(), JSON.toJSONString(content), true); ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getTopoId(), JSON.toJSONString(content), true,
FlowxOperationEnum.SUBMIT.getName(), "提交工单");
changeRecord.setState(ChangeStatusEnum.END.getStatus()); changeRecord.setState(ChangeStatusEnum.END.getStatus());
changeRecord.setFlowNode(confirmNode); changeRecord.setFlowNode(confirmNode);
changeRecord.setUpdateTime(DateUtils.getCurrentTime()); changeRecord.setUpdateTime(DateUtils.getCurrentTime());
...@@ -597,7 +600,8 @@ public class ChangeFlowBiz { ...@@ -597,7 +600,8 @@ public class ChangeFlowBiz {
Assert.isTrue(StringUtils.isNotBlank(cancelReason), "变更取消原因不可为空"); Assert.isTrue(StringUtils.isNotBlank(cancelReason), "变更取消原因不可为空");
changeRecord.setCancelReason(cancelReason); changeRecord.setCancelReason(cancelReason);
String cancelNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid, String cancelNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getTopoId(), JSON.toJSONString(content), true); ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getTopoId(), JSON.toJSONString(content), true,
FlowxOperationEnum.SUBMIT.getName(), "提交工单");
changeRecord.setState(ChangeStatusEnum.CANCEL.getStatus()); changeRecord.setState(ChangeStatusEnum.CANCEL.getStatus());
changeRecord.setFlowNode(cancelNode); changeRecord.setFlowNode(cancelNode);
changeRecord.setUpdateTime(DateUtils.getCurrentTime()); changeRecord.setUpdateTime(DateUtils.getCurrentTime());
...@@ -692,7 +696,8 @@ public class ChangeFlowBiz { ...@@ -692,7 +696,8 @@ public class ChangeFlowBiz {
content.put("updateTime", System.currentTimeMillis()); content.put("updateTime", System.currentTimeMillis());
content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.REFUSE.getValue()); content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.REFUSE.getValue());
String nextNodeId = flowService.submitFlow(String.valueOf(flowId), flowDataDTO, uid, String nextNodeId = flowService.submitFlow(String.valueOf(flowId), flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content), false); ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content), false,
FlowxOperationEnum.APPROVE_FAIL.getName(), "取消工单");
log.info("[cancel] flowId:{}, nextNodeId:{}", flowId, nextNodeId); log.info("[cancel] flowId:{}, nextNodeId:{}", flowId, nextNodeId);
// 填充更新数据 // 填充更新数据
changeRecord.setFlowNode(nextNodeId); changeRecord.setFlowNode(nextNodeId);
......
...@@ -73,7 +73,8 @@ public class FlowService { ...@@ -73,7 +73,8 @@ public class FlowService {
* @param approved * @param approved
* @return * @return
*/ */
public String submitFlow(String flowId, FlowDataDTO flowDataDTO, String uid, String topoId, String content, boolean approved) { public String submitFlow(String flowId, FlowDataDTO flowDataDTO, String uid, String topoId, String content,
boolean approved, String operateResult, String remark) {
NodeSubmitReqDTO nodeSubmitReqDTO = new NodeSubmitReqDTO(); NodeSubmitReqDTO nodeSubmitReqDTO = new NodeSubmitReqDTO();
nodeSubmitReqDTO.setFlowId(flowId); nodeSubmitReqDTO.setFlowId(flowId);
nodeSubmitReqDTO.setNodeId(flowDataDTO.getFlowMeta().getCurrNodeDataList().get(0).getNodeId()); nodeSubmitReqDTO.setNodeId(flowDataDTO.getFlowMeta().getCurrNodeDataList().get(0).getNodeId());
...@@ -81,7 +82,8 @@ public class FlowService { ...@@ -81,7 +82,8 @@ public class FlowService {
nodeSubmitReqDTO.setUserName(uid); nodeSubmitReqDTO.setUserName(uid);
nodeSubmitReqDTO.setTopoId(topoId); nodeSubmitReqDTO.setTopoId(topoId);
nodeSubmitReqDTO.setContent(content); nodeSubmitReqDTO.setContent(content);
nodeSubmitReqDTO.setOperateResult(FlowxOperationEnum.SUBMIT.getName()); nodeSubmitReqDTO.setOperateResult(operateResult);
nodeSubmitReqDTO.setRemark(remark);
nodeSubmitReqDTO.setCreateTime(System.currentTimeMillis()); nodeSubmitReqDTO.setCreateTime(System.currentTimeMillis());
nodeSubmitReqDTO.setApproved(approved); nodeSubmitReqDTO.setApproved(approved);
nodeSubmitReqDTO.setOccLock(flowDataDTO.getOccLock() + 1); nodeSubmitReqDTO.setOccLock(flowDataDTO.getOccLock() + 1);
...@@ -89,13 +91,13 @@ public class FlowService { ...@@ -89,13 +91,13 @@ public class FlowService {
List<String> nextNodeIdList; List<String> nextNodeIdList;
// 提交工单 // 提交工单
AjaxResponse<List<String>> submitResponse = flowRpcService.submit(CommonConstants.FLOWX_PRODUCT, AjaxResponse<List<String>> submitResponse = flowRpcService.submit(CommonConstants.FLOWX_PRODUCT,
nodeSubmitReqDTO); nodeSubmitReqDTO);
if (ResponseCodeEnum.SUCCESS.getCode() == submitResponse.getCode()) { if (ResponseCodeEnum.SUCCESS.getCode() == submitResponse.getCode()) {
nextNodeIdList = submitResponse.getData(); nextNodeIdList = submitResponse.getData();
log.info("[submitFlow] nextNodeIdList={}", JSON.toJSONString(nextNodeIdList)); log.info("[submitFlow] nextNodeIdList={}", JSON.toJSONString(nextNodeIdList));
} else { } else {
log.error("[submitFlow] submit flow failed, query={}, errMsg={}", JSON.toJSONString(nodeSubmitReqDTO), log.error("[submitFlow] submit flow failed, query={}, errMsg={}", JSON.toJSONString(nodeSubmitReqDTO),
JSON.toJSONString(submitResponse)); JSON.toJSONString(submitResponse));
throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "提交工单错误"); throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "提交工单错误");
} }
if (CollectionUtils.isEmpty(nextNodeIdList)) { if (CollectionUtils.isEmpty(nextNodeIdList)) {
......
...@@ -26,6 +26,7 @@ import com.netease.mail.yanxuan.change.common.bean.CommonConstants; ...@@ -26,6 +26,7 @@ import com.netease.mail.yanxuan.change.common.bean.CommonConstants;
import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum; import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum;
import com.netease.mail.yanxuan.change.common.enums.CreateSourceEnum; import com.netease.mail.yanxuan.change.common.enums.CreateSourceEnum;
import com.netease.mail.yanxuan.change.common.enums.FlowOperationTypeEnum; import com.netease.mail.yanxuan.change.common.enums.FlowOperationTypeEnum;
import com.netease.mail.yanxuan.change.common.enums.FlowxOperationEnum;
import com.netease.mail.yanxuan.change.common.util.DateUtils; import com.netease.mail.yanxuan.change.common.util.DateUtils;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord; import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
import com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeConfigPo; import com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeConfigPo;
...@@ -105,7 +106,8 @@ public class AutoSubmit extends IJobHandler { ...@@ -105,7 +106,8 @@ public class AutoSubmit extends IJobHandler {
content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.PASS.getValue()); content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.PASS.getValue());
try { try {
String execNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid, String execNode = flowService.submitFlow(flowId.toString(), flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_EXE.getTopoId(), JSON.toJSONString(content), true); ChangeFlowEnum.CHANGE_FLOW_EXE.getTopoId(), JSON.toJSONString(content), true,
FlowxOperationEnum.SUBMIT.getName(), "提交工单");
// 更新工单数据 // 更新工单数据
changeRecord.setFlowNode(execNode); changeRecord.setFlowNode(execNode);
changeRecord.setUpdateTime(DateUtils.getCurrentTime()); changeRecord.setUpdateTime(DateUtils.getCurrentTime());
......
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