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

不动产对接更新&url路径

chenendian 3 дней назад
Родитель
Сommit
2b0cffa3eb

+ 9 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/GyjsydjfwscdjMapper.java

@@ -44,4 +44,13 @@ public interface GyjsydjfwscdjMapper {
      * @param hasOnchain 是否上链
      */
     void updateHasOnchain(@Param("id") String id, @Param("hasOnchain") Boolean hasOnchain);
+
+
+
+    /**
+     * 根据主键ID获取单条记录
+     */
+    Gyjsydjfwscdj getBySourceId(@Param("sourceId") String sourceId);
+
+
 }

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

@@ -1,5 +1,6 @@
 package com.siwei.apply.service;
 
+import com.siwei.apply.domain.Gyjsydjfwscdj;
 import com.siwei.apply.domain.res.GyjsydjfwscdjRes;
 import com.siwei.apply.domain.res.GyjsydjfwscdjSinglRes;
 import com.siwei.apply.domain.vo.GyjsydjfwscdjUpdateVo;
@@ -46,4 +47,7 @@ public interface GyjsydjfwscdjService {
      * @param hasOnchain 是否上链
      */
     void updateHasOnchain(String id, Boolean hasOnchain);
+
+    Gyjsydjfwscdj getBySourceId(String sourceId);
+
 }

+ 8 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/Gyjsydjfwscdjmpl.java

@@ -120,4 +120,12 @@ public class Gyjsydjfwscdjmpl implements GyjsydjfwscdjService {
     public void updateHasOnchain(String id, Boolean hasOnchain) {
         gyjsydjfwscdjMapper.updateHasOnchain(id, hasOnchain);
     }
+
+
+    @Override
+    public Gyjsydjfwscdj getBySourceId(String sourceId) {
+        return gyjsydjfwscdjMapper.getBySourceId(sourceId);
+    }
+
+
 }

+ 42 - 44
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java

@@ -2,10 +2,8 @@ package com.siwei.apply.service.third.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.siwei.apply.domain.LandType;
-import com.siwei.apply.domain.Project;
-import com.siwei.apply.domain.ProjectImmobileCode;
-import com.siwei.apply.domain.ProjectWorkflow;
+import com.siwei.apply.domain.*;
+import com.siwei.apply.domain.res.GyjsydjfwscdjSinglRes;
 import com.siwei.apply.domain.res.GyjsydscdjRes;
 import com.siwei.apply.domain.res.GyjsydscdjSinglRes;
 import com.siwei.apply.domain.vo.*;
@@ -226,6 +224,9 @@ public class TakeDataServiceImpl implements TakeDataService {
         return retMap;
     }
 
