Browse Source

事件状态验证

develop
lau572 6 months ago
parent
commit
d4c19bfd9f
  1. 8
      zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java

8
zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java

@ -9,6 +9,8 @@ import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.exception.file.InvalidExtensionException; import com.ruoyi.common.exception.file.InvalidExtensionException;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils; import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.zc.business.domain.DcEvent;
import com.zc.business.service.IDcEventService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -43,6 +45,8 @@ public class DcEventProcessController extends BaseController
{ {
@Autowired @Autowired
private IDcEventProcessService dcEventProcessService; private IDcEventProcessService dcEventProcessService;
@Autowired
private IDcEventService dcEventService;
/** /**
* 查询事件处理流程列表 * 查询事件处理流程列表
@ -101,6 +105,10 @@ public class DcEventProcessController extends BaseController
@Log(title = "事件处理流程", businessType = BusinessType.INSERT) @Log(title = "事件处理流程", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcEventProcess dcEventProcess){ public AjaxResult add(@RequestBody DcEventProcess dcEventProcess){
DcEvent dcEvent = dcEventService.selectDcEventById(dcEventProcess.getEventId());
if (dcEvent.getEventState() == 2){
return AjaxResult.error("事件已结束,无法进行操作!");
}
if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){
int status = dcEventProcessService.selectPreviousNodeStatus(dcEventProcess.getEventId(),dcEventProcess.getProcessId()); int status = dcEventProcessService.selectPreviousNodeStatus(dcEventProcess.getEventId(),dcEventProcess.getProcessId());
if (status < 1){ if (status < 1){

Loading…
Cancel
Save