Browse Source

试验-接入成渝第三方接口开发
1、整合第三标 第五标数据,修改接口使其适配
2、清除绑定信息(未完成)

LHB 21 hours ago
parent
commit
274085a05d
17 changed files with 108 additions and 120 deletions
  1. 1 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialCyFinishTestReport.java
  2. 2 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialCyController.java
  3. 8 54
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TrialCyAccessoriesClientImpl.java
  4. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyFinishTestReportMapper.java
  5. 32 14
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyFinishTestReportMapper.xml
  6. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyTestTypeMapper.java
  7. 3 2
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyTestTypeMapper.xml
  8. 12 13
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyThirdReportMapper.xml
  9. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.java
  10. 2 2
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.xml
  11. 8 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/TrialCyFinishTestReportService.java
  12. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/TrialCyService.java
  13. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/TrialCyTestTypeService.java
  14. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialCyFinishTestReportServiceImpl.java
  15. 9 11
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialCyServiceImpl.java
  16. 2 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialCyTestTypeServiceImpl.java
  17. 3 15
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialCyFinishTestReport.java

@@ -138,7 +138,7 @@ public class TrialCyFinishTestReport {
      * 试验树id
      */
     @ApiModelProperty("组装文件(报告+记录+委托单)")
-    @TableField("assemble_file")
+        @TableField("assemble_file")
     public String assembleFile;
     /**
      * 附件

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialCyController.java

@@ -55,8 +55,8 @@ public class TrialCyController {
     @GetMapping("/getTree")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "获取成渝那边的树", notes = "传入项目id")
-    public R<List<TrialCyTestType>> getTree(Long projectId, String parentId){
-        return R.data(trialCyService.getTree(projectId,parentId));
+    public R<List<TrialCyTestType>> getTree(Long projectId, String parentId, String contractId){
+        return R.data(trialCyService.getTree(projectId,parentId,contractId));
     }
 
     /**

+ 8 - 54
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TrialCyAccessoriesClientImpl.java

@@ -40,68 +40,22 @@ public class TrialCyAccessoriesClientImpl implements TrialCyAccessoriesClient {
     @Override
     public List<JSONObject> getTrialFilePdfRecord(String primaryKeyId, List<Integer> list) {
         //获取id
-        List<Map<String, Object>> trialFilePdfRecord = trialSelfInspectionRecordMapper.getTrialFilePdfRecord(primaryKeyId, list);
+        List<String> trialFilePdfRecord = trialSelfInspectionRecordMapper.getTrialFilePdfRecord(primaryKeyId, list);
 
         if (CollectionUtil.isNotEmpty(trialFilePdfRecord)) {
 
-            //试验报告ids
-            List<Long> listOne = new ArrayList<>();
-            //第三方外委ids
-            List<Long> listTwo = new ArrayList<>();
-
-            for (Map<String, Object> stringObjectMap : trialFilePdfRecord) {
-
-                Integer type = (Integer) stringObjectMap.get("type");
-                Long recordId = (Long) stringObjectMap.get("record_id");
-                //试验报告
-                if (type == 11) {
-                    listOne.add(recordId);
-                } else {
-                    //第三方、外委
-                    listTwo.add(recordId);
-                }
-            }
-
             List<JSONObject> result = new ArrayList<>();
-
-            if (CollectionUtil.isNotEmpty(listOne)) {
-                List<TrialCyFinishTestReport> list1 = trialCyFinishTestReportService.list(Wrappers.<TrialCyFinishTestReport>lambdaQuery()
-                        .isNotNull(TrialCyFinishTestReport::getAssembleFile)
-                        .in(TrialCyFinishTestReport::getTaskId, listOne)
-                );
-
-                if (CollectionUtil.isNotEmpty(list1)) {
-                    list1.forEach(f -> {
-                        String[] split = f.getAssembleFile().split("/");
-                        JSONObject jsonObject = new JSONObject();
-                        jsonObject.put("id", f.getTaskId());
-                        jsonObject.put("name", split[split.length - 1]);
-                        jsonObject.put("contractId", f.getContractId());
-                        jsonObject.put("domainUrl", f.getAssembleFile());
-                        jsonObject.put("domainPdfUrl", f.getAssembleFile());
-                        jsonObject.put("tabId", primaryKeyId);
-                        jsonObject.put("extension", "pdf");
-                        //是否为试验关联的附件
-                        jsonObject.put("isTrial", true);
-                        result.add(jsonObject);
-                    });
-                }
-            }
-            if (CollectionUtil.isNotEmpty(listTwo)) {
-                List<TrialCyThirdReport> list1 = trialCyThirdReportService.list(Wrappers.<TrialCyThirdReport>lambdaQuery()
-                        .isNotNull(TrialCyThirdReport::getAssembleFile)
-                        .in(TrialCyThirdReport::getId, listTwo)
-                );
-
+            if (CollectionUtil.isNotEmpty(trialFilePdfRecord)) {
+                List<Map<String,Object>> list1 = trialCyFinishTestReportService.selectViewList(trialFilePdfRecord);
                 if (CollectionUtil.isNotEmpty(list1)) {
                     list1.forEach(f -> {
-                        String[] split = f.getAssembleFile().split("/");
+                        String[] split = f.get("assembleFile").toString().split("/");
                         JSONObject jsonObject = new JSONObject();
-                        jsonObject.put("id", f.getId());
+                        jsonObject.put("id", f.get("id"));
                         jsonObject.put("name", split[split.length - 1]);
-                        jsonObject.put("contractId", f.getContractId());
-                        jsonObject.put("domainUrl", f.getAssembleFile());
-                        jsonObject.put("domainPdfUrl", f.getAssembleFile());
+                        jsonObject.put("contractId", f.get("contractId"));
+                        jsonObject.put("domainUrl", f.get("assembleFile"));
+                        jsonObject.put("domainPdfUrl", f.get("assembleFile"));
                         jsonObject.put("tabId", primaryKeyId);
                         jsonObject.put("extension", "pdf");
                         //是否为试验关联的附件

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyFinishTestReportMapper.java

@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.springblade.business.vo.ThirdReportVo;
 import org.springblade.business.vo.TrialCyThirdReportQueryVo;
 
+import java.util.List;
+import java.util.Map;
+
 /**
 * @author LHB
 * @description 针对表【u_trial_cy_finish_test_report(成渝-获取标段已完成(已签章完成)的检测报告)】的数据库操作Mapper
@@ -16,6 +19,10 @@ import org.springblade.business.vo.TrialCyThirdReportQueryVo;
 public interface TrialCyFinishTestReportMapper extends BaseMapper<TrialCyFinishTestReport> {
 
     Page<ThirdReportVo> myPage(Page<ThirdReportVo> page, @Param("query") TrialCyThirdReportQueryVo queryVo);
+
+    List<String> selectViewPdfList(@Param("ids") List<Long> ids);
+
+    List<Map<String,Object>> selectViewList(@Param("ids") List<String> ids);
 }
 
 

+ 32 - 14
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyFinishTestReportMapper.xml

@@ -5,33 +5,51 @@
 <mapper namespace="org.springblade.business.mapper.TrialCyFinishTestReportMapper">
     <select id="myPage" resultType="org.springblade.business.vo.ThirdReportVo">
         select
-            task_id id,
-            contract_id contractId,
-            report_number reportNo,
-            report_date reportDate,
-            position projectPositionName,
-            case
-                when experiment_result = 1 then '合格'
-                else '不合格'
-            end detectionResultName,
+            id,
+            contractId,
+            reportNo,
+            reportDate,
+            projectPositionName,
+            detectionResultName,
         (select count(0) > 0 from u_trial_file_pdf_record where node_id = #{query.qualityTestPKeyId}  and type = 11 and record_id = t.id) isSelectedStatus
-        from u_trial_cy_finish_test_report t
+        from vw_u_trial_cy_decoment t
         <where>
+            and `type` in(1,2)
             <if test="query.contractId != null">
-                AND contract_id = #{query.contractId}
+                AND contractId = #{query.contractId}
             </if>
             <if test="query.nodeId != null">
-                AND exam_name_info_id = #{query.nodeId}
+                AND node_id = #{query.nodeId}
             </if>
             <if test="query.startTime != null">
-                AND report_date >= #{query.startTime}
+                AND reportDate >= #{query.startTime}
             </if>
             <if test="query.endTime != null">
-                AND report_date &lt;= #{query.endTime}
+                AND reportDate &lt;= #{query.endTime}
             </if>
             <if test="query.reportType != null">
                 AND cs = #{query.reportType}
             </if>
         </where>
     </select>
+    <select id="selectViewPdfList" resultType="java.lang.String">
+        select
+            assemble_file
+        from vw_u_trial_cy_decoment
+        where id in
+        <foreach item="item" collection="ids" separator="," open="(" close=")" index="">
+            #{item}
+        </foreach>
+    </select>
+    <select id="selectViewList" resultType="java.util.Map">
+        select
+            id,
+            contractId,
+            assemble_file as assembleFile
+        from vw_u_trial_cy_decoment
+        where assemble_file is not null and id in
+        <foreach item="item" collection="ids" separator="," open="(" close=")" index="">
+            #{item}
+        </foreach>
+    </select>
 </mapper>

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyTestTypeMapper.java

@@ -15,7 +15,8 @@ import java.util.List;
 public interface TrialCyTestTypeMapper extends BaseMapper<TrialCyTestType> {
 
     List<TrialCyTestType> getTree(@Param("projectId") Long projectId,
-                                  @Param("parentId") String parentId);
+                                  @Param("parentId") String parentId,
+                                  @Param("contractId") String contractId);
 }
 
 

+ 3 - 2
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyTestTypeMapper.xml

@@ -15,9 +15,10 @@
     <select id="getTree" resultType="org.springblade.business.entity.TrialCyTestType">
         select
             <include refid="Base_sql"/>,
-            (select count(1) > 0 from u_trial_cy_test_type where father_id = t.id) has_children
-        from u_trial_cy_test_type t
+            (select count(1) > 0 from vw_u_trial_cy_tree where father_id = t.id and contract_id = #{contractId}) has_children
+        from vw_u_trial_cy_tree t
         where project_id = #{projectId}
+          and contract_id = #{contractId}
           and father_id = #{parentId}
         order by order_index
     </select>

+ 12 - 13
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialCyThirdReportMapper.xml

@@ -6,30 +6,29 @@
     <select id="myPage" resultType="org.springblade.business.vo.ThirdReportVo">
         select
             id,
-            contract_id contractId,
-            report_no reportNo,
-            report_date reportDate,
-            project_part projectPositionName,
-            case when is_qualified = 1 then '合格'
-                else '不合格'
-            end detectionResultName,
+            contractId,
+            reportNo,
+            reportDate,
+            projectPositionName,
+            detectionResultName,
         (select count(0) > 0 from u_trial_file_pdf_record where node_id = #{query.qualityTestPKeyId}  and type in(12,13) and record_id = t.id) isSelectedStatus
-        from u_trial_cy_third_report t
+        from vw_u_trial_cy_decoment t
         <where>
+            AND `type` in(3,4)
             <if test="query.contractId != null">
-                AND contract_id = #{query.contractId}
+                AND contractId = #{query.contractId}
             </if>
             <if test="query.type != null">
-                AND `third_type` = #{query.type}
+                AND `type` = #{query.type}
             </if>
             <if test="query.startTime != null">
-                AND report_date >= #{query.startTime}
+                AND reportDate >= #{query.startTime}
             </if>
             <if test="query.endTime != null">
-                AND report_date &lt;= #{query.endTime}
+                AND reportDate &lt;= #{query.endTime}
             </if>
             <if test="query.nodeId != null">
-                AND exam_name_info_id = #{query.nodeId}
+                AND node_id = #{query.nodeId}
             </if>
         </where>
     </select>

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.java

@@ -46,6 +46,6 @@ public interface TrialSelfInspectionRecordMapper extends BaseMapper<TrialSelfIns
     @Select("select self_id from u_trial_self_quality_project where quality_node_id = #{pKeyId}")
     List<String> selectTrialIdByNodeId(Long pKeyId);
 
-    List<Map<String,Object>> getTrialFilePdfRecord(@Param("nodeId") String nodeId,
+    List<String> getTrialFilePdfRecord(@Param("nodeId") String nodeId,
                                                    @Param("types") List<Integer> types);
 }

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.xml

@@ -108,8 +108,8 @@
             </if>
         </where>
     </select>
-    <select id="getTrialFilePdfRecord" resultType="java.util.Map">
-        select record_id,type from u_trial_file_pdf_record where node_id = #{nodeId} and `type` in
+    <select id="getTrialFilePdfRecord" resultType="java.lang.String">
+        select record_id from u_trial_file_pdf_record where node_id = #{nodeId} and `type` in
        <foreach collection="types" item="type" open="(" close=")" separator=",">
            #{type}
        </foreach>

+ 8 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/TrialCyFinishTestReportService.java

@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.springblade.business.vo.ThirdReportVo;
 import org.springblade.business.vo.TrialCyThirdReportQueryVo;
 
+import java.util.List;
+import java.util.Map;
+
 /**
 * @author LHB
 * @description 针对表【u_trial_cy_finish_test_report(成渝-获取标段已完成(已签章完成)的检测报告)】的数据库操作Service
@@ -16,4 +19,9 @@ public interface TrialCyFinishTestReportService extends IService<TrialCyFinishTe
 
     Page<ThirdReportVo> myPage(Page<ThirdReportVo> objectPage,
                                TrialCyThirdReportQueryVo queryVo);
+
+    List<String> selectViewPdfList(List<Long> longList);
+
+    List<Map<String,Object>> selectViewList(List<String> trialFilePdfRecord);
+
 }

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/TrialCyService.java

@@ -15,7 +15,7 @@ import java.util.List;
 public interface TrialCyService {
     Boolean isCyAndTestModule(Long projectId, Long contractId);
 
-    List<TrialCyTestType> getTree(Long projectId, String parentId);
+    List<TrialCyTestType> getTree(Long projectId, String parentId, String contractId);
 
     Page<ThirdReportVo> getTrialDetectionReport(TrialCyThirdReportQueryVo queryVo);
 

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/TrialCyTestTypeService.java

@@ -12,5 +12,5 @@ import java.util.List;
 */
 public interface TrialCyTestTypeService extends IService<TrialCyTestType> {
 
-    List<TrialCyTestType> getTree(Long projectId, String parentId);
+    List<TrialCyTestType> getTree(Long projectId, String parentId, String contractId);
 }

+ 14 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialCyFinishTestReportServiceImpl.java

@@ -9,6 +9,10 @@ import org.springblade.business.vo.ThirdReportVo;
 import org.springblade.business.vo.TrialCyThirdReportQueryVo;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 /**
 * @author LHB
 * @description 针对表【u_trial_cy_finish_test_report(成渝-获取标段已完成(已签章完成)的检测报告)】的数据库操作Service实现
@@ -22,6 +26,16 @@ public class TrialCyFinishTestReportServiceImpl extends ServiceImpl<TrialCyFinis
     public Page<ThirdReportVo> myPage(Page<ThirdReportVo> page, TrialCyThirdReportQueryVo queryVo) {
         return baseMapper.myPage(page,queryVo);
     }
+
+    @Override
+    public List<String> selectViewPdfList(List<Long> ids) {
+        return baseMapper.selectViewPdfList(ids);
+    }
+
+    @Override
+    public List<Map<String,Object>> selectViewList(List<String> ids) {
+        return baseMapper.selectViewList(ids);
+    }
 }
 
 

+ 9 - 11
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialCyServiceImpl.java

@@ -52,29 +52,27 @@ public class TrialCyServiceImpl implements TrialCyService {
     }
 
     @Override
-    public List<TrialCyTestType> getTree(Long projectId, String parentId) {
-        List<TrialCyTestType> list = trialCyTestTypeService.getTree(projectId, parentId);
+    public List<TrialCyTestType> getTree(Long projectId, String parentId, String contractId) {
+        List<TrialCyTestType> list = trialCyTestTypeService.getTree(projectId, parentId, contractId);
         return list;
     }
 
     @Override
     public Page<ThirdReportVo> getTrialDetectionReport(TrialCyThirdReportQueryVo queryVo) {
-        TrialCyTestType byId = trialCyTestTypeService.getById(queryVo.getNodeId());
-        if(StringUtils.isBlank(byId.getId())){
-            return new Page<>();
-        }
-        queryVo.setNodeId(Long.valueOf(byId.getId()));
         Page<ThirdReportVo> page = trialCyFinishTestReportService.myPage(new Page<ThirdReportVo>(queryVo.getCurrent(), queryVo.getSize()),queryVo);
         return page;
     }
 
     @Override
     public Page<ThirdReportVo> getThirdReport(TrialCyThirdReportQueryVo queryVo) {
-        TrialCyTestType byId = trialCyTestTypeService.getById(queryVo.getNodeId());
-        if(StringUtils.isBlank(byId.getId())){
-            return new Page<>();
+        if(queryVo.getType() != null){
+            if(queryVo.getType() == 0){
+                queryVo.setType(3);
+            }
+            if(queryVo.getType() == 1){
+                queryVo.setType(4);
+            }
         }
-        queryVo.setNodeId(Long.valueOf(byId.getId()));
         Page<ThirdReportVo> page = trialCyThirdReportService.myPage(new Page<ThirdReportVo>(queryVo.getCurrent(), queryVo.getSize()), queryVo);
         return page;
     }

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialCyTestTypeServiceImpl.java

@@ -18,8 +18,8 @@ import java.util.List;
 public class TrialCyTestTypeServiceImpl extends ServiceImpl<TrialCyTestTypeMapper, TrialCyTestType>
     implements TrialCyTestTypeService {
     @Override
-    public List<TrialCyTestType> getTree(Long projectId, String parentId) {
-        return baseMapper.getTree(projectId, parentId);
+    public List<TrialCyTestType> getTree(Long projectId, String parentId, String contractId) {
+        return baseMapper.getTree(projectId, parentId,contractId);
     }
 }
 

+ 3 - 15
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -2051,21 +2051,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 }
 
                 //成渝自检
-                if (dto.getType().equals(11)) {
-                    List<TrialCyFinishTestReport> trialCyFinishTestReports = trialCyFinishTestReportService.getBaseMapper().selectList(Wrappers.<TrialCyFinishTestReport>lambdaQuery().in(TrialCyFinishTestReport::getTaskId, Func.toLongList(dto.getIds())));
-                    trialCyFinishTestReports.forEach(f -> {
-                        if (StringUtils.isNotBlank(f.getAssembleFile())) {
-                            pdfList.add(f.getAssembleFile());
-                        }
-
-                    });
-                } else if (dto.getType().equals(12) || dto.getType().equals(13)) {
-                    List<TrialCyThirdReport> trialCyThirdReports = trialCyThirdReportService.getBaseMapper().selectList(Wrappers.<TrialCyThirdReport>lambdaQuery().in(TrialCyThirdReport::getId, Func.toLongList(dto.getIds())));
-                    trialCyThirdReports.forEach(f -> {
-                        if (StringUtils.isNotBlank(f.getAssembleFile())) {
-                            pdfList.add(f.getAssembleFile());
-                        }
-                    });
+                if (dto.getType().equals(11) || dto.getType().equals(12) || dto.getType().equals(13)) {
+                    List<String> files = trialCyFinishTestReportService.selectViewPdfList(Func.toLongList(dto.getIds()));
+                    pdfList.addAll(files);
                 }
 
                 if (pdfList.size() > 0) {