Commit 340d5219 authored by maoying's avatar maoying

修改预案推送接口

parent f304650f
......@@ -47,6 +47,6 @@ public interface PlanDetailMapper {
List<String> getRuleIdByEquipment(@Param("id") Long id);
PlanDetailVo getPlanDetailByEquipmentId(@Param("fire_equipment_id") Long fireEquipmentId);
PlanDetailVo getPlanDetailByEquipmentId(@Param("fireEquipmentId") Long fireEquipmentId);
}
package com.yeejoin.amos.fas.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.fas.business.action.CustomerAction;
......@@ -107,6 +108,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
public ContingencyPlanResponseVo planStart(ContingencyPlanParamVo vo, Toke toke) throws Exception {
ContingencyPlanResponseVo result = new ContingencyPlanResponseVo();
//状态校验
logger.info("========状态校验===========");
ReserveEnum reserveEnum = this.runCheck(vo);
result.setMessage(reserveEnum.getText());
if (ReserveEnum.THISRUNNING.getStatus().equals(reserveEnum.getStatus())) {
......@@ -241,6 +243,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
//启动状态校验
public ReserveEnum runCheck(ContingencyPlanParamVo vo) throws Exception {
logger.info("========vo==========="+JSONObject.toJSONString(vo));
if (EquipmentRiskTypeEnum.HZGJ.getCode().equals(vo.getRiskType()) || StringUtils.isBlank(vo.getRiskType())) {
List<PlanDoc> planDocs = planDocDao.findAllByPlanId(Long.valueOf(vo.getPlanId()));
......
......@@ -139,7 +139,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
log.info("========topic==========: " + topic);
log.info("========data==========: " + JSON.toJSONString(data));
EquipmentSpecificIndexVo equipmentSpecificIndex = JSONObject.parseObject(topicEntity.getMessage(), EquipmentSpecificIndexVo.class);
long eqSpecId = equipmentSpecificIndex.getEquipmentSpecificId();
Long eqSpecId = equipmentSpecificIndex.getEquipmentSpecificId();
EquipmentSpecificForRiskVo equipmentSpecific = equipmentSpecificMapper.getOneById(eqSpecId);
log.info("========equipmentSpecific==========: " + JSON.toJSONString(equipmentSpecific));
if(ObjectUtils.isEmpty(equipmentSpecific)){
......@@ -233,16 +233,21 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
}
private void startPlan(Equipment equipment, Toke toke, long fireEquipmentId) {
private void startPlan(Equipment equipment, Toke toke, Long fireEquipmentId) {
PlanDetailVo planDetailVo = planDetailMapper.getPlanDetailByEquipmentId(equipment.getId());
//3d页面打开且存在预案,套用之前数字源码启动逻辑 进行预案的启动
boolean isOnLine = this.getOpen3dUser();
log.info("isOnLine==="+isOnLine);
log.info("planDetailVo==="+JSONObject.toJSONString(planDetailVo));
if (planDetailVo != null && isOnLine) {
ContingencyPlanParamVo vo = new ContingencyPlanParamVo();
vo.setUserId(loginId);
//TODO 待优化为调用平台进行查询
vo.setUserName("系统用户");
vo.setFireEquipmentId(fireEquipmentId);
vo.setPlanId(String.valueOf(planDetailVo.getId()));
vo.setStatus(5);
try {
iContingencyPlanService.planStart(vo, toke);
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment