Explorar o código

导图树和合同段划分树颜色显示

huangjn %!s(int64=3) %!d(string=hai) anos
pai
achega
97c563aa89

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

@@ -0,0 +1,18 @@
+package org.springblade.business.vo;
+
+import lombok.Data;
+
+@Data
+public class QueryProcessDataVO {
+
+    private String ancestors;
+
+    private String primaryKeyId;
+
+    private String treeId;
+
+    private String informationQueryId;
+
+    private Integer status;
+
+}

+ 7 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreeContractClient.java

@@ -22,7 +22,7 @@ public interface WbsTreeContractClient {
     String API_PREFIX = "/api/manager/WbsTreeContract";
 
     @PostMapping(API_PREFIX + "/queryChildByParentId")
-    List<WbsTreeContract> queryChildByParentId(@RequestBody WbsTreeContract treeNode);
+    List<WbsTreeContract> queryChildByParentId(@RequestBody WbsTreeContract treeNode, @RequestParam String queryTable);
 
     @PostMapping(API_PREFIX + "/saveBatch")
     Boolean saveBatch(@RequestBody List<WbsTreeContract> list);
@@ -42,6 +42,12 @@ public interface WbsTreeContractClient {
     @PostMapping(API_PREFIX + "/removeContractTreeNode")
     Boolean removeContractTreeNode(@RequestParam String ids);
 
+    /**
+     * 根据合同段ID和id获取合同段划分树的节点信息
+     */
+    @PostMapping(API_PREFIX + "/getContractWbsTreeByContractIdAndId")
+    WbsTreeContract getContractWbsTreeByContractIdAndId(@RequestParam Long id, @RequestParam Long contractId);
+
     /**
      * 根据primaryKeyId获取合同段划分树的节点信息
      * @param primaryKeyId 节点唯一主键

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractTreeVOS.java

@@ -67,4 +67,7 @@ public class WbsTreeContractTreeVOS {
     @ApiModelProperty("原id,如果当前字段有数据则说明这条数据是复制节点")
     private String oldId;
 
+    @ApiModelProperty("未填报1 、已填报-未上报2 、已填报-待审批3 、已审批4")
+    private Integer colorStatus;
+
 }

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

@@ -104,7 +104,7 @@ public class BusinessUserOpinionController {
             @ApiImplicitParam(name = "newNumber", value = "当前流程次数", required = true),
             @ApiImplicitParam(name = "currentLinkId", value = "当前环节ID", required = true)
     })
-    public R<Boolean> manageUserOperationStatus(@RequestParam String userOpinionId, @RequestParam Integer currentLink, @RequestParam Integer newNumber, @RequestParam String currentLinkId, @RequestParam String manageTime){
+    public R<Boolean> manageUserOperationStatus(@RequestParam String userOpinionId, @RequestParam Integer currentLink, @RequestParam Integer newNumber, @RequestParam String currentLinkId, String manageTime){
 
         if(StringUtils.isEmpty(currentLinkId)){
             return R.data(-1, false, "缺少currentLinkId参数");

+ 182 - 18
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -328,6 +328,26 @@ public class InformationWriteQueryController extends BladeController {
 						newData.setCreateTime(new Date());
 						newData.setUpdateTime(new Date());
 						newData.setCreateUser(AuthUtil.getUserId());
+
+						//重塑父节点关联关系
+						String ancestors = newData.getAncestors();
+						if(StringUtils.isNotEmpty(ancestors)){
+							//重组后的链表
+							StringBuilder stringBuilder = new StringBuilder();
+							//拆分重组
+							String[] ancestorsArray = ancestors.split(",");
+							for(String oldParentId : ancestorsArray){
+								if(StringUtils.isNotEmpty(oldParentId)){
+									//获取新的
+									Long newParentId = oldToNewIdMap.get(Long.parseLong(oldParentId));
+									//如果新的id为空,说明不变
+									stringBuilder.append(",").append(newParentId == null ? oldParentId : newParentId);
+								}
+							}
+							//将新链表设置进对象中
+							newData.setAncestors(stringBuilder.substring(1));
+						}
+
 						//保存到集合中
 						saveList.add(newData);
 
@@ -369,13 +389,20 @@ public class InformationWriteQueryController extends BladeController {
 		parentList.forEach(parent -> {
 			if(!new Integer("6").equals(parent.getDeptCategory())){
 				//查询子节点
-				List<WbsTreeContract> childs = this.wbsTreeContractClient.queryChildByParentId(parent);
+				List<WbsTreeContract> childs = this.wbsTreeContractClient.queryChildByParentId(parent, "notQueryTable");
 				if(childs != null && childs.size() > 0){
 					//添加入结果集
 					childList.addAll(childs);
 					//还有子级,继续向下
 					this.foreachQueryChildContract(childs, childList);
 				}
+			} else {
+				//工序,则查询对应的表格数据
+				List<WbsTreeContract> childs = this.wbsTreeContractClient.queryChildByParentId(parent, "queryTable");
+				if(childs != null && childs.size() > 0){
+					//添加入结果集
+					childList.addAll(childs);
+				}
 			}
 		});
 	}
@@ -401,6 +428,8 @@ public class InformationWriteQueryController extends BladeController {
 		if(contractInfo.getContractType() != null && new Integer("2").equals(contractInfo.getContractType())){
 			//监理合同段
 			List<WbsTreeContractTreeVOS> childList = this.wbsTreeContractClient.lazyTree(StringUtils.isNotEmpty(parentId) ? Long.parseLong(parentId) : 0, contractId, contractIdRelation, contractInfo.getContractType());
+			//设置合同段根节点的名称
+			this.setRootNodeName(parentId, childList);
 			if(childList != null && childList.size() == 1){
 				//需要向下展开
 				this.foreachQueryChildNode(childList, childList.get(0).getContractIdRelation(), contractInfo.getContractType());
@@ -419,19 +448,55 @@ public class InformationWriteQueryController extends BladeController {
 		} else {
 			if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
 				//直接返回
-				return R.data(this.clientTreePublicCodeClient.queryContractWbsTreeByContractIdAndType(contractId, wbsType, "0"));
-			}
-			//不是根节点,则获取子节点
-			result = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);
-			//判断当前节点下是不是只有一个子节点
-			if(result != null && result.size() == 1){
-				this.foreachQueryChildNode(result, contractId, contractInfo.getContractType());
+				result = this.clientTreePublicCodeClient.queryContractWbsTreeByContractIdAndType(contractId, wbsType, "0");
+			} else {
+				//不是根节点,则获取子节点
+				result = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);
+				//判断当前节点下是不是只有一个子节点
+				if(result != null && result.size() == 1){
+					this.foreachQueryChildNode(result, contractId, contractInfo.getContractType());
+				}
 			}
 		}
 
+		if(result != null){
+			//获取当前父节点下所有工序节点及填报资料
+			List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, contractInfo.getContractType(), contractId);
+			result.forEach(vos -> {
+				if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
+					vos.setTitle(contractInfo.getContractName());
+				}
+				if(queryDataResult != null && queryDataResult.size() > 0){
+					//设置颜色
+					this.setNodeColor(vos, queryDataResult);
+				}
+				//处理子节点
+				if(vos.getChildren() != null && vos.getChildren().size() > 0){
+					vos.getChildren().forEach(child -> this.setNodeColor(vos, queryDataResult));
+				}
+
+			});
+		}
+
 		return R.data(result);
 	}
 
+	/**
+	 * 监理合同段设置关联合同段的根节点名称
+	 */
+	private void setRootNodeName(@RequestParam String parentId, List<WbsTreeContractTreeVOS> childList) {
+		if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
+			if(childList != null && childList.size() > 0){
+				childList.forEach(treeNode -> {
+					ContractInfo clientContract = this.contractClient.getContractById(Long.parseLong(treeNode.getContractIdRelation()));
+					if(clientContract != null){
+						treeNode.setTitle(clientContract.getContractName());
+					}
+				});
+			}
+		}
+	}
+
 	/**
 	 * 如果子节点只有一个,则进一步查询该子节点的下级节点
 	 * @param result 子节点集合
@@ -610,6 +675,25 @@ public class InformationWriteQueryController extends BladeController {
 				newData.setContractType(treeContract.getContractType());
 				newData.setCreateTime(new Date());
 
+				//重塑父节点关联关系
+				String ancestors = newData.getAncestors();
+				if(StringUtils.isNotEmpty(ancestors)){
+					//重组后的链表
+					StringBuilder stringBuilder = new StringBuilder();
+					//拆分重组
+					String[] ancestorsArray = ancestors.split(",");
+					for(String oldParentId : ancestorsArray){
+						if(StringUtils.isNotEmpty(oldParentId)){
+							//获取新的
+							Long newParentId = OldIdToNewIdMap.get(Long.parseLong(oldParentId));
+							//如果新的id为空,说明不变
+							stringBuilder.append(",").append(newParentId == null ? oldParentId : newParentId);
+						}
+					}
+					//将新链表设置进对象中
+					newData.setAncestors(stringBuilder.substring(1));
+				}
+
 				//设置名称
 				Iterator<AddContractTreeNodeVO.Node> iterator = selectList.iterator();
 				while (iterator.hasNext()){
@@ -826,16 +910,8 @@ public class InformationWriteQueryController extends BladeController {
 		if(new Integer("2").equals(contractInfo.getContractType())){
 			//监理合同段,需要获取关联的施工方合同段根节点数据
 			rootTreeNode = this.wbsTreeContractClient.lazyTree(StringUtils.isNotEmpty(parentId) ? Long.parseLong(parentId) : 0, contractId, contractIdRelation, contractInfo.getContractType());
-			if(StringUtils.isEmpty(parentId)){
-				if(rootTreeNode != null && rootTreeNode.size() > 0){
-					rootTreeNode.forEach(treeNode -> {
-						ContractInfo clientContract = this.contractClient.getContractById(Long.parseLong(treeNode.getContractIdRelation()));
-						if(clientContract != null){
-							treeNode.setTitle(clientContract.getContractName());
-						}
-					});
-				}
-			}
+			//设置合同段根节点的名称
+			this.setRootNodeName(parentId, rootTreeNode);
 
 		} else {
 			if(com.alibaba.nacos.common.utils.StringUtils.isEmpty(parentId)){
@@ -850,8 +926,16 @@ public class InformationWriteQueryController extends BladeController {
 
 		//其他参数
 		if(rootTreeNode != null && rootTreeNode.size() > 0){
+			//获取当前父节点下所有工序节点及填报资料
+			List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, contractInfo.getContractType(), contractId);
+
 			rootTreeNode.forEach(vo -> {
 				String primaryKeyId = new Integer("2").equals(contractInfo.getContractType()) ? vo.getId() : vo.getPrimaryKeyId();
+
+				if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
+					vo.setTitle(contractInfo.getContractName());
+				}
+
 				//获取上传的图纸
 				ContractTreeDrawings drawings = this.contractTreeDrawingsService.queryCurrentNodeDrawings(primaryKeyId);
 				if(drawings != null){
@@ -861,6 +945,11 @@ public class InformationWriteQueryController extends BladeController {
 					vo.setFileUrl(drawings.getFileUrl());
 				}
 
+				//处理颜色
+				if(queryDataResult != null && queryDataResult.size() > 0){
+					this.setNodeColor(vo, queryDataResult);
+				}
+
 				//判断当前节点是否被标记为首件
 				TreeContractFirst first = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getIsDeleted, 0).eq(TreeContractFirst::getWbsNodeId, primaryKeyId));
 				vo.setIsFirst(first != null);
@@ -870,6 +959,81 @@ public class InformationWriteQueryController extends BladeController {
 		return R.data(rootTreeNode);
 	}
 
+	/**
+	 * 设置节点颜色
+	 * 填报节点:
+	 * 未填报1 < 已填报-未上报2 < 已填报-待审批3 < 已审批4
+	 *
+	 * 非填报节点
+	 * 未填报1(其下所有工序节点均未填报) < 已填报2(未上报和待审批) < 已审批4(其下所有工序节点均审批)
+	 *
+	 */
+	private void setNodeColor(WbsTreeContractTreeVOS vos, List<QueryProcessDataVO> queryDataResult){
+		if(queryDataResult != null && queryDataResult.size() > 0){
+			Iterator<QueryProcessDataVO> iterator =  queryDataResult.iterator();
+			//默认均未填报
+			StringBuilder colorStatusValue = new StringBuilder();
+			while (iterator.hasNext()) {
+				QueryProcessDataVO query = iterator.next();
+				if(query.getAncestors().contains(vos.getId()) || query.getAncestors().startsWith(vos.getParentId() + ",") || query.getTreeId().equals(vos.getId())){
+					//如果为空,说明未填报
+					if(query.getStatus() == null || query.getStatus() == -1){
+						colorStatusValue.append("1");
+					} else {
+						switch (query.getStatus()){
+							case 0:
+							case 3:
+								//未上报
+								colorStatusValue.append("2");
+								break;
+							case 1:
+								//待审批
+								colorStatusValue.append("3");
+								break;
+							case 2:
+								//已审批
+								colorStatusValue.append("4");
+								break;
+							default:
+								colorStatusValue.append("1");
+								break;
+						}
+						iterator.remove();
+					}
+				}
+			}
+			//检查字符串
+			if(StringUtils.isNotEmpty(colorStatusValue.toString())){
+				if(new Integer("6").equals(vos.getDeptCategory())){
+					//工序,则直接使用字符串的判断
+					vos.setColorStatus(new Integer(colorStatusValue.toString()));
+				} else {
+					if(colorStatusValue.toString().contains("1")){
+						//含有1
+						if(colorStatusValue.toString().contains("2") || colorStatusValue.toString().contains("3") || colorStatusValue.toString().contains("4")){
+							//同时含有2/3/4,取2
+							vos.setColorStatus(2);
+						} else {
+							//否则,取1
+							vos.setColorStatus(1);
+						}
+					} else {
+						//不含有1
+						if(colorStatusValue.toString().contains("4") && !colorStatusValue.toString().contains("2") && !colorStatusValue.toString().contains("3")){
+							//只含有4,取4
+							vos.setColorStatus(4);
+						} else {
+							//反之包含2/3,取2
+							vos.setColorStatus(2);
+						}
+					}
+				}
+			} else {
+				vos.setColorStatus(1);
+			}
+		}
+	}
+
 	/**
 	 * 修改 
 	 */

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

@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
+import org.springblade.business.vo.QueryProcessDataVO;
 
 /**
  *  Mapper 接口
@@ -31,6 +32,11 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 
+	/**
+	 * 查询工序节点的填报记录
+	 */
+	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractId(@Param("parentId") String parentId, @Param("classify") Integer classify, @Param("contractId") String contractId);
+
 	/**
 	 * 根据节点ID及其填报的类型获取填报记录
 	 * @param wbsId 节点ID

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

@@ -23,7 +23,6 @@
         <result column="is_experiment" property="isExperiment"/>
         <result column="data_id" property="dataId"/>
         <result column="task_id" property="taskId"/>
-        <result column="task_status" property="taskStatus"/>
         <result column="file_user_id_and_name" property="fileUserIdAndName"/>
         <result column="audit_user_id_and_name" property="auditUserIdAndName"/>
         <result column="report_number" property="reportNumber"/>
@@ -31,8 +30,35 @@
         <result column="source_type" property="sourceType"/>
     </resultMap>
 
+    <resultMap id="queryProcessDataMap" type="org.springblade.business.vo.QueryProcessDataVO">
+        <result column="treeId" property="treeId"/>
+        <result column="p_key_id" property="primaryKeyId"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="informationQueryId" property="informationQueryId"/>
+        <result column="status" property="status"/>
+    </resultMap>
+
     <resultMap id="intResultMap" type="java.lang.Integer"/>
 
+    <select id="queryProcessDataByParentIdAndContractId" resultMap="queryProcessDataMap">
+        SELECT
+            wtc.id AS treeId,
+            wtc.p_key_id,
+            wtc.ancestors,
+            uiq.id AS informationQueryId,
+            uiq.status
+        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.wbs_type = 1
+        AND wtc.type = 1
+        AND wtc.dept_category = 6
+        AND wtc.ancestors like concat('%',#{parentId},'%')
+        AND wtc.contract_id = #{contractId}
+        AND wtc.is_deleted = 0
+    </select>
+
     <select id="getInformationQueryByWbsId" resultMap="informationQueryResultMap">
         select * from u_information_query where is_deleted = 0 and wbs_id = #{wbsId} and classify = #{classify}
     </select>

+ 31 - 26
blade-service/blade-business/src/main/java/org/springblade/business/mapper/UserOpinionMapper.xml

@@ -38,35 +38,40 @@
 
     <select id="queryManageUserOpinionList" resultMap="businessUserOpinionMap">
         select
-            uo.id as userOpinionId,
-            uo.create_time as createTime,
-            uof.manage_time as manageTime,
-            pi.project_name as projectName,
-            ci.contract_name as contractName,
-            uo.problem_type as problemType,
-            uo.opinion_content as opinionContent,
-            case uof.is_current
-            when 2 then 'true' else 'false' end as isCurrent,
-            uof.number as number,
-	        uo.number as newNumber,
-            uof.evaluation as evaluation
+            re.*
         from
-            u_user_opinion as uo
-        left join m_project_info as pi on uo.project_id = pi.id
-        left join m_contract_info as ci on uo.contract_id = ci.id
-        right join (
+        (
             select
-                uof.*
+                uo.id as userOpinionId,
+                uo.create_time as createTime,
+                uof.manage_time as manageTime,
+                pi.project_name as projectName,
+                ci.contract_name as contractName,
+                uo.problem_type as problemType,
+                uo.opinion_content as opinionContent,
+                case uof.is_current
+                when 2 then 'true' else 'false' end as isCurrent,
+                uof.number as number,
+                uo.number as newNumber,
+                uof.evaluation as evaluation
             from
-            (
-                select user_opinion_id,is_current,manage_time,number,sort,evaluation from u_user_opinion_flow where is_deleted = 0
-                <if test="currentUser != null and currentUser != ''">
-                    and manage_user = #{currentUser}
-                </if>
-                and sort = 4 order by number DESC
-            ) as uof
-        ) as uof on uof.user_opinion_id = uo.id
-        where uo.is_deleted = 0 order by uo.create_time DESC
+                u_user_opinion as uo
+            left join m_project_info as pi on uo.project_id = pi.id
+            left join m_contract_info as ci on uo.contract_id = ci.id
+            right join (
+                select
+                    uof.*
+                from
+                (
+                    select user_opinion_id,is_current,manage_time,number,sort,evaluation from u_user_opinion_flow where is_deleted = 0
+                    <if test="currentUser != null and currentUser != ''">
+                        and manage_user = #{currentUser}
+                    </if>
+                    and sort = 4 order by number DESC
+                ) as uof
+            ) as uof on uof.user_opinion_id = uo.id
+            where uo.is_deleted = 0 order by uof.number DESC
+        ) AS re group by re.userOpinionId order by re.createTime DESC
     </select>
 
     <select id="queryCurrentUserOpinionList" resultMap="userOpinionResultMap">

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

@@ -19,9 +19,9 @@ package org.springblade.business.service;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
+import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.secure.BladeUser;
 
 import java.util.List;
 
@@ -33,6 +33,11 @@ import java.util.List;
  */
 public interface IInformationQueryService extends BaseService<InformationQuery> {
 
+	/**
+	 * 查询工序节点的填报记录
+	 */
+	List<QueryProcessDataVO> queryProcessDataByParentIdAndContractId(String parentId, Integer classify, String contractId);
+
 	/**
 	 * 保存填报时新增或修改填报资料记录表数据
 	 * @param wbsId 当前填报节点

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

@@ -10,6 +10,7 @@ import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.business.mapper.InformationQueryMapper;
 import org.springblade.business.service.IInformationQueryService;
+import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -33,12 +34,28 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 	private final WbsTreeContractClient wbsTreeContractClient;
 
+	@Override
+	public List<QueryProcessDataVO> queryProcessDataByParentIdAndContractId(String parentId, Integer classify, String contractId) {
+		List<QueryProcessDataVO> result = this.baseMapper.queryProcessDataByParentIdAndContractId(parentId, classify, contractId);
+		if(result == null || result.size() <= 0){
+			result = this.baseMapper.queryProcessDataByParentIdAndContractId("", classify, contractId);
+		}
+		return result;
+	}
+
 	@Override
 	public void saveOrUpdateInformationQueryData(String primaryKeyId, String fileName, Integer classify, Integer sourceType) {
 		BladeUser user = AuthUtil.getUser();
 
+		//首先根据wbsId获取合同段ID和项目ID
+		WbsTreeContract contractTree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(primaryKeyId));
+		if(new Integer("2").equals(contractTree.getWbsType()) || new Integer("2").equals(contractTree.getType())){
+			//说明是表单,需要获取其父级
+			contractTree = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(contractTree.getParentId(), Long.parseLong(contractTree.getContractId()));
+		}
+
 		//判断当前填报节点下是否已经存在相应数据
-		InformationQuery oldData = this.baseMapper.getInformationQueryByWbsId(Long.parseLong(primaryKeyId), classify);
+		InformationQuery oldData = this.baseMapper.getInformationQueryByWbsId(contractTree.getPKeyId(), classify);
 
 		if(oldData != null){
 			//存在记录,修改
@@ -62,8 +79,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 			//修改数据
 			this.baseMapper.updateById(oldData);
 		} else {
-			//首先根据wbsId获取合同段ID和项目ID
-			WbsTreeContract contractTree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(primaryKeyId));
+
+
 			//新增基础数据
 			InformationQuery newData = new InformationQuery();
 			//设置文件题名
@@ -77,7 +94,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 			//施工资料还是质检资料
 			newData.setClassify(classify);
 			//节点ID
-			newData.setWbsId(Long.parseLong(primaryKeyId));
+			newData.setWbsId(contractTree.getPKeyId());
 			//是否是试验节点
 			newData.setIsExperiment(contractTree.getIsExpernode());
 			//数据ID
@@ -89,7 +106,6 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 			//数据源类型
 			newData.setSourceType(sourceType);
 			newData.setCreateUser(user.getUserId());
-			newData.setCreateDept(user.getDeptId().contains(",") ? Long.parseLong(user.getDeptId().split(",")[0]) : Long.parseLong(user.getDeptId()));
 			newData.setCreateTime(new Date());
 			//保存数据
 			this.baseMapper.insert(newData);

+ 14 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -2,13 +2,13 @@ package org.springblade.manager.feign;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.mixsmart.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.NumberUtil;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.service.IContractInfoService;
 import org.springblade.manager.service.IWbsTreeContractService;
@@ -31,8 +31,13 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
     private final IDictBizClient dictBizClient;
 
     @Override
-    public List<WbsTreeContract> queryChildByParentId(WbsTreeContract treeNode) {
-        return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, treeNode.getId()).eq(WbsTreeContract::getContractId, treeNode.getContractId()).eq(WbsTreeContract::getWbsType, treeNode.getWbsType()));
+    public List<WbsTreeContract> queryChildByParentId(WbsTreeContract treeNode, String queryTable) {
+        if("queryTable".equals(queryTable)){
+            //查询表格
+            return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, treeNode.getId()).eq(WbsTreeContract::getContractId, treeNode.getContractId()).eq(WbsTreeContract::getType, "2").eq(WbsTreeContract::getWbsType, "2"));
+        } else {
+            return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, treeNode.getId()).eq(WbsTreeContract::getContractId, treeNode.getContractId()).eq(WbsTreeContract::getType, 1).eq(WbsTreeContract::getWbsType, treeNode.getWbsType()));
+        }
     }
 
     @Override
@@ -82,9 +87,14 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
         return this.wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getIsDeleted, 1).in(WbsTreeContract::getPKeyId, Func.toLongList(ids)));
     }
 
+    @Override
+    public WbsTreeContract getContractWbsTreeByContractIdAndId(Long id, Long contractId) {
+        return this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getId, id.toString()).eq(WbsTreeContract::getContractId, contractId.toString()));
+    }
+
     @Override
     public WbsTreeContract getContractWbsTreeByPrimaryKeyId(Long primaryKeyId) {
-        return this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, primaryKeyId).eq(WbsTreeContract::getIsDeleted, 0));
+        return this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, primaryKeyId));
     }
 
     @Override