Prechádzať zdrojové kódy

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

liuyc 3 rokov pred
rodič
commit
d1ef20b9b8
37 zmenil súbory, kde vykonal 1384 pridanie a 69 odobranie
  1. 3 1
      .idea/compiler.xml
  2. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractLogDTO.java
  3. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TreeContractFirstDTO.java
  4. 73 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractLog.java
  5. 67 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TreeContractFirst.java
  6. 35 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogVO.java
  7. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TreeContractFirstVO.java
  8. 54 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormData.java
  9. 19 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormulaBean.java
  10. 2 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/Formula.java
  11. 21 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreeContractClient.java
  12. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractTreeVOS.java
  13. 78 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java
  14. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractTreeDrawingsController.java
  15. 34 31
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  16. 4 10
      blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java
  17. 258 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TreeContractFirstController.java
  18. 30 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ClientTreePublicCodeClientImpl.java
  19. 43 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogMapper.java
  20. 87 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogMapper.xml
  21. 34 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TreeContractFirstMapper.java
  22. 20 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TreeContractFirstMapper.xml
  23. 44 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IContractLogService.java
  24. 32 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITreeContractFirstService.java
  25. 72 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java
  26. 36 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TreeContractFirstServiceImpl.java
  27. 50 7
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FormulaController.java
  28. 57 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java
  29. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/FormulaMapper.xml
  30. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java
  31. 13 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml
  32. 11 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IFormulaService.java
  33. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeContractService.java
  34. 0 16
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaService.java
  35. 68 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  36. 4 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java
  37. 24 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/FormulaWrapper.java

+ 3 - 1
.idea/compiler.xml

@@ -21,7 +21,8 @@
         <module name="blade-xxljob-admin" />
         <module name="blade-desk" />
         <module name="blade-flow-api" />
-        <module name="blade-develop" />
+        <module name="blade-business" />
+        <module name="blade-desk-api" />
         <module name="blade-report" />
         <module name="blade-system-api" />
         <module name="blade-auth" />
@@ -31,6 +32,7 @@
         <module name="blade-user-api" />
         <module name="blade-resource" />
         <module name="blade-dict-api" />
+        <module name="blade-business-api" />
         <module name="blade-resource-api" />
       </profile>
     </annotationProcessing>

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractLogDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.ContractLog;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 日志通用表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractLogDTO extends ContractLog {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TreeContractFirstDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.TreeContractFirst;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 合同段划分树首件关联表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TreeContractFirstDTO extends TreeContractFirst {
+	private static final long serialVersionUID = 1L;
+
+}

+ 73 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractLog.java

@@ -0,0 +1,73 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 日志通用表实体类
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+@Data
+@TableName("u_contract_log")
+@EqualsAndHashCode(callSuper = true)
+public class ContractLog extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 项目ID
+     */
+    private Long projectId;
+    /**
+     * 合同段ID
+     */
+    private Long contractId;
+    /**
+     * 所填报的节点类型ID
+     */
+    private Long wbsNodeId;
+    /**
+     * 日志类型
+     */
+    private Integer wbsNodeType;
+    /**
+     * 填报时间、施工时间
+     */
+    private String recordTime;
+    /**
+     * 编号
+     */
+    private String recordNumber;
+    private String projectPileno;
+    private String projectPart;
+    /**
+     * 数据ID
+     */
+    private Long dataId;
+    private String createUserName;
+
+
+}

+ 67 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TreeContractFirst.java

@@ -0,0 +1,67 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 合同段划分树首件关联表实体类
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+@Data
+@TableName("u_tree_contract_first")
+@EqualsAndHashCode(callSuper = true)
+public class TreeContractFirst extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 项目ID
+     */
+    private Long projectId;
+
+    /**
+     * 合同段ID
+     */
+    private Long contractId;
+
+    /**
+     * wbs_tree_contract表p_key_id
+     */
+    private Long wbsNodeId;
+
+    public TreeContractFirst(Long projectId, Long contractId, Long wbsNodeId, Long userId, String deptId){
+        this.projectId = projectId;
+        this.contractId = contractId;
+        this.wbsNodeId = wbsNodeId;
+        this.setCreateUser(userId);
+        this.setCreateDept(deptId.contains(",") ? Long.parseLong(String.valueOf(deptId).split(",")[0]) : Long.parseLong(deptId));
+        this.setCreateTime(new Date());
+    }
+
+    public TreeContractFirst(){}
+
+}

+ 35 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogVO.java

