| | |
| | | import cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord; |
| | | import cn.gistack.alerts.sms.vo.Temp; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.patrol.feign.PatrolTaskClient; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | |
| | | @Autowired |
| | | private AlarmRuleService alarmRuleService; |
| | | |
| | | @Autowired |
| | | private PatrolTaskClient patrolTaskClient; |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | |
| | | // 返回数据 |
| | | return objects; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateStatus(AlarmRecord alarmRecord) { |
| | | |
| | | AlarmRecordVO vo = baseMapper.getVODetail(alarmRecord.getId()); |
| | | String processDefinitionId = "c2d5326e-e27b-11ed-a04e-00ff0b362ee4"; |
| | | |
| | | //日常巡查 |
| | | String taskType = "1641037874390999041"; |
| | | String title = StringUtil.format("{}{}巡查", |
| | | vo.getReservoirName(),vo.getAlarmRuleType()); |
| | | |
| | | String tm = DateUtil.format(vo.getCreateTime(),"MM月dd日HH时mm分"); |
| | | |
| | | //杨树堰水库在20231206 080005时近1h水位陡降 |
| | | String content = StringUtil.format("{}在{}时{}", |
| | | vo.getReservoirName(),tm,vo.getRuleName()); |
| | | |
| | | //创建新任务 |
| | | String taskId = patrolTaskClient.createTask(processDefinitionId, taskType, title, content, vo.getReservoirNumber()); |
| | | |
| | | //更新状态 |
| | | alarmRecord.setTaskId(taskId); |
| | | boolean b = updateById(alarmRecord); |
| | | |
| | | return b; |
| | | } |
| | | } |