1
0
chenendian 2 недель назад
Родитель
Сommit
a3d1c89a32

+ 3 - 4
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/third/OfferDataController.java

@@ -29,6 +29,7 @@ import java.net.URLEncoder;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
@@ -54,10 +55,9 @@ public class OfferDataController extends BaseController {
      * @return
      */
     @PostMapping("/third/getLandSupplyList")
-    public R<Map<String, Object>> landSupplyList(@RequestBody ThirdProjectParamVo body) {
+    public R<List<Map<String, Object>>> landSupplyList(@RequestBody ThirdProjectParamVo body) {
         try {
-            Map<String, Object> map = offerDataService.landSupplyAndProjectList(body);
-            map.put("id", map.get("id"));
+            List<Map<String, Object>> map = offerDataService.landSupplyAndProjectList(body);
             return R.ok(map);
         } catch (Exception e) {
             return R.fail(e.getMessage());
@@ -67,7 +67,6 @@ public class OfferDataController extends BaseController {
 
 
 
-
     /**
      * 国有建设用地使用权首次登记
      * 不动产土地登记完成后入参使用

+ 12 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/ProjectImmobileCode.java

@@ -20,5 +20,17 @@ public class ProjectImmobileCode extends BaseId {
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updatedAt;
+
+    /** 环节id */
+    private String nodeId;
+
+    /** 矢量批次 */
+    private Integer geomDbId;
+
+    /** 数据id */
+    private Integer geomDetailsId;
+
+    /** 预赋不动产单元号 */
+    private String preAssignCode;
 }
 

+ 2 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/NodeLandMapper.java

@@ -61,4 +61,6 @@ public interface NodeLandMapper {
 
 
 
+    List<NodeLand> selectByGeom(@Param("ewkt") String ewkt);
+
 }

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

@@ -38,7 +38,7 @@ public interface ProjectImmobileCodeMapper {
     void insert(ProjectImmobileCode projectImmobileCode);
 
     /**
-     * 根据业务ID更新记录(更新 code, validFlag, updatedAt)
+     * 根据业务ID更新记录(更新 code, validFlag, updatedAt, nodeId, geomDbId, geomDetailsId, preAssignCode
      */
     void update(ProjectImmobileCode projectImmobileCode);
 

+ 2 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ProjectMapper.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface ProjectMapper {
@@ -86,7 +87,6 @@ public interface ProjectMapper {
 
     Integer getSearchGraphicLayerCount(ProjectFilterVo projectFilterVo);
 
-
     /**
      * 获取工改同步项目信息
      * @param nodeTableName
@@ -95,11 +95,10 @@ public interface ProjectMapper {
     List<Project> getZrzysiteProjectList(String nodeTableName);
 
 
-
     String getNodeSourceIdByTable(@Param("nodeId")String nodeId,@Param("tableName") String tableName);
 
 
-
+    List<Map<String,Object>> getTdyProjectList(@Param("condition") String condition);
 
 
 }

+ 2 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/OfferDataService.java

@@ -5,6 +5,7 @@ import com.siwei.apply.domain.vo.HouseFirstParamVo;
 import com.siwei.apply.domain.vo.LandFirstParamVo;
 import com.siwei.apply.domain.vo.ThirdProjectParamVo;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -34,7 +35,7 @@ public interface OfferDataService {
 
     Map<String, Object> houseFirstRegistration(HouseFirstParamVo body);
 
-    Map<String, Object> landSupplyAndProjectList(ThirdProjectParamVo body) ;
+    List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) ;
 
 
     }

+ 38 - 16
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/OfferDataServiceImpl.java

@@ -1,9 +1,12 @@
 package com.siwei.apply.service.third.impl;
 
 import com.siwei.apply.domain.NodeAttachment;
+import com.siwei.apply.domain.NodeLand;
 import com.siwei.apply.domain.ProjectWorkflow;
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
+import com.siwei.apply.mapper.NodeLandMapper;
+import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.mapper.ProjectWorkflowMapper;
 import com.siwei.apply.service.GyjsydjfwscdjService;
 import com.siwei.apply.service.GyjsydscdjService;
@@ -51,6 +54,13 @@ public class OfferDataServiceImpl implements OfferDataService {
     @Autowired
     private NodeLandService nodeLandService;
 
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private NodeLandMapper nodeLandMapper;
+
+
     @Override
     public Map<String, String> get(String projectId) {
         return Map.of();
@@ -61,14 +71,13 @@ public class OfferDataServiceImpl implements OfferDataService {
         return Map.of();
     }
 
-
     /**
      * 根据入参数据,多个取并集,获取项目的相关数据
      * @param body
      * @return
      */
     @Override
-    public Map<String, Object> landSupplyAndProjectList(ThirdProjectParamVo body) {
+    public List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) {
         /*
         1.根据项目名称,项目代码,获取项目列表
         2.根据srf,获取项目列表
@@ -77,27 +86,43 @@ public class OfferDataServiceImpl implements OfferDataService {
         5.将以上四个列表取并集,返回结果
         获取 1.项目与土地供应,两个表进行关联。
         并且为上链的,并且数据已经存在的数据。
-         */
 
+        --  geom相关信息,如何查询,通过交集的相关
+        SELECT   pro."name"  as xmmc ,  pro."code"  as xmdm  ,td.*  from "t_tdgy" td
+        LEFT JOIN   "t_project"  pro  on   td.project_id=pro."id"
+        LEFT JOIN  "t_project_immobile_code"    immobile  ON pro.id = immobile.project_id and immobile.valid_flag=1
+        WHERE td.has_onchain='t'   and  pro."id" is not null  and immobile.code is   null
+        and   ( pro."name" LIKE '%测试%'  or   pro."code" LIKE '%测试%'  or    td."srf"   LIKE '%测试%'    );
 
+
+
+        */
        String projectName =  body.getXmmc();
        String projectCode =  body.getXmdm();
        String srf =  body.getSrf();
        String yfbdcdyh =  body.getYfbdcdyh();
-       String geom =  body.getGeom();
-
-
-
-
-
-       
-
-
+       String ewktString =  body.getGeom();
 
 
+        String condition = "1=1";
+        if(StringUtils.isNotBlank(projectName)){
+            condition += " and xmmc like '%"+projectName+"%'";
+        }
+        if(StringUtils.isNotBlank(projectCode)){
+            condition += " and xmdm like '%"+projectCode+"%'";
+        }
+        if(StringUtils.isNotBlank(srf)) {
+            condition += " and srf like '%" + srf + "%'";
+        }
 
+        if(StringUtils.isNotBlank(yfbdcdyh)) {
+            List<NodeLand> res = nodeLandMapper.selectByGeom(ewktString);
+            //todo nodeId 的list 然后进行in条件的拼接
+            condition+="";
+        }
 
-        return null;
+        List<Map<String,Object>>  result = projectMapper.getTdyProjectList("");
+        return result;
     }
 
 
@@ -107,9 +132,6 @@ public class OfferDataServiceImpl implements OfferDataService {
 
 
 
-
-
-
     @Override
     public Map<String, Object> landFirstRegistration(LandFirstParamVo body) {
         String yfbdcdyh = body.getYfbdcdyh();

+ 8 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/NodeLandMapper.xml

@@ -147,4 +147,12 @@
     </select>
 
 
+    <select id="selectByGeom"  parameterType="String"  resultMap="BaseResultMap">
+         SELECT  bb.*   from  t_geom_db_details aa
+         LEFT JOIN t_node_land bb  on aa.upload_id = bb.geom_db_id
+         LEFT JOIN t_tdgy  cc
+         on  bb.node_id=cc.id
+         where  public.ST_Intersects(aa.geom,public.ST_GeomFromEWKT(#{ewkt})) and   cc.id is not null
+    </select>
+
 </mapper>

+ 26 - 5
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectImmobileCodeMapper.xml

@@ -14,11 +14,16 @@
         <result property="validFlag" column="valid_flag"/>
         <result property="createdAt" column="created_at"/>
         <result property="updatedAt" column="updated_at"/>
+        <result property="nodeId" column="node_id"/>
+        <result property="geomDbId" column="geom_db_id"/>
+        <result property="geomDetailsId" column="geom_details_id"/>
+        <result property="preAssignCode" column="preAssignCode"/>
     </resultMap>
 
     <!-- 基础查询字段 -->
     <sql id="Base_Column_List">
-        id, project_id, business_id, code, valid_flag, created_at, updated_at
+        id, project_id, business_id, code, valid_flag, created_at, updated_at,
+        node_id, geom_db_id, geom_details_id, "preAssignCode"
     </sql>
 
     <!-- 根据ID查询 -->
@@ -70,7 +75,11 @@
             code,
             valid_flag,
             created_at,
-            updated_at
+            updated_at,
+            node_id,
+            geom_db_id,
+            geom_details_id,
+            "preAssignCode"
         ) VALUES (
             #{id},
             #{projectId},
@@ -78,16 +87,24 @@
             #{code},
             #{validFlag},
             #{createdAt},
-            #{updatedAt}
+            #{updatedAt},
+            #{nodeId},
+            #{geomDbId},
+            #{geomDetailsId},
+            #{preAssignCode}
         )
     </insert>
 
-    <!-- 根据业务ID更新记录(更新 code, valid_flag, updated_at) -->
+    <!-- 根据业务ID更新记录(更新 code, valid_flag, updated_at, node_id, geom_db_id, geom_details_id, preAssignCode) -->
     <update id="update" parameterType="com.siwei.apply.domain.ProjectImmobileCode">
         UPDATE t_project_immobile_code
         SET code = #{code},
             valid_flag = #{validFlag},
-            updated_at = #{updatedAt}
+            updated_at = #{updatedAt},
+            node_id = #{nodeId},
+            geom_db_id = #{geomDbId},
+            geom_details_id = #{geomDetailsId},
+            "preAssignCode" = #{preAssignCode}
         WHERE business_id = #{businessId}
     </update>
 
@@ -99,6 +116,10 @@
             <if test="businessId != null">business_id = #{businessId},</if>
             <if test="code != null">code = #{code},</if>
             <if test="validFlag != null">valid_flag = #{validFlag},</if>
+            <if test="nodeId != null">node_id = #{nodeId},</if>
+            <if test="geomDbId != null">geom_db_id = #{geomDbId},</if>
+            <if test="geomDetailsId != null">geom_details_id = #{geomDetailsId},</if>
+            <if test="preAssignCode != null">"preAssignCode" = #{preAssignCode},</if>
             <if test="updatedAt != null">updated_at = #{updatedAt}</if>
         </set>
         WHERE id = #{id}

+ 13 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -832,4 +832,17 @@
         where  LENGTH(TRIM(p.code))>0   and  node.has_onchain=false  and  node.source_id is null
     </select>
 
+
+    <!-- 1.查询不动产单元号未赋值的,没有与不动产交互的。2.前置阶段已经上链的-->
+    <select id="getTdyProjectList" resultType="map">
+        SELECT   pro."name"  as xmmc ,  pro."code"  as xmdm  ,td.*  from "t_tdgy" td
+        LEFT JOIN   "t_project"  pro  on   td.project_id=pro."id"
+        LEFT JOIN  "t_project_immobile_code"    immobile  ON pro.id = immobile.project_id and immobile.valid_flag=1
+        WHERE td.has_onchain='t'   and  pro."id" is not null  and immobile.code is   null
+        <if test="condition != null condition!= ''">
+            and   ( $condition  )
+        </if>
+    </select>
+
+
 </mapper>