+
+
+
     /**
      * 远程获取国有建设用地使用权首次登记数据
      * 并且入库
@@ -247,7 +248,6 @@ public class TakeDataServiceImpl implements TakeDataService {
             throw new ServiceException("业务类型为空");
         }
         Map<String, Object> retMap = new HashMap<>();
-
         //todo 这里进行远程请求,获取相关数据,解析后入库
         try {
             Map<String,Object> paramMap = new LinkedHashMap<>();
@@ -263,67 +263,69 @@ public class TakeDataServiceImpl implements TakeDataService {
                     throw new ServiceException("检查预赋不动产单元号是否正确");
                 }
                 //todo  这里根据 sourceId 确认是修改还是新增
-                //
-
+                String needUpdateNodeId = "";
                 String projectId = immobileCodeRes.getProjectId();
-                //Project project = projectMapper.get(projectId);
-                GyjsydscdjVo gyjsydscdjVo = new GyjsydscdjVo();
-                gyjsydscdjVo.setProjectId(projectId);
-                gyjsydscdjVo.setQlr(body.getQlr());
-
-                gyjsydscdjVo.setGyqk(body.getGyqk());
-                gyjsydscdjVo.setZl(body.getZl());
-                gyjsydscdjVo.setQllx(body.getQllx());
-                gyjsydscdjVo.setQlxz(body.getQlxz());
-                //土地用途转化
-                if(StringUtils.isNotBlank(body.getTdyt())){
-                    String code = this.getTdytCodeByName(body.getTdyt());
-                    gyjsydscdjVo.setTdyt(code);
-                }
-                if (StringUtils.isNotBlank(body.getTdmj())) {
-                    gyjsydscdjVo.setArea(Float.valueOf(body.getTdmj()));
+                String sourceId = body.getYwbh();
+                Gyjsydjfwscdj existsNode = gyjsydjfwscdjService.getBySourceId(sourceId);//todo 这里需要根据sourceId 检查
+                if(Objects.nonNull(existsNode)){
+                    needUpdateNodeId = existsNode.getId();
                 }
-                gyjsydscdjVo.setAreaUnit(body.getTdmjdw());
-                gyjsydscdjVo.setBdcdyh(StringUtils.isNotBlank(body.getBdcdyh()) ? body.getBdcdyh() : body.getYfbdcdyh());
-                gyjsydscdjVo.setBdczh(body.getBdczh());
-                gyjsydscdjVo.setDjjg(body.getDjjg());
-                gyjsydscdjVo.setDjDate(body.getDjrq());
-                gyjsydscdjVo.setSourceId(ywh);
-                String nodeId = gyjsydscdjService.add(gyjsydscdjVo);
-                retMap.put("id", nodeId);
+                String addNodeId = addOrUpdateLandFirstRegistration(body,projectId,needUpdateNodeId);
                 //这里保存附件信息
                 if(Objects.nonNull(body.getAttachment()) && !body.getAttachment().isEmpty()){
-                    nodeAttachmentService.getThirdAttachment(projectId,nodeId,AloneWorkFlowEnum.NODE_3.getName(),body.getAttachment());
+                    nodeAttachmentService.getThirdAttachment(projectId,addNodeId,AloneWorkFlowEnum.NODE_3.getName(),body.getAttachment());
                 }
             }
         } catch (Exception e) {
             log.error("调用矢量保存文件错误,业务编号:{}: ", ywh);
             e.printStackTrace();
         }
-        //todo 同步完成之后,需要修改t_third_record_status 表的状态值,同步完成;
         return retMap;
     }
 
 
 
-    public String  addOrUpdateLandFirstRegistration( LandFirstParamVo body ,String projectId,String needUpdateNodeId,String ywh ) {
+    public String  addOrUpdateLandFirstRegistration(LandFirstParamVo body,String projectId,String needUpdateNodeId) {
         String addNodeId = "";
         if (StringUtils.isNotBlank(needUpdateNodeId)) {
+            GyjsydscdjUpdateVo gyjsydscdjUpdateVo = new GyjsydscdjUpdateVo();
+            gyjsydscdjUpdateVo.setProjectId(projectId);
+            gyjsydscdjUpdateVo.setId(needUpdateNodeId);
+            gyjsydscdjUpdateVo.setQlr(body.getQlr());
+            gyjsydscdjUpdateVo.setGyqk(body.getGyqk());
+            gyjsydscdjUpdateVo.setZl(body.getZl());
+            gyjsydscdjUpdateVo.setQllx(body.getQllx());
+            gyjsydscdjUpdateVo.setQlxz(body.getQlxz());
+
+            //土地用途转化
+            if (StringUtils.isNotBlank(body.getTdyt())) {
+                String code = null; //todo 转化
+                gyjsydscdjUpdateVo.setTdyt(code);
+            }
+            if (StringUtils.isNotBlank(body.getTdmj())) {
+                gyjsydscdjUpdateVo.setArea(Float.valueOf(body.getTdmj()));
+            }
+            gyjsydscdjUpdateVo.setAreaUnit(body.getTdmjdw());
+            gyjsydscdjUpdateVo.setBdcdyh(StringUtils.isNotBlank(body.getBdcdyh()) ? body.getBdcdyh() : body.getYfbdcdyh());
+            gyjsydscdjUpdateVo.setBdczh(body.getBdczh());
+            gyjsydscdjUpdateVo.setDjjg(body.getDjjg());
+            gyjsydscdjUpdateVo.setDjDate(body.getDjrq());
+            gyjsydscdjUpdateVo.setSourceId(body.getYwbh());
+            gyjsydscdjService.update(gyjsydscdjUpdateVo);
+            addNodeId = needUpdateNodeId;
+        }else{
             GyjsydscdjVo gyjsydscdjVo = new GyjsydscdjVo();
             gyjsydscdjVo.setProjectId(projectId);
             gyjsydscdjVo.setQlr(body.getQlr());
-
             gyjsydscdjVo.setGyqk(body.getGyqk());
             gyjsydscdjVo.setZl(body.getZl());
             gyjsydscdjVo.setQllx(body.getQllx());
             gyjsydscdjVo.setQlxz(body.getQlxz());
-
             //土地用途转化
-            if (StringUtils.isNotBlank(body.getTdyt())) {
-                String code = null;
+            if(StringUtils.isNotBlank(body.getTdyt())){
+                String code = this.getTdytCodeByName(body.getTdyt());
                 gyjsydscdjVo.setTdyt(code);
             }
-
             if (StringUtils.isNotBlank(body.getTdmj())) {
                 gyjsydscdjVo.setArea(Float.valueOf(body.getTdmj()));
             }
@@ -332,11 +334,10 @@ public class TakeDataServiceImpl implements TakeDataService {
             gyjsydscdjVo.setBdczh(body.getBdczh());
             gyjsydscdjVo.setDjjg(body.getDjjg());
             gyjsydscdjVo.setDjDate(body.getDjrq());
-            gyjsydscdjVo.setSourceId(ywh);
+            gyjsydscdjVo.setSourceId(body.getYwbh());
             String nodeId = gyjsydscdjService.add(gyjsydscdjVo);
             addNodeId = nodeId;
         }
-
         return addNodeId;
     }
 
@@ -348,9 +349,6 @@ public class TakeDataServiceImpl implements TakeDataService {
 
 
 
-
-
-
     @Override
     public Map<String, Object> remoteHouseFirstRegistration(ThirdRecordStatusParamVo paramVo) {
         String yfbdcdyh = paramVo.getYfbdcdyh();

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

@@ -57,6 +57,16 @@
         WHERE id = #{id}
     </select>
 
+
+    <!-- 新增:根据主键ID获取单条记录 -->
+    <select id="getBySourceId" resultMap="BaseResultMap" parameterType="String">
+        SELECT *
+        FROM t_gyjsydjfwscdj
+        WHERE source_id = #{sourceId}
+        Limit 1
+    </select>
+
+
     <!-- 更新记录 -->
     <update id="update" parameterType="com.siwei.apply.domain.vo.GyjsydjfwscdjUpdateVo">
         UPDATE t_gyjsydjfwscdj
@@ -87,4 +97,7 @@
         WHERE id = #{id}
     </update>
 
+
+
+
 </mapper>

+ 1 - 1
siwei-modules/siwei-system/src/main/java/com/siwei/system/controller/SysProfileController.java

@@ -141,7 +141,7 @@ public class SysProfileController extends BaseController
             {
                 return error("文件服务异常,请联系管理员");
             }
-            String url = fileResult.getData().getUrl();
+            String url = fileResult.getData().getPath();
             if (userService.updateUserAvatar(loginUser.getUsername(), url))
             {
                 AjaxResult ajax = AjaxResult.success();