Răsfoiți Sursa

根据项目获取不动产登记码

chenendian 3 luni în urmă
părinte
comite
e28534e4f1

+ 6 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/LandOneCodeMapper.java

@@ -29,4 +29,10 @@ public interface LandOneCodeMapper {
     LandOneCode getByWorkflowId(@Param("workflowId") String workflowId);
 
 
+
+    LandOneCode getByProjectId(@Param("projectId") String projectId);
+
+
+
+
 }

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/LandOneCodeServiceImpl.java

@@ -332,6 +332,10 @@ public class LandOneCodeServiceImpl implements LandOneCodeService {
         LandOneCode landOneCode = mapper.getByWorkflowId(projectWorkflowId);
         String randomNumber = RandomStringUtils.randomNumeric(5);
         String resourceImmobileCode = "360122011009GB"+randomNumber+"W00000000";
+        LandOneCode existLandOneCod = mapper.getByProjectId(projectId);
+        if(Objects.nonNull(existLandOneCod) && StringUtils.isNotBlank(existLandOneCod.getResourceImmobileCode())){
+            resourceImmobileCode = existLandOneCod.getResourceImmobileCode();
+        }
         if(Objects.nonNull(landOneCode)){ //修改数据
             landOneCode.setProjectId(projectId);
             landOneCode.setLandCode(landCodeId);

+ 11 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/LandOneCodeMapper.xml

@@ -34,6 +34,17 @@
     </select>
 
 
+    <select id="getByProjectId" parameterType="string" resultMap="LandOneCodeResultMap">
+        SELECT id, land_code, project_id, project_workflow_id,
+               resource_immobile_code, resource_business_code, resource_project_code
+        FROM t_land_one_code
+        WHERE project_id = #{projectId}
+            LIMIT 1
+    </select>
+
+
+
+
     <select id="getById" parameterType="string" resultMap="LandOneCodeResultMap">
         SELECT id, land_code, project_id, project_workflow_id,
                resource_immobile_code, resource_business_code, resource_project_code