1
0
Просмотр исходного кода

Merge branch 'dev-excel0521' into dev-to-user-1

# Conflicts:
#	siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceUtil.java
chenendian 6 часов назад
Родитель
Сommit
bac1dc24e6

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

@@ -60,6 +60,14 @@ public interface ProjectImmobileCodeMapper {
      */
      */
     void updateById(ProjectImmobileCode projectImmobileCode);
     void updateById(ProjectImmobileCode projectImmobileCode);
 
 
+
+    /**
+     * 根据ID更新记录(可选字段更新)
+     */
+    void updateByPreCode(ProjectImmobileCode projectImmobileCode);
+
+
+
     /**
     /**
      * 根据项目ID删除
      * 根据项目ID删除
      */
      */

+ 12 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/OfferDataServiceImpl.java

@@ -133,6 +133,12 @@ public class OfferDataServiceImpl implements OfferDataService {
 //            throw new ServiceException("预赋不动产单元号长度必须为19位");
 //            throw new ServiceException("预赋不动产单元号长度必须为19位");
 //        }
 //        }
 
 
+        //这里两者必须绑定
+        String bdcdyh = body.getBdcdyh();
+        if (StringUtils.isBlank(bdcdyh)) {
+            throw new ServiceException("不动产单元号为空");
+        }
+
         String ywlx = body.getYwlx();
         String ywlx = body.getYwlx();
         if (StringUtils.isBlank(ywlx)) {
         if (StringUtils.isBlank(ywlx)) {
             throw new ServiceException("业务类型为空");
             throw new ServiceException("业务类型为空");
@@ -195,6 +201,12 @@ public class OfferDataServiceImpl implements OfferDataService {
                 updateVo.setId(body.getId());
                 updateVo.setId(body.getId());
                 updateVo.setTbzt("1");
                 updateVo.setTbzt("1");
                 thirdRecordStatusMapper.updateById(updateVo);
                 thirdRecordStatusMapper.updateById(updateVo);
+
+                //这里需要更新绑定关系
+                ProjectImmobileCode  updateImmobileCode = new ProjectImmobileCode();
+                updateImmobileCode.setCode(bdcdyh);
+                updateImmobileCode.setPreAssignCode(yfbdcdyh);
+                projectImmobileCodeMapper.updateByPreCode(updateImmobileCode);
                 return body.getId();
                 return body.getId();
             }).exceptionally(e -> {
             }).exceptionally(e -> {
                 log.error("不动产远程抓取数据失败: ywh={}, ywlx={}", ywh, ywlx, e);
                 log.error("不动产远程抓取数据失败: ywh={}, ywlx={}", ywh, ywlx, e);

+ 17 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectImmobileCodeMapper.xml

@@ -178,6 +178,23 @@
         WHERE id = #{id}
         WHERE id = #{id}
     </update>
     </update>
 
 
+    <!-- 根据预赋码更新记录(可选字段更新) -->
+    <update id="updateByPreCode" parameterType="com.siwei.apply.domain.ProjectImmobileCode">
+        UPDATE t_project_immobile_code
+        <set>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="sequenceNumber != null">sequence_number = #{sequenceNumber},</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="updatedAt != null">updated_at = #{updatedAt}</if>
+        </set>
+        WHERE pre_assign_code = #{preAssignCode}
+    </update>
+
+
     <!-- 根据项目ID删除 -->
     <!-- 根据项目ID删除 -->
     <delete id="deleteByProjectId" parameterType="String">
     <delete id="deleteByProjectId" parameterType="String">
         DELETE FROM t_project_immobile_code WHERE project_id = #{projectId}
         DELETE FROM t_project_immobile_code WHERE project_id = #{projectId}

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

@@ -848,12 +848,12 @@
             td.has_zz         as bzzt,
             td.has_zz         as bzzt,
             td.hbcrhtbh       as hbcrhtbh,
             td.hbcrhtbh       as hbcrhtbh,
             td.hbcrht_date    as hbcrhtrq,
             td.hbcrht_date    as hbcrhtrq,
-            (SELECT immobile.pre_assign_code
+            COALESCE((SELECT immobile.pre_assign_code
                FROM t_project_immobile_code immobile
                FROM t_project_immobile_code immobile
               WHERE immobile.project_id = pro.id
               WHERE immobile.project_id = pro.id
                 AND immobile.valid_flag = 1
                 AND immobile.valid_flag = 1
                 AND immobile.pre_assign_code IS NOT NULL
                 AND immobile.pre_assign_code IS NOT NULL
-              LIMIT 1) as yfbdcdyh,
+              LIMIT 1),'') as yfbdcdyh,
             (SELECT array_to_string(array_agg(ST_AsEWKT(gd.geom)), '|')
             (SELECT array_to_string(array_agg(ST_AsEWKT(gd.geom)), '|')
                FROM t_node_land nl
                FROM t_node_land nl
                LEFT JOIN t_geom_db_details gd ON nl.geom_db_id = gd.upload_id
                LEFT JOIN t_geom_db_details gd ON nl.geom_db_id = gd.upload_id

+ 0 - 3
siwei-modules/siwei-apply/src/main/resources/mapper/ThirdRecordStatusMapper.xml

@@ -101,9 +101,6 @@
     </select>
     </select>
 
 
 
 
-
-
-
     <!-- 根据主键 ID 覆盖更新登簿状态信息 -->
     <!-- 根据主键 ID 覆盖更新登簿状态信息 -->
     <update id="updateById" parameterType="com.siwei.apply.domain.vo.ThirdRecordStatusParamVo">
     <update id="updateById" parameterType="com.siwei.apply.domain.vo.ThirdRecordStatusParamVo">
         UPDATE t_third_record_status
         UPDATE t_third_record_status