|
@@ -210,13 +210,28 @@ public class TFCustomFlowController {
|
|
|
List<TFCustomFlowEntity> tfCustomFlowEntityList = tfCustomFlowEntityService.findListByCustomFlowId(customFlowParam.getId());
|
|
|
if (Objects.nonNull(tfCustomFlowEntityList) && tfCustomFlowEntityList.size() > 0) {
|
|
|
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("已存在流程数据,不能删除");
|
|
|
+ int min = 0;
|
|
|
+ int max = SystemConstant.IN_SIZE_MAX, size = flowIds.size();
|
|
|
+ if (max >= size) {
|
|
|
+ max = size;
|
|
|
+ }
|
|
|
+ while (max <= size) {
|
|
|
+ QueryWrapper<TFFlowApprove> tfFlowApproveQueryWrapper = new QueryWrapper<>();
|
|
|
+ tfFlowApproveQueryWrapper.lambda().ne(TFFlowApprove::getStatus, FlowStatusEnum.FINISH)
|
|
|
+ .ne(TFFlowApprove::getStatus, FlowStatusEnum.END)
|
|
|
+ .in(TFFlowApprove::getFlowId, flowIds.subList(min, max));
|
|
|
+ int count = tfFlowApproveService.count(tfFlowApproveQueryWrapper);
|
|
|
+ if (count > 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("已存在流程数据,不能删除");
|
|
|
+ }
|
|
|
+ if (max == size) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ min = max;
|
|
|
+ max += SystemConstant.IN_SIZE_MAX;
|
|
|
+ if (max >= size) {
|
|
|
+ max = size;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|