|
|
@ -188,32 +188,32 @@ public class BusinessAlertController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary ="ai实时流预警保存-用于演示",description = "ai实时流预警保存-用于演示") |
|
|
|
@PostMapping("/saveAlert") |
|
|
|
public R selectAlert(@RequestBody BusinessAlertVo vo) { |
|
|
|
vo.setBusinessType(2); |
|
|
|
BusinessAlert businessAlert = businessAlertService.addBusinessAlert(vo); |
|
|
|
RemoteStartProcess startProcess = new RemoteStartProcess(); |
|
|
|
startProcess.setBusinessId(String.valueOf(businessAlert.getId())); |
|
|
|
startProcess.setFlowCode("alertChz"); |
|
|
|
remoteWorkflowService.startWorkFlowBatch(List.of(startProcess)); |
|
|
|
RemoteNoticeBo remoteNoticeBo = new RemoteNoticeBo(); |
|
|
|
remoteNoticeBo.setNoticeTitle(vo.getDeptName()+"产生预警,预警类型["+vo.getLabelCn()+"],请立即查看"); |
|
|
|
remoteNoticeBo.setNoticeType("3"); |
|
|
|
remoteNoticeBo.setNoticeContent(vo.getDeptName()+"产生预警,预警类型["+vo.getLabelCn()+"],请立即查看"); |
|
|
|
remoteNoticeBo.setStatus("0"); |
|
|
|
remoteNoticeBo.setIsRead(0); |
|
|
|
remoteNoticeBo.setCreateBy(1L); |
|
|
|
remoteNoticeBo.setCreateDept(1L); |
|
|
|
remoteNoticeBo.setCreateTime(businessAlert.getCreateTime()); |
|
|
|
if (businessAlert.getBusinessType() == 2){ |
|
|
|
businessAlert.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_DKCY, vo.getImages(), 3600).toString()); |
|
|
|
} |
|
|
|
remoteNoticeBo.setDeviceSn(vo.getDeviceSn()); |
|
|
|
businessAlert.setDeviceSn(vo.getDeviceSn()); |
|
|
|
remoteNoticeBo.setParam(JSON.toJSONString(businessAlert)); |
|
|
|
remoteNoticeService.saveNotice(remoteNoticeBo); |
|
|
|
remoteSubmailConfigService.remoteCmdSend("smsMultixsend", JSON.toJSONString(vo)); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
// @Operation(summary ="ai实时流预警保存-用于演示",description = "ai实时流预警保存-用于演示")
|
|
|
|
// @PostMapping("/saveAlert")
|
|
|
|
// public R selectAlert(@RequestBody BusinessAlertVo vo) {
|
|
|
|
// vo.setBusinessType(2);
|
|
|
|
// BusinessAlert businessAlert = businessAlertService.addBusinessAlert(vo);
|
|
|
|
// RemoteStartProcess startProcess = new RemoteStartProcess();
|
|
|
|
// startProcess.setBusinessId(String.valueOf(businessAlert.getId()));
|
|
|
|
// startProcess.setFlowCode("alertChz");
|
|
|
|
// remoteWorkflowService.startWorkFlowBatch(List.of(startProcess));
|
|
|
|
// RemoteNoticeBo remoteNoticeBo = new RemoteNoticeBo();
|
|
|
|
// remoteNoticeBo.setNoticeTitle(vo.getDeptName()+"产生预警,预警类型["+vo.getLabelCn()+"],请立即查看");
|
|
|
|
// remoteNoticeBo.setNoticeType("3");
|
|
|
|
// remoteNoticeBo.setNoticeContent(vo.getDeptName()+"产生预警,预警类型["+vo.getLabelCn()+"],请立即查看");
|
|
|
|
// remoteNoticeBo.setStatus("0");
|
|
|
|
// remoteNoticeBo.setIsRead(0);
|
|
|
|
// remoteNoticeBo.setCreateBy(1L);
|
|
|
|
// remoteNoticeBo.setCreateDept(1L);
|
|
|
|
// remoteNoticeBo.setCreateTime(businessAlert.getCreateTime());
|
|
|
|
// if (businessAlert.getBusinessType() == 2){
|
|
|
|
// businessAlert.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_DKCY, vo.getImages(), 3600).toString());
|
|
|
|
// }
|
|
|
|
// remoteNoticeBo.setDeviceSn(vo.getDeviceSn());
|
|
|
|
// businessAlert.setDeviceSn(vo.getDeviceSn());
|
|
|
|
// remoteNoticeBo.setParam(JSON.toJSONString(businessAlert));
|
|
|
|
// remoteNoticeService.saveNotice(remoteNoticeBo);
|
|
|
|
// remoteSubmailConfigService.remoteCmdSend("smsMultixsend", JSON.toJSONString(vo));
|
|
|
|
// return R.ok();
|
|
|
|
// }
|
|
|
|
} |
|
|
|