Kaynağa Gözat

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

huangtf 2 yıl önce
ebeveyn
işleme
86a7163f5f

+ 13 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java

@@ -93,10 +93,19 @@ public class MaterialProgressController extends BladeController {
         } else {
             //找到根节点
             List<WbsTreeContractTreeVOS> nodeResult = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, StringUtils.isNotEmpty(parentId) ? parentId : "0");
-            if(nodeResult != null && nodeResult.size() > 0){
-
-                //找到当前节点下的所有填报节点
-                List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, new Integer(classifyType), contractId);
+            if(nodeResult != null && nodeResult.size() > 0) {
+                List<QueryProcessDataVO> queryDataResult = new ArrayList<>();
+                if (StringUtils.isEmpty(parentId)) {
+                    //找到当前节点下的所有填报节点
+                    queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdThree("", new Integer(classifyType), contractId);
+                } else{
+                    WbsTreeContract node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(Long.valueOf(parentId), Long.valueOf(contractId));
+                    if (node.getParentId() == 0){
+                        queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdThree("", new Integer(classifyType), contractId);
+                    }else {
+                        queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdThree(parentId, new Integer(classifyType), contractId);
+                    }
+                }
                 //统计
                 this.countAmount(nodeResult, queryDataResult, contractId, reVO);
 

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

@@ -48,6 +48,10 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 	 * 查询工序节点的填报记录
 	 */
 	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(@Param("parentId") String parentId, @Param("classify") Integer classify, @Param("contractId") String contractId);
+	/**
+	 * 查询工序节点的填报记录,资料进度使用
+	 */
+	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdThree(@Param("parentId") String parentId, @Param("classify") Integer classify, @Param("contractId") String contractId);
 
 	/**
 	 * 根据节点ID及其填报的类型获取填报记录

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

@@ -570,4 +570,27 @@
           AND wtc.is_deleted = 0
     </select>
 
+    <select id="queryProcessDataByParentIdAndContractIdThree" resultMap="queryProcessDataMap">
+        SELECT
+            wtc.id AS treeId,
+            wtc.p_key_id,
+            wtc.ancestors,
+            wtc.major_data_type,
+            wtc.node_type AS nodeType,
+            IFNULL(if(length(trim(wtc.full_name)) > 0, wtc.full_name, wtc.node_name),wtc.node_name) AS title,
+            wtc.parent_id AS parentId,
+            uiq.id AS informationQueryId,
+            uiq.status,
+            uiq.type AS queryType
+        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
+        WHERE
+            wtc.type = 1
+          AND wtc.major_data_type in(1,2,3,4)
+          AND wtc.ancestors like concat('%',#{parentId},'%')
+          AND wtc.contract_id = #{contractId}
+          AND wtc.is_deleted = 0
+    </select>
+
 </mapper>

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

@@ -62,10 +62,15 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
 	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractId(String parentId, Integer classify, String contractId);
 
 	/**
-	 * 查询工序节点的填报记录2
+	 * 查询工序节点的填报记录,简化
 	 */
 	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(String parentId, Integer classify, String contractId);
 
+	/**
+	 * 查询工序节点的填报记录,status不默认为0,资料进度统计
+	 */
+	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdThree(String parentId, Integer classify, String contractId);
+
 	/**
 	 * 保存填报时新增或修改填报资料记录表数据
 	 * @param wbsId 当前填报节点

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

@@ -119,13 +119,18 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         }
         return result;
     }
-
+    //简化
     @Override
     public List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdTwo(String parentId, Integer classify, String contractId) {
         List<QueryProcessDataVO> result = this.baseMapper.queryProcessDataByParentIdAndContractIdTwo(parentId, classify, contractId);
         return result;
     }
-
+    //资料进度统计使用
+    @Override
+    public List<QueryProcessDataVO> queryProcessDataByParentIdAndContractIdThree(String parentId, Integer classify, String contractId) {
+        List<QueryProcessDataVO> result = this.baseMapper.queryProcessDataByParentIdAndContractIdThree(parentId, classify, contractId);
+        return result;
+    }
 
     private List<FirstInformation> setFirstLinkData(List<JSONObject> linkDataList, String businessId) {
         List<FirstInformation> linkList = new ArrayList<>();