Commit 10f58548 authored by tangwei's avatar tangwei

解决冲突

parents 39c72700 89b893c4
...@@ -302,11 +302,11 @@ ...@@ -302,11 +302,11 @@
( (
SELECT SELECT
wr.WARNING_NAME AS warningName, wr.WARNING_NAME AS warningName,
vc.POINT_NAME AS pointName, wr.POINT_NAME AS pointName,
count( 1 ) AS num count( 1 ) AS num,
wr.STATION as station
FROM FROM
idx_biz_pv_warning_record wr idx_biz_pv_warning_record wr
LEFT JOIN idx_biz_pv_point_process_variable_classification vc on vc.GATEWAY_ID = wr.GATEWAY_ID and vc.INDEX_ADDRESS = wr.INDEX_ADDRESS
<where> <where>
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
wr.ARAE like concat('%', #{areaCode}, '%') wr.ARAE like concat('%', #{areaCode}, '%')
...@@ -317,11 +317,11 @@ ...@@ -317,11 +317,11 @@
warningName UNION ALL warningName UNION ALL
SELECT SELECT
wr.WARNING_NAME AS warningName, wr.WARNING_NAME AS warningName,
vc.POINT_NAME AS pointName, wr.POINT_NAME AS pointName,
count( 1 ) AS num count( 1 ) AS num,
wr.STATION as station
FROM FROM
idx_biz_fan_warning_record wr idx_biz_fan_warning_record wr
LEFT JOIN idx_biz_fan_point_process_variable_classification vc on vc.GATEWAY_ID = wr.GATEWAY_ID and vc.INDEX_ADDRESS = wr.INDEX_ADDRESS
<where> <where>
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
wr.ARAE like concat('%', #{areaCode}, '%') wr.ARAE like concat('%', #{areaCode}, '%')
...@@ -334,6 +334,7 @@ ...@@ -334,6 +334,7 @@
WHERE WHERE
a.pointName IS NOT NULL a.pointName IS NOT NULL
AND a.pointName != '' AND a.pointName != ''
GROUP BY pointName ,STATION,warningName
</select> </select>
<select id="getSubSystemInfo" resultType="java.util.Map"> <select id="getSubSystemInfo" resultType="java.util.Map">
......
...@@ -344,7 +344,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -344,7 +344,7 @@ public class MonitorFanIdxController extends BaseController {
if (null != stationType) { if (null != stationType) {
gatewayId = stationBasic.getFanGatewayId(); gatewayId = stationBasic.getFanGatewayId();
} }
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, systemType, frontModule, equipNum); List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, systemType, frontModule, equipNum,stationBasic.getStationType());
IPage<Map<String, Object>> result = new Page<>(); IPage<Map<String, Object>> result = new Page<>();
result.setRecords(statusMonitoring); result.setRecords(statusMonitoring);
result.setCurrent(1); result.setCurrent(1);
...@@ -368,7 +368,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -368,7 +368,7 @@ public class MonitorFanIdxController extends BaseController {
stringStringHashMap.put("agzp", "A套保护光字牌"); stringStringHashMap.put("agzp", "A套保护光字牌");
stringStringHashMap.put("bgzp", "B套保护光字牌"); stringStringHashMap.put("bgzp", "B套保护光字牌");
for (Map.Entry<String, String> stringStringEntry : stringStringHashMap.entrySet()) { for (Map.Entry<String, String> stringStringEntry : stringStringHashMap.entrySet()) {
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, stringStringEntry.getValue(), name, null); List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, stringStringEntry.getValue(), name, null,stationBasic.getStationType());
IPage<Map<String, Object>> result = new Page<>(); IPage<Map<String, Object>> result = new Page<>();
result.setRecords(statusMonitoring); result.setRecords(statusMonitoring);
result.setCurrent(1); result.setCurrent(1);
...@@ -577,7 +577,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -577,7 +577,7 @@ public class MonitorFanIdxController extends BaseController {
// String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE (equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机 or 'equipmentIndexName ='停机' or equipmentIndexName ='停机') and value = 'true'"; // String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE (equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机 or 'equipmentIndexName ='停机' or equipmentIndexName ='停机') and value = 'true'";
Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(gatewayId, name); Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(gatewayId, name);
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, "网络", name, null); List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, "网络", name, null,stationBasic.getStationType());
IPage<Map<String, Object>> result = new Page<>(); IPage<Map<String, Object>> result = new Page<>();
switchUrl.put("records", statusMonitoring); switchUrl.put("records", statusMonitoring);
switchUrl.put("current", 1); switchUrl.put("current", 1);
......
...@@ -567,7 +567,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -567,7 +567,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<String> windSpeeds = new ArrayList<>(); List<String> windSpeeds = new ArrayList<>();
List<String> activePowers = new ArrayList<>(); List<String> activePowers = new ArrayList<>();
List<String> axisData = new ArrayList<>(); List<String> axisData = new ArrayList<>();
Integer size = indicatorDataListWindSpeed.size()>indicatorDataListActivePower.size() ? indicatorDataListActivePower.size():indicatorDataListWindSpeed.size(); Integer size = indicatorDataListWindSpeed.size() > indicatorDataListActivePower.size() ? indicatorDataListActivePower.size() : indicatorDataListWindSpeed.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
windSpeeds.add(indicatorDataListWindSpeed.get(i).getValue()); windSpeeds.add(indicatorDataListWindSpeed.get(i).getValue());
activePowers.add(indicatorDataListActivePower.get(i).getValue()); activePowers.add(indicatorDataListActivePower.get(i).getValue());
...@@ -831,23 +831,27 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -831,23 +831,27 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public List<Map<String, Object>> getStatusGzp(String gatewayId, String systemType, String frontModule, String equipNum) { public List<Map<String, Object>> getStatusGzp(String gatewayId, String systemType, String frontModule, String equipNum, String stationType) {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCondtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList(systemType));
if (null != equipNum) { if (null != equipNum) {
queryCondtion.put(CommonConstans.QueryStringEquipmentNumberKeyword, Arrays.asList(equipNum)); queryCondtion.put(CommonConstans.QueryStringEquipmentNumberKeyword, Arrays.asList(equipNum));
} }
Map<String, String> likeMap = new HashMap<>(); Map<String, String> likeMap = new HashMap<>();
likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, frontModule); likeMap.put(CommonConstans.QueryStringFrontMoudle, frontModule);
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap); if (stationType.equals("FDZ")) {
queryCondtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList(systemType));
} else {
likeMap.put(CommonConstans.QueryStringSystemTypeKeyword, systemType);
}
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeMap);
List<Map<String, Object>> statusMaps = new ArrayList<>(); List<Map<String, Object>> statusMaps = new ArrayList<>();
for (ESEquipments listDatum : indicatorsDtoList) { for (ESEquipments listDatum : indicatorsDtoList) {
Map<String, Object> statusMap = new HashMap<>(); Map<String, Object> statusMap = new HashMap<>();
String data = listDatum.getDisplayName(); String data = listDatum.getDisplayName();
if (StringUtils.isEmpty(data)||(!ObjectUtils.isEmpty(listDatum.getEquipmentNumber())&&data.equals(listDatum.getEquipmentNumber()))) { if (StringUtils.isEmpty(data) || (!ObjectUtils.isEmpty(listDatum.getEquipmentNumber()) && data.equals(listDatum.getEquipmentNumber()))) {
data = listDatum.getEquipmentIndexName(); data = listDatum.getEquipmentIndexName();
} }
statusMap.put("addres", listDatum.getAddress()); statusMap.put("addres", listDatum.getAddress());
...@@ -1798,13 +1802,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1798,13 +1802,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<ESEquipments> dtos = list1.stream().filter(e -> e.getEquipmentNumber().equals(s)).collect(Collectors.toList()); List<ESEquipments> dtos = list1.stream().filter(e -> e.getEquipmentNumber().equals(s)).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(dtos)) { if (!ValidationUtil.isEmpty(dtos)) {
for (ESEquipments esEquipments : indicatorsDtos) { for (ESEquipments esEquipments : indicatorsDtos) {
lsv = lsv + Math.pow(esEquipments.getValueF() - dtos.get(0).getValueF(), 2); lsv = lsv + Math.pow(esEquipments.getValueF() - avageValue, 2);
} }
} }
lsv = Math.sqrt(lsv) / dtos.get(0).getValueF(); lsv= lsv/indicatorsDtos.size();
lsv = Math.sqrt(lsv);
} }
resultMap.put("lsv", String.format(CommonConstans.Twodecimalplaces, lsv)); resultMap.put("lsv", String.format(CommonConstans.Twodecimalplaces, lsv));
resultList.add(resultMap); resultList.add(resultMap);
} }
...@@ -1876,9 +1879,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1876,9 +1879,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<Map<String, Object>> seriesData = new ArrayList<>(); List<Map<String, Object>> seriesData = new ArrayList<>();
for (String s : data.keySet()) { for (String s : data.keySet()) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<String> value = data.get(s).stream().map(indicatorData-> String.format(CommonConstans.Twodecimalplaces, Double.valueOf(indicatorData.getValue()))).collect(Collectors.toList()); List<String> value = data.get(s).stream().map(indicatorData -> String.format(CommonConstans.Twodecimalplaces, Double.valueOf(indicatorData.getValue()))).collect(Collectors.toList());
axisData = data.get(s).stream().map(indicatorData -> DateUtil.format(indicatorData.getCreatedTime(), "HH:mm")).collect(Collectors.toList()); axisData = data.get(s).stream().map(indicatorData -> DateUtil.format(indicatorData.getCreatedTime(), "HH:mm")).collect(Collectors.toList());
map.put("data", value); map.put("data", value);
seriesData.add(map); seriesData.add(map);
} }
resultMap.put("axisData", axisData); resultMap.put("axisData", axisData);
...@@ -1978,7 +1981,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1978,7 +1981,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringEquipmentNumber, Arrays.asList(equipNum)); queryCondtion.put(CommonConstans.QueryStringEquipmentNumber, Arrays.asList(equipNum));
Map<String, String> shouldCondtion = new HashMap<>(); Map<String, String> shouldCondtion = new HashMap<>();
shouldCondtion.put(CommonConstans.QueryStringEquipmentIndexName, "实时故障"); shouldCondtion.put(CommonConstans.QueryStringEquipmentIndexName, "实时故障");
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class,shouldCondtion); List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldCondtion);
//获取风机型号 //获取风机型号
String type = indicatorsDtoList.get(0).getEquipmentSpecificName().substring(0, 5); String type = indicatorsDtoList.get(0).getEquipmentSpecificName().substring(0, 5);
List<String> sytemNames = Arrays.asList("发电机系统", "机舱与塔筒系统", "变流与主控系统", "偏航与液压系统", "叶轮系统"); List<String> sytemNames = Arrays.asList("发电机系统", "机舱与塔筒系统", "变流与主控系统", "偏航与液压系统", "叶轮系统");
...@@ -2139,7 +2142,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2139,7 +2142,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public ResultsData getDeaviAtionRate(String gatewayId, String zz, String nbq, String hlx) { public ResultsData getDeaviAtionRate(String gatewayId, String zz, String nbq, String hlx) {
ArrayList<Map<String, Object>> resultList = new ArrayList<>(); ArrayList<Map<String, Object>> resultList = new ArrayList<>();
Map<String, List<String>> queryConditon = new HashMap<>(); Map<String, List<String>> queryConditon = new HashMap<>();
queryConditon.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryConditon.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
...@@ -2181,7 +2184,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2181,7 +2184,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultList.add(resultMap); resultList.add(resultMap);
} }
} }
Collections.sort(resultList, new Comparator<Map<String, Object>>() { Collections.sort(resultList, new Comparator<Map<String, Object>>() {
public int compare(Map<String, Object> o1, Map<String, Object> o2) { public int compare(Map<String, Object> o1, Map<String, Object> o2) {
String str1 = o1.get("hlx").toString(); String str1 = o1.get("hlx").toString();
...@@ -2191,7 +2194,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2191,7 +2194,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
}); });
// 构建平台数据 // 构建平台数据
DataGridMock DataGridMock = new DataGridMock(0, resultList.size(), false, 0, resultList); DataGridMock DataGridMock = new DataGridMock(0, resultList.size(), false, 0, resultList);
ColModel colModelEventMovement = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx"); ColModel colModelEventMovement = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx");
......
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