Commit 8bacc268 authored by tangwei's avatar tangwei

三维地图弹框数据接口

parent ad5ae215
......@@ -154,4 +154,10 @@ public class StationBasic extends BaseEntity {
//地图偏移量
@TableField(value = "title_pos",typeHandler = FastjsonTypeHandler.class)
private List<BigDecimal> titlePos;
/**
* 赋码颜色
*/
@TableField("qrcode_color")
private String qrcodeColor;
}
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
......@@ -77,6 +78,8 @@ public class MonitorFanIdxController extends BaseController {
@Autowired
EmqKeeper emqKeeper;
@Autowired
MonitoringServiceImpl monitoringService;
@Autowired
private ElasticsearchRestTemplate elasticsearchTemplate;
@Value("classpath:/json/overview.json")
private Resource overview;
......@@ -105,6 +108,24 @@ public class MonitorFanIdxController extends BaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏三维地图信息弹框")
@GetMapping("/getBasicInfonew")
public ResponseModel< Map<String, Object>> getBasicInfonew(@RequestParam(value = "stationId") String stationId) {
List<Map<String,String>> list =new ArrayList<>();
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String,String> date= monitoringService.getStationfs(stationBasic);
Map<String,String> date1= monitoringService.getStationrl(stationBasic);
list.add(date);
list.add(date1);
Map<String, Object> queryCondtion = new HashMap<>();
queryCondtion.put("color",stationBasic.getQrcodeColor());
queryCondtion.put("date",list);
return ResponseHelper.buildResponse(queryCondtion);
}
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "风机布置图 - 风机状态列表")
// @GetMapping("/getFanStatusList")
......@@ -226,7 +247,7 @@ public class MonitorFanIdxController extends BaseController {
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("30秒平均风速"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
List<ESEquipments> result2 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
columnMap.put(column, String.format("%.2f", result2.get(0).getValueF()));
columnMap.put(column, String.format("%.2f", String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getAvagerByEquipmentIndxName(result2, "30秒平均风速"))));
}
......
......@@ -95,6 +95,12 @@ public class CommonServiceImpl {
return Double.valueOf(String.format("%.2f", totalvalue));
}
public Double getAvagerByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).average().getAsDouble();
return result;
}
// public Double getNumByIndicatior(String gatewayId,String indicator){
// String sql = "SELECT * FROM indicators_"+gatewayId+" where equipmentIndexName=~/"+indicator+"$/";
// Double totalvalue = 0.0;
......
......@@ -81,6 +81,49 @@ public class MonitoringServiceImpl {
return ObjectUtils.isEmpty(installCapacity) ? 0.00 : installCapacity;
}
/***
* 获取风站场站
*
* */
public Map<String,String> getStationfs(StationBasic stationBasic) {
String value="0";
Map<String,String> map=new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>();
if(stationBasic.getStationType().equals("FDZ")){
String gatewayId = stationBasic.getFanGatewayId();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("30秒平均风速"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
List<ESEquipments> result2 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
value= String.format("%.2f", commonServiceImpl.getAvagerByEquipmentIndxName(result2, "30秒平均风速"));
map.put("name","风速/辐照度");
map.put("value",value);
}else{
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("WTX-801_25_WTX-801_总辐射"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
value= String.format("%.2f", commonServiceImpl.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射"));
map.put("name","风速/辐照度");
map.put("value",value);
}
return map;
}
/***
* 电站容量
* */
public Map<String,String> getStationrl(StationBasic stationBasic) {
Double installCapacity = 0.0;
installCapacity = this.SjglZsjZsbtzServiceImpl.getStationCapactityByStationWerks(stationBasic.getStationNumber());
String value= ObjectUtils.isEmpty(installCapacity) ? "0.00" :String.format("%.2f", installCapacity);
Map<String,String> map=new HashMap<>();
map.put("name","容量");
map.put("value",value);
return map;
}
/**
* 根据省份名称查询电站详情
*
......
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