Commit 926ec4ec by 王志超

feat: 子工单分批流转逻辑处理

parent aad7e88e
Pipeline #86484 passed with stages
in 1 minute 40 seconds
...@@ -404,6 +404,7 @@ public class ChangeFlowBiz { ...@@ -404,6 +404,7 @@ public class ChangeFlowBiz {
.changeExecUserEmail(execUserEmail) .changeExecUserEmail(execUserEmail)
.changeExecDepartment(execDepartment) .changeExecDepartment(execDepartment)
.changeCommander(changeRecord.getChangeCommander()) .changeCommander(changeRecord.getChangeCommander())
.changeConfirmResultTime(changeRecord.getChangeConfirmResultTime())
.createTime(DateUtils.getCurrentTime()) .createTime(DateUtils.getCurrentTime())
.updateTime(DateUtils.getCurrentTime()) .updateTime(DateUtils.getCurrentTime())
.build(); .build();
......
...@@ -87,26 +87,26 @@ public class ChangeSubFlowBiz { ...@@ -87,26 +87,26 @@ public class ChangeSubFlowBiz {
private final SupplierSendService sendSupplierEmail; private final SupplierSendService sendSupplierEmail;
public String createAndSubmit(@Valid ChangeSubFlowCreateReq changeSubFlowCreateReq) { //public String createAndSubmit(@Valid ChangeSubFlowCreateReq changeSubFlowCreateReq) {
String uid = RequestLocalBean.getUid(); // String uid = RequestLocalBean.getUid();
String name = RequestLocalBean.getName(); // String name = RequestLocalBean.getName();
Map<String, Object> content = new HashMap<>(10); // Map<String, Object> content = new HashMap<>(10);
content.put("createUserName", uid); // content.put("createUserName", uid);
content.put("createUser", uid); // content.put("createUser", uid);
content.put("createTime", System.currentTimeMillis()); // content.put("createTime", System.currentTimeMillis());
content.put("updateTime", System.currentTimeMillis()); // content.put("updateTime", System.currentTimeMillis());
content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.PASS.getValue()); // content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.PASS.getValue());
String flowName = ""; // String flowName = "";
// 组装工单创建数据 // // 组装工单创建数据
FlowCreateReqDTO flowCreateReqDTO = buildFlowCreateReqDTO(ChangeFlowEnum.CHANGE_SUB_FLOW.getTopoId(), uid, // FlowCreateReqDTO flowCreateReqDTO = buildFlowCreateReqDTO(ChangeFlowEnum.CHANGE_SUB_FLOW.getTopoId(), uid,
JSON.toJSONString(content), FlowxOperationEnum.CREATE.getName(), name, flowName); // JSON.toJSONString(content), FlowxOperationEnum.CREATE.getName(), name, flowName);
// 创建工单 // // 创建工单
String subFlowId = flowService.createFlow(flowCreateReqDTO); // String subFlowId = flowService.createFlow(flowCreateReqDTO);
//
ChangeExecRecord execRecord = new ChangeExecRecord(); // ChangeExecRecord execRecord = new ChangeExecRecord();
changeSubFlowService.createSubFlow(execRecord); // changeSubFlowService.createSubFlow(execRecord);
return ""; // return "";
} //}
private FlowCreateReqDTO buildFlowCreateReqDTO(String topoId, String uid, String content, String operateResult, private FlowCreateReqDTO buildFlowCreateReqDTO(String topoId, String uid, String content, String operateResult,
String name, String flowName) { String name, String flowName) {
...@@ -463,21 +463,22 @@ public class ChangeSubFlowBiz { ...@@ -463,21 +463,22 @@ public class ChangeSubFlowBiz {
* 处理子单延期(DELAY) * 处理子单延期(DELAY)
*/ */
private String handleSubFlowDelay(ChangeSubFlowRecord subFlowRecord, ChangeSubFlowSubmitReq req) { private String handleSubFlowDelay(ChangeSubFlowRecord subFlowRecord, ChangeSubFlowSubmitReq req) {
// 1. 验证延期时间 // 验证延期时间
Long changeConfirmResultTime = req.getChangeConfirmResultTime(); Long changeConfirmResultTime = req.getChangeConfirmResultTime();
Long tomorrowSpecificTime = DateUtils.getTomorrowSpecificTime("00:00:00"); Long tomorrowSpecificTime = DateUtils.getTomorrowSpecificTime("00:00:00");
if (changeConfirmResultTime == null || changeConfirmResultTime < tomorrowSpecificTime) { if (changeConfirmResultTime == null || changeConfirmResultTime < tomorrowSpecificTime) {
throw ExceptionFactory.createBiz(ResponseCode.BAD_REQUEST, "时间不可晚于下次执行时间"); throw ExceptionFactory.createBiz(ResponseCode.BAD_REQUEST, "时间不可晚于下次执行时间");
} }
// 2. 更新子单延期时间,不流转工单 // 更新子单延期时间,不流转工单
subFlowRecord.setChangeConfirmResultTime(changeConfirmResultTime); subFlowRecord.setChangeConfirmResultTime(changeConfirmResultTime);
subFlowRecord.setUpdateTime(DateUtils.getCurrentTime()); subFlowRecord.setUpdateTime(DateUtils.getCurrentTime());
changeSubFlowRecordService.update(subFlowRecord); changeSubFlowRecordService.update(subFlowRecord);
// todo:延期需要重新发邮件,改变执行邮件状态
log.info("[handleSubFlowDelay] 子单延期,subFlowId:{}, delayTime:{}", subFlowRecord.getSubFlowId(), changeConfirmResultTime); log.info("[handleSubFlowDelay] 子单延期,subFlowId:{}, delayTime:{}", subFlowRecord.getSubFlowId(), changeConfirmResultTime);
// 延期不流转工单,返回null
return null; return null;
} }
......
...@@ -95,16 +95,6 @@ public class TestController { ...@@ -95,16 +95,6 @@ public class TestController {
} }
/** /**
* 发起变更执行工单
*
* @return
*/
@PostMapping("/create")
public AjaxResult<String> createAndSubmit(@RequestBody @Valid ChangeSubFlowCreateReq changeSubFlowCreateReq) {
return AjaxResult.success(changeSubFlowBiz.createAndSubmit(changeSubFlowCreateReq));
}
/**
* 查询topo实际节点信息 * 查询topo实际节点信息
* *
* @param flowId 工单ID * @param flowId 工单ID
......
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