|
@ -151,28 +151,36 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void addBusinessAlertList(List<BusinessAlertVo> alertVoList) { |
|
|
public void addBusinessAlertList(List<BusinessAlertVo> alertVoList) { |
|
|
if(!alertVoList.isEmpty()) { |
|
|
if (ObjectUtil.isEmpty(alertVoList)) { |
|
|
incrementalCount(alertVoList); |
|
|
throw new ServiceException("预警参数为空!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<RemoteStartProcess> remoteStartProcessList = new ArrayList<>(); |
|
|
try { |
|
|
for (BusinessAlertVo alertVo : alertVoList) { |
|
|
incrementalCount(alertVoList); |
|
|
alertVo.setBusinessType(2); |
|
|
} catch (Exception e) { |
|
|
alertVo.setHandleType(BusinessStatusEnum.WAITING.getStatus()); |
|
|
log.error(e.getMessage(),e); |
|
|
BusinessAlert alert = addBusinessAlert(alertVo); |
|
|
} |
|
|
RemoteStartProcess startProcess = new RemoteStartProcess(); |
|
|
|
|
|
startProcess.setBusinessId(String.valueOf(alert.getId())); |
|
|
|
|
|
startProcess.setFlowCode("alertChz"); |
|
|
|
|
|
remoteStartProcessList.add(startProcess); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int startIndex = 0; // 从第 0 条开始
|
|
|
List<RemoteStartProcess> remoteStartProcessList = new ArrayList<>(); |
|
|
int batchSize = 5; // 每批处理 5 条
|
|
|
for (BusinessAlertVo alertVo : alertVoList) { |
|
|
boolean flag = BatchProcessorUtil.processBatches(remoteStartProcessList, batchSize, startIndex, batch -> { |
|
|
alertVo.setBusinessType(2); |
|
|
//批量新增部门区域数据
|
|
|
BusinessAlert alert = addBusinessAlert(alertVo); |
|
|
remoteWorkflowService.startWorkFlowBatch(batch); |
|
|
RemoteStartProcess startProcess = new RemoteStartProcess(); |
|
|
}); |
|
|
startProcess.setBusinessId(String.valueOf(alert.getId())); |
|
|
|
|
|
//根据标签获取流程code
|
|
|
|
|
|
String flowCode = remoteWorkflowService.getFlowCode(alertVo.getLabelEn()); |
|
|
|
|
|
log.info("flowCode:{}",flowCode); |
|
|
|
|
|
startProcess.setFlowCode(flowCode); |
|
|
|
|
|
remoteStartProcessList.add(startProcess); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int startIndex = 0; // 从第 0 条开始
|
|
|
|
|
|
int batchSize = 5; // 每批处理 5 条
|
|
|
|
|
|
boolean flag = BatchProcessorUtil.processBatches(remoteStartProcessList, batchSize, startIndex, batch -> { |
|
|
|
|
|
//批量新增部门区域数据
|
|
|
|
|
|
remoteWorkflowService.startWorkFlowBatch(batch); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|