|
@ -1,20 +1,22 @@ |
|
|
package org.dromara.business.controller; |
|
|
package org.dromara.business.controller; |
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
import org.apache.dubbo.config.annotation.DubboReference; |
|
|
import org.dromara.business.domain.BusinessAlert; |
|
|
import org.dromara.business.domain.BusinessAlert; |
|
|
import org.dromara.business.domain.bo.BusinessAlertBo; |
|
|
import org.dromara.business.domain.bo.BusinessAlertBo; |
|
|
|
|
|
import org.dromara.business.domain.vo.BusinessAlertVo; |
|
|
import org.dromara.business.service.IBusinessAlertService; |
|
|
import org.dromara.business.service.IBusinessAlertService; |
|
|
import org.dromara.common.mybatis.core.page.PageQuery; |
|
|
import org.dromara.common.mybatis.core.page.PageQuery; |
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
import org.dromara.common.web.core.BaseController; |
|
|
import org.dromara.common.web.core.BaseController; |
|
|
|
|
|
import org.dromara.workflow.api.RemoteWorkflowService; |
|
|
|
|
|
import org.dromara.workflow.api.domain.RemoteStartProcess; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import java.util.List; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 预警服务 |
|
|
* 预警服务 |
|
@ -31,6 +33,8 @@ public class BusinessAlertController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IBusinessAlertService businessAlertService; |
|
|
private final IBusinessAlertService businessAlertService; |
|
|
|
|
|
@DubboReference(timeout = 30000) |
|
|
|
|
|
private RemoteWorkflowService remoteWorkflowService; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查询全部预警/待办/已完成/忽略 |
|
|
* 查询全部预警/待办/已完成/忽略 |
|
@ -41,6 +45,28 @@ public class BusinessAlertController extends BaseController { |
|
|
return businessAlertService.getInfo(bo,pageQuery,alertCode); |
|
|
return businessAlertService.getInfo(bo,pageQuery,alertCode); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询全部预警/待办/已完成/忽略 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Operation(summary ="ai实时流预警保存",description = "ai实时流预警保存") |
|
|
|
|
|
@PostMapping("/saveAlert") |
|
|
|
|
|
public void saveAlert(BusinessAlertVo vo) { |
|
|
|
|
|
vo.setBusinessType(2); |
|
|
|
|
|
BusinessAlert businessAlert = businessAlertService.addBusinessAlert(vo); |
|
|
|
|
|
RemoteStartProcess startProcess = new RemoteStartProcess(); |
|
|
|
|
|
startProcess.setBusinessId(businessAlert.getAlertId()); |
|
|
|
|
|
startProcess.setFlowCode("alertChz"); |
|
|
|
|
|
remoteWorkflowService.startWorkFlowBatch(List.of(startProcess)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询全部预警/待办/已完成/忽略 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Operation(summary ="ai实时流预警保存",description = "ai实时流预警保存") |
|
|
|
|
|
@PostMapping("/saveAlertList") |
|
|
|
|
|
public void saveAlert(List<BusinessAlertVo> alertVoList) { |
|
|
|
|
|
businessAlertService.addBusinessAlertList(alertVoList); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|