6793290b 张雷

奥体项目设备实时数据,模拟量实时数据接口开发

1 个父辈 c8036cd1
......@@ -339,4 +339,14 @@ public class OlympicCenterController {
result.setSuccess(true);
return result;
}
@ApiOperation(value="获取新锅炉房泵实时数据", notes="获取新锅炉房泵实时数据")
@GetMapping(value = "/getNewBoilerPumpRealTimeData")
public Result<Map<String,Object>> getNewBoilerPumpRealTimeData(String sourceType,String pumpId){
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = olympicCenterService.getNewBoilerPumpRealTimeData(sourceType, pumpId);
result.setResult(map);
result.setSuccess(true);
return result;
}
}
......
......@@ -37,4 +37,6 @@ public interface WhatStructDataMapper {
List<WhatStructData> getEquipDataListOfNewBoiler(@Param("sourceType") String sourceType);
List<WhatStructData> getRealTimeDataOfNewBoiler(@Param("sourceType") String sourceType, @Param("pipeDn") String pipeDn);
List<WhatStructData> getXglfEquipDataList(@Param("sourceType") String sourceType, @Param("pumpId") String pumpId);
}
......
......@@ -96,4 +96,9 @@
AND equip_type = 'other'
</select>
<select id="getXglfEquipDataList" resultType="com.skua.modules.business.entity.WhatStructData">
select * from what_struct_data_xglf
where pump_code = #{sourceType} and equip_code = #{pumpId}
</select>
</mapper>
\ No newline at end of file
......
......@@ -64,4 +64,6 @@ public interface IOlympicCenterService {
List<Map<String,Object>> getNewBoilerRealTimeReport(String sourceType);
List<TableResult> getNewBoilerRealDataReport(String sourceType,String pipeDn);
Map<String, Object> getNewBoilerPumpRealTimeData(String sourceType, String pumpId);
}
......
......@@ -2968,6 +2968,52 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return list;
}
@Override
public Map<String, Object> getNewBoilerPumpRealTimeData(String sourceType, String pumpId) {
Map<String, Object> map = new HashMap<>();
map.put("status","停止");
map.put("runtime","0");
map.put("name",pumpId);
map.put("id",pumpId);
String pgField = "";
List<Map<String, Object>> statusList = new ArrayList<>();
List<WhatStructData> equipList = new ArrayList<>();
equipList = whatStructDataMapper.getXglfEquipDataList(sourceType, pumpId);
if(equipList.size()==0){
return map;
}
Map<String, Object> equipMap = new HashMap<>();
for (WhatStructData whatStructData : equipList) {
pgField = pgField +","+whatStructData.getMonitorId();
if("equip_status".equals(whatStructData.getEquipType())){
Map<String, Object> statusMap = new HashMap<>();
statusMap.put("name",whatStructData.getMonitorName());
statusMap.put("id",whatStructData.getId());
statusMap.put("monitorid",whatStructData.getMonitorId());
statusList.add(statusMap);
map.put("name",whatStructData.getMonitorName());
}
if("equip_time".equals(whatStructData.getEquipType())){
equipMap.put("runtime",whatStructData.getMonitorId());
}
}
Map<String, Object> monitorMap = new HashMap<>();
List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField);
if(monitorList.size()==1){
monitorMap = monitorList.get(0);
if(monitorMap.get(equipMap.get("runtime").toString())!=null){
map.put("runtime", monitorMap.get(equipMap.get("runtime").toString()));
}else{
map.put("runtime", "--");
}
String equipStatus = "停止";
equipStatus = getStatusNew2(monitorMap,statusList,pumpId);
map.put("status",equipStatus);
}
return map;
}
//遍历两个年份之间的年份
private static String[] getYearsArray(String startYear, String endYear) {
int length = Integer.parseInt(endYear) - Integer.parseInt(startYear) + 1;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!