Browse Source

[feat]提交;画框预警逻辑

pull/7/head
杨威 2 weeks ago
parent
commit
601dd66b30
  1. 65
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java

65
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<BusinessAlertVo> alertVoList) {
if(!alertVoList.isEmpty()) {
if (ObjectUtil.isEmpty(alertVoList)){
throw new ServiceException("参数为空!");
}
try {
incrementalCount(alertVoList);
//用于短信推送
List<Map<String, Object>> noticeList=new ArrayList<>();
List<RemoteStartProcess> remoteStartProcessList = new ArrayList<>();
for (BusinessAlertVo alertVo : alertVoList) {
Map<String,Object>map=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<Map<String, Object>> noticeList=new ArrayList<>();
List<RemoteStartProcess> remoteStartProcessList = new ArrayList<>();
for (BusinessAlertVo alertVo : alertVoList) {
Map<String,Object>map=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);
}
/**

Loading…
Cancel
Save