@@ -0,0 +1,35 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.business.entity.ContractLog;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 日志通用表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractLogVO extends ContractLog {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("当前页数")
+	private Integer current;
+
+	@ApiModelProperty("当前页显示条数")
+	private Integer size;
+
+	@ApiModelProperty("时间查询")
+	private String queryTime;
+
+	private String startTime;
+
+	private String endTime;
+
+	@ApiModelProperty("关键字查询")
+	private String queryValue;
+
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TreeContractFirstVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import org.springblade.business.entity.TreeContractFirst;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 合同段划分树首件关联表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TreeContractFirstVO extends TreeContractFirst {
+	private static final long serialVersionUID = 1L;
+
+}

+ 54 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormData.java

@@ -0,0 +1,54 @@
+package org.springblade.manager.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.manager.entity.Formula;
+
+import java.util.List;
+
+/**
+ * @author yangyj
+ * @Date 2022/6/15 15:02
+ * @description TODO
+ */
+@Data
+public class FormData {
+    /**
+     * 元素key
+     */
+    private String eKey;
+    /**
+     * 元素名称
+     */
+    private String eName;
+
+    /**
+     * 元素类型
+     */
+    private Integer eType;
+
+    /**
+     * 元素长度
+     */
+    private Integer eLength;
+
+    /**
+     * 允许偏差值
+     */
+    private String eAllowDeviation;
+    /**
+     * 内容
+     */
+    private List<Object[][]> values;
+    /**
+     * 公式脚本
+     */
+    private Formula formula;
+    /**
+     * 业务组
+     */
+    private  Integer groupId;
+
+
+}

+ 19 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormulaBean.java

@@ -0,0 +1,19 @@
+package org.springblade.manager.dto;
+
+import lombok.Data;
+
+import javax.validation.constraints.Size;
+
+/**
+ * @author yangyj
+ * @Date 2022/6/14 16:27
+ * @description TODO
+ */
+@Data
+public class FormulaBean {
+    private Long id;
+    private String formula;
+    private String remark;
+    private Long wbsId;
+    private Long elementId;
+}

+ 2 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/Formula.java

@@ -25,4 +25,6 @@ public class Formula extends BaseEntity {
    private String remark;
    @Size(max = 20)
    private Long wbsId;
+   @Size(max = 20)
+   private Long elementId;
 }

+ 21 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreeContractClient.java

@@ -47,4 +47,25 @@ public interface WbsTreeContractClient {
     @GetMapping(API_PREFIX + "/queryContractWbsTreeByContractIdAndType")
     List<WbsTreeContractTreeVOS> queryContractWbsTreeByContractIdAndType(@RequestParam String contractId, @RequestParam Integer wbsType, @RequestParam String parentId);
 
+    @GetMapping(API_PREFIX + "/queryCurrentContractLogList")
+    List<WbsTreeContractTreeVOS> queryCurrentContractLogList(@RequestParam String contractId);
+
+    /**
+     * 获取当前节点的所有父节点
+     * @param contractId 合同段ID
+     * @param parentId 父节点ID
+     * @return 结果
+     */
+    @PostMapping(API_PREFIX + "/queryCurrentNodeAllParent")
+    WbsTreeContract queryCurrentNodeAllParent(@RequestParam Long contractId, @RequestParam Long parentId);
+
+    /**
+     * 获取当前节点的所有子节点
+     * @param contractId 合同段ID
+     * @param parentId 当前节点ID
+     * @return 结果
+     */
+    @PostMapping(API_PREFIX + "/queryCurrentNodeAllChild")
+    List<WbsTreeContract> queryCurrentNodeAllChild(@RequestParam Long contractId, @RequestParam Long parentId);
+
 }

+ 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;
+
 }

+ 78 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -0,0 +1,78 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.vo.ContractLogVO;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.manager.feign.WbsTreeContractClient;
+import org.springblade.manager.vo.WbsTreeContractTreeVOS;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.business.service.IContractLogService;
+import org.springblade.core.boot.ctrl.BladeController;
+import java.util.List;
+
+/**
+ * 日志通用表 控制器
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/contractLog")
+@Api(value = "日志通用表", tags = "日志通用表接口")
+public class ContractLogController extends BladeController {
+
+	private final IContractLogService contractLogService;
+
+	private final WbsTreeContractClient wbsTreeContractClient;
+
+	/**
+	 * 施工日志分页
+	 * @param logVo 查询条件
+	 * @return 结果
+	 */
+	@GetMapping("/constructionLogPage")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "施工日志分页")
+	public R<IPage<ContractLogVO>> constructionLogPage(@RequestBody ContractLogVO logVo){
+		return R.data(this.contractLogService.constructionLogPage(logVo));
+	}
+
+	/**
+	 * 获取当前合同段下的日志类型
+	 * @param contractId 合同段ID
+	 * @return 结果
+	 */
+	@GetMapping("/queryCurrentContractLogList")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "获取当前合同段下的日志类型")
+	@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+	public R<List<WbsTreeContractTreeVOS>> queryCurrentContractLogList(@RequestParam String contractId){
+		return R.data(this.wbsTreeContractClient.queryCurrentContractLogList(contractId));
+	}
+	
+}

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

