Commit 7a5fc60c authored by KeYong's avatar KeYong

Merge branch 'develop_dl_3.7.1.1' of http://36.40.66.175:5000/moa/amos-boot-biz…

Merge branch 'develop_dl_3.7.1.1' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_dl_3.7.1.1
parents e4297db6 90fda53a
...@@ -105,8 +105,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -105,8 +105,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
filter(index -> index.get("code").equals(String.valueOf(f.get("typeCode")))).collect(Collectors.toList()); filter(index -> index.get("code").equals(String.valueOf(f.get("typeCode")))).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect)) { if (!ObjectUtils.isEmpty(collect)) {
String indicator = String.valueOf(collect.get(0).get("index")); String indicator = String.valueOf(collect.get(0).get("index"));
analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
} }
}); });
} }
...@@ -136,8 +136,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -136,8 +136,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
filter(index -> index.get("code").equals(String.valueOf(f.get("typeCode")))).collect(Collectors.toList()); filter(index -> index.get("code").equals(String.valueOf(f.get("typeCode")))).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect)) { if (!ObjectUtils.isEmpty(collect)) {
String indicator = String.valueOf(collect.get(0).get("index")); String indicator = String.valueOf(collect.get(0).get("index"));
analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
} }
}); });
} }
......
...@@ -1684,7 +1684,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1684,7 +1684,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
Map<String, Object> summarize = fireFightingSystemMapper.selectMonthSummarize(startDate.substring(0, 7), String.valueOf(sys.get("id"))); Map<String, Object> summarize = fireFightingSystemMapper.selectMonthSummarize(startDate.substring(0, 7), String.valueOf(sys.get("id")));
if (!ObjectUtils.isEmpty(summarize)) { if (!ObjectUtils.isEmpty(summarize)) {
systemData.put("summarize", ObjectUtils.isEmpty(summarize.get("summary_info")) ? "" : String.valueOf(summarize.get("summary_info"))); systemData.put("summarize", ObjectUtils.isEmpty(summarize.get("summary_info")) ? "" : String.valueOf(summarize.get("summary_info")));
} else { } else {
systemData.put("summarize", ""); systemData.put("summarize", "");
} }
...@@ -1693,10 +1692,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1693,10 +1692,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
String[] split = indicator.split(","); String[] split = indicator.split(",");
List<String> indicatorList = Arrays.asList(split); List<String> indicatorList = Arrays.asList(split);
List<Map<String, Object>> pieChartList = fireFightingSystemMapper.selectMonthPieChart(String.valueOf(sys.get("code")), startDate, endDate); List<Map<String, Object>> pieChartList = fireFightingSystemMapper.selectMonthPieChart(String.valueOf(sys.get("code")), startDate, endDate);
List<Map<String, Object>> pieChartListTwo = fireFightingSystemMapper.selectMonthPieChartTwo(String.valueOf(sys.get("code")), startDate, endDate, indicatorList); List<Map<String, Object>> pieChartListTwo = fireFightingSystemMapper.selectMonthPieChartTwo(String.valueOf(sys.get("code")), startDate, endDate, new ArrayList<>());
List<Map<String, Object>> selectMonthPolyline = fireFightingSystemMapper.selectMonthPolyline(String.valueOf(sys.get("code")), startDate, endDate, new ArrayList<>());
List<Map<String, Object>> selectMonthPolyline = fireFightingSystemMapper.selectMonthPolyline(String.valueOf(sys.get("code")), startDate, endDate, indicatorList); log.info("===========rrrrrrrrrr,{}",JSONObject.toJSONString(pieChartList));
log.info("===========ssssssssss,{}",JSONObject.toJSONString(pieChartListTwo));
log.info("===========aaaaaaaaaa,{}",JSONObject.toJSONString(selectMonthPolyline));
String pieChart = ChartsUtils.pieChart(pieChartList, "故障设备类型占比"); String pieChart = ChartsUtils.pieChart(pieChartList, "故障设备类型占比");
systemData.put("bing1", pieChart); systemData.put("bing1", pieChart);
...@@ -1876,7 +1881,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1876,7 +1881,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum"))); // listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum")));
// 7日告警条数 // 7日告警条数
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) { if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) {
Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, indicatorList); Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, new ArrayList<>());
listItem.put("trueNum", String.valueOf(integer)); listItem.put("trueNum", String.valueOf(integer));
} else { } else {
listItem.put("trueNum", String.valueOf(0)); listItem.put("trueNum", String.valueOf(0));
...@@ -1901,7 +1906,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1901,7 +1906,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
// 总结 // 总结
Map<String, Object> summarize = fireFightingSystemMapper.selectWeekSummarize(valueOf(system.get("id")), startDate, endDate, indicatorList); Map<String, Object> summarize = fireFightingSystemMapper.selectWeekSummarize(valueOf(system.get("id")), startDate, endDate, new ArrayList<>());
// if (!ObjectUtils.isEmpty(summarize.get("contant"))) { // if (!ObjectUtils.isEmpty(summarize.get("contant"))) {
// systemData.put("summarize", String.valueOf(summarize.get("contant"))); // systemData.put("summarize", String.valueOf(summarize.get("contant")));
// } else { // } else {
...@@ -1945,7 +1950,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1945,7 +1950,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
String pieChart2 = ChartsUtils.pieChart(weekEchart, "故障设备类型占比"); String pieChart2 = ChartsUtils.pieChart(weekEchart, "故障设备类型占比");
systemData.put("pictureCenter", pieChart2); systemData.put("pictureCenter", pieChart2);
List<Map<String, Object>> linesEchart = fireFightingSystemMapper.selectWeekLinesEchart(valueOf(system.get("code")), startDate, endDate, indicatorList); List<Map<String, Object>> linesEchart = fireFightingSystemMapper.selectWeekLinesEchart(valueOf(system.get("code")), startDate, endDate, new ArrayList<>());
String lines = ChartsUtils.manyLineChart(linesEchart, "报警趋势", "日期", "报警数量", "week"); String lines = ChartsUtils.manyLineChart(linesEchart, "报警趋势", "日期", "报警数量", "week");
systemData.put("lines", lines); systemData.put("lines", lines);
...@@ -1974,6 +1979,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1974,6 +1979,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public String iotWeekReport(String bizOrgCode, String startDate, String endDate) { public String iotWeekReport(String bizOrgCode, String startDate, String endDate) {
Map<String, Object> dataMap = getWeekData(bizOrgCode, startDate, endDate); Map<String, Object> dataMap = getWeekData(bizOrgCode, startDate, endDate);
log.info("===========ddddddd,{}",JSONObject.toJSONString(dataMap));
if (dataMap == null) { if (dataMap == null) {
return null; return null;
} }
...@@ -2086,8 +2092,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2086,8 +2092,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// 日告警设备数 // 日告警设备数
listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum"))); listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum")));
// 日告警条数 // 日告警条数
log.info("==========sbco={}", weekItem.get("type_code").toString());
log.info("==========sbCC={}", weekItem.get("code").toString());
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) { if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) {
Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, indicatorList); Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, new ArrayList<>());
listItem.put("trueNum", String.valueOf(integer)); listItem.put("trueNum", String.valueOf(integer));
} else { } else {
listItem.put("trueNum", String.valueOf(0)); listItem.put("trueNum", String.valueOf(0));
...@@ -2095,6 +2103,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2095,6 +2103,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// if (Integer.parseInt(listItem.get("trueNum").toString()) == 0) { // if (Integer.parseInt(listItem.get("trueNum").toString()) == 0) {
// continue; // continue;
// } // }
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && String.valueOf(weekItem.get("type_code")).endsWith("Fault")){ if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && String.valueOf(weekItem.get("type_code")).endsWith("Fault")){
if (!ObjectUtils.isEmpty(binMap) && !ObjectUtils.isEmpty(listItem.get("name")) && binMap.containsKey(String.valueOf(listItem.get("name")))){ if (!ObjectUtils.isEmpty(binMap) && !ObjectUtils.isEmpty(listItem.get("name")) && binMap.containsKey(String.valueOf(listItem.get("name")))){
int newValue = Integer.parseInt(String.valueOf(listItem.get("alarmEquipNum"))); int newValue = Integer.parseInt(String.valueOf(listItem.get("alarmEquipNum")));
...@@ -2130,7 +2139,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2130,7 +2139,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
// 总结 // 总结
Map<String, Object> summarize = fireFightingSystemMapper.selectDaySummarize(valueOf(system.get("id")), startDate, endDate, indicatorList); Map<String, Object> summarize = fireFightingSystemMapper.selectDaySummarize(valueOf(system.get("id")), startDate, endDate, new ArrayList<>());
// if (!ObjectUtils.isEmpty(summarize.get("contant"))) { // if (!ObjectUtils.isEmpty(summarize.get("contant"))) {
// systemData.put("summarize", String.valueOf(summarize.get("contant"))); // systemData.put("summarize", String.valueOf(summarize.get("contant")));
// } else { // } else {
...@@ -2142,6 +2151,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2142,6 +2151,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// echarts 图表 // echarts 图表
List<Map<String, Object>> mapList = fireFightingSystemMapper.selectDayEquipEchart(valueOf(system.get("code")), startDate, endDate); List<Map<String, Object>> mapList = fireFightingSystemMapper.selectDayEquipEchart(valueOf(system.get("code")), startDate, endDate);
log.info("77777777777777,{}" ,JSONObject.toJSONString(alarmMapList));
String pieChart1 = ChartsUtils.pieChart(alarmMapList, "故障设备类型占比"); String pieChart1 = ChartsUtils.pieChart(alarmMapList, "故障设备类型占比");
// List<Map<String, Object>> dayEcharts = fireFightingSystemMapper.selectDayEchart(valueOf(system.get("id")), startDate, indicatorList); // List<Map<String, Object>> dayEcharts = fireFightingSystemMapper.selectDayEchart(valueOf(system.get("id")), startDate, indicatorList);
...@@ -2188,6 +2199,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2188,6 +2199,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public String iotDayReport(String bizOrgCode, String startDate, String endDate) { public String iotDayReport(String bizOrgCode, String startDate, String endDate) {
Map<String, Object> dataMap = getDayData(bizOrgCode, startDate, endDate); Map<String, Object> dataMap = getDayData(bizOrgCode, startDate, endDate);
log.info("===========ddddddd,{}",JSONObject.toJSONString(dataMap));
if (dataMap == null){ if (dataMap == null){
return null; return null;
} }
......
...@@ -495,8 +495,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -495,8 +495,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
indexStateList.add(createIndexStateVo(equipmentSpeIndex)); indexStateList.add(createIndexStateVo(equipmentSpeIndex));
// 添加指标报告
saveEquipmentAlarmReportDay(equipmentSpeIndex);
// 火眼数据构造告警指标逻辑 // 火眼数据构造告警指标逻辑
equipmentSpeIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist); equipmentSpeIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist);
...@@ -523,6 +522,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -523,6 +522,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
handlingAlarms(equipmentSpeIndex, alarmFlag); handlingAlarms(equipmentSpeIndex, alarmFlag);
} }
// 添加指标报告
saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag);
// 指标告警处理 // 指标告警处理
if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm()) { if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm()) {
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap));
...@@ -760,8 +762,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -760,8 +762,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
indexStateList.add(createIndexStateVo(equipmentSpeIndex)); indexStateList.add(createIndexStateVo(equipmentSpeIndex));
// 添加指标报告
saveEquipmentAlarmReportDay(equipmentSpeIndex);
// 火眼数据构造告警指标逻辑 // 火眼数据构造告警指标逻辑
equipmentSpeIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist); equipmentSpeIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist);
...@@ -788,6 +789,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -788,6 +789,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
handlingAlarms(equipmentSpeIndex, alarmFlag); handlingAlarms(equipmentSpeIndex, alarmFlag);
} }
// 添加指标报告
saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag);
// 指标告警处理 // 指标告警处理
if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm()) { if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm()) {
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap));
...@@ -1021,8 +1025,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1021,8 +1025,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 推送数据到组态大屏 // 推送数据到组态大屏
pushDataToIntegrationPage(equipmentSpecificIndexList); pushDataToIntegrationPage(equipmentSpecificIndexList);
// 添加指标报告
saveEquipmentAlarmReportDay(equipmentSpeIndex);
// 火眼数据构造告警指标逻辑 // 火眼数据构造告警指标逻辑
equipmentSpecificIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist); equipmentSpecificIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist);
...@@ -1048,6 +1051,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1048,6 +1051,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
handlingAlarms(equipmentSpecificIndex, alarmFlag); handlingAlarms(equipmentSpecificIndex, alarmFlag);
} }
// 添加指标报告
saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag);
// 指标告警处理 // 指标告警处理
if (equipmentSpecificIndex.getIsAlarm() != null && 1 == equipmentSpecificIndex.getIsAlarm() && !equipmentSpecificIndex.getEquipmentIndexKey().equals(pressurePumpStart)) { if (equipmentSpecificIndex.getIsAlarm() != null && 1 == equipmentSpecificIndex.getIsAlarm() && !equipmentSpecificIndex.getEquipmentIndexKey().equals(pressurePumpStart)) {
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpecificIndex, messageBodyMap)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpecificIndex, messageBodyMap));
...@@ -1540,7 +1546,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1540,7 +1546,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
} }
private EquipmentAlarmReportDay addEquipAlarmReportRecord(EquipmentSpecificIndex equipmentSpecificIndex) { private EquipmentAlarmReportDay addEquipAlarmReportRecord(EquipmentSpecificIndex equipmentSpecificIndex, boolean flag) {
EquipmentAlarmReportDay equipmentAlarmReportDay = new EquipmentAlarmReportDay(); EquipmentAlarmReportDay equipmentAlarmReportDay = new EquipmentAlarmReportDay();
equipmentAlarmReportDay.setOrgCode(equipmentSpecificIndex.getOrgCode()); equipmentAlarmReportDay.setOrgCode(equipmentSpecificIndex.getOrgCode());
equipmentAlarmReportDay.setReportDate(new Date()); equipmentAlarmReportDay.setReportDate(new Date());
...@@ -1552,8 +1558,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1552,8 +1558,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentAlarmReportDay.setEquipmentDetailId(equipmentSpecificIndex.getEquipmentDetailId()); equipmentAlarmReportDay.setEquipmentDetailId(equipmentSpecificIndex.getEquipmentDetailId());
equipmentAlarmReportDay.setEquipmentId(equipmentSpecificIndex.getEquipmentId()); equipmentAlarmReportDay.setEquipmentId(equipmentSpecificIndex.getEquipmentId());
equipmentAlarmReportDay.setEquipmentCode(equipmentSpecificIndex.getEquipmentCode()); equipmentAlarmReportDay.setEquipmentCode(equipmentSpecificIndex.getEquipmentCode());
equipmentAlarmReportDay if(flag) {
.setIndexTrueNum(TrueOrFalseEnum.real.value.equals(equipmentSpecificIndex.getValue()) ? 1L : 0L); equipmentAlarmReportDay
.setIndexTrueNum(1L);
} else {
equipmentAlarmReportDay
.setIndexTrueNum(TrueOrFalseEnum.real.value.equals(equipmentSpecificIndex.getValue()) ? 1L : 0L);
}
equipmentAlarmReportDay.setAlarmType(equipmentSpecificIndex.getTypeCode()); equipmentAlarmReportDay.setAlarmType(equipmentSpecificIndex.getTypeCode());
equipmentAlarmReportDay.setAlarmTypeName(equipmentSpecificIndex.getTypeName()); equipmentAlarmReportDay.setAlarmTypeName(equipmentSpecificIndex.getTypeName());
equipmentAlarmReportDay.setIndexId(equipmentSpecificIndex.getEquipmentIndexId()); equipmentAlarmReportDay.setIndexId(equipmentSpecificIndex.getEquipmentIndexId());
...@@ -2017,9 +2029,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2017,9 +2029,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* *
* @param equipmentSpecificIndex * @param equipmentSpecificIndex
*/ */
private void saveEquipmentAlarmReportDay(EquipmentSpecificIndex equipmentSpecificIndex) { private void saveEquipmentAlarmReportDay(EquipmentSpecificIndex equipmentSpecificIndex, boolean flag) {
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN); SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN);
EquipmentAlarmReportDay equipmentAlarmReportDay = addEquipAlarmReportRecord(equipmentSpecificIndex); EquipmentAlarmReportDay equipmentAlarmReportDay = addEquipAlarmReportRecord(equipmentSpecificIndex, flag);
LambdaQueryWrapper<EquipmentAlarmReportDay> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentAlarmReportDay> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentAlarmReportDay::getReportDate, sdf.format(equipmentAlarmReportDay.getReportDate())) wrapper.eq(EquipmentAlarmReportDay::getReportDate, sdf.format(equipmentAlarmReportDay.getReportDate()))
.eq(EquipmentAlarmReportDay::getIndexId, equipmentAlarmReportDay.getIndexId()) .eq(EquipmentAlarmReportDay::getIndexId, equipmentAlarmReportDay.getIndexId())
......
...@@ -4145,7 +4145,7 @@ ...@@ -4145,7 +4145,7 @@
</select> </select>
<select id="selectWeekReportList" resultType="java.util.Map"> <select id="selectWeekReportList" resultType="java.util.Map">
select * from (
SELECT temp.name,temp.num,temp.normalNum,temp1.type_name , temp1.monitoringData,temp1.acquisition,temp1.normal, SELECT temp.name,temp.num,temp.normalNum,temp1.type_name , temp1.monitoringData,temp1.acquisition,temp1.normal,
IFNULL(temp1.alarmEquipNum,0) AS alarmEquipNum, temp1.type_code,temp.code IFNULL(temp1.alarmEquipNum,0) AS alarmEquipNum, temp1.type_code,temp.code
FROM FROM
...@@ -4163,12 +4163,6 @@ ...@@ -4163,12 +4163,6 @@
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%','FireAlarm','%')
or report.index_type LIKE CONCAT('%','Fault','%')
or report.index_type LIKE CONCAT('%','Shield','%')
or report.index_type LIKE CONCAT('%','Open','%')
or report.index_type LIKE CONCAT('%','OilLeak','%')
or report.index_type LIKE CONCAT('%','Alarm','%') )
and report.index_true_num > 0 and report.report_date >= #{startDate} and and report.index_true_num > 0 and report.report_date >= #{startDate} and
report.report_date &lt;= #{endDate}) as exepctionNum report.report_date &lt;= #{endDate}) as exepctionNum
FROM( FROM(
...@@ -4176,7 +4170,7 @@ ...@@ -4176,7 +4170,7 @@
s.id as system_id, s.id as system_id,
equipment.code, equipment.code,
equipment.name, equipment.name,
count(1) AS num (select count(1) from wl_equipment_specific s where FIND_IN_SET( #{systemId}, s.system_id ) AND equipment.is_iot = 1 and s.equipment_code = equipment.code ) AS num
FROM FROM
wl_equipment_specific spec wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
...@@ -4240,7 +4234,8 @@ ...@@ -4240,7 +4234,8 @@
)temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code )temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code
group by code, type_code group by code, type_code
ORDER BY temp.name ORDER BY temp.name ) d where type_code is not null
</select> </select>
<select id="selectAlarms" resultType="java.lang.Integer"> <select id="selectAlarms" resultType="java.lang.Integer">
SELECT SELECT
...@@ -4256,7 +4251,7 @@ ...@@ -4256,7 +4251,7 @@
</foreach> </foreach>
and report.report_date BETWEEN #{startDate} and #{endDate} and report.report_date BETWEEN #{startDate} and #{endDate}
and system_id = #{systemId} and FIND_IN_SET( #{systemId}, system_id)
and index_type = #{indexType} and index_type = #{indexType}
and report.equipment_code = #{equipmentCode} and report.equipment_code = #{equipmentCode}
</select> </select>
......
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