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

对外接口下载附件数据

chenendian 2 недель назад
Родитель
Сommit
aef164a7a4

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

@@ -150,18 +150,18 @@ public class OfferDataController extends BaseController {
     public R<NodeAttachment> attachmentList(@RequestBody AttachmentParamVo paramVo) {
     public R<NodeAttachment> attachmentList(@RequestBody AttachmentParamVo paramVo) {
         try {
         try {
             String projectId = paramVo.getYwbh();
             String projectId = paramVo.getYwbh();
-            String immobileCode = paramVo.getYfbdcdyh();
+            String preImmobileCode = paramVo.getYfbdcdyh();
             String dqjd = paramVo.getDqjd();
             String dqjd = paramVo.getDqjd();
-            if (StringUtils.isBlank(immobileCode)) {
+            if (StringUtils.isBlank(preImmobileCode)) {
                 return R.fail(502, "不动产号为空,请填充");
                 return R.fail(502, "不动产号为空,请填充");
             }
             }
             if (StringUtils.isBlank(dqjd)) {
             if (StringUtils.isBlank(dqjd)) {
                 return R.fail(502, "标识阶段为空,请填充");
                 return R.fail(502, "标识阶段为空,请填充");
             }
             }
-            if (StringUtils.isBlank(projectId)) {
-                return R.fail(502, "项目id为空,请填充");
-            }
-            NodeAttachment nodeAttachment = offerDataService.getThirdNodeAttachment(immobileCode, projectId, dqjd);
+//            if (StringUtils.isBlank(projectId)) {
+//                return R.fail(502, "项目id为空,请填充");
+//            }
+            NodeAttachment nodeAttachment = offerDataService.getThirdNodeAttachment(preImmobileCode, projectId, dqjd);
             return R.ok(nodeAttachment);
             return R.ok(nodeAttachment);
         } catch (Exception e) {
         } catch (Exception e) {
             return R.fail(502, "获取附件材料失败");
             return R.fail(502, "获取附件材料失败");

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

@@ -32,6 +32,12 @@ public interface ProjectImmobileCodeMapper {
      */
      */
     List<ProjectImmobileCode> selectByBusinessIdList(@Param("businessIdList") List<String> businessIdList);
     List<ProjectImmobileCode> selectByBusinessIdList(@Param("businessIdList") List<String> businessIdList);
 
 
+
+    /**
+     * 根据业务ID查询(只返回一条)
+     */
+    ProjectImmobileCode selectByPreAssignCode(@Param("preAssignCode") String preAssignCode);
+
     /**
     /**
      * 插入记录
      * 插入记录
      */
      */

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

@@ -30,7 +30,7 @@ public interface OfferDataService {
 
 
     String  getTheFile(String attachmentId, String dirName,String fileName) ;
     String  getTheFile(String attachmentId, String dirName,String fileName) ;
 
 
-    NodeAttachment getThirdNodeAttachment(String immobileCode, String projectId, String dqjd) throws Exception;
+    NodeAttachment getThirdNodeAttachment(String preImmobileCode, String projectId, String dqjd) throws Exception;
 
 
     Map<String, Object> landFirstRegistration(LandFirstParamVo body);
     Map<String, Object> landFirstRegistration(LandFirstParamVo body);
 
 

+ 26 - 14
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/OfferDataServiceImpl.java

@@ -1,9 +1,11 @@
 package com.siwei.apply.service.third.impl;
 package com.siwei.apply.service.third.impl;
 
 
 import com.siwei.apply.domain.NodeAttachment;
 import com.siwei.apply.domain.NodeAttachment;
+import com.siwei.apply.domain.ProjectImmobileCode;
 import com.siwei.apply.domain.ProjectWorkflow;
 import com.siwei.apply.domain.ProjectWorkflow;
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
+import com.siwei.apply.mapper.ProjectImmobileCodeMapper;
 import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.mapper.ProjectWorkflowMapper;
 import com.siwei.apply.mapper.ProjectWorkflowMapper;
 import com.siwei.apply.mapper.ThirdRecordStatusMapper;
 import com.siwei.apply.mapper.ThirdRecordStatusMapper;
@@ -61,6 +63,11 @@ public class OfferDataServiceImpl implements OfferDataService {
     private ThirdRecordStatusMapper thirdRecordStatusMapper;
     private ThirdRecordStatusMapper thirdRecordStatusMapper;
 
 
 
 
+    @Autowired
+    private ProjectImmobileCodeMapper projectImmobileCodeMapper;
+
+
+
     @Override
     @Override
     public Map<String, String> get(String projectId) {
     public Map<String, String> get(String projectId) {
         return Map.of();
         return Map.of();
@@ -226,11 +233,9 @@ public class OfferDataServiceImpl implements OfferDataService {
             throw new ServiceException("geom信息为空");
             throw new ServiceException("geom信息为空");
         }
         }
         //todo 这里进行文件下载入库:
         //todo 这里进行文件下载入库:
-
         try {
         try {
             GyjsydjfwscdjVo gyjsydjfwscdjVo = new GyjsydjfwscdjVo();
             GyjsydjfwscdjVo gyjsydjfwscdjVo = new GyjsydjfwscdjVo();
             gyjsydjfwscdjVo.setProjectId(body.getXmbh());
             gyjsydjfwscdjVo.setProjectId(body.getXmbh());
-
 //            gyjsydjfwscdjVo.setYwh(body.getYwh());
 //            gyjsydjfwscdjVo.setYwh(body.getYwh());
 //            gyjsydjfwscdjVo.setGzdgzsj(body.getGzdgzsj());
 //            gyjsydjfwscdjVo.setGzdgzsj(body.getGzdgzsj());
 //            gyjsydjfwscdjVo.setKfdw(body.getKfdw());
 //            gyjsydjfwscdjVo.setKfdw(body.getKfdw());
@@ -264,8 +269,6 @@ public class OfferDataServiceImpl implements OfferDataService {
     }
     }
 
 
 
 
-
-
     @Override
     @Override
     public String getTheFile(String attachmentId, String dirName, String fileName) {
     public String getTheFile(String attachmentId, String dirName, String fileName) {
         String fileAndPath = "";
         String fileAndPath = "";
@@ -285,17 +288,26 @@ public class OfferDataServiceImpl implements OfferDataService {
     }
     }
 
 
     @Override
     @Override
-    public NodeAttachment getThirdNodeAttachment(String immobileCode, String projectId, String dqjd) throws Exception {
-        String nodeTableName = dqjd.equals("00") ? AloneWorkFlowEnum.NODE_2.getTableName() : dqjd.equals("01") ? AloneWorkFlowEnum.NODE_6.getTableName() : "";
+    public NodeAttachment getThirdNodeAttachment(String preImmobileCode, String projectId, String dqjd) throws Exception {
         NodeAttachment nodeAttachment = null;
         NodeAttachment nodeAttachment = null;
-        List<ProjectWorkflow> projectWorkflows = projectWorkflowMapper.selectByProjectIdAndNodeTableName(projectId, nodeTableName);
-        Optional<ProjectWorkflow> res = projectWorkflows.stream().findFirst();
-        if (res.isPresent()) {
-            String nodeId = res.get().getNodeId();
-            log.info("-------getAttachmentByProjectIdAndTable-----" + nodeId);
-            nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId, null);
-            //这里获取到所有附件文件路径进行转化拼接为新的
-            ServiceUtil.convertFilePath(nodeAttachment);
+        //这里根据预赋不动产单元号获取项目id
+        if(StringUtils.isBlank(projectId)){
+            ProjectImmobileCode existing = projectImmobileCodeMapper.selectByPreAssignCode(preImmobileCode);
+            if (Objects.nonNull(existing)) {
+                projectId = existing.getProjectId();
+            }
+        }
+        if(StringUtils.isNotBlank(projectId)){
+            String nodeTableName = dqjd.equals("00") ? AloneWorkFlowEnum.NODE_2.getTableName() : dqjd.equals("01") ? AloneWorkFlowEnum.NODE_6.getTableName() : "";
+            List<ProjectWorkflow> projectWorkflows = projectWorkflowMapper.selectByProjectIdAndNodeTableName(projectId, nodeTableName);
+            Optional<ProjectWorkflow> res = projectWorkflows.stream().findFirst();
+            if (res.isPresent()) {
+                String nodeId = res.get().getNodeId();
+                log.info("-------getAttachmentByProjectIdAndTable-----" + nodeId);
+                nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId, null);
+                //这里获取到所有附件文件路径进行转化拼接为新的
+                ServiceUtil.convertFilePath(nodeAttachment);
+            }
         }
         }
         return nodeAttachment;
         return nodeAttachment;
     }
     }

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

@@ -66,6 +66,20 @@
         </where>
         </where>
     </select>
     </select>
 
 
+    <select id="selectByPreAssignCode" parameterType="String" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_project_immobile_code
+        <where>
+            <if test="preAssignCode != null and preAssignCode != ''">
+                pre_assign_code = #{preAssignCode}
+            </if>
+            And  valid_flag = 1
+        </where>
+        LIMIT 1
+    </select>
+
+
     <!-- 插入记录 -->
     <!-- 插入记录 -->
     <insert id="insert" parameterType="com.siwei.apply.domain.ProjectImmobileCode">
     <insert id="insert" parameterType="com.siwei.apply.domain.ProjectImmobileCode">
         INSERT INTO t_project_immobile_code (
         INSERT INTO t_project_immobile_code (
@@ -142,5 +156,13 @@
         DELETE FROM t_project_immobile_code WHERE business_id = #{businessId}
         DELETE FROM t_project_immobile_code WHERE business_id = #{businessId}
     </delete>
     </delete>
 
 
+
+
+
+
+
+
+
+
 </mapper>
 </mapper>
 
 

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

@@ -836,6 +836,7 @@
     <!-- 1.查询不动产单元号未赋值的,没有与不动产交互的。2.前置阶段已经上链的-->
     <!-- 1.查询不动产单元号未赋值的,没有与不动产交互的。2.前置阶段已经上链的-->
     <select id="getTdyProjectList" resultType="map">
     <select id="getTdyProjectList" resultType="map">
         SELECT
         SELECT
+            pro."id"          as xmbh,
             pro."name"        as xmmc,
             pro."name"        as xmmc,
             pro."code"        as xmdm,
             pro."code"        as xmdm,
             td.srf            as srf,
             td.srf            as srf,