@@ -58,7 +58,7 @@ public class ContractTreeDrawingsController extends BladeController {
 	@ApiImplicitParams({
 			@ApiImplicitParam(name = "primaryKeyId", value = "节点primaryKeyId", required = true),
 			@ApiImplicitParam(name = "fileUrl", value = "文件url", required = true),
-			@ApiImplicitParam(name = "id", value = "文件url")
+			@ApiImplicitParam(name = "id", value = "节点的drawingsId")
 	})
 	public R<Boolean> saveOrUpdateContractTreeDrawings(@RequestParam String primaryKeyId, @RequestParam String fileUrl, @RequestParam String id){
 		//当前提交用户

+ 34 - 31
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -25,7 +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;
@@ -74,6 +77,10 @@ public class InformationWriteQueryController extends BladeController {
 
 	private final IContractTreeDrawingsService contractTreeDrawingsService;
 
+	private final ClientTreePublicCodeClientImpl clientTreePublicCodeClient;
+
+	private final ITreeContractFirstService treeContractFirstService;
+
 	/**
 	 * 修改节点信息
 	 * @param node 节点信息
@@ -118,26 +125,26 @@ public class InformationWriteQueryController extends BladeController {
 		return R.data(this.wbsTreeContractClient.removeContractTreeNode(ids));
 	}
 
-	/**
-	 * 新增子节点
-	 * @param contractNodePrimaryKeyId 新增的节点所在位置,即当前点出菜单栏的节点PrimaryKeyId
-	 * @param projectNodePrimaryKeyId 被选中的新增节点
-	 * @return 新增结果
-	 */
-	@PostMapping("/saveContractTreeNode")
-	@ApiOperationSupport(order = 10)
-	@ApiOperation(value = "新增节点及其子节点")
-	@ApiImplicitParams({
-			@ApiImplicitParam(name = "contractNodePrimaryKeyId", value = "新增的节点所在位置,即当前点出菜单栏的节点PrimaryKeyId", required = true),
-			@ApiImplicitParam(name = "projectNodePrimaryKeyId", value = "被选中的新增节点", required = true)
-	})
-	public R<Boolean> saveContractTreeNode(@RequestParam String contractNodePrimaryKeyId, @RequestParam String projectNodePrimaryKeyId){
-		//先获取当前节点的信息
-		WbsTreeContract treeContract = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(contractNodePrimaryKeyId));
-		//判断新增
-
-		return null;
-	}
+//	/**
+//	 * 新增子节点
+//	 * @param contractNodePrimaryKeyId 新增的节点所在位置,即当前点出菜单栏的节点PrimaryKeyId
+//	 * @param projectNodePrimaryKeyId 被选中的新增节点
+//	 * @return 新增结果
+//	 */
+//	@PostMapping("/saveContractTreeNode")
+//	@ApiOperationSupport(order = 10)
+//	@ApiOperation(value = "新增节点及其子节点")
+//	@ApiImplicitParams({
+//			@ApiImplicitParam(name = "contractNodePrimaryKeyId", value = "新增的节点所在位置,即当前点出菜单栏的节点PrimaryKeyId", required = true),
+//			@ApiImplicitParam(name = "projectNodePrimaryKeyId", value = "被选中的新增节点", required = true)
+//	})
+//	public R<Boolean> saveContractTreeNode(@RequestParam String contractNodePrimaryKeyId, @RequestParam String projectNodePrimaryKeyId){
+//		//先获取当前节点的信息
+//		WbsTreeContract treeContract = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(contractNodePrimaryKeyId));
+//		//检查当前节点下是否添加了子节点
+//
+//		return null;
+//	}
 
 	/**
 	 * 懒加载项目级工程划分树
@@ -266,24 +273,16 @@ public class InformationWriteQueryController extends BladeController {
 		if(com.alibaba.nacos.common.utils.StringUtils.isEmpty(parentId)){
 			//为空,说明初始化
 			//获取根节点
-			rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, "0");
-			if(rootTreeNode != null && rootTreeNode.size() != 0){
-				rootTreeNode.forEach(vo -> {
-					//获取一级子节点
-					List<WbsTreeContractTreeVOS> treeNodes = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, vo.getId());
-					if(treeNodes != null && treeNodes.size() != 0){
-						vo.setChildren(treeNodes);
-					}
-				});
-			}
+			rootTreeNode = this.clientTreePublicCodeClient.queryContractWbsTreeByContractIdAndType(contractId, 1, "0");
 		} else {
 			//不为空,获取其下子节点
 			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){
 					//主键
@@ -291,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);
 			});
 		}
 

+ 4 - 10
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java

@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.business.entity.ConstructionLedger;
+import org.springblade.business.feignClient.ClientTreePublicCodeClientImpl;
 import org.springblade.business.service.IConstructionLedgerService;
 import org.springblade.business.vo.NeiYeLedgerVO;
 import org.springblade.business.vo.NeiYeQueryVO;
@@ -33,6 +34,8 @@ public class NeiYeController {
 
     private final IConstructionLedgerService constructionLedgerService;
 
+    private final ClientTreePublicCodeClientImpl clientTreePublicCodeClient;
+
     /**
      * 获取内业台账列表
      * @return 内业台账列表
@@ -195,16 +198,7 @@ public class NeiYeController {
         if(StringUtils.isEmpty(parentId)){
             //为空,说明初始化
             //获取根节点
-            rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, "0");
-            if(rootTreeNode != null && rootTreeNode.size() != 0){
-                rootTreeNode.forEach(vo -> {
-                    //获取一级子节点
-                    List<WbsTreeContractTreeVOS> treeNodes = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, vo.getId());
-                    if(treeNodes != null && treeNodes.size() != 0){
-                        vo.setChildren(treeNodes);
-                    }
-                });
-            }
+            rootTreeNode = this.clientTreePublicCodeClient.queryContractWbsTreeByContractIdAndType(contractId, 1, "0");
         } else {
             //不为空,获取其下子节点
             rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);

+ 258 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TreeContractFirstController.java

@@ -0,0 +1,258 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import io.swagger.annotations.*;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.feignClient.ClientTreePublicCodeClientImpl;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.feign.WbsTreeContractClient;
+import org.springblade.manager.vo.WbsTreeContractTreeVOS;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springblade.business.entity.TreeContractFirst;
+import org.springblade.business.service.ITreeContractFirstService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 合同段划分树首件关联表 控制器
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/treeContractFirst")
+@Api(value = "合同段划分树首件关联表", tags = "合同段划分树首件关联表接口")
+public class TreeContractFirstController extends BladeController {
+
+	private final ITreeContractFirstService treeContractFirstService;
+
+	private final WbsTreeContractClient wbsTreeContractClient;
+
+	private final ClientTreePublicCodeClientImpl clientTreePublicCodeClient;
+
+	/**
+	 * 获取合同段划分树中被标记为首件的节点
+	 * @param parentId 父节点,为空则查询第一级节点
+	 * @param contractId 合同段ID
+	 * @return 结果
+	 */
+	@GetMapping("/queryContractWbsTreeFirstByContractIdAndType")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "获取合同段划分树中被标记为首件的节点")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
+			@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+	})
+	public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeFirstByContractIdAndType(@RequestParam String parentId, @RequestParam String contractId){
+		List<WbsTreeContractTreeVOS> rootTreeNode;
+
+		if(StringUtils.isEmpty(parentId)){
+			//为空,说明初始化
+			//获取根节点
+			rootTreeNode = this.clientTreePublicCodeClient.queryContractWbsTreeByContractIdAndType(contractId, 1, "0");
+		} else {
+			//不为空,获取其下子节点
+			rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);
+		}
+
+		//判断这些节点哪些是标记为首件的
+		Iterator<WbsTreeContractTreeVOS> iterator = rootTreeNode.iterator();
+		while (iterator.hasNext()){
+			WbsTreeContractTreeVOS vos = iterator.next();
+
+			if(vos.getChildren() != null && vos.getChildren().size() != 0){
+				Iterator<WbsTreeContractTreeVOS> iterators = vos.getChildren().iterator();
+				while (iterators.hasNext()){
+					WbsTreeContractTreeVOS vo = iterators.next();
+					TreeContractFirst first = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getWbsNodeId, vo.getPrimaryKeyId()).eq(TreeContractFirst::getIsDeleted, 0));
+					if(first == null){
+						//如果当前节点没被标记为首件则不显示当前节点
+						iterators.remove();
+					}
+				}
+			}
+
+			if("0".equals(vos.getParentId())){
+				//根节点不删除
+				continue;
+			}
+
+			TreeContractFirst first = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getWbsNodeId, vos.getPrimaryKeyId()).eq(TreeContractFirst::getIsDeleted, 0));
+			if(first == null){
+				//如果当前节点没被标记为首件则不显示当前节点
+				iterator.remove();
+			}
+		}
+
+		return R.data(rootTreeNode);
+	}
+
+	/**
+	 * 新增或删除 合同段划分树首件关联表
+	 */
+	@PostMapping("/saveOrDelete")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "新增或删除 合同段划分树首件关联")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "primaryKeyId", value = "标记为首件的节点primaryKeyId或pKeyId", required = true),
+			@ApiImplicitParam(name = "saveOrDeleted", value = "新增为0,删除为1", required = true)
+	})
+	public R<List<String>> saveOrDelete(@RequestParam String primaryKeyId, @RequestParam Integer saveOrDeleted) {
+		//获取当前操作用户
+		BladeUser user = AuthUtil.getUser();
+		//获取当前节点的信息
+		WbsTreeContract nodeData = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.valueOf(primaryKeyId));
+		if(nodeData == null){
+			return R.data(-1, null, "未找到当前节点");
+		}
+		//获取当前节点的所有父节点和子节点
+		StringBuilder parentIds = new StringBuilder(), childIds = new StringBuilder();
+		//获取父节点
+		this.currentNodeAllParent(parentIds, nodeData);
+		//获取子节点
+		this.currentNodeAllChild(childIds, nodeData);
+
+		//判断是新增还是删除
+		if(new Integer("0").equals(saveOrDeleted)){
+			//检查当前请求的节点是否已经被关联
+			TreeContractFirst firstData = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getIsDeleted, 0).eq(TreeContractFirst::getWbsNodeId, primaryKeyId));
+			if(firstData != null){
+				return R.data(JSONArray.parseArray(JSONObject.toJSONString(primaryKeyId), String.class));
+			}
+
+			//新增集合
+			List<TreeContractFirst> save = new ArrayList<>();
+			//新增当前节点
+			save.add(new TreeContractFirst(Long.parseLong(nodeData.getProjectId()), Long.parseLong(nodeData.getContractId()), nodeData.getPKeyId(), user.getUserId(), user.getDeptId()));
+			//新增当前节点下的子节点
+			if(StringUtils.isNotEmpty(childIds.toString()) && !",".equals(childIds.toString())){
+				String[] childArray = childIds.toString().split(",");
+				for(String child : childArray){
+					if(StringUtils.isNotEmpty(child)){
+						save.add(new TreeContractFirst(Long.parseLong(nodeData.getProjectId()), Long.parseLong(nodeData.getContractId()), Long.parseLong(child), user.getUserId(), user.getDeptId()));
+					}
+				}
+			}
+			//新增父节点
+			if(StringUtils.isNotEmpty(parentIds.toString()) && !",".equals(parentIds.toString())){
+				//新增父节点需要判断当前父节点是否已经被标记为首件
+				String[] parentIdArray = parentIds.toString().split(",");
+				for(String parentId : parentIdArray){
+					if(StringUtils.isNotEmpty(parentId)){
+						//判断是否被标记为首件
+						TreeContractFirst old = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getWbsNodeId, parentId).eq(TreeContractFirst::getIsDeleted, 0));
+						if(old == null){
+							//说明没有被标记,新增
+							save.add(new TreeContractFirst(Long.parseLong(nodeData.getProjectId()), Long.parseLong(nodeData.getContractId()), Long.parseLong(parentId), user.getUserId(), user.getDeptId()));
+						}
+					}
+				}
+			}
+			//最后操作落库
+			this.treeContractFirstService.saveBatch(save);
+			//返回当前操作的节点
+			parentIds.append(",").append(primaryKeyId).append(childIds);
+			List<String> result = JSONArray.parseArray(JSONObject.toJSONString(parentIds.toString().split(",")), String.class);
+			//删掉为空的数据
+			result.removeIf(StringUtils::isEmpty);
+			return R.data(result);
+		} else {
+			//删除自身
+			this.treeContractFirstService.update(Wrappers.<TreeContractFirst>lambdaUpdate().set(TreeContractFirst::getIsDeleted, 1).eq(TreeContractFirst::getWbsNodeId, primaryKeyId));
+			//删除子节点
+			if(StringUtils.isNotEmpty(childIds.toString()) && !",".equals(childIds.toString())){
+				//存在子节点,均更改为删除状态
+				this.treeContractFirstService.update(Wrappers.<TreeContractFirst>lambdaUpdate().set(TreeContractFirst::getIsDeleted, 1).in(TreeContractFirst::getWbsNodeId, Func.toLongList(childIds.toString())));
+			}
+			//删除父节点
+			StringBuilder parentResult = new StringBuilder();
+			if(StringUtils.isNotEmpty(parentIds.toString()) && !",".equals(parentIds.toString())){
+				//删除父节点情况相对复杂,需要判断对应节点下的是否还存在子节点处于首件状态,如果存在那么当前父节点就不能被删除掉
+				String[] parentIdArray = parentIds.toString().split(",");
+				for(String parentId : parentIdArray){
+					if(StringUtils.isNotEmpty(parentId)){
+						//首先获取当前父节点的下一级子节点
+						WbsTreeContract parentNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(parentId);
+						List<WbsTreeContractTreeVOS> oneChild = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(nodeData.getContractId(), nodeData.getWbsType(), String.valueOf(parentNode.getId()));
+						//获取唯一键
+						List<String> ids = oneChild.stream().map(WbsTreeContractTreeVOS::getPrimaryKeyId).distinct().collect(Collectors.toList());
+						//判断是否存在首件标记
+						List<TreeContractFirst> result = this.treeContractFirstService.list(Wrappers.<TreeContractFirst>lambdaQuery().in(TreeContractFirst::getWbsNodeId, ids).eq(TreeContractFirst::getIsDeleted, 0));
+						if(result != null && result.size() != 0){
+							//result不为空且有数据,说明当前节点下的子节点仍存在除了 nodeData 外的节点处于首件标记,那么当前节点及其更上级节点都不能被取消首件标记,故直接中断循环
+							break;
+						} else {
+							//反之,说明当前节点下的子节点已经不存在处理首件标记的有效记录,则当前节点可以被取消首件标记
+							this.treeContractFirstService.update(Wrappers.<TreeContractFirst>lambdaUpdate().set(TreeContractFirst::getIsDeleted, 1).eq(TreeContractFirst::getWbsNodeId, parentId));
+							parentResult.append(",").append(parentId);
+							//之后对当前节点的上一级做相同判断
+						}
+					}
+				}
+			}
+			parentResult.append(",").append(primaryKeyId).append(childIds);
+			List<String> result = JSONArray.parseArray(JSONObject.toJSONString(parentResult.toString().split(",")), String.class);
+			//删掉为空的数据
+			result.removeIf(StringUtils::isEmpty);
+
+			return R.data(result);
+		}
+	}
+
+	/**
+	 * 获取所有父节点
+	 */
+	private void currentNodeAllParent(StringBuilder parentIds, WbsTreeContract currentNode){
+		if(!"0".equals(String.valueOf(currentNode.getParentId()))){
+			//如果父节点不是0说明没到顶层
+			WbsTreeContract parentNode = this.wbsTreeContractClient.queryCurrentNodeAllParent(Long.parseLong(currentNode.getContractId()), currentNode.getParentId());
+			if(parentNode != null){
+				parentIds.append(",").append(parentNode.getPKeyId());
+				this.currentNodeAllParent(parentIds, parentNode);
+			}
+		}
+	}
+
+	/**
+	 * 获取所有子节点
+	 */
+	private void currentNodeAllChild(StringBuilder childIds, WbsTreeContract currentNode){
+		//获取所有子节点
+		List<WbsTreeContract> childList = this.wbsTreeContractClient.queryCurrentNodeAllChild(Long.parseLong(currentNode.getContractId()), currentNode.getId());
+		if(childList != null && childList.size() != 0){
+			childList.forEach(child -> childIds.append(",").append(child.getPKeyId()));
+		}
+	}
+
+}

