Quellcode durchsuchen

台账管理-业内台账
1、查询台账列表接口调整

LHB vor 1 Monat
Ursprung
Commit
d71a4aeb74

+ 8 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/NeiYeLedgerVO.java

@@ -88,16 +88,24 @@ public class NeiYeLedgerVO {
     /**
      * 是否填写了日期
      */
+    @ApiModelProperty(value = "是否填写了日期")
     private Integer dateIsComplete;
     /**
      * 文件提名
      */
+    @ApiModelProperty(value = "文件提名")
     private String infoQueryName;
 
     /**
      * 文件pdf路径
      */
+    @ApiModelProperty(value = "路径")
     private String pdfUrl;
+    /**
+     * 附件报告
+     */
+    @ApiModelProperty(value = "附件报告")
+    private String fileTypeMsg;
 
     public NeiYeLedgerVO(String... values) {
         this.unitProject = values[0];

+ 6 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/NeiYeQueryVO.java

@@ -38,6 +38,12 @@ public class NeiYeQueryVO {
     @ApiModelProperty(value = "项目ID")
     private String contractIdRelation;
 
+    @ApiModelProperty(value = "是否缺少附件:true为完整")
+    private Boolean isFile;
+
+    @ApiModelProperty(value = "日期是否填报,与质检树类型一致")
+    private Integer dateIsComplete;
+
     private List<String> wbsIds;
 
 }

+ 18 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/QueryProcessDataVO.java

@@ -46,5 +46,23 @@ public class QueryProcessDataVO {
      * 文件pdf路径
      */
     private String pdfUrl;
+    /**
+     * 文件pdf路径
+     */
+    private String privateTableFileType;
+    /**
+     * 文件pdf路径
+     */
+    private String contractTableFileType;
+
+    /**
+     * 附件报告
+     */
+    private String fileTypeMsg;
+
+    /**
+     * 附件报告是否完整
+     */
+    private Boolean fileType = false;
 
 }

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

@@ -99,7 +99,7 @@ public class NeiWaiYeProgressController {
                 queryProcessDataVOList = this.informationQueryService.queryProcessDataByParentIdAndContractId2(node.getId().toString(), classFy, contractId);
             } else {
                 //填报节点
-                queryProcessDataVOList = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), classFy);
+                queryProcessDataVOList = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), classFy, null);
                 childList.clear();
                 //设置填报节点进集合中
                 childList.add(node);
@@ -165,7 +165,7 @@ public class NeiWaiYeProgressController {
                 queryProcessDataVOList = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), 1, contractId);
             } else {
                 //填报节点
-                queryProcessDataVOList = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), 1);
+                queryProcessDataVOList = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), 1, null);
                 childList.clear();
                 //设置填报节点进集合中
                 childList.add(node);

+ 44 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java

@@ -1,6 +1,7 @@
 package org.springblade.business.controller;
 
 import cn.hutool.core.date.DateUtil;
+import com.aliyun.oss.ServiceException;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -27,6 +28,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.WbsFormElement;
@@ -36,6 +38,7 @@ import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.manager.feign.WbsTreePrivateClient;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
+import org.springblade.system.entity.DictBiz;
 import org.springframework.core.io.ByteArrayResource;
 import org.springframework.core.io.Resource;
 import org.springframework.http.HttpHeaders;
