Bläddra i källkod

新增首件判断

huangjn 3 år sedan
förälder
incheckning
e0ddf2d66c

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

@@ -49,4 +49,7 @@ public class WbsTreeContractTreeVOS {
     @ApiModelProperty("节点上传图纸URL")
     private String fileUrl;
 
+    @ApiModelProperty("是否被标记为首件")
+    private Boolean isFirst;
+
 }

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

@@ -25,8 +25,10 @@ import javax.validation.Valid;
 
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.ContractTreeDrawings;
+import org.springblade.business.entity.TreeContractFirst;
 import org.springblade.business.feignClient.ClientTreePublicCodeClientImpl;
 import org.springblade.business.service.IContractTreeDrawingsService;
+import org.springblade.business.service.ITreeContractFirstService;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.core.mp.support.Condition;
@@ -77,6 +79,8 @@ public class InformationWriteQueryController extends BladeController {
 
 	private final ClientTreePublicCodeClientImpl clientTreePublicCodeClient;
 
+	private final ITreeContractFirstService treeContractFirstService;
+
 	/**
 	 * 修改节点信息
 	 * @param node 节点信息
@@ -275,9 +279,10 @@ public class InformationWriteQueryController extends BladeController {
 			rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);
 		}
 
-		//获取上传的图纸
+		//其他参数
 		if(rootTreeNode != null && rootTreeNode.size() != 0){
 			rootTreeNode.forEach(vo -> {
+				//获取上传的图纸
 				ContractTreeDrawings drawings = this.contractTreeDrawingsService.queryCurrentNodeDrawings(vo.getPrimaryKeyId());
 				if(drawings != null){
 					//主键
@@ -285,6 +290,10 @@ public class InformationWriteQueryController extends BladeController {
 					//文件路径
 					vo.setFileUrl(drawings.getFileUrl());
 				}
+
+				//判断当前节点是否被标记为首件
+				TreeContractFirst first = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getIsDeleted, 0).eq(TreeContractFirst::getWbsNodeId, vo.getPrimaryKeyId()));
+				vo.setIsFirst(first != null);
 			});
 		}