+ 30 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ClientTreePublicCodeClientImpl.java

@@ -0,0 +1,30 @@
+package org.springblade.business.feignClient;
+
+import lombok.AllArgsConstructor;
+import org.springblade.manager.feign.WbsTreeContractClient;
+import org.springblade.manager.vo.WbsTreeContractTreeVOS;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+public class ClientTreePublicCodeClientImpl {
+
+    private final WbsTreeContractClient wbsTreeContractClient;
+    
+    public List<WbsTreeContractTreeVOS> queryContractWbsTreeByContractIdAndType(String contractId, Integer wbsType, String parentId){
+        List<WbsTreeContractTreeVOS> rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, wbsType, parentId);
+        if(rootTreeNode != null && rootTreeNode.size() != 0){
+            rootTreeNode.forEach(vo -> {
+                //获取一级子节点
+                List<WbsTreeContractTreeVOS> treeNodes = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, wbsType, vo.getId());
+                if(treeNodes != null && treeNodes.size() != 0){
+                    vo.setChildren(treeNodes);
+                }
+            });
+        }
+        return rootTreeNode;
+    }
+    
+}

+ 43 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogMapper.java

@@ -0,0 +1,43 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.vo.ContractLogVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 日志通用表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+public interface ContractLogMapper extends BaseMapper<ContractLog> {
+
+	List<ContractLog> constructionLogPage(@Param("current") Integer current, @Param("size") Integer size, @Param("vo") ContractLogVO vo);
+
+	Integer selectPageCount(@Param("vo") ContractLogVO vo);
+
+	/**
+	 * 自定义分页
+	 */
+	List<ContractLogVO> selectContractLogPage(IPage page, ContractLogVO contractLog);
+
+}

