|
@@ -1,6 +1,7 @@
|
|
|
package com.qmth.distributed.print.api;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.gson.Gson;
|
|
@@ -45,6 +46,7 @@ import javax.validation.constraints.Min;
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -207,7 +209,15 @@ public class TFCustomFlowController {
|
|
|
if (!customFlowParam.getEnable()) {
|
|
|
List<TFCustomFlowEntity> tfCustomFlowEntityList = tfCustomFlowEntityService.findListByCustomFlowId(customFlowParam.getId());
|
|
|
if (Objects.nonNull(tfCustomFlowEntityList) && tfCustomFlowEntityList.size() > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("已存在流程数据,不能删除");
|
|
|
+ List<Long> flowIds = tfCustomFlowEntityList.stream().map(e -> e.getFlowId()).collect(Collectors.toList());
|
|
|
+ QueryWrapper<TFFlowApprove> tfFlowApproveQueryWrapper = new QueryWrapper<>();
|
|
|
+ tfFlowApproveQueryWrapper.lambda().ne(TFFlowApprove::getStatus, FlowStatusEnum.FINISH)
|
|
|
+ .ne(TFFlowApprove::getStatus, FlowStatusEnum.END)
|
|
|
+ .in(TFFlowApprove::getFlowId, flowIds);
|
|
|
+ int count = tfFlowApproveService.count(tfFlowApproveQueryWrapper);
|
|
|
+ if (count > 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("已存在流程数据,不能删除");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
tfCustomFlow.setEnable(!customFlowParam.getEnable() ? null : customFlowParam.getEnable());
|