Browse Source

#智能预警

zhongwei
yang_shj 2 years ago
parent
commit
878f53b781
  1. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  2. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
  3. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -252,7 +252,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
}
// 查询处理告警
List<Long> handles = this.getAlarmHandleIds();
List<String> handles = this.getAlarmHandleIds();
// 返回数据
AlarmReustVo response = new AlarmReustVo();
@ -263,7 +263,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
if(CollectionUtil.isEmpty(handles)){
record.setIsHandle(false);
}else{
record.setIsHandle(handles.contains(alarm.getId()));
record.setIsHandle(handles.contains(String.valueOf(alarm.getId())));
}
record.setStationCode(alarm.getStation());
record.setContent(alarm.getSoeExplain());
@ -291,7 +291,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
* 获取处理数据ID集合
* @return
*/
private List<Long> getAlarmHandleIds() {
private List<String> getAlarmHandleIds() {
List<AlarmHandleEntity> handles = handleService.list();
if(CollectionUtil.isEmpty(handles)){
return null;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java

@ -543,8 +543,7 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl<OperPhenomenonMap
defectVO.setDefect(0);
return defectVO;
}
defectVO.setTotalIds(operPhenomenonList.stream().map(OperPhenomenonEntity::getId)
.filter(Func::isNotEmpty).map(id -> id.toString()).collect(Collectors.joining(",")));
defectVO.setTotalIds(operPhenomenonList.stream().map(o->String.valueOf(o.getId())).collect(Collectors.joining(",")));
defectVO.setDefectSum(operPhenomenonList.size());
// 消缺数
List<Long> defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).

27
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java

@ -537,9 +537,9 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
// 预测
this.getPredictPlanPower(oldActualMap,oldOldActualMap,areaStationList,areaMonthReport);
// 安全生产会议次数、月度检查报告、技能培训、安全大检查
this.getSecurityCheck(areaStationList,areaMonthReport,mon + "-01 00:00:00", getStrEndTime(mon));
this.getSecurityCheck(Collections.singletonList(area.getId()),areaMonthReport,mon + "-01 00:00:00", getStrEndTime(mon));
// 设备试验
this.getDeviceTry(mon + "-01 00:00:00", getStrEndTime(mon), areaStationList,areaMonthReport);
this.getDeviceTry(mon + "-01 00:00:00", getStrEndTime(mon), Collections.singletonList(area.getId()),areaMonthReport);
areaMonthReportVoList.add(areaMonthReport);
});
return areaMonthReportVoList;
@ -853,20 +853,21 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
/**
* 安全检查
* @param areaStationList
* @param areas
* @param areaMonthReport
* @param startTime
* @param endTime
*/
private void getSecurityCheck(List<StationEntity> areaStationList, AreaMonthReportVo areaMonthReport,String startTime,String endTime) {
private void getSecurityCheck(List<Long> areas, AreaMonthReportVo areaMonthReport,String startTime,String endTime) {
areaMonthReport.setSafetyMeeting(0);
areaMonthReport.setSelfReport(0);
areaMonthReport.setSkillTrainy(0);
areaMonthReport.setSecurityCheck(0);
// 站点归属机构集合
List<Long> deptList = areaStationList.stream().filter(o-> null != o.getRefDept()).map(StationEntity::getRefDept).collect(Collectors.toList());
Map<String, Object> map = new HashMap<>();
map.put("startDate", startTime);
map.put("endDate", endTime);
map.put("deptList", deptList);
map.put("deptList", areas);
// 调用安全大检查fegin接口
R<Map<String, Object>> R = safeCheckClient.getCount(map);
if(!R.isSuccess() || MapUtils.isEmpty(R.getData())){
@ -884,17 +885,15 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
/**
* 获取设备试验数据
* @param stationList
* @return
* @param startTime
* @param endTime
* @param areas
* @param areaMonthReport
*/
private void getDeviceTry(String startTime,String endTime,List<StationEntity> stationList,AreaMonthReportVo areaMonthReport) {
private void getDeviceTry(String startTime,String endTime,List<Long> areas,AreaMonthReportVo areaMonthReport) {
areaMonthReport.setDeviceTry(0);
List<Long> deptIdList = stationList.stream().map(StationEntity::getRefDept).collect(Collectors.toList());
if(CollectionUtil.isEmpty(deptIdList)){
return;
}
SafeEquipmentTrialDTO request = new SafeEquipmentTrialDTO();
request.setDeptList(deptIdList);
request.setDeptList(areas);
request.setStartTime(startTime);
request.setEndTime(endTime);
R<Integer> R = safeEquipmentTrialClient.getCount(request);

Loading…
Cancel
Save