@@ -86,6 +89,12 @@ public class NeiYeController {
     @ApiOperation(value = "获取内业台账列表")
     public R<IPage<NeiYeLedgerVO>> queryCurrentNodeNeiYeLedger(@RequestBody NeiYeQueryVO queryVO) {
         if (queryVO.getWbsIds() != null && queryVO.getWbsIds().size() > 0) {
+            //查询字典 dict_biz  code = table_file_type
+            List<DictBiz> dictBiz = jdbcTemplate.query("select * from blade_dict_biz where code = 'table_file_type'", new BeanPropertyRowMapper<>(DictBiz.class));
+            if(CollectionUtil.isEmpty(dictBiz)){
+               throw new ServiceException("table_file_type 字典未查询到数据");
+            }
+            Map<String, String> dictMap = dictBiz.stream().collect(Collectors.toMap(DictBiz::getDictKey, DictBiz::getDictValue));
             //生成列表
             List<NeiYeLedgerVO> neiYeLedgerVOList = new ArrayList<>();
             Integer contractType = 1;
@@ -117,13 +126,13 @@ public class NeiYeController {
                     && !node.getNodeName().contains("开工报告") && !node.getNodeName().contains("质量检验评定表")) {
                 //非填报节点
                 if (node.getParentId() == 0) {
-                    queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo("", contractType, contractId);
+                    queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo("", contractType, contractId, queryVO.getDateIsComplete());
                 } else {
-                    queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo(node.getPKeyId().toString(), contractType, contractId);
+                    queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo(node.getPKeyId().toString(), contractType, contractId, queryVO.getDateIsComplete());
                 }
             } else {
                 //填报节点
-                queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), contractType);
+                queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), contractType, queryVO.getDateIsComplete());
             }
 
             if (queryDataResult != null && queryDataResult.size() > 0) {
@@ -134,6 +143,33 @@ public class NeiYeController {
                 List<String> stringList = jdbcTemplate.queryForList(sql, String.class);
                 if (stringList.size() > 0) {
                     queryDataResult.stream().forEach(qdr -> {
+                        StringBuilder sb = new StringBuilder();
+                        if (StringUtils.isEmpty(qdr.getPrivateTableFileType())) {
+                            sb.append("后台未配置附件类型");
+                        } else {
+                            //后台节点配置的附件类型
+                            List<String> privateFileType = Arrays.asList(qdr.getPrivateTableFileType().split(","));
+                            //附件名称
+                            List<String> names = new ArrayList<>();
+
+                            if (StringUtils.isNotEmpty(qdr.getContractTableFileType())) {
+                                List<String> contractFileType = Arrays.asList(qdr.getContractTableFileType().split(","));
+                                //后台配置的与合同段配置的附件类型比较 查到质检未配置的附件名称
+                                List<String> collect = privateFileType.stream().filter(fileType -> !contractFileType.contains(fileType)).collect(Collectors.toList());
+                                if (CollectionUtil.isNotEmpty(collect)) {
+                                    collect.forEach(f -> names.add("【" + dictMap.get(f) + "】"));
+                                } else {
+                                    sb.append("报告完整");
+                                    qdr.setFileType(true);
+                                }
+                            } else {
+                                privateFileType.forEach(f -> names.add("【" + dictMap.get(f) + "】"));
+                            }
+                            sb.append("缺少").append(StringUtils.join(names, "、"));
+                        }
+
+                        qdr.setFileTypeMsg(sb.toString());
+
                         if (stringList.contains(qdr.getPrimaryKeyId())) {
                             qdr.setIsExperiment("true");
                         }
@@ -145,6 +181,10 @@ public class NeiYeController {
                     queryDataResult = queryDataResult.stream()
                             .filter(qdr -> isExperiment.equals(qdr.getIsExperiment())).collect(Collectors.toList());
                 }
+                //过滤附件
+                if (queryVO.getIsFile() != null) {
+                    queryDataResult = queryDataResult.stream().filter(f -> Objects.equals(f.getFileType(), queryVO.getIsFile())).collect(Collectors.toList());
+                }
                 //设置评定值
                 queryDataResult.stream().forEach(qdr -> qdr.setEvaluate("false"));
                 List<QueryProcessDataVO> vos = queryDataResult.stream().filter(qdr -> qdr.getTitle().contains("质量检验评定表"))
@@ -290,6 +330,7 @@ public class NeiYeController {
                     neiYeLedgerVO.setDateIsComplete(vo.getDateIsComplete());
                     neiYeLedgerVO.setInfoQueryName(vo.getInfoQueryName());
                     neiYeLedgerVO.setPdfUrl(vo.getPdfUrl());
+                    neiYeLedgerVO.setFileTypeMsg(vo.getFileTypeMsg());
                     neiYeLedgerVOList.add(neiYeLedgerVO);
                 }
                 //转换为page信息

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

@@ -42,7 +42,7 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 
     List<WbsTreeContractTreeVOS> queryContractTree(@Param("contractId") String contractId, @Param("parentId") String parentId, @Param("classify") Integer classify);
 
-    List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(@Param("primaryKeyId") String primaryKeyId, @Param("classify") Integer classify);
+    List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(@Param("primaryKeyId") String primaryKeyId, @Param("classify") Integer classify, @Param("dateIsComplete") Integer dateIsComplete);
 
     /**
      * 查询工序节点的填报记录
@@ -57,7 +57,7 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
     /**
      * 查询工序节点的填报记录
      */
-    List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(@Param("parentId") String parentId, @Param("classify") Integer classify, @Param("contractId") String contractId);
+    List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(@Param("parentId") String parentId, @Param("classify") Integer classify, @Param("contractId") String contractId, @Param("dateIsComplete") Integer dateIsComplete);
 
     /**
      * 查询工序节点的填报记录3

+ 15 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -53,6 +53,9 @@
         <result column="dateIsComplete" property="dateIsComplete"/>
         <result column="infoQueryName" property="infoQueryName"/>
         <result column="pdfUrl" property="pdfUrl"/>
+        <result column="privateTableFileType" property="privateTableFileType"/>
+        <result column="contractTableFileType" property="contractTableFileType"/>
+        <result column="pdfUrl" property="pdfUrl"/>
     </resultMap>
 
     <resultMap id="queryContractTreeMap" type="org.springblade.manager.vo.WbsTreeContractTreeVOS">
@@ -438,6 +441,8 @@
                uiq.name                                                                                   AS     infoQueryName,
                uiq.pdf_url                                                                                   AS     pdfUrl,
                uiq.status,
+               p.table_file_type									                                    AS privateTableFileType,
+               (select GROUP_CONCAT(DISTINCT table_file_type) from u_trial_file_pdf_record where node_id = wtc.p_key_id) contractTableFileType,
                (
                    select case iq.status
                               WHEN 2 then 'true'
@@ -457,9 +462,13 @@
         FROM
         m_wbs_tree_contract AS wtc
         LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = #{classify} and uiq.is_deleted =  0 and uiq.status != 3
+        left join m_wbs_tree_private p on wtc.is_type_private_pid = p.p_key_id
         WHERE
         wtc.p_key_id = #{primaryKeyId}
         AND  wtc.is_deleted = 0
+        <if test="dateIsComplete != null">
+            AND wtc.date_is_complete = #{dateIsComplete}
+        </if>
     </select>
 
     <select id="queryProcessDataByParentIdAndContractId" resultMap="queryProcessDataMap">
@@ -824,6 +833,8 @@
                uiq.type                                                                                 AS queryType,
                uiq.name                                                                                 AS infoQueryName,
                uiq.pdf_url                                                                              AS pdfUrl,
+               p.table_file_type									                                    AS privateTableFileType,
+               (select GROUP_CONCAT(DISTINCT table_file_type) from u_trial_file_pdf_record where node_id = wtc.p_key_id) contractTableFileType,
                case
                    WHEN uiq.pdf_trial_url is null then 'false'
                    ELSE 'true' end                                                                      AS isExperiment
@@ -831,12 +842,16 @@
                  LEFT JOIN u_information_query AS uiq
                            ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = #{classify} and uiq.is_deleted = 0 and
                               uiq.status != 3
+                 left join m_wbs_tree_private p on wtc.is_type_private_pid = p.p_key_id
         WHERE wtc.type = 1
           AND wtc.major_data_type in (0, 1, 2, 3, 4)
           AND wtc.ancestors like concat('%', #{parentId}, '%')
           AND wtc.contract_id = #{contractId}
           AND wtc.is_deleted = 0
           AND wtc.status = 1
+        <if test="dateIsComplete != null">
+            AND wtc.date_is_complete = #{dateIsComplete}
+        </if>
     </select>
 
     <select id="queryProcessDataByParentIdAndContractId_3" resultMap="queryProcessDataMap">

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

@@ -57,7 +57,7 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
     /**
      * 查询工序节点的填报记录
      */
-    List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(String primaryKeyId, Integer classify);
+    List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(String primaryKeyId, Integer classify, Integer dateIsComplete);
 
     /**
      * 查询工序节点的填报记录
@@ -73,7 +73,7 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
     /**
      * 查询工序节点的填报记录,简化
      */
-    List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(String parentId, Integer classify, String contractId);
+    List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(String parentId, Integer classify, String contractId, Integer dateIsComplete);
 
     /**
      * 查询工序节点的填报记录,status不默认为0,资料进度统计

+ 4 - 4
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -141,8 +141,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
     }
 
     @Override
-    public List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(String primaryKeyId, Integer classify) {
-        return this.baseMapper.queryProcessDataByPrimaryKeyIdAndClassify(primaryKeyId, classify);
+    public List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(String primaryKeyId, Integer classify, Integer dateIsComplete) {
+        return this.baseMapper.queryProcessDataByPrimaryKeyIdAndClassify(primaryKeyId, classify, dateIsComplete);
     }
 
     @Override
@@ -166,8 +166,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
     //简化
     @Override
-    public List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(String parentId, Integer classify, String contractId) {
-        List<QueryProcessDataVO> result = this.baseMapper.queryProcessDataByParentIdAndContractIdTwo(parentId, classify, contractId);
+    public List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(String parentId, Integer classify, String contractId, Integer dateIsComplete) {
+        List<QueryProcessDataVO> result = this.baseMapper.queryProcessDataByParentIdAndContractIdTwo(parentId, classify, contractId, dateIsComplete);
         return result;
     }