Commit 37255a65 authored by chenzhao's avatar chenzhao

修改代码

parent 9241b970
......@@ -493,10 +493,11 @@ public class MonitorFanIdxController extends BaseController {
@GetMapping("/electricQuantity")
public ResponseModel<ResultsData> getElectricQuantityList(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "stationId") String stationId) {
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "stationType",required = false) String stationType) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getBoosterGatewayId();
ResultsData resultsData = monitorFanIndicatorImpl.getElectricQuantityList(current, size, gatewayId);
ResultsData resultsData = monitorFanIndicatorImpl.getElectricQuantityList(current, size, gatewayId,stationType);
return ResponseHelper.buildResponse(resultsData);
}
......
......@@ -1037,41 +1037,40 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public ResultsData getElectricQuantityList(int current, int size,String gatewayId) {
public ResultsData getElectricQuantityList(int current, int size,String gatewayId,String stationType) {
String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE frontModule ='电量表计' and displayName != '' and displayName != '检修状态' ";
List<IndicatorsDto> windSqlList = influxDButils.getListDataAll(sql, IndicatorsDto.class);
Map<String, List<IndicatorsDto>> maps = windSqlList.stream().collect(Collectors.groupingBy(IndicatorsDto::getSystemType));
ArrayList<Map<String, String>> resultList = new ArrayList<>();
Set<ColModel> listColModel = new LinkedHashSet<>();
List<ColModel> listColModels = new ArrayList<>();
ColModel name = new ColModel("name", "name", "测量点", "测量点", "dataGrid", "name");
listColModel.add(name);
for (Map.Entry<String, List<IndicatorsDto>> stringListEntry : maps.entrySet()) {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("name", stringListEntry.getKey());
for (IndicatorsDto indicatorsDto : stringListEntry.getValue()) {
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.2f",ObjectUtils.isEmpty(indicatorsDto.getValue())?0.0:Double.parseDouble(indicatorsDto.getValue())));
String key = ElectricQuantity.getCode(indicatorsDto.getDisplayName());
ColModel keyName = new ColModel(key, key, indicatorsDto.getDisplayName(),indicatorsDto.getDisplayName(), "dataGrid", key);
listColModel.add(keyName);
}
resultList.add(stringStringHashMap);
}
listColModels.addAll(listColModel);
//构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList);
// ColModel colModelStationName = new ColModel("zxzyg", "zxzyg", "正向总有功", "正向总有功", "dataGrid", "zxzyg");
// ColModel colModelEventDesc = new ColModel("fxzyg", "fxzyg", "反向总有功", "反向总有功", "dataGrid", "fxzyg");
// ColModel colModelAlarmGroupName = new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "dataGrid", "zxzwg");
// ColModel colModelEventTime = new ColModel("fxzwg", "fxzwg", "反向总无功", "反向总无功", "dataGrid", "fxzwg");
//List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime);
ResultsData resultsData = new ResultsData(DataGridMock, listColModels);
ColModel colModelEventMovement = new ColModel("name", "name", "测量点", "测量点", "dataGrid", "name");
ColModel colModelStationName = new ColModel("zxzyg", "zxzyg", "正向总有功", "正向总有功", "dataGrid", "zxzyg");
ColModel colModelEventDesc = new ColModel("fxzyg", "fxzyg", "反向总有功", "反向总有功", "dataGrid", "fxzyg");
ColModel colModelAlarmGroupName = new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "dataGrid", "zxzwg");
ColModel colModelEventTime = new ColModel("fxzwg", "fxzwg", "反向总无功", "反向总无功", "dataGrid", "fxzwg");
if (null != stationType){
colModelEventMovement = new ColModel("name", "name", "测量点", "测量点", "dataGrid", "name");
colModelStationName = new ColModel("zgxwg", "zgxwg", "总感性无功", "总感性无功", "dataGrid", "zgxwg");
colModelEventDesc = new ColModel("zzxwg", "zzxwg", "总正向有功", "总正向有功", "dataGrid", "zzxwg");
colModelAlarmGroupName = new ColModel("zrxwg", "zrxwg", "总容性无功", "总容性无功", "dataGrid", "zrxwg");
colModelEventTime = new ColModel("zfxyg", "zfxyg", "总反向有功", "总反向有功", "dataGrid", "zfxyg");
}
List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
public void getAnalogQuantityInfo(String gatewayId, String stationId, String routeName) {
if (StringUtils.isNotEmpty(gatewayId)) {
Map<String, String> map = monitorFanIndicatorregionMapper.getMajorBoosterStationInfoBySort(gatewayId, routeName);
......
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