|
|
@ -1,6 +1,7 @@ |
|
|
|
package org.dromara.business.controller; |
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
|
|
|
import cn.hutool.core.convert.Convert; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.nacos.client.utils.TenantUtil; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
@ -108,27 +109,37 @@ public class BusinessAlertController extends BaseController { |
|
|
|
public R saveAlert(@RequestBody BusinessAlertVo vo) { |
|
|
|
vo.setBusinessType(2); |
|
|
|
BusinessAlert businessAlert = businessAlertService.addBusinessAlert(vo); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* ai实时流预警保存 |
|
|
|
*/ |
|
|
|
@Operation(summary ="预警推送-实时预警模块专用",description = "预警推送-实时预警模块专用") |
|
|
|
@GetMapping("/pushAlert") |
|
|
|
public R pushAlert(Long alertId) { |
|
|
|
BusinessAlert businessAlert= businessAlertService.getBusinessAlert(alertId); |
|
|
|
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.setNoticeTitle(businessAlert.getDeptName()+"产生预警,预警类型["+businessAlert.getLabelCn()+"],请立即查看"); |
|
|
|
remoteNoticeBo.setNoticeType("3"); |
|
|
|
remoteNoticeBo.setNoticeContent(vo.getDeptName()+"产生预警,预警类型["+vo.getLabelCn()+"],请立即查看"); |
|
|
|
remoteNoticeBo.setNoticeContent(businessAlert.getDeptName()+"产生预警,预警类型["+businessAlert.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()); |
|
|
|
businessAlert.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_DKCY, businessAlert.getImages(), 3600).toString()); |
|
|
|
} |
|
|
|
remoteNoticeBo.setDeviceSn(vo.getDeviceSn()); |
|
|
|
businessAlert.setDeviceSn(vo.getDeviceSn()); |
|
|
|
remoteNoticeBo.setDeviceSn(businessAlert.getDeviceSn()); |
|
|
|
businessAlert.setDeviceSn(businessAlert.getDeviceSn()); |
|
|
|
remoteNoticeBo.setParam(JSON.toJSONString(businessAlert)); |
|
|
|
remoteNoticeService.saveNotice(remoteNoticeBo); |
|
|
|
remoteSubmailConfigService.remoteCmdSend("smsMultixsend", JSON.toJSONString(vo)); |
|
|
|
remoteSubmailConfigService.remoteCmdSend("smsMultixsend", JSON.toJSONString(businessAlert)); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
|
|
|
|