燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-06-18 caa8596884dac891a8b5c4fcf85dd2f7a12812f5
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
@@ -368,19 +368,36 @@
    }
    @Override
    public List<WarningVo> getAlarmAndWarnByTime(Date begin, Date end) {
    public List<Report> getAlarmAndWarnByTime(Date begin, Date end) {
        String startTime = ymdhms.format(begin);
        String endTime = ymdhms.format(end);
        List<WarningDetail> rs = warningDetailMapper.selectByTime(startTime, endTime);
        if (null == rs || rs.isEmpty()) {
            return null;
        }
        List<WarningDetail> rs = new ArrayList<>();
        List<WarningDetail> rsYj = warningDetailMapper.selectByTimeForYj(startTime, endTime);
        if (null != rsYj && rsYj.size() > 0) rs.addAll(rsYj);
        List<WarningVo> list = new ArrayList<>();
        List<WarningDetail> rsBj = warningDetailMapper.selectByTimeForBj(startTime, endTime);
        if (null != rsBj && rsBj.size() > 0) rs.addAll(rsBj);
        List<Report> list = new ArrayList<>();
        for (WarningDetail wd : rs) {
            String time = ymdh.format(wd.getCreateTime());
            list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time));
            //String time = ymdh.format(wd.getCreateTime());
            //list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time));
            DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(wd.getTableName(), wd.getSuYuanId());
            int rows = suYuanMapper.isTableExists(wd.getTableName());
            DistanceSuYuan suMax = null;
            if (rows > 0) {
                MonitorPointPosition point = commonService.select3dCheckPointByName(wd.getLocationName());
                List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50);
                suMax = suYuanMapper.getSuYuan500Max(wd.getTableName(), ids3d);
            } else {
                suMax = suYuan;
            }
            Report report = Report.calcReport(wd, suYuan, suMax);
            list.add(report);
        }
        return list;