huangjn 2 年之前
父節點
當前提交
4c79d6bf1c

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

@@ -35,6 +35,9 @@ public class NeiYeQueryVO {
     @ApiModelProperty(value = "项目ID")
     private String contractId;
 
+    @ApiModelProperty(value = "项目ID")
+    private String contractIdRelation;
+
     private List<String> wbsIds;
 
 }

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

@@ -1021,7 +1021,7 @@ public class InformationWriteQueryController extends BladeController {
 		//获取合同段,检查是否是监理合同段
 		ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(contractId));
 
-		if(contractInfo.getContractType() != null && new Integer("2").equals(contractInfo.getContractType())){
+		if(contractInfo.getContractType() != null && (new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType()))){
 			//监理合同段
 			List<WbsTreeContractTreeVOS> childList = this.wbsTreeContractClient.lazyTree(StringUtils.isNotEmpty(parentId) ? Long.parseLong(parentId) : 0, contractId, contractIdRelation, contractInfo.getContractType());
 			//设置合同段根节点的名称
@@ -1088,9 +1088,6 @@ public class InformationWriteQueryController extends BladeController {
 			});
 		}
 
-
-
-
 		return R.data(result);
 	}
 
@@ -1865,7 +1862,7 @@ public class InformationWriteQueryController extends BladeController {
 
 		//获取合同段,检查是否是监理合同段
 		ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(contractId));
-		if(new Integer("2").equals(contractInfo.getContractType())){
+		if(new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType())){
 			//监理合同段,需要获取关联的施工方合同段根节点数据
 			rootTreeNode = this.wbsTreeContractClient.lazyTree(StringUtils.isNotEmpty(parentId) ? Long.parseLong(parentId) : 0, contractId, contractIdRelation, contractInfo.getContractType());
 		} else {

+ 12 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java

@@ -16,6 +16,7 @@ import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.api.R;
+import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
@@ -52,8 +53,14 @@ public class NeiYeController {
             //生成列表
             List<NeiYeLedgerVO> neiYeLedgerVOList = new ArrayList<>();
 
+            ContractInfo contract = this.contractClient.getContractById(Long.parseLong(queryVO.getContractId()));
+            String contractId = contract.getId().toString();
+            if(!new Integer("1").equals(contract.getContractType())){
+                contractId = queryVO.getContractIdRelation();
+            }
+
             //获取当前合同段所有划分情况
-            List<WbsTreeContractTreeVOS> contractNodeLIst = this.wbsTreeContractClient.queryContractWbsTreeAll(queryVO.getContractId(), 1, "");
+            List<WbsTreeContractTreeVOS> contractNodeLIst = this.wbsTreeContractClient.queryContractWbsTreeAll(contractId, 1, "");
             //设置map
             Map<String, WbsTreeContractTreeVOS> idToNodeMap = new HashMap<>();
             contractNodeLIst.forEach(vos -> idToNodeMap.put(vos.getId().toString(), vos));
@@ -62,16 +69,16 @@ public class NeiYeController {
             WbsTreeContract node = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(queryVO.getWbsIds().get(0));
             if(node == null){
                 //这一步主要是为了兼容监理合同段
-                node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(Long.parseLong(queryVO.getWbsIds().get(0)), Long.parseLong(queryVO.getContractId()));
+                node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(Long.parseLong(queryVO.getWbsIds().get(0)), Long.parseLong(contractId));
             }
             //不是工序,则查询当前节点下的所有填报节点
             List<QueryProcessDataVO> queryDataResult;
             if(!new Integer("6").equals(node.getDeptCategory()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())){
                 //非填报节点
-                queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), 1, queryVO.getContractId());
+                queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), contractId);
             } else {
                 //填报节点
-                queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), 1);
+                queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), contract.getContractType());
             }
 
             if (queryDataResult != null && queryDataResult.size() > 0) {
@@ -87,7 +94,7 @@ public class NeiYeController {
 
                     //处理父节点信息
                     Map<String, String> map = new HashMap<>();
-                    this.foreachGetParent(map, idToNodeMap, vo.getParentId(), queryVO.getContractId());
+                    this.foreachGetParent(map, idToNodeMap, vo.getParentId(), contractId);
 
                     //获取当前工序的施工台账信息
                     if (ledgers != null && ledgers.size() > 0) {

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

@@ -188,7 +188,7 @@
                     ELSE 'false' end AS evaluate
                 from
                     m_wbs_tree_contract AS tc
-                left join u_information_query AS iq on tc.p_key_id = iq.wbs_id
+                left join u_information_query AS iq on tc.p_key_id = iq.wbs_id AND iq.classify = #{classify} and iq.is_deleted = 0
                 where
                     tc.major_data_type = 2
                 and tc.parent_id = wtc.parent_id