Commit b73d4be6 authored by maoying's avatar maoying

修改三维接口返回

parent 5247f7f9
...@@ -635,15 +635,22 @@ public class RiskSourceController extends BaseController { ...@@ -635,15 +635,22 @@ public class RiskSourceController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "重点设备启动预案", notes = "重点设备启动预案") @ApiOperation(httpMethod = "GET", value = "重点设备启动预案", notes = "重点设备启动预案")
@RequestMapping(value = "/startEquipReserve", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/startEquipReserve", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel startEquipReserve(@RequestParam Long id, @RequestParam String typeCode) { public ResponseModel startEquipReserve(@RequestParam Long id, @RequestParam String typeCode) {
ReserveEnum reserveEnum = riskSourceService.startEquipReserve(id, typeCode); try{
Integer status = reserveEnum.getStatus(); ReserveEnum reserveEnum = riskSourceService.startEquipReserve(id, typeCode);
String text = reserveEnum.getText(); Integer status = reserveEnum.getStatus();
if (status == 1) { String text = reserveEnum.getText();
return CommonResponseUtil2.success(text); if (status == 1) {
} else { return CommonResponseUtil2.success(text);
return CommonResponseUtil2.failure(text); } else {
} return CommonResponseUtil2.failure(text);
}
}catch (Exception e) {
log.error(e.getMessage());
return CommonResponseUtil2.failure();
// TODO: handle exception
}
} }
@ApiOperation(httpMethod = "POST", value = "上传消防设备数据", notes = "上传消防设备数据") @ApiOperation(httpMethod = "POST", value = "上传消防设备数据", notes = "上传消防设备数据")
......
package com.yeejoin.amos.fas.business.controller; package com.yeejoin.amos.fas.business.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
...@@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.fas.business.bo.BindPointBo; import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.BindRegionBo; import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.param.RetrieveParams; import com.yeejoin.amos.fas.business.param.RetrieveParams;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService; import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService; import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
...@@ -154,12 +157,17 @@ public class View3dController extends BaseController { ...@@ -154,12 +157,17 @@ public class View3dController extends BaseController {
return CommonResponseUtil.success(view3dService.getStatisticsCheck(orgCode)); return CommonResponseUtil.success(view3dService.getStatisticsCheck(orgCode));
} }
@Permission
@ApiOperation(value = "异常显示最新5条",notes = "异常显示最新5条") @ApiOperation(value = "异常显示最新5条",notes = "异常显示最新5条")
@GetMapping(value = "safetyExecute/list/{type}") @GetMapping(value = "safetyExecute/list/{type}")
public CommonResponse getSafetyExecuteListTop5(@PathVariable("type")String type){ public CommonResponse getSafetyExecuteListTop5(@PathVariable("type")String type){
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getSafetyExecuteListTop5(type,orgCode)); List<SafetyExecuteBo> dataList = view3dService.getSafetyExecuteListTop5(type,orgCode);
Map<String,Object> result = new HashMap<>();
result.put("type",type);
result.put("dataList", dataList);
return CommonResponseUtil.success(result);
} }
@Permission @Permission
......
...@@ -9,6 +9,7 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyRo; ...@@ -9,6 +9,7 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo; import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe; import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.dao.mapper.*; import com.yeejoin.amos.fas.business.dao.mapper.*;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao; import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao; import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao;
...@@ -172,7 +173,11 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -172,7 +173,11 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
* 影响区域:消防安全=>火灾告警 * 影响区域:消防安全=>火灾告警
*/ */
String title = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety"); String title = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety");
webMqttComponent.publish(title, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", equipmentSpecific.getOrgCode()))); List<SafetyExecuteBo> dataList = view3dService.getSafetyExecuteListTop5("fire", equipmentSpecific.getOrgCode());
Map<String,Object> result = new HashMap<>();
result.put("type","fire");
result.put("dataList", dataList);
webMqttComponent.publish(title, JSON.toJSONString(result));
// 报警触发调用规则服务 // 报警触发调用规则服务
if(EquipmentRiskTypeEnum.HZGJ.getCode().equals(specificIndexType)&&!ObjectUtils.isEmpty(equipment) && !ObjectUtils.isEmpty(equipment.getReservePlan())){ if(EquipmentRiskTypeEnum.HZGJ.getCode().equals(specificIndexType)&&!ObjectUtils.isEmpty(equipment) && !ObjectUtils.isEmpty(equipment.getReservePlan())){
......
...@@ -65,6 +65,7 @@ import com.yeejoin.amos.fas.business.bo.JpushMsgBo; ...@@ -65,6 +65,7 @@ import com.yeejoin.amos.fas.business.bo.JpushMsgBo;
import com.yeejoin.amos.fas.business.bo.JpushMsgContentBo; import com.yeejoin.amos.fas.business.bo.JpushMsgContentBo;
import com.yeejoin.amos.fas.business.bo.MsgParamBo; import com.yeejoin.amos.fas.business.bo.MsgParamBo;
import com.yeejoin.amos.fas.business.bo.RpnCalculationBo; import com.yeejoin.amos.fas.business.bo.RpnCalculationBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.constants.FasConstant; import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
...@@ -813,7 +814,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -813,7 +814,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// 巡检异常 // 巡检异常
String topicTwo = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety"); String topicTwo = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety");
webMqttComponent.publish(topicTwo, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode))); List<SafetyExecuteBo> dataList = view3dService.getSafetyExecuteListTop5("check", orgCode);
Map<String,Object> result = new HashMap<>();
result.put("type","check");
result.put("dataList", dataList);
webMqttComponent.publish(topicTwo, JSON.toJSONString(result));
// 一周安全趋势 // 一周安全趋势
String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex"); String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex");
...@@ -1219,7 +1224,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1219,7 +1224,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 影响区域:消防安全=>火灾告警 * 影响区域:消防安全=>火灾告警
*/ */
String topic = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety"); String topic = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety");
webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", fireEquipmentPoint.getOrgCode()))); List<SafetyExecuteBo> dataList = view3dService.getSafetyExecuteListTop5("fire", fireEquipmentPoint.getOrgCode());
Map<String,Object> result = new HashMap<>();
result.put("type","fire");
result.put("dataList", dataList);
webMqttComponent.publish(topic, JSON.toJSONString(result));
} }
} }
...@@ -1780,9 +1789,23 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1780,9 +1789,23 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// 消防安全 // 消防安全
String topicTow = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/fireSafety"); String topicTow = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/fireSafety");
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("risk", orgCode))); List<SafetyExecuteBo> riskdataList = view3dService.getSafetyExecuteListTop5("risk", orgCode);
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode))); Map<String,Object> riskResult = new HashMap<>();
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", orgCode))); riskResult.put("type","risk");
riskResult.put("dataList", riskdataList);
webMqttComponent.publish(topicTow, JSON.toJSONString(riskResult));
List<SafetyExecuteBo> checkdataList = view3dService.getSafetyExecuteListTop5("check", orgCode);
Map<String,Object> checkResult = new HashMap<>();
checkResult.put("type","check");
checkResult.put("dataList", checkdataList);
webMqttComponent.publish(topicTow, JSON.toJSONString(checkResult));
List<SafetyExecuteBo> firedataList = view3dService.getSafetyExecuteListTop5("fire", orgCode);
Map<String,Object> firekResult = new HashMap<>();
firekResult.put("type","fire");
firekResult.put("dataList", firedataList);
webMqttComponent.publish(topicTow, JSON.toJSONString(firekResult));
// 一周安全趋势 // 一周安全趋势
String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex"); String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex");
...@@ -1839,10 +1862,25 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1839,10 +1862,25 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// 消防安全 // 消防安全
String topicTow = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/fireSafety"); String topicTow = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/fireSafety");
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("risk", orgCode)));
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode))); List<SafetyExecuteBo> riskdataList = view3dService.getSafetyExecuteListTop5("risk", orgCode);
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", orgCode))); Map<String,Object> riskResult = new HashMap<>();
riskResult.put("type","risk");
riskResult.put("dataList", riskdataList);
webMqttComponent.publish(topicTow, JSON.toJSONString(riskResult));
List<SafetyExecuteBo> checkdataList = view3dService.getSafetyExecuteListTop5("check", orgCode);
Map<String,Object> checkResult = new HashMap<>();
checkResult.put("type","check");
checkResult.put("dataList", checkdataList);
webMqttComponent.publish(topicTow, JSON.toJSONString(checkResult));
List<SafetyExecuteBo> firedataList = view3dService.getSafetyExecuteListTop5("fire", orgCode);
Map<String,Object> firekResult = new HashMap<>();
firekResult.put("type","fire");
firekResult.put("dataList", firedataList);
webMqttComponent.publish(topicTow, JSON.toJSONString(firekResult));
// 一周安全趋势 // 一周安全趋势
String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex"); String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex");
webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode))); webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode)));
......
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