Commit edefe1b2 authored by 刘林's avatar 刘林

fix(JG):撤回添加状态校验

parent d62e38b5
...@@ -776,6 +776,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -776,6 +776,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Transactional @Transactional
public void cancel(JgInstallationNoticeDto noticeDto) { public void cancel(JgInstallationNoticeDto noticeDto) {
JgInstallationNotice jgInstallationNotice = this.baseMapper.selectById(noticeDto.getSequenceNbr()); JgInstallationNotice jgInstallationNotice = this.baseMapper.selectById(noticeDto.getSequenceNbr());
String expectedStatus = String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode());
// 检查实际状态是否不等于期望状态
if (!expectedStatus.equals(jgInstallationNotice.getNoticeStatus())) {
throw new BadRequest("当前业务状态不是待处理状态,请刷新页面后重试操作!");
}
ProcessTaskDTO processTaskDTO = iCmWorkflowService.rollBack(jgInstallationNotice.getInstanceId()); ProcessTaskDTO processTaskDTO = iCmWorkflowService.rollBack(jgInstallationNotice.getInstanceId());
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
......
...@@ -721,6 +721,11 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -721,6 +721,11 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
public void cancel(JgMaintainNoticeDto noticeDto) { public void cancel(JgMaintainNoticeDto noticeDto) {
JgMaintainNotice jgMaintainNotice = this.baseMapper.selectById(noticeDto.getSequenceNbr()); JgMaintainNotice jgMaintainNotice = this.baseMapper.selectById(noticeDto.getSequenceNbr());
String expectedStatus = String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode());
// 检查实际状态是否不等于期望状态
if (!expectedStatus.equals(jgMaintainNotice.getNoticeStatus())) {
throw new BadRequest("当前业务状态不是待处理状态,请刷新页面后重试操作!");
}
ProcessTaskDTO processTaskDTO = cmWorkflowService.rollBack(jgMaintainNotice.getInstanceId()); ProcessTaskDTO processTaskDTO = cmWorkflowService.rollBack(jgMaintainNotice.getInstanceId());
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
......
...@@ -689,6 +689,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -689,6 +689,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
JgReformNotice notice = baseMapper.selectById(noticeDto.getSequenceNbr()); JgReformNotice notice = baseMapper.selectById(noticeDto.getSequenceNbr());
if (notice != null) { if (notice != null) {
String expectedStatus = String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode());
// 检查实际状态是否不等于期望状态
if (!expectedStatus.equals(notice.getNoticeStatus())) {
throw new BadRequest("当前业务状态不是待处理状态,请刷新页面后重试操作!");
}
// 回滚工作流 // 回滚工作流
ProcessTaskDTO processTaskDTO = cmWorkflowService.rollBack(noticeDto.getInstanceId()); ProcessTaskDTO processTaskDTO = cmWorkflowService.rollBack(noticeDto.getInstanceId());
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
......
...@@ -47,8 +47,8 @@ import org.springframework.util.StringUtils; ...@@ -47,8 +47,8 @@ import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
...@@ -664,6 +664,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -664,6 +664,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
@Transactional @Transactional
public void cancel(JgTransferNoticeDto noticeDto) { public void cancel(JgTransferNoticeDto noticeDto) {
JgTransferNotice jgInstallationNotice = this.baseMapper.selectById(noticeDto.getSequenceNbr()); JgTransferNotice jgInstallationNotice = this.baseMapper.selectById(noticeDto.getSequenceNbr());
String expectedStatus = String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode());
// 检查实际状态是否不等于期望状态
if (!expectedStatus.equals(jgInstallationNotice.getNoticeStatus())) {
throw new BadRequest("当前业务状态不是待处理状态,请刷新页面后重试操作!");
}
ProcessTaskDTO processTaskDTO = iCmWorkflowService.rollBack(jgInstallationNotice.getInstanceId()); ProcessTaskDTO processTaskDTO = iCmWorkflowService.rollBack(jgInstallationNotice.getInstanceId());
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
......
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