diff --git a/dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java b/dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java index b139c25..5a1065d 100644 --- a/dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java +++ b/dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java @@ -155,37 +155,48 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { @Override public void addBusinessAlertList(List alertVoList) { - if(!alertVoList.isEmpty()) { + + if (ObjectUtil.isEmpty(alertVoList)){ + throw new ServiceException("参数为空!"); + } + + try { incrementalCount(alertVoList); - //用于短信推送 - List> noticeList=new ArrayList<>(); - List remoteStartProcessList = new ArrayList<>(); - for (BusinessAlertVo alertVo : alertVoList) { - Mapmap=new HashMap<>(); - alertVo.setBusinessType(2); - alertVo.setHandleType(BusinessStatusEnum.WAITING.getStatus()); - BusinessAlert alert = addBusinessAlert(alertVo); - RemoteStartProcess startProcess = new RemoteStartProcess(); - startProcess.setBusinessId(String.valueOf(alert.getId())); - startProcess.setFlowCode("alertChz"); - map.put("deptId",alertVo.getDeptId()); - map.put("deptName",alertVo.getDeptName()); - map.put("labelCn",alertVo.getLabelCn()); - map.put("labelEn",alertVo.getLabelEn()); - map.put("jobName",alertVo.getJobName()); - noticeList.add(map); - remoteStartProcessList.add(startProcess); - } + } catch (Exception e) { + log.error(e.getMessage(),e); + } - int startIndex = 0; // 从第 0 条开始 - int batchSize = 5; // 每批处理 5 条 - boolean flag = BatchProcessorUtil.processBatches(remoteStartProcessList, batchSize, startIndex, batch -> { - //批量新增部门区域数据 - remoteWorkflowService.startWorkFlowBatch(batch); - }); - remoteSubmailConfigService.remoteSend("smsMultixsend",noticeList); + //用于短信推送 + List> noticeList=new ArrayList<>(); + List remoteStartProcessList = new ArrayList<>(); + for (BusinessAlertVo alertVo : alertVoList) { + Mapmap=new HashMap<>(); + alertVo.setBusinessType(2); + BusinessAlert alert = addBusinessAlert(alertVo); + RemoteStartProcess startProcess = new RemoteStartProcess(); + startProcess.setBusinessId(String.valueOf(alert.getId())); + + String flowCode = remoteWorkflowService.getFlowCode(alertVo.getLabelEn()); + log.info("flowCode:{}",flowCode); + + startProcess.setFlowCode(flowCode); + map.put("deptId",alertVo.getDeptId()); + map.put("deptName",alertVo.getDeptName()); + map.put("labelCn",alertVo.getLabelCn()); + map.put("labelEn",alertVo.getLabelEn()); + map.put("jobName",alertVo.getJobName()); + noticeList.add(map); + remoteStartProcessList.add(startProcess); } + int startIndex = 0; // 从第 0 条开始 + int batchSize = 5; // 每批处理 5 条 + boolean flag = BatchProcessorUtil.processBatches(remoteStartProcessList, batchSize, startIndex, batch -> { + //批量新增部门区域数据 + remoteWorkflowService.startWorkFlowBatch(batch); + }); + remoteSubmailConfigService.remoteSend("smsMultixsend",noticeList); + } /**