Commit 8c967ea5 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://36.40.66.175:5000/moa/amos-boot-biz into developer

parents 26d34f82 3b08ab26
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</foreach> </foreach>
</if> </if>
<if test="dateTime!=null"> <if test="dateTime!=null">
and year = #{dateTime} and month_time = #{dateTime}
</if> </if>
</where> </where>
LIMIT #{current} ,#{size} LIMIT #{current} ,#{size}
......
...@@ -142,6 +142,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -142,6 +142,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
tdHYGFInverterDayGeneratePage.setTotal(tdHYGFInverterDayGenerates.size()); tdHYGFInverterDayGeneratePage.setTotal(tdHYGFInverterDayGenerates.size());
tdHYGFInverterDayGeneratePage.setSize(size); tdHYGFInverterDayGeneratePage.setSize(size);
tdHYGFInverterDayGeneratePage.setCurrent(current); tdHYGFInverterDayGeneratePage.setCurrent(current);
tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerates.stream().filter(tdHYGFInverterDayGenerate -> StringUtils.isNotBlank(tdHYGFInverterDayGenerate.getSnCode().trim())).collect(Collectors.toList());
tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerates.subList((current - 1) * size, current * size > tdHYGFInverterDayGenerates.size() ? tdHYGFInverterDayGenerates.size() : current * size); tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerates.subList((current - 1) * size, current * size > tdHYGFInverterDayGenerates.size() ? tdHYGFInverterDayGenerates.size() : current * size);
tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> { tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> {
Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime()); Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime());
...@@ -164,6 +165,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -164,6 +165,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
} }
queryWrapper.orderByDesc("created_time"); queryWrapper.orderByDesc("created_time");
List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectList(queryWrapper); List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectList(queryWrapper);
tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerates.stream().filter(tdHYGFInverterDayGenerate -> StringUtils.isNotBlank(tdHYGFInverterDayGenerate.getSnCode().trim())).collect(Collectors.toList());
tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> { tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> {
Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime()); Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime());
tdHYGFInverterDayGenerate.setCreatedTimeStr(DateUtil.format(date1, DatePattern.NORM_DATETIME_PATTERN)); tdHYGFInverterDayGenerate.setCreatedTimeStr(DateUtil.format(date1, DatePattern.NORM_DATETIME_PATTERN));
...@@ -184,6 +186,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -184,6 +186,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
tdHYGFInverterMonthGeneratePage.setTotal(tdHYGFInverterMonthGenerates.size()); tdHYGFInverterMonthGeneratePage.setTotal(tdHYGFInverterMonthGenerates.size());
tdHYGFInverterMonthGeneratePage.setSize(size); tdHYGFInverterMonthGeneratePage.setSize(size);
tdHYGFInverterMonthGeneratePage.setCurrent(current); tdHYGFInverterMonthGeneratePage.setCurrent(current);
tdHYGFInverterMonthGenerates = tdHYGFInverterMonthGenerates.stream().filter(tdHYGFInverterMonthGenerate -> StringUtils.isNotBlank(tdHYGFInverterMonthGenerate.getSnCode().trim())).collect(Collectors.toList());
tdHYGFInverterMonthGenerates = tdHYGFInverterMonthGenerates.subList((current - 1) * size, current * size > tdHYGFInverterMonthGenerates.size() ? tdHYGFInverterMonthGenerates.size() : current * size); tdHYGFInverterMonthGenerates = tdHYGFInverterMonthGenerates.subList((current - 1) * size, current * size > tdHYGFInverterMonthGenerates.size() ? tdHYGFInverterMonthGenerates.size() : current * size);
tdHYGFInverterMonthGenerates.forEach(tdHYGFInverterMonthGenerate -> tdHYGFInverterMonthGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterMonthGenerate.getFullhour())))); tdHYGFInverterMonthGenerates.forEach(tdHYGFInverterMonthGenerate -> tdHYGFInverterMonthGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterMonthGenerate.getFullhour()))));
tdHYGFInverterMonthGeneratePage.setRecords(tdHYGFInverterMonthGenerates); tdHYGFInverterMonthGeneratePage.setRecords(tdHYGFInverterMonthGenerates);
...@@ -199,6 +202,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -199,6 +202,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
} }
queryWrapper.orderByDesc("day_time"); queryWrapper.orderByDesc("day_time");
List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates = tdHYGFInverterMonthGenerateMapper.selectList(queryWrapper); List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates = tdHYGFInverterMonthGenerateMapper.selectList(queryWrapper);
tdHYGFInverterMonthGenerates = tdHYGFInverterMonthGenerates.stream().filter(tdHYGFInverterMonthGenerate -> StringUtils.isNotBlank(tdHYGFInverterMonthGenerate.getSnCode().trim())).collect(Collectors.toList());
tdHYGFInverterMonthGenerates.forEach(tdHYGFInverterMonthGenerate -> tdHYGFInverterMonthGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterMonthGenerate.getFullhour())))); tdHYGFInverterMonthGenerates.forEach(tdHYGFInverterMonthGenerate -> tdHYGFInverterMonthGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterMonthGenerate.getFullhour()))));
return tdHYGFInverterMonthGenerates; return tdHYGFInverterMonthGenerates;
} }
...@@ -216,6 +220,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -216,6 +220,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
tdHYGFInverterYearGeneratePage.setTotal(tdHYGFInverterYearGenerates.size()); tdHYGFInverterYearGeneratePage.setTotal(tdHYGFInverterYearGenerates.size());
tdHYGFInverterYearGeneratePage.setSize(size); tdHYGFInverterYearGeneratePage.setSize(size);
tdHYGFInverterYearGeneratePage.setCurrent(current); tdHYGFInverterYearGeneratePage.setCurrent(current);
tdHYGFInverterYearGenerates = tdHYGFInverterYearGenerates.stream().filter(tdHYGFInverterYearGenerate -> StringUtils.isNotBlank(tdHYGFInverterYearGenerate.getSnCode().trim())).collect(Collectors.toList());
tdHYGFInverterYearGenerates = tdHYGFInverterYearGenerates.subList((current - 1) * size, current * size > tdHYGFInverterYearGenerates.size() ? tdHYGFInverterYearGenerates.size() : current * size); tdHYGFInverterYearGenerates = tdHYGFInverterYearGenerates.subList((current - 1) * size, current * size > tdHYGFInverterYearGenerates.size() ? tdHYGFInverterYearGenerates.size() : current * size);
tdHYGFInverterYearGenerates.forEach(tdHYGFInverterYearGenerate -> tdHYGFInverterYearGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterYearGenerate.getFullhour())))); tdHYGFInverterYearGenerates.forEach(tdHYGFInverterYearGenerate -> tdHYGFInverterYearGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterYearGenerate.getFullhour()))));
tdHYGFInverterYearGeneratePage.setRecords(tdHYGFInverterYearGenerates); tdHYGFInverterYearGeneratePage.setRecords(tdHYGFInverterYearGenerates);
...@@ -231,6 +236,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -231,6 +236,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
} }
queryWrapper.orderByDesc("month_time"); queryWrapper.orderByDesc("month_time");
List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates = tdHYGFInverterYearGenerateMapper.selectList(queryWrapper); List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates = tdHYGFInverterYearGenerateMapper.selectList(queryWrapper);
tdHYGFInverterYearGenerates = tdHYGFInverterYearGenerates.stream().filter(tdHYGFInverterYearGenerate -> StringUtils.isNotBlank(tdHYGFInverterYearGenerate.getSnCode().trim())).collect(Collectors.toList());
tdHYGFInverterYearGenerates.forEach(tdHYGFInverterYearGenerate -> tdHYGFInverterYearGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterYearGenerate.getFullhour())))); tdHYGFInverterYearGenerates.forEach(tdHYGFInverterYearGenerate -> tdHYGFInverterYearGenerate.setFullhour(Double.valueOf(String.format("%.2f",tdHYGFInverterYearGenerate.getFullhour()))));
return tdHYGFInverterYearGenerates; return tdHYGFInverterYearGenerates;
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
...@@ -252,7 +253,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -252,7 +253,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
@Override @Override
@UserLimits @UserLimits
public Map<String, List<Object>> getPowerqxnew(String date,JpStationDto reviewDto) { public Map<String, List<Object>> getPowerqxnew(String date,JpStationDto reviewDto) {
date = DateUtil.format(new Date(), "yyyy-MM-dd");
List<String> statioId=new ArrayList(); List<String> statioId=new ArrayList();
List<JpStation> dataJpStation= jpStationMapper.getJpStation(reviewDto); List<JpStation> dataJpStation= jpStationMapper.getJpStation(reviewDto);
for (JpStation jpStation : dataJpStation) { for (JpStation jpStation : dataJpStation) {
...@@ -444,6 +445,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -444,6 +445,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setUserName(jpStation.getUserName()); hd.setUserName(jpStation.getUserName());
hd.setStationContact(jpStation.getStationContact()); hd.setStationContact(jpStation.getStationContact());
hd.setState(jpStation.getState()); hd.setState(jpStation.getState());
hd.setThirdStationId(jpStation.getThirdStationId());
hd.setAccumulatedPower(jpStation.getAccumulatedPower()); hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setFullhour(Double.valueOf(String.format("%.2f", jpStation.getAccumulatedPower()/jpStation.getCapacity()))); hd.setFullhour(Double.valueOf(String.format("%.2f", jpStation.getAccumulatedPower()/jpStation.getCapacity())));
hd.setAccumulatedPower(jpStation.getAccumulatedPower()); hd.setAccumulatedPower(jpStation.getAccumulatedPower());
...@@ -486,7 +488,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -486,7 +488,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setStationContact(jpStation.getStationContact()); hd.setStationContact(jpStation.getStationContact());
hd.setState(jpStation.getState()); hd.setState(jpStation.getState());
hd.setAccumulatedPower(jpStation.getAccumulatedPower()); hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setThirdStationId(jpStation.getThirdStationId());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null); hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
hd.setDayGenerate(dayGenerate.getGenerate()); hd.setDayGenerate(dayGenerate.getGenerate());
hd.setTimeDate(dayGenerate.getDayTime()); hd.setTimeDate(dayGenerate.getDayTime());
...@@ -510,6 +512,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -510,6 +512,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setUserName(jpStation.getUserName()); hd.setUserName(jpStation.getUserName());
hd.setStationContact(jpStation.getStationContact()); hd.setStationContact(jpStation.getStationContact());
hd.setState(jpStation.getState()); hd.setState(jpStation.getState());
hd.setThirdStationId(jpStation.getThirdStationId());
hd.setAccumulatedPower(jpStation.getAccumulatedPower()); hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setMonthGenerate(dayGenerate.getGenerate()); hd.setMonthGenerate(dayGenerate.getGenerate());
hd.setMonthIncome(dayGenerate.getMonthIncome()); hd.setMonthIncome(dayGenerate.getMonthIncome());
...@@ -535,7 +538,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -535,7 +538,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setStationContact(jpStation.getStationContact()); hd.setStationContact(jpStation.getStationContact());
hd.setState(jpStation.getState()); hd.setState(jpStation.getState());
hd.setAccumulatedPower(jpStation.getAccumulatedPower()); hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setThirdStationId(jpStation.getThirdStationId());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null); hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
hd.setYearGenerate(dayGenerate.getGenerate()); hd.setYearGenerate(dayGenerate.getGenerate());
hd.setYearIncome(dayGenerate.getYearIncome()); hd.setYearIncome(dayGenerate.getYearIncome());
......
...@@ -127,12 +127,12 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -127,12 +127,12 @@ public class TDBigScreenAnalyseController extends BaseController {
if (CharSequenceUtil.isNotEmpty(stationCode)) { if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper stringBigDecimalHashMap.put("value",
.getHealthScoreInfoByStation(stationCode, tableName)); idxBizFanHealthIndexMapper.getHealthScoreInfoByStation(stationCode, tableName));
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper stringBigDecimalHashMap.put("value",
.getHealthScoreInfoByLatest(areaCode, stationCode)); idxBizFanHealthIndexMapper.getHealthScoreInfoByLatest(areaCode, stationCode));
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
...@@ -297,7 +297,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -297,7 +297,8 @@ public class TDBigScreenAnalyseController extends BaseController {
public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception { public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea(); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea();
Map<String, Object> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> t.get("healthIndex"))); Map<String, Object> collect = healthListInfo.stream()
.collect(Collectors.toMap(t -> t.get("area").toString(), t -> t.get("healthIndex")));
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
...@@ -562,8 +563,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -562,8 +563,8 @@ public class TDBigScreenAnalyseController extends BaseController {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId());
Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap( Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream()
t -> t.get("subSystem"), t -> t.get("healthIndex"))); .collect(Collectors.toMap(t -> t.get("subSystem"), t -> t.get("healthIndex")));
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
...@@ -580,22 +581,24 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -580,22 +581,24 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "该子系统各指标预警 - 风站中间 下方列表") @ApiOperation(value = "该子系统各指标预警 - 风站中间 下方列表")
@GetMapping("/getSubSystemPointInfo") @GetMapping("/getSubSystemPointInfo")
public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(@RequestParam(value = "subSystem", required = false) String subSystem, public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(
@RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "stationId", required = false) String stationId, @RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "equipmentName", required = false) String equipmentName) { @RequestParam(value = "equipmentName", required = false) String equipmentName) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
equipmentName = StrUtil.isNotEmpty(equipmentName) ? "%" + equipmentName + "风机%" : equipmentName; equipmentName = StrUtil.isNotEmpty(equipmentName) ? "%" + equipmentName + "风机%" : equipmentName;
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId(), equipmentName); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem,
stationBasic.getFanGatewayId(), equipmentName);
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(
Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName); List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName);
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0);
...@@ -638,8 +641,6 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -638,8 +641,6 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(mapPage); return ResponseHelper.buildResponse(mapPage);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "光伏 左侧风机信息列表") @ApiOperation(value = "光伏 左侧风机信息列表")
@GetMapping("/getPvInfoByPage") @GetMapping("/getPvInfoByPage")
...@@ -691,8 +692,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -691,8 +692,8 @@ public class TDBigScreenAnalyseController extends BaseController {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray, List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId());
Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream()
.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex"))); .collect(Collectors.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex")));
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
...@@ -712,15 +713,19 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -712,15 +713,19 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "光伏 该装备下各指标预警 - 风站中间 下方列表") @ApiOperation(value = "光伏 该装备下各指标预警 - 风站中间 下方列表")
@GetMapping("/getPvSubSystemPointInfo") @GetMapping("/getPvSubSystemPointInfo")
public ResponseModel<Page<Map<String, Object>>> getPvSubSystemPointInfo(@RequestParam(value = "equipmentName", required = false) String equipmentName, public ResponseModel<Page<Map<String, Object>>> getPvSubSystemPointInfo(
@RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "stationId", required = false) String stationId) { @RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName,
stationBasic.getFanGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(
Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName); List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName);
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0);
...@@ -1190,14 +1195,44 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1190,14 +1195,44 @@ public class TDBigScreenAnalyseController extends BaseController {
@ApiOperation(value = "修改业务事实表的一条数据") @ApiOperation(value = "修改业务事实表的一条数据")
@PutMapping("/updateRowAndManyTable") @PutMapping("/updateRowAndManyTable")
public ResponseModel<Boolean> updateRowAndManyTable(@RequestBody Map<String, Object> kv) { public ResponseModel<Boolean> updateRowAndManyTable(@RequestBody Map<String, Object> kv) {
if ("安全".equals(kv.get("HEALTH_LEVEL").toString()) && (!"100.0".equals(kv.get("GROUP_UPPER_LIMIT").toString()) if ("安全".equals(kv.get("HEALTH_LEVEL").toString())) {
if ((!"100.0".equals(kv.get("GROUP_UPPER_LIMIT").toString())
&& !"100".equals(kv.get("GROUP_UPPER_LIMIT").toString()))) { && !"100".equals(kv.get("GROUP_UPPER_LIMIT").toString()))) {
throw new RuntimeException("安全的分数上限只能是100"); throw new RuntimeException("安全的分数上限只能是100");
} }
if ("危险".equals(kv.get("HEALTH_LEVEL").toString()) && (!"0.0".equals(kv.get("GROUP_LOWER_LIMIT").toString()) List<IdxBizFanHealthLevel> list = idxBizFanHealthLevelMapper.selectList(
new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "注意"));
Map<String, Double> map = list.stream().collect(
Collectors.toMap(IdxBizFanHealthLevel::getHealthLevel, IdxBizFanHealthLevel::getGroupLowerLimit));
if (Double.valueOf(kv.get("GROUP_LOWER_LIMIT").toString()) <= map.get("groupUpperLimit")) {
throw new RuntimeException("安全的下限和注意的上限不能低于注意的下限");
}
} else if ("注意".equals(kv.get("HEALTH_LEVEL").toString())) {
List<IdxBizFanHealthLevel> list = idxBizFanHealthLevelMapper.selectList(
new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "警告"));
Map<String, Double> map = list.stream().collect(
Collectors.toMap(IdxBizFanHealthLevel::getHealthLevel, IdxBizFanHealthLevel::getGroupLowerLimit));
if (Double.valueOf(kv.get("GROUP_LOWER_LIMIT").toString()) <= map.get("groupUpperLimit")) {
throw new RuntimeException("注意的下限和安全的上限不能低于安全的下限");
}
} else if ("警告".equals(kv.get("HEALTH_LEVEL").toString())) {
List<IdxBizFanHealthLevel> list = idxBizFanHealthLevelMapper.selectList(
new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "危险"));
Map<String, Double> map = list.stream().collect(
Collectors.toMap(IdxBizFanHealthLevel::getHealthLevel, IdxBizFanHealthLevel::getGroupLowerLimit));
if (Double.valueOf(kv.get("GROUP_LOWER_LIMIT").toString()) <= map.get("groupUpperLimit")) {
throw new RuntimeException("警告的下限和注意的上限不能低于注意的下限");
}
} else if ("危险".equals(kv.get("HEALTH_LEVEL").toString())) {
if ((!"0.0".equals(kv.get("GROUP_LOWER_LIMIT").toString())
&& !"0".equals(kv.get("GROUP_LOWER_LIMIT").toString()))) { && !"0".equals(kv.get("GROUP_LOWER_LIMIT").toString()))) {
throw new RuntimeException("危险的分数下限只能是0"); throw new RuntimeException("危险的分数下限只能是0");
} }
}
if (Integer.valueOf(kv.get("GROUP_UPPER_LIMIT").toString()) <= Integer
.valueOf(kv.get("GROUP_LOWER_LIMIT").toString())) {
throw new RuntimeException(kv.get("HEALTH_LEVEL").toString() + "的分数上限不能小于或等于本身下限");
}
idxBizFanHealthLevelMapper.updateByInfo("idx_biz_pv_health_level", kv.get("GROUP_UPPER_LIMIT").toString(), idxBizFanHealthLevelMapper.updateByInfo("idx_biz_pv_health_level", kv.get("GROUP_UPPER_LIMIT").toString(),
kv.get("GROUP_LOWER_LIMIT").toString(), kv.get("ANALYSIS_OBJ_TYPE").toString(), kv.get("GROUP_LOWER_LIMIT").toString(), kv.get("ANALYSIS_OBJ_TYPE").toString(),
...@@ -1278,15 +1313,15 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1278,15 +1313,15 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风站/光伏 右下实时趋势") @ApiOperation(value = "风站/光伏 右下实时趋势")
@GetMapping("/getTrendInfoByAddressBy1118") @GetMapping("/getTrendInfoByAddressBy1118")
public ResponseModel<Map<String, Object>> getTrendInfoByAddressBy1118(@RequestParam(value = "indexAddress", required = false) String indexAddress, public ResponseModel<Map<String, Object>> getTrendInfoByAddressBy1118(
@RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "stationId", required = false) String stationId) { @RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(DateUtils.dateAddDays(new Date(), - 15)); Date currentDayStartTime = DateUtils.getCurrentDayStartTime(DateUtils.dateAddDays(new Date(), -15));
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date()); Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
String startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN); String startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
String endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN); String endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN);
...@@ -1325,11 +1360,12 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1325,11 +1360,12 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风站/光伏 右下实时趋势") @ApiOperation(value = "风站/光伏 右下实时趋势")
@GetMapping("/getTrendInfoByAddressBy1118Pv") @GetMapping("/getTrendInfoByAddressBy1118Pv")
public ResponseModel<Map<String, Object>> getTrendInfoByAddressBy1118Pv(@RequestParam(value = "indexAddress", required = false) String indexAddress, public ResponseModel<Map<String, Object>> getTrendInfoByAddressBy1118Pv(
@RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "stationId", required = false) String stationId) { @RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(DateUtils.dateAddDays(new Date(), - 15)); Date currentDayStartTime = DateUtils.getCurrentDayStartTime(DateUtils.dateAddDays(new Date(), -15));
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date()); Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
String startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN); String startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
String endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN); String endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN);
...@@ -1371,7 +1407,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1371,7 +1407,8 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam(value = "stationId") String stationId) { @RequestParam(value = "stationId") String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper.getHealthIndexByIndexAddress(stationBasic.getFanGatewayId(), varDesc); Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper
.getHealthIndexByIndexAddress(stationBasic.getFanGatewayId(), varDesc);
if (ObjectUtils.isEmpty(healthIndexMap)) { if (ObjectUtils.isEmpty(healthIndexMap)) {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("content", "正常运行"); stringStringHashMap.put("content", "正常运行");
...@@ -1412,7 +1449,6 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1412,7 +1449,6 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(stringStringHashMap); return ResponseHelper.buildResponse(stringStringHashMap);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风站/光伏 右下诊断分析") @ApiOperation(value = "风站/光伏 右下诊断分析")
@GetMapping("/getRiskHandleByVarDescBy1118Pv") @GetMapping("/getRiskHandleByVarDescBy1118Pv")
...@@ -1422,7 +1458,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1422,7 +1458,8 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam(value = "stationId") String stationId) { @RequestParam(value = "stationId") String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper.getHealthIndexByIndexAddressPv(stationBasic.getFanGatewayId(), varDesc); Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper
.getHealthIndexByIndexAddressPv(stationBasic.getFanGatewayId(), varDesc);
if (ObjectUtils.isEmpty(healthIndexMap)) { if (ObjectUtils.isEmpty(healthIndexMap)) {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("content", "正常运行"); stringStringHashMap.put("content", "正常运行");
...@@ -1463,5 +1500,4 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1463,5 +1500,4 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(stringStringHashMap); return ResponseHelper.buildResponse(stringStringHashMap);
} }
} }
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