Commit ca2fb797 authored by tangwei's avatar tangwei

修改大屏单个风机信息

parent a0dd353e
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion;
import com.yeejoin.amos.boot.module.jxiop.api.entity.Region;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MapRegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IMapRegionService;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
......@@ -28,10 +32,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.logging.Handler;
import java.util.stream.Collectors;
@RestController
@Api(tags = "监盘地图接口")
......@@ -43,7 +46,12 @@ public class MonitoringMapController extends BaseController {
@Autowired
LargeScreenImpl largeScreenImpl;
@Autowired
RegionMapper regionMapper;
@Autowired
MapRegionMapper mapRegionMapper;
@Autowired
StationBasicMapper stationBasicMapper;
// @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
// @ApiOperation(value = "获取监盘全国地图数据")
// @GetMapping("/nationwide")
......@@ -169,25 +177,68 @@ public class MonitoringMapController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页- 全国发电量趋势完成率")
@GetMapping("/getqgqs")
public ResponseModel<HashMap<String, List<String>>> getqgqs() {
@GetMapping("/gettimedateqyyfdqs")
public ResponseModel<Map<String,Object>> sendQYFDLMqttyfdqs(String areaName) {
List<StationBasic> stationBasicListAll = getListOfStationBasicByAreaName(areaName);
List<String> ids = stationBasicListAll.stream().map(StationBasic::getFanGatewayId).collect(Collectors.toList());
List<Long> idsStationId = stationBasicListAll.stream().map(StationBasic::getSequenceNbr).collect(Collectors.toList());
List<String> idsStationIdmnew =new ArrayList<>();
for (Long aLong : idsStationId) {
idsStationIdmnew.add(String.valueOf(aLong));
}
Map<String,Object> map= largeScreenImpl.gettimedateqyyfdqs(new Date(),ids,areaName,idsStationIdmnew);
largeScreenImpl.sendQYFDLMqttyfdqs();
largeScreenImpl.sendQYFDLMqttyfd();
return ResponseHelper.buildResponse(null);
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页- 全国发电量趋势完成率")
@GetMapping("/getqyqs")
public ResponseModel<HashMap<String, List<String>>> getqyqs() {
@GetMapping("/gettimedateqyyfd")
public ResponseModel<Map<String,Object>> sendQYFDLMqttyfd(String areaName) {
largeScreenImpl.gettimedateyfdqs();
largeScreenImpl.gettimedateyfd();
List<StationBasic> stationBasicListAll = getListOfStationBasicByAreaName(areaName);
List<String> ids = stationBasicListAll.stream().map(StationBasic::getFanGatewayId).collect(Collectors.toList());
Map<String,Object> map= largeScreenImpl.gettimedateqyyfd( new Date(),ids, areaName);
return ResponseHelper.buildResponse(null);
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页- 全国发电量趋势完成率")
@GetMapping("/gettimedateyfdqs")
public ResponseModel<Map<String,Object>> gettimedateyfdqs() {
Map<String,Object> map= largeScreenImpl.gettimedateyfdqs();
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页- 全国发电量趋势完成率")
@GetMapping("/gettimedateyfd")
public ResponseModel< Map<String,Object>> gettimedateyfd() {
Map<String,Object> map= largeScreenImpl.gettimedateyfd();
return ResponseHelper.buildResponse(map);
}
public List<StationBasic> getListOfStationBasicByAreaName(String areaName) {
List<StationBasic> stationBasicListAll = new ArrayList<>();
MapRegion mapRegion = mapRegionMapper.selectOne(new QueryWrapper<MapRegion>().eq("name", areaName));
//获取片区下的省份名称
ArrayList<String> stringArrayList = mapRegion.getProvince();
//变量获取所有的场站信息
for (int i = 0; i < stringArrayList.size(); i++) {
Region region = regionMapper.selectOne(new QueryWrapper<Region>().eq("LEVEL", 1).like("REGION_NAME", stringArrayList.get(i)));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("belong_area", region.getRegionCode()));
stationBasicListAll.addAll(stationBasicList);
}
return stationBasicListAll;
}
}
......@@ -541,7 +541,7 @@ public class LargeScreenImpl {
//全国月发电量趋势
@Scheduled(cron = "0/10 * * * * ?")
public List<Double> gettimedateyfd( ){
public Map<String,Object> gettimedateyfd( ){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(new Date());
......@@ -587,7 +587,7 @@ public List<Double> gettimedateyfd( ){
e.printStackTrace();
}
return listdate;
return mapjn;
}
......@@ -609,7 +609,7 @@ public List<Double> gettimedateyfd( ){
public List<Double> gettimedateqyyfd( Date date,List<String> gatewayId,String areaCode){
public Map<String,Object> gettimedateqyyfd( Date date,List<String> gatewayId,String areaCode){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(date);
......@@ -655,7 +655,7 @@ public List<Double> gettimedateyfd( ){
e.printStackTrace();
}
return listdate;
return mapjn;
}
......@@ -665,7 +665,7 @@ public List<Double> gettimedateyfd( ){
//全国发电完成趋势
@Scheduled(cron = "0/10 * * * * ?")
public List<Double> gettimedateyfdqs( ){
public Map<String,Object> gettimedateyfdqs( ){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(new Date());
......@@ -727,7 +727,7 @@ public List<Double> gettimedateyfd( ){
e.printStackTrace();
}
return listdate;
return mapjn;
}
......@@ -748,7 +748,7 @@ public List<Double> gettimedateyfd( ){
public List<Double> gettimedateqyyfdqs( Date date,List<String> gatewayId,String areaCode,List<String> idsStationId){
public Map<String,Object> gettimedateqyyfdqs( Date date,List<String> gatewayId,String areaCode,List<String> idsStationId){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(date);
......@@ -813,7 +813,7 @@ public List<Double> gettimedateyfd( ){
e.printStackTrace();
}
return listdate;
return mapjn;
}
......
......@@ -6,7 +6,7 @@
<select id="timingTemporarysSorageData" resultType="map">
SELECT FORMAT( avg(value),2)as value ,
SELECT FORMAT( sum(value),2)as value ,
created_time as createdTime ,
equipmentIndexName
FROM
......
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