+ 87 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogMapper.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.ContractLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="contractLogResultMap" type="org.springblade.business.entity.ContractLog">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="wbs_node_id" property="wbsNodeId"/>
+        <result column="wbs_node_type" property="wbsNodeType"/>
+        <result column="record_time" property="recordTime"/>
+        <result column="record_number" property="recordNumber"/>
+        <result column="project_pileno" property="projectPileno"/>
+        <result column="project_part" property="projectPart"/>
+        <result column="data_id" property="dataId"/>
+        <result column="create_user_name" property="createUserName"/>
+    </resultMap>
+
+    <select id="constructionLogPage" resultMap="contractLogResultMap">
+        select
+          id,
+          record_time,
+          record_number,
+          project_pileno,
+          project_part,
+          data_id,
+          create_user_name
+        from
+          u_contract_log
+        where
+        is_deleted = 0
+        and wbs_node_id = #{vo.wbsNodeId}
+        <if test="vo.queryValue != null and vo.queryValue != ''">
+            and
+            (
+            project_pileno like concat('%',#{vo.queryValue},'%')
+            or
+            project_part like concat('%',#{vo.queryValue},'%')
+            or
+            record_number like concat('%',#{vo.queryValue},'%')
+            )
+        </if>
+        <if test="vo.createUser != null and vo.createUser != ''">
+            and create_user = #{vo.createUser}
+        </if>
+        <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != ''">
+            and record_time between #{startTime} and #{endTime}
+        </if>
+        order by record_time DESC limit #{current}, #{size}
+    </select>
+
+    <select id="selectPageCount" resultType="java.lang.Integer">
+        select count(id) from u_contract_log
+        where
+          is_deleted = 0
+        and wbs_node_id = #{vo.wbsNodeId}
+        <if test="vo.queryValue != null and vo.queryValue != ''">
+          and
+            (
+                project_pileno like concat('%',#{vo.queryValue},'%')
+                  or
+                project_part like concat('%',#{vo.queryValue},'%')
+                  or
+                record_number like concat('%',#{vo.queryValue},'%')
+            )
+        </if>
+        <if test="vo.createUser != null and vo.createUser != ''">
+            and create_user = #{vo.createUser}
+        </if>
+        <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != ''">
+            and record_time between #{startTime} and #{endTime}
+        </if>
+    </select>
+
+    <select id="selectContractLogPage" resultMap="contractLogResultMap">
+        select * from u_contract_log where is_deleted = 0
+    </select>
+
+</mapper>

+ 34 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TreeContractFirstMapper.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.TreeContractFirst;
+import org.springblade.business.vo.TreeContractFirstVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 合同段划分树首件关联表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+public interface TreeContractFirstMapper extends BaseMapper<TreeContractFirst> {
+
+}

+ 20 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TreeContractFirstMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.TreeContractFirstMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="treeContractFirstResultMap" type="org.springblade.business.entity.TreeContractFirst">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="wbs_node_id" property="wbsNodeId"/>
+    </resultMap>
+
+</mapper>

+ 44 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IContractLogService.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.vo.ContractLogVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 日志通用表 服务类
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+public interface IContractLogService extends BaseService<ContractLog> {
+
+	/**
+	 * 施工日志分页
+	 * @param logVO 查询条件
+	 * @return 结果
+	 */
+	IPage<ContractLogVO> constructionLogPage(ContractLogVO logVO);
+
+	/**
+	 * 自定义分页
+	 */
+	IPage<ContractLogVO> selectContractLogPage(IPage<ContractLogVO> page, ContractLogVO contractLog);
+
+}

+ 32 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITreeContractFirstService.java

@@ -0,0 +1,32 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.TreeContractFirst;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * 合同段划分树首件关联表 服务类
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+public interface ITreeContractFirstService extends BaseService<TreeContractFirst> {
+
+}

+ 72 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java

@@ -0,0 +1,72 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.vo.ContractLogVO;
+import org.springblade.business.mapper.ContractLogMapper;
+import org.springblade.business.service.IContractLogService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 日志通用表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-06-15
+ */
+@Service
+public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, ContractLog> implements IContractLogService {
+
+	@Override
+	public IPage<ContractLogVO> constructionLogPage(ContractLogVO logVO) {
+		Integer current = (logVO.getCurrent() - 1) * logVO.getSize();
+
+		Query query = new Query();
+		query.setCurrent(logVO.getCurrent());
+		query.setSize(logVO.getSize());
+
+		//总数
+		Integer count = this.baseMapper.selectPageCount(logVO);
+		//分页信息
+		List<ContractLog> result = this.baseMapper.constructionLogPage(current, logVO.getSize(), logVO);
+		//没有数据
+		if(result == null || result.size() == 0){
+			return Condition.getPage(query);
+		}
+		//有数据,转换成VO
+		List<ContractLogVO> voResult = JSONArray.parseArray(JSONObject.toJSONString(result), ContractLogVO.class);
+
+		IPage<ContractLogVO> iPage = Condition.getPage(query);
+		iPage.setTotal(count);
+		return iPage.setRecords(voResult);
+	}
+
+	@Override
+	public IPage<ContractLogVO> selectContractLogPage(IPage<ContractLogVO> page, ContractLogVO contractLog) {
+		return page.setRecords(this.baseMapper.selectContractLogPage(page, contractLog));
+	}
+
+}

+ 36 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TreeContractFirstServiceImpl.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.springblade.business.entity.TreeContractFirst;
+import org.springblade.business.mapper.TreeContractFirstMapper;
+import org.springblade.business.service.ITreeContractFirstService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 合同段划分树首件关联表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-06-16
+ */
+@Service
+public class TreeContractFirstServiceImpl extends BaseServiceImpl<TreeContractFirstMapper, TreeContractFirst> implements ITreeContractFirstService {
+
+}

+ 50 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FormulaController.java

@@ -1,15 +1,28 @@
 package org.springblade.manager.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.dto.FormulaBean;
 import org.springblade.manager.entity.Formula;
-import org.springblade.manager.service.impl.FormulaService;
+import org.springblade.manager.service.impl.FormulaServiceImpl;
+import org.springblade.manager.wrapper.FormulaWrapper;
+import org.springblade.system.user.entity.User;
+import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+import java.util.Objects;
 
 /**
  * @author yangyj
@@ -21,14 +34,14 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/formula")
 @Api(value = "公式脚本", tags = "公式脚本")
 public class FormulaController {
-    private final FormulaService service;
+    private final FormulaServiceImpl service;
     /**
      * 新增或修改
      */
     @PostMapping("/save")
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "新增或修改", notes = "传入")
-    public R save(Formula f) {
+    public R save(@RequestBody Formula f) {
         return R.status(service.save(f));
     }
 
@@ -38,8 +51,15 @@ public class FormulaController {
     @PostMapping("/update")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "修改", notes = "传入脚本")
-    public R update( Formula f) {
-        return R.status(service.updateById(f));
+    public R update( @RequestBody FormulaBean f) {
+        if(f.getId()!=null){
+            Formula old = this.service.getById(f.getId());
+            if(old!=null){
+                BeanUtils.copyProperties(f,old);
+                return R.status(service.updateById(old));
+            }
+        }
+        return R.status(false);
     }
 
     /**
@@ -57,10 +77,33 @@ public class FormulaController {
     @ApiOperationSupport(order =7)
     @ApiOperation(value = "查看详情", notes = "传入id")
     @GetMapping("/detail")
-    public R<Formula> detail(Formula f) {
+    public R<FormulaBean> detail(Formula f) {
         Formula detail = service.getOne(Condition.getQueryWrapper(f));
-        return R.data(detail);
+        if(detail!=null){
+           return R.data(BeanUtil.copy(detail,FormulaBean.class));
+        }
+        return R.fail("无数据");
+    }
+
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "公式翻页查询", notes = "公式翻页查询")
+    @GetMapping("/page")
+    public IPage<FormulaBean> userSearch(@ApiIgnore FormulaBean param, @ApiIgnore Query query) {
+        LambdaQueryWrapper<Formula> queryWrapper = Wrappers.<Formula>query().lambda();
+        if(Func.isNotEmpty(param.getWbsId())){
+            queryWrapper.eq(Formula::getWbsId,param.getWbsId());
+        }
+        if(Func.isNotEmpty(param.getFormula())){
+            queryWrapper.like(Formula::getFormula,param.getFormula());
+        }
+        if(Func.isNotEmpty(param.getRemark())){
+            queryWrapper.like(Formula::getRemark,param.getRemark());
+        }
+        IPage<Formula> pages  = this.service.page(Condition.getPage(query),queryWrapper);
+         return FormulaWrapper.build().pageVO(pages);
     }
 
 
+
+
 }

+ 57 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -3,6 +3,7 @@ package org.springblade.manager.feign;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.mixsmart.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.WbsTreeContract;
@@ -10,8 +11,11 @@ import org.springblade.manager.service.IContractInfoService;
 import org.springblade.manager.service.IWbsTreeContractService;
 import org.springblade.manager.vo.WbsTreeContractTreeVO;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
+import org.springblade.system.entity.DictBiz;
+import org.springblade.system.feign.IDictBizClient;
 import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
+
+import java.util.*;
 
 @RestController
 @AllArgsConstructor
@@ -21,9 +25,11 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
 
     private final IWbsTreeContractService wbsTreeContractService;
 
+    private final IDictBizClient dictBizClient;
+
     @Override
     public Boolean updateContractNodeParameter(WbsTreeContract node) {
-        return this.wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getDeptName, node.getDeptName()).eq(WbsTreeContract::getPKeyId, node.getPKeyId()));
+        return this.wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getFullName, node.getDeptName()).set(WbsTreeContract::getPartitionCode, node.getPartitionCode()).eq(WbsTreeContract::getPKeyId, node.getPKeyId()));
     }
 
     @Override
@@ -55,4 +61,53 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
         vos.forEach(voData -> voData.setLeaf(new Integer("6").equals(voData.getDeptCategory())));
         return vos;
     }
+
+    @Override
+    public WbsTreeContract queryCurrentNodeAllParent(Long contractId, Long parentId) {
+        return this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId, contractId).eq(WbsTreeContract::getId, parentId).eq(WbsTreeContract::getIsDeleted, 0));
+    }
+
+    @Override
+    public List<WbsTreeContract> queryCurrentNodeAllChild(Long contractId, Long parentId) {
+        return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId, contractId).like(WbsTreeContract::getAncestors, parentId).eq(WbsTreeContract::getIsDeleted, 0));
+    }
+
+    @Override
+    public List<WbsTreeContractTreeVOS> queryCurrentContractLogList(String contractId) {
+        List<WbsTreeContract> result = this.wbsTreeContractService.queryCurrentContractLogList(contractId);
+        if(result != null && result.size() != 0){
+            List<WbsTreeContractTreeVOS> vosResult = new ArrayList<>();
+            result.forEach(node -> {
+                //转换
+                WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();
+                vos.setPrimaryKeyId(String.valueOf(node.getPKeyId()));
+                vos.setTitle(StringUtils.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getDeptName());
+                //最终返回集合
+                vosResult.add(vos);
+            });
+
+            List<WbsTreeContractTreeVOS> finalResult = new ArrayList<>();
+            //排序顺序
+            List<DictBiz> dictBizList = this.dictBizClient.getList("contract_log_sort", "notRoot").getData();
+            if(dictBizList == null || dictBizList.size() == 0){
+                return vosResult;
+            }
+            //存在排序,则根据排序规则对数据进行排序
+            dictBizList.sort(Comparator.comparingInt(DictBiz::getSort));
+            dictBizList.forEach(dictBiz -> {
+                Iterator<WbsTreeContractTreeVOS> iterator = vosResult.iterator();
+                while (iterator.hasNext()){
+                    WbsTreeContractTreeVOS next = iterator.next();
+                    if(next.getTitle().contains(dictBiz.getDictValue())){
+                        finalResult.add(next);
+                        iterator.remove();
+                        break;
+                    }
+                }
+            });
+
+            return finalResult;
+        }
+        return null;
+    }
 }

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/FormulaMapper.xml

@@ -16,6 +16,7 @@
         <result column="orderNum" property="order_num"/>
         <result column="remark" property="remark"/>
         <result column="wbsId" property="wbs_id"/>
+        <result column="elementId" property="element_id"/>
     </resultMap>
 
 </mapper>

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java

@@ -12,6 +12,8 @@ import java.util.List;
 
 public interface WbsTreeContractMapper extends BaseMapper<WbsTreeContract> {
 
+    List<WbsTreeContract> queryCurrentContractLogList(@Param("contractId") String contractId);
+
     List<WbsTreeContractVO> selectAll();
 
     Integer insertWbsTreeContract1(@Param("snowId") Long snowId,

+ 13 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -166,5 +166,18 @@
         AND id = #{parentId}
     </select>
 
+    <select id="queryCurrentContractLogList" resultMap="ResultMap">
+        select
+            p_key_id,
+            dept_name,
+            full_name
+        from
+          m_wbs_tree_contract
+        where
+          is_deleted = 0
+        and parent_id in(select id from m_wbs_tree_contract where is_deleted = 0 and contract_id = #{contractId} and parent_id = 0)
+        and major_data_type = 5
+        and contract_id = #{contractId}
+    </select>
 
 </mapper>

+ 11 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IFormulaService.java

@@ -0,0 +1,11 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.entity.Formula;
+
+/**
+ * @author yangyj
+ */
+public interface IFormulaService extends BaseService<Formula> {
+
+}

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeContractService.java

@@ -13,4 +13,6 @@ public interface IWbsTreeContractService extends BaseService<WbsTreeContract> {
     boolean submitWbsTreeInContract(WbsTreeContractDTO wbsTreeContractDTO);
 
     List<WbsTreeContract> findWbsTreeContract(String ids);
+
+    List<WbsTreeContract> queryCurrentContractLogList(String contractId);
 }

+ 0 - 16
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaService.java

@@ -1,16 +0,0 @@
-package org.springblade.manager.service.impl;
-
-
-import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.manager.entity.Formula;
-import org.springblade.manager.mapper.FormulaMapper;
-import org.springframework.stereotype.Service;
-
-/**
- * @author yangyj
- * @Date 2022/6/9 14:29
- * @description TODO
- */
-@Service
-public class FormulaService extends BaseServiceImpl<FormulaMapper, Formula> {
-}

+ 68 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -0,0 +1,68 @@
+package org.springblade.manager.service.impl;
+
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.manager.dto.FormData;
+import org.springblade.manager.entity.Formula;
+import org.springblade.manager.entity.WbsFormElement;
+import org.springblade.manager.mapper.FormulaMapper;
+import org.springblade.manager.service.IFormulaService;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+/**
+ * @author yangyj
+ * @Date 2022/6/9 14:29
+ * @description TODO
+ */
+@Service
+public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula> implements IFormulaService {
+    /**
+     * @Description
+     * @Param [variables, list:表单数据, formulas:同一个wbsId]
+     * @return void
+     * @Author yangyj
+     * @Date 2022.06.15 16:34
+     **/
+    public void execute(Map variables, List<FormData> list,List<Formula> formulas ){
+             Map<Boolean,List<FormData>> map = list.stream().collect(Collectors.partitioningBy(e->e!=null&&e.getFormula().getFormula().contains("E[")));
+             /*有依赖的*/
+             List<FormData> rely= map.get(true);
+             /*没有依赖的*/
+             List<FormData> simple=map.get(false);
+
+    }
+
+
+    public static final String ELE_CODE_REG= "(?<=E\\[)[^]]+(?=\\])";
+
+    /**
+     * 依赖排序
+     */
+    public   void sort( List<FormData> list,List<FormData> data,List<FormData> queue,FormData current){
+        if(current!=null){
+            Pattern p = Pattern.compile(ELE_CODE_REG);
+            Matcher m =p.matcher(current.getFormula().getFormula());
+            List<String> cp =  new ArrayList<>();
+            while (m.find()){
+                cp.add(m.group());
+            }
+           Map<Boolean,List<FormData>>  map= list.stream().collect(Collectors.partitioningBy(e->cp.contains(e.getEKey())));
+            List<FormData> match =map.get(true);
+            if(CollectionUtil.isNotEmpty(match)){
+                data.addAll(match);
+            }
+            List<FormData> remain =map.get(false);
+            if(CollectionUtil.isNotEmpty(remain)){
+                list.clear();
+                list.addAll(remain);
+            }
+        }
+    }
+
+}

+ 4 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -137,5 +137,8 @@ public class WbsTreeContractServiceImpl
         return list;
     }
 
-
+    @Override
+    public List<WbsTreeContract> queryCurrentContractLogList(String contractId) {
+        return this.baseMapper.queryCurrentContractLogList(contractId);
+    }
 }

+ 24 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/FormulaWrapper.java

@@ -0,0 +1,24 @@
+package org.springblade.manager.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.manager.dto.FormulaBean;
+import org.springblade.manager.entity.Formula;
+import org.springblade.system.user.vo.UserVO;
+
+import java.util.Objects;
+
+/**
+ * @author yangyj
+ * @Date 2022/6/14 17:33
+ * @description TODO
+ */
+public class FormulaWrapper extends BaseEntityWrapper<Formula,FormulaBean> {
+    public static FormulaWrapper build() {
+        return new FormulaWrapper();
+    }
+    @Override
+    public FormulaBean entityVO(Formula entity) {
+        return  Objects.requireNonNull(BeanUtil.copy(entity, FormulaBean.class));
+    }
+}