Преглед изворни кода

生命周期环节增加字段

chenendian пре 1 месец
родитељ
комит
47b646b7f6

+ 9 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/res/ProjectWorkflowRes.java

@@ -37,5 +37,14 @@ public class ProjectWorkflowRes {
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date createdAt;
+
+
+    /**
+     * 展示名称
+     */
+    @JsonIgnore
+    private String viewField;
+
+
 }
 

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/CadastreFileMapper.java

@@ -58,7 +58,7 @@ public interface CadastreFileMapper {
 
     List<Map<String,String>> selectTableCollumAndType(@Param("tableName") String tableName);
 
-    List<String> selectDistinctValueByField(@Param("tableName") String tableName, @Param("fieldName") String fieldName);
+    List<String> selectDistinctValueByField(@Param("tableName") String tableName, @Param("fieldName") String fieldName,@Param("validFlag") String validFlag);
 
     /**
      * 查询所有表名

+ 5 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java

@@ -1313,15 +1313,18 @@ public class CadastreManageServiceImpl implements CadastreManageService {
         return res;
     }
 
-
     @Override
     public List<String> getDistinctValueByField(String tableName,String fieldName) {
         List<String> res = new ArrayList<>();
+        String validFlag =null;
         List<String> collumList = cadastreFileMapper.selectTableCollum(tableName);
         if(!collumList.contains(fieldName)){
             return res;
         }
-        res = cadastreFileMapper.selectDistinctValueByField(tableName,fieldName);
+        if(collumList.contains("valid_flag")){
+            validFlag = "0";
+        }
+        res = cadastreFileMapper.selectDistinctValueByField(tableName,fieldName,validFlag);
         return res;
     }
 

+ 15 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java

@@ -253,6 +253,21 @@ public class ProjectImpl implements ProjectService {
                         }
                     }
                     projectWorkflowRes.setCreatedAt(businessDate);
+
+                    String viewField = "";
+                    String tableName = projectWorkflowRes.getNodeTableName();
+                    if(AloneWorkFlowEnum.NODE_0.getTableName().equalsIgnoreCase(tableName)){
+                        //取建设单位
+                        Project project = projectMapper.get(projectId);
+                        viewField = project.getCompany();
+                    }else if(AloneWorkFlowEnum.NODE_1.getTableName().equalsIgnoreCase(tableName)) {
+                        viewField =  currentNode.get("pfwh") != null ? String.valueOf(currentNode.get("pfwh")) : "";
+                    } else if (AloneWorkFlowEnum.NODE_2.getTableName().equalsIgnoreCase(tableName)) {
+                        viewField =  currentNode.get("srf") != null ? String.valueOf(currentNode.get("srf")) : "";
+                    } else if (AloneWorkFlowEnum.NODE_3.getTableName().equalsIgnoreCase(tableName)) {
+                        viewField = currentNode.get("bdcdyh") != null ? String.valueOf(currentNode.get("bdcdyh")) : "";
+                    }
+                    projectWorkflowRes.setViewField(viewField);
                 }
                 projectWorkflows.add(projectWorkflowRes);
             }

+ 6 - 37
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/MdbUtil.java

@@ -357,48 +357,17 @@ public class MdbUtil {
 
 
 
-
     /**
-     * 判断两个List<Map<String, Object>>中的数据是否完全一致
-     * (排除map中的geom字段和valid_flag字段的比较,针对其他字段做比较)
+     *  判断两个List<Map<String, Object>>中的数据是否完全一致
+     * (排除map中的geom字段和valid_flag字段的比较,针对其他字段值做比较)
+     * @param dbDataList  之前图层数据列表 (从数据库查询出来的图层数据列表)
+     * @param layerDataList 图层数据列表
+     * @return
      */
-    private boolean validMapSameData(List<Map<String, Object>> dataList1, List<Map<String, Object>> dataList2) {
-        if (dataList1 == null && dataList2 == null) {
-            return true;
-        }
-        if (dataList1 == null || dataList2 == null) {
-            return false;
-        }
-        if (dataList1.size() != dataList2.size()) {
-            return false;
-        }
-
-        for (int i = 0; i < dataList1.size(); i++) {
-            Map<String, Object> map1 = dataList1.get(i);
-            Map<String, Object> map2 = dataList2.get(i);
+    private boolean validMapSameData(List<Map<String, Object>> dbDataList, List<Map<String, Object>> layerDataList) {
 
-            if (map1 == null && map2 == null) continue;
-            if (map1 == null || map2 == null) return false;
 
-            // 获取所有唯一的键
-            Set<String> keys = new HashSet<>(map1.keySet());
-            keys.addAll(map2.keySet());
 
-            for (String key : keys) {
-                // 排除 geom 相关字段和 valid_flag 字段
-                if ("geom".equalsIgnoreCase(key) || "wkt_geom".equalsIgnoreCase(key) || "valid_flag".equalsIgnoreCase(key)) {
-                    continue;
-                }
-
-                Object v1 = map1.get(key);
-                Object v2 = map2.get(key);
-
-                // 使用 Objects.deepEquals 处理 null 和数组 (如 byte[])
-                if (!Objects.deepEquals(v1, v2)) {
-                    return false;
-                }
-            }
-        }
         return true;
     }
 

+ 5 - 2
siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/CadastreFileMapper.xml

@@ -121,7 +121,10 @@
 
     <select id="selectDistinctValueByField" parameterType="String" resultType="String">
         select distinct ${fieldName}  FROM  vector.${tableName}
-        WHERE valid_flag = 0
+        WHERE 1=1
+        <if test="validFlag != null">
+            AND   valid_flag = #{validFlag}::int2
+        </if>
     </select>
 
     <select id="selectAllTable"  resultType="string">
@@ -297,7 +300,7 @@
         <if test="ywh != null and ywh != ''">
             and ${ywh}
         </if>
-        LIMIT 100
+        LIMIT 10000
     </select>