소스 검색

内页台账查询

qianxb 2 년 전
부모
커밋
8d04c72e70

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

@@ -44,6 +44,10 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 	 * 查询工序节点的填报记录
 	 */
 	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractId(@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);
 
 	/**
 	 * 根据节点ID及其填报的类型获取填报记录

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

@@ -448,5 +448,27 @@
     <select id="getContractWbsTreeAll" resultType="org.springblade.manager.entity.WbsTreeContract">
         select p_key_id,id,node_name,node_type,parent_id,sort from m_wbs_tree_contract where project_id = #{obj.projectId} and contract_id = #{obj.contractId} and `type` = 1 and status = 1 and node_type in (1,2,3,4,5,6) order by sort
     </select>
+    <select id="queryProcessDataByParentIdAndContractIdTwo" 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>

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

@@ -61,6 +61,11 @@ 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);
+
 	/**
 	 * 保存填报时新增或修改填报资料记录表数据
 	 * @param wbsId 当前填报节点

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

@@ -116,6 +116,16 @@ 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);
+        if (result == null || result.size() <= 0) {
+            result = this.baseMapper.queryProcessDataByParentIdAndContractIdTwo("", classify, contractId);
+        }
+        return result;
+    }
+
+
     private List<FirstInformation> setFirstLinkData(List<JSONObject> linkDataList, String businessId) {
         List<FirstInformation> linkList = new ArrayList<>();