1
0
chenendian 1 сар өмнө
parent
commit
adb560b3d0

+ 31 - 9
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/LandOneCodeServiceImpl.java

@@ -52,7 +52,8 @@ public class LandOneCodeServiceImpl implements LandOneCodeService {
     @Autowired
     private NodeLandMapper nodeLandMapper;
 
-
+    @Autowired
+    private JsgcghxkMapper jsgcghxkMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -196,12 +197,22 @@ public class LandOneCodeServiceImpl implements LandOneCodeService {
 //                registrationProcessCode = "1";
 //            }
 
+//            //许可分期编码
+//            if(currentNodeTableList.contains(talbeName6)){
+//                licenseStagesCode = "2";
+//            } else if(currentNodeTableList.contains(talbeName5)){
+//                licenseStagesCode = "1";
+//            }
             //许可分期编码
-            if(currentNodeTableList.contains(talbeName6)){
-                licenseStagesCode = "2";
-            } else if(currentNodeTableList.contains(talbeName5)){
-                licenseStagesCode = "1";
+            if(nodeTableName.equalsIgnoreCase(talbeName6)){
+                //建设工程规划许可阶段存在期数,其它默认当前阶段为1
+                Jsgcghxk jsgcghxk = jsgcghxkMapper.getById(nodeId);
+                Integer djq = jsgcghxk.getDjq();
+                if(Objects.nonNull(djq)){
+                    licenseStagesCode = String.valueOf(djq);
+                }
             }
+
         }else if(ProjectType.BATCH.getCode().equals(String.valueOf(projectType))){
             Tdgy globalTdgy = null; //土地供应对象
             //取征转状态
@@ -254,14 +265,25 @@ public class LandOneCodeServiceImpl implements LandOneCodeService {
 //                registrationProcessCode = "2";
 //            } else if(currentNodeTableList.contains(talbeName3)){
 //                registrationProcessCode = "1";
+//            }
+
+//            //许可分期编码
+//            if(currentNodeTableList.contains(talbeName6)){
+//                licenseStagesCode = "2";
+//            } else if(currentNodeTableList.contains(talbeName5)){
+//                licenseStagesCode = "1";
 //            }
 
             //许可分期编码
-            if(currentNodeTableList.contains(talbeName6)){
-                licenseStagesCode = "2";
-            } else if(currentNodeTableList.contains(talbeName5)){
-                licenseStagesCode = "1";
+            if(nodeTableName.equalsIgnoreCase(talbeName6)){
+                //建设工程规划许可阶段存在期数,其它默认当前阶段为1
+                Jsgcghxk jsgcghxk = jsgcghxkMapper.getById(nodeId);
+                Integer djq = jsgcghxk.getDjq();
+                if(Objects.nonNull(djq)){
+                    licenseStagesCode = String.valueOf(djq);
+                }
             }
+
         }
        returnCode = levyStatusCode+landSupplyModeCode+approvalProcessCode+licenseStagesCode;
        return returnCode;

+ 3 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/TdgyImpl.java

@@ -176,18 +176,19 @@ public class TdgyImpl implements TdgyService {
             for (Map<String, String> geomDetailsMap : geomDetailsList) {
                 String geomDetailsId = geomDetailsMap.get("id");
                 //校验图斑是否包含批次报批节点(重点)
-                Map<String, String> geomDetailsAndNodeMap= nodeLandService.selectGeomContainsNode(geomDetailsId);
+                Map<String, String> geomDetailsAndNodeMap = nodeLandService.selectGeomContainsNode(geomDetailsId);
                 if(!MapUtils.isEmpty(geomDetailsAndNodeMap)){
                     String nodeId = geomDetailsAndNodeMap.get("node_id");
                     resultMap.put(nodeId, geomDetailsAndNodeMap.get("id"));
                 }
             }
             if(resultMap.isEmpty()){
-                throw new ServiceException("当前地块未包含审核过的批次报批空间信息,请检查后再上链!");
+                throw new ServiceException("当前地块未被包含审核过的批次报批空间数据中,请检查后再上链!");
             }
             if(resultMap.size()>1){
                 throw new ServiceException("当前地块未包含多个地块,报批数据不在同一批次!");
             }
+
             String tableName ="t_ydbp_data";
             //获取到对应的批次报批节点,插入到流程表中
             String nodeId = resultMap.keySet().stream().findFirst().get();

+ 2 - 1
siwei-modules/siwei-apply/src/main/resources/mapper/NodeLandMapper.xml

@@ -110,11 +110,12 @@
     </select>
 
     <select id="selectGeomContainsNode" parameterType="String" resultType="map">
-        SELECT  geom.* , node.node_id   FROM  "t_geom_db_details"  geom
+        SELECT  geom.id , node.node_id   FROM  "t_geom_db_details"  geom
                 LEFT JOIN "public"."t_geom_db"  upload   on geom.upload_id=upload.id
                 LEFT JOIN "public"."t_node_land" node    on  node.geom_db_id=upload.id
                 LEFT JOIN  "public"."t_ydbp_data" ydbp   on  node.node_id=ydbp.id
                 where ydbp.has_onchain=true AND  st_contains(geom.geom, (SELECT geom FROM "t_geom_db_details" WHERE id = #{detailsId}) )
+                order by ydbp.created_at desc
                 limit 1
     </select>