Commit 42a2aa4a by 王志超

feat: 行动工单提交变更执行

parent e6375ae7
Pipeline #86781 passed with stages
in 1 minute 25 seconds
...@@ -44,4 +44,4 @@ CREATE TABLE `TB_YX_QC_CHANGE_SUB_FLOW_FILE` ...@@ -44,4 +44,4 @@ CREATE TABLE `TB_YX_QC_CHANGE_SUB_FLOW_FILE`
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `idx_sub_flow_record_id` (`sub_flow_record_id`), KEY `idx_sub_flow_record_id` (`sub_flow_record_id`),
KEY `idx_file_type` (`file_type`) KEY `idx_file_type` (`file_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='子单文件表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='变更行动工单附件表';
\ No newline at end of file \ No newline at end of file
...@@ -391,13 +391,13 @@ public class ChangeSubFlowBiz { ...@@ -391,13 +391,13 @@ public class ChangeSubFlowBiz {
} }
Integer subFlowChangeResult = changeSubFlowSubmitReq.getChangeResult(); Integer subFlowChangeResult = changeSubFlowSubmitReq.getChangeResult();
ChangeResultEnum subFlowResultStatus = ChangeResultEnum.getByStatus(subFlowChangeResult); ChangeResultEnum changeResultEnum = ChangeResultEnum.getByValue(subFlowChangeResult);
if (subFlowResultStatus == null) { if (changeResultEnum == null) {
throw ExceptionFactory.createBiz(ResponseCode.BAD_REQUEST, "变更结论类型错误"); throw ExceptionFactory.createBiz(ResponseCode.BAD_REQUEST, "变更结论类型错误");
} }
// 填写变更结论和备注到子单记录 // 填写变更结论和备注到子单记录
subFlowRecord.setChangeResult(subFlowResultStatus.getStatus()); subFlowRecord.setChangeResult(subFlowChangeResult);
subFlowRecord.setRemark(changeSubFlowSubmitReq.getRemark()); subFlowRecord.setRemark(changeSubFlowSubmitReq.getRemark());
// 处理子单的变更结果文件(所有结论类型都需要保存文件) // 处理子单的变更结果文件(所有结论类型都需要保存文件)
...@@ -411,10 +411,10 @@ public class ChangeSubFlowBiz { ...@@ -411,10 +411,10 @@ public class ChangeSubFlowBiz {
fileList.forEach(changeSubFlowFileService::saveRecord); fileList.forEach(changeSubFlowFileService::saveRecord);
} }
switch (subFlowResultStatus) { switch (changeResultEnum) {
case FINISH_ALL: case FINISH_ALL:
case FINISH_PART: case FINISH_PART:
return handleSubFlowFinish(subFlowRecord, changeSubFlowSubmitReq, flowDataDTO, uid, content, subFlowResultStatus, oldNodeId, oldNodeName); return handleSubFlowFinish(subFlowRecord, changeSubFlowSubmitReq, flowDataDTO, uid, content, changeResultEnum, oldNodeId, oldNodeName);
case CANCEL: case CANCEL:
return handleSubFlowCancel(subFlowRecord, changeSubFlowSubmitReq, flowDataDTO, uid, content, oldNodeId, oldNodeName); return handleSubFlowCancel(subFlowRecord, changeSubFlowSubmitReq, flowDataDTO, uid, content, oldNodeId, oldNodeName);
......
...@@ -315,7 +315,7 @@ public class ChangeFlowExportCallback implements DesCallbackService { ...@@ -315,7 +315,7 @@ public class ChangeFlowExportCallback implements DesCallbackService {
} }
private void obtainOther(ChangeRecord record, ChangeFlowExcelDTO changeFlowExcelDTO) { private void obtainOther(ChangeRecord record, ChangeFlowExcelDTO changeFlowExcelDTO) {
ChangeResultEnum resultEnum = ChangeResultEnum.getByStatus(record.getChangeResult()); ChangeResultEnum resultEnum = ChangeResultEnum.getByValue(record.getChangeResult());
log.debug("[obtainOther] record:{}, resultEnum:{}", JSON.toJSONString(record), resultEnum); log.debug("[obtainOther] record:{}, resultEnum:{}", JSON.toJSONString(record), resultEnum);
changeFlowExcelDTO.setChangeResult(resultEnum == null ? "/" : resultEnum.getDesc()); changeFlowExcelDTO.setChangeResult(resultEnum == null ? "/" : resultEnum.getDesc());
if (record.getState().equals(ChangeStatusEnum.CANCEL.getStatus()) if (record.getState().equals(ChangeStatusEnum.CANCEL.getStatus())
......
...@@ -17,24 +17,24 @@ public enum ChangeResultEnum { ...@@ -17,24 +17,24 @@ public enum ChangeResultEnum {
CANCEL(3, "不通过,变更取消"), CANCEL(3, "不通过,变更取消"),
DELAY(4, "延期确认"); DELAY(4, "延期确认");
private Integer status; private Integer value;
private String desc; private String desc;
ChangeResultEnum(Integer status, String desc) { ChangeResultEnum(Integer value, String desc) {
this.status = status; this.value = value;
this.desc = desc; this.desc = desc;
} }
public static ChangeResultEnum getByStatus(Integer status) { public static ChangeResultEnum getByValue(Integer value) {
for (ChangeResultEnum value : ChangeResultEnum.values()) { for (ChangeResultEnum resultEnum : ChangeResultEnum.values()) {
if (value.getStatus().equals(status)) { if (resultEnum.getValue().equals(value)) {
return value; return resultEnum;
} }
} }
return null; return null;
} }
public Integer getStatus() { public Integer getValue() {
return status; return value;
} }
public String getDesc() { public String getDesc() {
......
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