燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-06-18 caa8596884dac891a8b5c4fcf85dd2f7a12812f5
1
已修改3个文件
44 ■■■■ 文件已修改
src/main/java/com/yssh/entity/Report.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/CalculateUtils.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/Report.java
@@ -72,23 +72,23 @@
        String time = wd.getTableName().replace("su_yuan_", "");
        double lastVal = 0;
        double speed1 = CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU());
        double speed1 = CalculateUtils.round2(CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU()));
        double direction1 = CalculateUtils.getWindDirection(suYuan.getV(), suYuan.getU());
        String dir = CalculateUtils.getDir(direction1);
        double maxVal = suMax.getVocsValue();
        double dis = CalculateUtils.getDistance2(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        //double dis = CalculateUtils.getDistance2(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double dis1 = CalculateUtils.getDistance1(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double angle = CalculateUtils.getAngle(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double angle = CalculateUtils.getAngle2(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double speed2 = CalculateUtils.getWindSpeed(suMax.getV(), suMax.getU());
        double direction2 = CalculateUtils.getWindDirection(suMax.getV(), suMax.getU());
        String maxDir = CalculateUtils.getDir(direction2);
        int isSame = (Math.abs(direction1 - direction2) < 15 && Math.abs(speed1 - speed2) < 0.3) ? 1 : 0;
        String maxDir = CalculateUtils.getDir(angle);
        int isSame = (Math.abs(direction1 - direction2) < 30 && Math.abs(speed1 - speed2) < 0.5) ? 1 : 0;
        return new Report(wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), lastVal, time,
                speed1, dir, maxVal, dis, maxDir, isSame);
                speed1, dir, maxVal, dis1, maxDir, isSame);
    }
    public String getName() {
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
@@ -392,6 +392,8 @@
                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);
src/main/java/com/yssh/utils/CalculateUtils.java
@@ -47,7 +47,7 @@
        s = s * EARTH_RADIUS1;
        return Math.round(s * 100) / 100;
        return round2(s);
    }
    /**
@@ -66,7 +66,11 @@
        // 计算距离,单位:米
        double distance = geodeticCalculator.getOrthodromicDistance();
        return Math.round(distance * 100) / 100;
        return round2(distance);
    }
    public static double round2(double d) {
        return ((long)(d * 100)) / 100D;
    }
    /**
@@ -84,13 +88,33 @@
            double angle = gc.getAzimuth();
            return Math.round(angle * 100) / 100;
            return round2(angle);
        } catch (Exception ex) {
            return 0;
        }
    }
    /**
     * 计算角度2
     */
    public static double getAngle2(double x1, double y1, double x2, double y2){
        try {
            DirectPosition2D p1 = new DirectPosition2D( x1, y1);
            DirectPosition2D p2 = new DirectPosition2D(x2, y2);
            GeodeticCalculator gc = new GeodeticCalculator();
            gc.setStartingGeographicPoint(p1);
            gc.setDestinationGeographicPoint(p2);
            double angle = gc.getAzimuth();
            return round2(angle);
        }catch (Exception ex){
            return 0;
        }
    }
    /**
     * 获取坐标
     * @param su
     * @return