guoshilong
2023-12-05 ae830f0421032b415ab505e8fbd82d257d01f1d5
skjcmanager/skjcmanager-service/skjcmanager-nky/src/main/java/cn/gistack/nky/feign/NkyClientImpl.java
@@ -8,12 +8,16 @@
import cn.gistack.nky.service.INkyService;
import cn.gistack.nky.vo.AlarmGetVO;
import cn.gistack.nky.vo.PageVO;
import cn.gistack.sm.patrol.feign.PatrolTaskClient;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -32,6 +36,7 @@
   private final IArimaPredictService arimaPredictService;
   private final IHstPredictService hstPredictService;
   private final IAlarmGetService alarmGetService;
   private final PatrolTaskClient patrolTaskClient;
   @Override
@@ -96,7 +101,35 @@
   @Override
   @PostMapping(UPDATE_ALARM_GET)
   public Boolean updateAlarmGet(AlarmGet alarmGet) {
   @Transactional(rollbackFor = Exception.class)
   public Boolean updateAlarmGet(AlarmGetVO alarmGet) {
      //修改处置状态
      AlarmGetVO byId = alarmGetService.getAlarmVO(alarmGet);
      String processDefinitionId = "c2d5326e-e27b-11ed-a04e-00ff0b362ee4";
      //日常巡查
      String taskType = "1641037874390999041";
      //杨树堰水库大坝预警巡查
      String title = StringUtil.format("{}大坝预警巡查",byId.getReservoirName());
      //杨树堰水库在2023-11-29 17:41:19时监测到位移GN1测点,测点值为2.37,预警等级为三级
      String resNm = byId.getReservoirName();
      String tm = DateUtil.format(byId.getTime(),"MM月dd日HH时mm分");
      String typeName = byId.getTypeName();
      String cdNm = byId.getCdName();
      String value = byId.getValue();
      String level =String.valueOf( byId.getLevel());
      String content=StringUtil.format("{}在{}时监测到{}{}测点值为{},预警等级为{}级",
         resNm,tm,typeName,cdNm,value,level);
      String resCd = byId.getDamId();
      //创建巡查任务
      String taskId = patrolTaskClient.createTask(processDefinitionId,taskType,title,content,resCd);
      alarmGet.setTaskId(taskId);
      return alarmGetService.updateById(alarmGet);
   }
}