管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-28 c33441493c8a2111998de4be47c4b52a03f28e87
1
已修改3个文件
89 ■■■■■ 文件已修改
src/main/java/com/lf/server/entity/all/StaticData.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/GdbHelper.java 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/show/OneMapMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -59,6 +59,16 @@
     */
    public static final double D1050 = 1050.0;
    public static final int I12 = 12;
    public static final int I24 = 24;
    public static final int I31 = 31;
    public static final int I60 = 60;
    public static final int I2050 = 2050;
    /**
     * 字符1
     */
src/main/java/com/lf/server/helper/GdbHelper.java
@@ -163,9 +163,8 @@
                }
                T t = (T) clazz.newInstance();
                if (readFeature(t, f, map, gField)) {
                    list.add(t);
                }
                readFeature(t, f, map, gField);
                list.add(t);
            } while (true);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
@@ -222,21 +221,18 @@
    /**
     * 读取Feature
     */
    private static <T> boolean readFeature(T t, Feature f, Map<Integer, Field> map, Field gField) {
        try {
            for (Integer i : map.keySet()) {
    private static <T> void readFeature(T t, Feature f, Map<Integer, Field> map, Field gField) {
        for (Integer i : map.keySet()) {
            try {
                Field field = map.get(i);
                setValue(t, f, field, i);
            } catch (Exception e) {
                log.error(e.getMessage(), e);
            }
        }
            if (null != gField) {
                setGeom(t, f, gField);
            }
            return true;
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            return false;
        if (null != gField) {
            setGeom(t, f, gField);
        }
    }
@@ -287,28 +283,32 @@
     * wkbNone = 100,
     * wkbLinearRing = 101
     */
    private static <T> void setGeom(T t, Feature f, Field gField) throws Exception {
        String geo = "null";
        if (null != f.GetGeometryRef()) {
            String wkt = f.GetGeometryRef().ExportToWkt();
            // noinspection AlibabaRemoveCommentedCode
            switch (f.GetGeometryRef().GetGeometryType()) {
                //case 1:
                //    wkt = wkt.replace("POINT", "MULTIPOINT");
                //    break;
                case 2:
                    wkt = wkt.replace("LINESTRING (", "MULTILINESTRING ((") + ")";
                    break;
                case 3:
                    wkt = wkt.replace("POLYGON (", "MULTIPOLYGON ((") + ")";
                    break;
                default:
                    break;
    private static <T> void setGeom(T t, Feature f, Field gField) {
        try {
            String geo = "null";
            if (null != f.GetGeometryRef()) {
                String wkt = f.GetGeometryRef().ExportToWkt();
                // noinspection AlibabaRemoveCommentedCode
                switch (f.GetGeometryRef().GetGeometryType()) {
                    //case 1:
                    //    wkt = wkt.replace("POINT", "MULTIPOINT");
                    //    break;
                    case 2:
                        wkt = wkt.replace("LINESTRING (", "MULTILINESTRING ((") + ")";
                        break;
                    case 3:
                        wkt = wkt.replace("POLYGON (", "MULTIPOLYGON ((") + ")";
                        break;
                    default:
                        break;
                }
                geo = String.format("ST_GeomFromText('%s')", wkt);
            }
            geo = String.format("ST_GeomFromText('%s')", wkt);
        }
        gField.set(t, geo);
            gField.set(t, geo);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
    /**
@@ -328,6 +328,10 @@
        float fSecond = pfSecond[0];
        int s = (int) fSecond;
        int ns = (int) (1000000000 * fSecond - s);
        if (pnYear[0] > StaticData.I2050 || pnMonth[0] > StaticData.I12 || pnDay[0] > StaticData.I31 || pnHour[0] > StaticData.I24 || pnMinute[0] > StaticData.I60) {
            return null;
        }
        LocalDateTime localDateTime = LocalDateTime.of(
                LocalDate.of(pnYear[0], pnMonth[0], pnDay[0]),
@@ -350,6 +354,9 @@
        int[] pnTzFlag = new int[1];
        f.GetFieldAsDateTime(index, pnYear, pnMonth, pnDay, pnHour, pnMinute, pfSecond, pnTzFlag);
        if (pnYear[0] > StaticData.I2050 || pnMonth[0] > StaticData.I12 || pnDay[0] > StaticData.I31) {
            return null;
        }
        return LocalDate.of(pnYear[0], pnMonth[0], pnDay[0]);
    }
src/main/java/com/lf/server/mapper/show/OneMapMapper.java
@@ -191,7 +191,7 @@
     * 选择项目信息
     * 查询项目信息
     *
     * @param projectName 项目名称
     * @param projectCode 项目编码
     * @return {@link List}<{@link String}>
     */
    public List<String> selectProjectInfo(String projectCode);
@@ -226,6 +226,4 @@
     * @return {@link List}<{@link String}>
     */
    public List<String> countProjectDown(String projectCode);
}