管道基础大数据平台系统开发-【后端】-Server
13693261870
2023-02-21 fcd88fa48dccd67a9fb828fe1e27d8e3711aa69d
src/main/java/com/lf/server/helper/GdbHelper.java
@@ -242,7 +242,7 @@
    /**
     * 设置值
     */
    private static <T> void setValue(T t, Feature f, Field field, Integer i) throws Exception {
    public static <T> void setValue(T t, Feature f, Field field, Integer i) throws Exception {
        switch (field.getType().getName()) {
            case "java.math.BigDecimal":
                double dd = f.GetFieldAsDouble(i);
@@ -313,7 +313,7 @@
    /**
     * 获取 Timestamp
     */
    private static Timestamp getTimestamp(Feature f, int index) {
    public static Timestamp getTimestamp(Feature f, int index) {
        int[] pnYear = new int[1];
        int[] pnMonth = new int[1];
        int[] pnDay = new int[1];
@@ -339,7 +339,7 @@
    /**
     * 获取 LocalDate
     */
    private static LocalDate getLocalDate(Feature f, int index) {
    public static LocalDate getLocalDate(Feature f, int index) {
        int[] pnYear = new int[1];
        int[] pnMonth = new int[1];
        int[] pnDay = new int[1];
@@ -390,8 +390,7 @@
                    }
                    List<Field> fields = new ArrayList<>();
                    // fields.add(getGeomField(clazz))
                    getFields(clazz, fields);
                    getFields(clazz, fields, StaticData.GDB_EXCLUDE_FIELDS);
                    addLayerField(layer, fields);
                    setLayerData(layer, fields, map.get(key));
@@ -465,11 +464,11 @@
    /**
     * 获取字段
     */
    private static void getFields(Class clazz, List<Field> list) {
    public static void getFields(Class clazz, List<Field> list, List<String> excludeFields) {
        try {
            Field[] fields = clazz.getDeclaredFields();
            for (Field f : fields) {
                if (StaticData.GDB_EXCLUDE_FIELDS.contains(f.getName())) {
                if (excludeFields.contains(f.getName())) {
                    continue;
                }
@@ -478,7 +477,7 @@
            }
            if (!StaticData.OBJECT.equals(clazz.getSuperclass().getName())) {
                getFields(clazz.getSuperclass(), list);
                getFields(clazz.getSuperclass(), list, excludeFields);
            }
        } catch (Exception ex) {
            //