Преглед на файлове

元素公式、元素识别相关

liuyc преди 2 години
родител
ревизия
5e0270fb83
променени са 12 файла, в които са добавени 331 реда и са изтрити 140 реда
  1. 27 26
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ExctabCell.java
  2. 47 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ExctabCellVO2.java
  3. 22 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsNodeTabAndParamVO.java
  4. 7 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsNodeTableVO.java
  5. 91 87
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExctabCellController.java
  6. 41 26
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  7. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.java
  8. 23 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  9. 3 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreePrivateService.java
  10. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsParamServiceImpl.java
  11. 15 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java
  12. 52 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/unit/CopyUtil.java

+ 27 - 26
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ExctabCell.java

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
+
 import java.io.Serializable;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -41,34 +42,34 @@ import lombok.EqualsAndHashCode;
 @ApiModel(value = "ExctabCell对象", description = "ExctabCell对象")
 public class ExctabCell implements Serializable {
 
-	private static final long serialVersionUID = 1L;
-	/**
-	 * 主键
-	 */
-	@JsonSerialize(using = ToStringSerializer.class)
-	@ApiModelProperty(value = "主键")
-	@TableId(value = "id", type = IdType.ASSIGN_ID)
-	private Long id;
+    private static final long serialVersionUID = 1L;
+    /**
+     * 主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
 
-	/**
-	* 清表Id
-	*/
-		private Long exctabId;
+    /**
+     * 清表Id
+     */
+    private Long exctabId;
 
-	/**
-	* 文本信息
-	*/
-		private String textInfo;
+    /**
+     * 文本信息
+     */
+    private String textInfo;
 
-	/**
-	 * 坐标值
-	 */
-	private String xys;
+    /**
+     * 坐标值
+     */
+    private String xys;
 
-	/**
-	 * 是否已删除
-	 */
-	@TableLogic
-	@ApiModelProperty(value = "是否已删除")
-	private Integer isDeleted;
+    /**
+     * 是否已删除
+     */
+    @TableLogic
+    @ApiModelProperty(value = "是否已删除")
+    private Integer isDeleted;
 }

+ 47 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ExctabCellVO2.java

@@ -0,0 +1,47 @@
+package org.springblade.manager.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.ExctabCell;
+
+import java.io.Serializable;
+
+@Data
+public class ExctabCellVO2 implements Serializable {
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 主键
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.ASSIGN_ID)
+	private Long id;
+
+	/**
+	 * 清表Id
+	 */
+	private String exctabId;
+
+	/**
+	 * 文本信息
+	 */
+	private String textInfo;
+
+	/**
+	 * 坐标值
+	 */
+	private String xys;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+}

+ 22 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsNodeTabAndParamVO.java

@@ -0,0 +1,22 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+import org.springblade.manager.entity.WbsParam;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class WbsNodeTabAndParamVO implements Serializable {
+
+    /**
+     * 节点元素表
+     */
+    List<WbsNodeTableVO> tabData;
+
+    /**
+     * 节点参数
+     */
+    List<WbsParam> paramData;
+
+}

+ 7 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsNodeTableVO.java

@@ -2,8 +2,10 @@ package org.springblade.manager.vo;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springblade.manager.entity.WbsParam;
 
 import java.io.Serializable;
+import java.util.List;
 
 @Data
 public class WbsNodeTableVO implements Serializable {
@@ -72,4 +74,9 @@ public class WbsNodeTableVO implements Serializable {
      */
     private Integer status;
 
+    /**
+     * 父级id
+     */
+    private String parentId;
+
 }

+ 91 - 87
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExctabCellController.java

@@ -21,12 +21,15 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
+
 import javax.validation.Valid;
 
 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.Func;
+import org.springblade.manager.unit.CopyUtil;
+import org.springblade.manager.vo.ExctabCellVO2;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -49,92 +52,93 @@ import java.util.List;
 @Api(value = "Excel 结构信息表", tags = "Excel 结构信息表接口")
 public class ExctabCellController extends BladeController {
 
-	private final IExctabCellService exctabCellService;
-
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入exctabCell")
-	public R<ExctabCell> detail(ExctabCell exctabCell) {
-		ExctabCell detail = exctabCellService.getOne(Condition.getQueryWrapper(exctabCell));
-		return R.data(detail);
-	}
-
-	/**
-	 * 分页 Excel 结构信息表
-	 */
-	@GetMapping("/list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入exctabCell")
-	public R<IPage<ExctabCell>> list(ExctabCell exctabCell, Query query) {
-		IPage<ExctabCell> pages = exctabCellService.page(Condition.getPage(query), Condition.getQueryWrapper(exctabCell));
-		return R.data(pages);
-	}
-
-	/**
-	 * 自定义分页 Excel 结构信息表
-	 */
-	@GetMapping("/page")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入exctabCell")
-	public R<IPage<ExctabCellVO>> page(ExctabCellVO exctabCell, Query query) {
-		IPage<ExctabCellVO> pages = exctabCellService.selectExctabCellPage(Condition.getPage(query), exctabCell);
-		return R.data(pages);
-	}
-
-	/**
-	 * 新增 Excel 结构信息表
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入exctabCell")
-	public R save(@Valid @RequestBody List<ExctabCell> exctabCellList) {
-		return R.status(exctabCellService.saveBatch(exctabCellList));
-	}
-
-
-	/**
-	 * 修改 Excel 结构信息表
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入exctabCell")
-	public R update(@Valid @RequestBody ExctabCell exctabCell) {
-		return R.status(exctabCellService.updateById(exctabCell));
-	}
-
-	/**
-	 * 新增或修改 Excel 结构信息表
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入exctabCell")
-	public R submit(@Valid @RequestBody ExctabCell exctabCell) {
-		return R.status(exctabCellService.saveOrUpdate(exctabCell));
-	}
-
-	
-	/**
-	 * 删除 Excel 结构信息表
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(exctabCellService.removeByIds(Func.toLongList(ids)));
-	}
-
-
-	/**
-	 *  获取excel 元素信息
-	 */
-	@GetMapping("/getColByTabId")
-	@ApiOperationSupport(order = 8)
-	@ApiOperation(value = "获取excel字段信息", notes = "tabId")
-	public R getColByTabId(@ApiParam(value = "主键集合", required = true) @RequestParam String tabId) {
-		return R.data(exctabCellService.getColSelect(tabId));
-	}
+    private final IExctabCellService exctabCellService;
+
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入exctabCell")
+    public R<ExctabCell> detail(ExctabCell exctabCell) {
+        ExctabCell detail = exctabCellService.getOne(Condition.getQueryWrapper(exctabCell));
+        return R.data(detail);
+    }
+
+    /**
+     * 分页 Excel 结构信息表
+     */
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "分页", notes = "传入exctabCell")
+    public R<IPage<ExctabCell>> list(ExctabCell exctabCell, Query query) {
+        IPage<ExctabCell> pages = exctabCellService.page(Condition.getPage(query), Condition.getQueryWrapper(exctabCell));
+        return R.data(pages);
+    }
+
+    /**
+     * 自定义分页 Excel 结构信息表
+     */
+    @GetMapping("/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页", notes = "传入exctabCell")
+    public R<IPage<ExctabCellVO>> page(ExctabCellVO exctabCell, Query query) {
+        IPage<ExctabCellVO> pages = exctabCellService.selectExctabCellPage(Condition.getPage(query), exctabCell);
+        return R.data(pages);
+    }
+
+    /**
+     * 新增 Excel 结构信息表
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "传入exctabCell")
+    public R save(@Valid @RequestBody List<ExctabCellVO2> exctabCellList) {
+        List<ExctabCell> exctabCells = CopyUtil.convert(exctabCellList, ExctabCell.class);
+        return R.status(exctabCellService.saveBatch(exctabCells));
+    }
+
+
+    /**
+     * 修改 Excel 结构信息表
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "传入exctabCell")
+    public R update(@Valid @RequestBody ExctabCell exctabCell) {
+        return R.status(exctabCellService.updateById(exctabCell));
+    }
+
+    /**
+     * 新增或修改 Excel 结构信息表
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "传入exctabCell")
+    public R submit(@Valid @RequestBody ExctabCell exctabCell) {
+        return R.status(exctabCellService.saveOrUpdate(exctabCell));
+    }
+
+
+    /**
+     * 删除 Excel 结构信息表
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(exctabCellService.removeByIds(Func.toLongList(ids)));
+    }
+
+
+    /**
+     * 获取excel 元素信息
+     */
+    @GetMapping("/getColByTabId")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "获取excel字段信息", notes = "tabId")
+    public R getColByTabId(@ApiParam(value = "主键集合", required = true) @RequestParam String tabId) {
+        return R.data(exctabCellService.getColSelect(tabId));
+    }
 
 }

+ 41 - 26
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -26,6 +26,7 @@ import org.springblade.manager.mapper.WbsTreePrivateMapper;
 import org.springblade.manager.service.IProjectInfoService;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.service.IWbsTreeService;
+import org.springblade.manager.vo.WbsNodeTabAndParamVO;
 import org.springblade.manager.vo.WbsNodeTableVO;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 import org.springblade.manager.wrapper.WbsTreePrivateWrapper;
@@ -56,8 +57,8 @@ public class WbsTreePrivateController extends BladeController {
     @PostMapping("/saveContractLogNode")
     @ApiOperationSupport(order = 12)
     @ApiOperation(value = "保存项目日志划分")
-    public R<Boolean> saveContractLogNode(@RequestBody SaveLogContractVO vo){
-        if(StringUtils.isNotEmpty(vo.getWbsTreeIds())){
+    public R<Boolean> saveContractLogNode(@RequestBody SaveLogContractVO vo) {
+        if (StringUtils.isNotEmpty(vo.getWbsTreeIds())) {
             Date now = new Date();
 
             //获取当前项目已经划分的日志树
@@ -69,14 +70,14 @@ public class WbsTreePrivateController extends BladeController {
             //模板节点
             List<String> wbsTreeIds = new ArrayList<>(Arrays.asList(vo.getWbsTreeIds().split(",")));
 
-            if(oldDataList != null && oldDataList.size() > 0){
+            if (oldDataList != null && oldDataList.size() > 0) {
                 //只新增节点
                 //检查哪些节点是重复的,删除
                 Iterator<String> iterator = wbsTreeIds.iterator();
-                while (iterator.hasNext()){
+                while (iterator.hasNext()) {
                     String id = iterator.next();
-                    for(WbsTreePrivate oldPrivate : oldDataList){
-                        if(oldPrivate.getId().toString().equals(id)){
+                    for (WbsTreePrivate oldPrivate : oldDataList) {
+                        if (oldPrivate.getId().toString().equals(id)) {
                             iterator.remove();
                             break;
                         }
@@ -88,8 +89,8 @@ public class WbsTreePrivateController extends BladeController {
             List<WbsTreePrivate> updateList = new ArrayList<>();
 
             //检查一下原本节点的表是否有新增的(只处理新增)
-            if(oldDataList != null && oldDataList.size() > 0){
-                for(WbsTreePrivate treePrivate : oldDataList){
+            if (oldDataList != null && oldDataList.size() > 0) {
+                for (WbsTreePrivate treePrivate : oldDataList) {
                     //获取当前节点下绑定的表格元素
                     List<WbsTreePrivate> treePrivateTableList = this.wbsTreePrivateService.list(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, treePrivate.getProjectId()).eq(WbsTreePrivate::getParentId, treePrivate.getId()).eq(WbsTreePrivate::getType, 2));
 
@@ -97,20 +98,20 @@ public class WbsTreePrivateController extends BladeController {
                     List<WbsTree> wbsTreeTableList = this.wbsTreeService.list(Wrappers.<WbsTree>lambdaQuery().eq(WbsTree::getParentId, treePrivate.getId()).eq(WbsTree::getType, 2));
 
                     //校验数量
-                    if(wbsTreeTableList != null && wbsTreeTableList.size() > 0){
-                        if(treePrivateTableList != null){
+                    if (wbsTreeTableList != null && wbsTreeTableList.size() > 0) {
+                        if (treePrivateTableList != null) {
                             //小于,说明模板节点存在新增,检查哪些是新增的
                             Iterator<WbsTree> iterator = wbsTreeTableList.iterator();
-                            while (iterator.hasNext()){
+                            while (iterator.hasNext()) {
                                 WbsTree tree = iterator.next();
 
-                                for(WbsTreePrivate privateNode : treePrivateTableList){
-                                    if(privateNode.getId().equals(tree.getId())){
-                                        if(
+                                for (WbsTreePrivate privateNode : treePrivateTableList) {
+                                    if (privateNode.getId().equals(tree.getId())) {
+                                        if (
                                                 (StringUtils.isNotEmpty(privateNode.getFullName(), tree.getFullName()) && !privateNode.getFullName().equals(tree.getFullName()))
-                                                ||
-                                                (StringUtils.isNotEmpty(privateNode.getNodeName(), tree.getNodeName()) && !privateNode.getNodeName().equals(tree.getNodeName()))
-                                        ){
+                                                        ||
+                                                        (StringUtils.isNotEmpty(privateNode.getNodeName(), tree.getNodeName()) && !privateNode.getNodeName().equals(tree.getNodeName()))
+                                        ) {
                                             //名字不同,需要修改
                                             privateNode.setFullName(tree.getFullName());
                                             privateNode.setNodeName(tree.getNodeName());
@@ -124,8 +125,8 @@ public class WbsTreePrivateController extends BladeController {
                                 }
                             }
                             //多出来的,新增
-                            if(wbsTreeTableList.size() > 0){
-                                for(WbsTree wbsTree : wbsTreeTableList){
+                            if (wbsTreeTableList.size() > 0) {
+                                for (WbsTree wbsTree : wbsTreeTableList) {
                                     WbsTreePrivate newTreePrivate = new WbsTreePrivate();
                                     BeanUtils.copyProperties(wbsTree, newTreePrivate);
                                     newTreePrivate.setWbsType("4");
@@ -141,17 +142,17 @@ public class WbsTreePrivateController extends BladeController {
                 }
             }
 
-            if(wbsTreeIds.size() > 0){
+            if (wbsTreeIds.size() > 0) {
                 //获取模板节点
                 List<WbsTree> wbsTreeList = this.wbsTreeService.list(Wrappers.<WbsTree>lambdaQuery().in(WbsTree::getId, wbsTreeIds));
                 //获取这些模板下的表格元素
                 List<WbsTree> wbsTreeTableList = this.wbsTreeService.list(Wrappers.<WbsTree>lambdaQuery().in(WbsTree::getParentId, wbsTreeIds).eq(WbsTree::getType, 2));
-                if(wbsTreeTableList != null && wbsTreeTableList.size() > 0){
+                if (wbsTreeTableList != null && wbsTreeTableList.size() > 0) {
                     wbsTreeList.addAll(wbsTreeTableList);
                 }
 
                 //复制数据
-                for(WbsTree tree : wbsTreeList){
+                for (WbsTree tree : wbsTreeList) {
                     WbsTreePrivate treePrivate = new WbsTreePrivate();
                     BeanUtils.copyProperties(tree, treePrivate);
                     treePrivate.setWbsType("4");
@@ -163,15 +164,15 @@ public class WbsTreePrivateController extends BladeController {
                 }
             }
 
-            if(saveTreePrivateList.size() > 0){
+            if (saveTreePrivateList.size() > 0) {
                 //修改项目引用
                 this.projectInfoService.update(Wrappers.<ProjectInfo>lambdaUpdate().set(ProjectInfo::getReferenceLogWbsTemplateId, vo.getWbsId()).eq(ProjectInfo::getId, vo.getProjectId()));
 
                 //保存数据
                 this.wbsTreePrivateService.saveBatch(saveTreePrivateList);
             }
-            if(updateList.size() > 0){
-                for(WbsTreePrivate treePrivate : updateList){
+            if (updateList.size() > 0) {
+                for (WbsTreePrivate treePrivate : updateList) {
                     this.wbsTreePrivateService.update(Wrappers.<WbsTreePrivate>lambdaUpdate().set(WbsTreePrivate::getNodeName, treePrivate.getNodeName()).set(WbsTreePrivate::getFullName, treePrivate.getFullName()).eq(WbsTreePrivate::getPKeyId, treePrivate.getPKeyId()));
                 }
             }
@@ -217,7 +218,8 @@ public class WbsTreePrivateController extends BladeController {
 
     /**
      * wbs私有库新增节点接口 同步合同段wbs库
-     * @Description  根据业务需求-暂时只修改,不新增
+     *
+     * @Description 根据业务需求-暂时只修改,不新增
      */
     @PostMapping("/submit")
     @ApiOperationSupport(order = 2)
@@ -363,5 +365,18 @@ public class WbsTreePrivateController extends BladeController {
         return R.status(wbsTreePrivateService.updateStatus(pKeyId));
     }
 
+    /**
+     * 查询节点元素表与节点参数
+     */
+    @ApiOperationSupport(order = 12)
+    @ApiOperation(value = "查询节点元素表与节点参数", notes = "传入节点oldId、节点oldId")
+    @RequestMapping(value = "/getNodeTabAndParam", method = RequestMethod.GET)
+    public R<WbsNodeTabAndParamVO> getNodeTabAndParam(@RequestParam("parentId") String parentId,
+                                                      @RequestParam("wbsId") String wbsId,
+                                                      @RequestParam("projectId") String projectId) {
+        WbsNodeTabAndParamVO rs = wbsTreePrivateService.getNodeTabAndParam(parentId, wbsId, projectId);
+        return R.data(rs);
+    }
+
 
 }

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

@@ -74,4 +74,6 @@ public interface WbsTreePrivateMapper extends EasyBaseMapper<WbsTreePrivate> {
 
     void updateBatchWbsPrivate(@Param("listPrivate")List<WbsTreePrivate> listPrivate);
 
+    List<WbsNodeTableVO> selectNodeTabAndParamList(String id, String wbsId, String projectId);
+
 }

+ 23 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -479,4 +479,27 @@
         AND project_id = #{projectId}
     </select>
 
+    <select id="selectNodeTabAndParamList" resultType="org.springblade.manager.vo.WbsNodeTableVO">
+        SELECT wt.p_key_id                                                  AS "pKeyId",
+               wt.id                                                        AS id,
+               wt.node_name                                                 AS tableName,
+               wt.table_type                                                AS tableType,
+               wt.`status`                                                  AS isCreateTable,
+               wt.table_owner                                               as tableOwner,
+               wt.is_link_table,
+               wt.init_table_name,
+               wt.excel_id                                                  as excelId,
+               wt.sort,
+               wt.status,
+               wt.parent_id AS parentId,
+               (SELECT count(1) FROM m_wbs_form_element WHERE f_id = wt.id) AS "elementTotal"
+        FROM m_wbs_tree_private AS wt
+        WHERE wt.type = 2
+          AND wt.is_deleted = 0
+          AND wt.parent_id = #{id}
+          AND wt.wbs_id = #{wbsId}
+          AND wt.project_id = #{projectId}
+        ORDER BY wt.sort, wt.node_name, wt.create_time
+    </select>
+
 </mapper>

+ 3 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreePrivateService.java

@@ -5,6 +5,7 @@ import org.springblade.manager.dto.WbsTreePrivateDTO2;
 import org.springblade.manager.dto.WbsTreePrivateDTO3;
 import org.springblade.manager.entity.WbsTree;
 import org.springblade.manager.entity.WbsTreePrivate;
+import org.springblade.manager.vo.WbsNodeTabAndParamVO;
 import org.springblade.manager.vo.WbsNodeTableVO;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 
@@ -40,4 +41,6 @@ public interface IWbsTreePrivateService extends BaseService<WbsTreePrivate> {
 
     boolean updateBatchByIds2(List<WbsTreePrivate> wbsTreePrivates, List<WbsTreePrivate> wbsTreePrivatesAllNow, String projectId, String wbsId);
 
+    WbsNodeTabAndParamVO getNodeTabAndParam(String id, String wbsId, String projectId);
+
 }

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

@@ -56,7 +56,7 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
 
     @Override
     public List<WbsParam> findByNodeId(Long nodeId) {
-        if(Func.isNotEmpty(nodeId)){
+        if(nodeId != null){
            return this.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getWbsId,nodeId));
         }
         return Collections.emptyList();

+ 15 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -18,6 +18,7 @@ import org.springblade.manager.entity.*;
 
 import org.springblade.manager.mapper.*;
 import org.springblade.manager.service.IWbsTreePrivateService;
+import org.springblade.manager.vo.WbsNodeTabAndParamVO;
 import org.springblade.manager.vo.WbsNodeTableVO;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 import org.springframework.stereotype.Service;
@@ -28,6 +29,7 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.Optional;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 @Service
 @AllArgsConstructor
@@ -36,6 +38,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
     private final WbsTreeContractMapper wbsTreeContractMapper;
     private final ContractInfoMapper contractInfoMapper;
     private final WbsInfoMapper wbsInfoMapper;
+    private final WbsParamServiceImpl wbsParamServiceImpl;
 
     @Override
     public List<WbsTreePrivateVO> tree(String wbsId, String projectId) {
@@ -392,4 +395,16 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         return true;
     }
 
+    @Override
+    public WbsNodeTabAndParamVO getNodeTabAndParam(String id, String wbsId, String projectId) {
+        WbsNodeTabAndParamVO resultList = new WbsNodeTabAndParamVO();
+        //获取该节点下所有表单
+        List<WbsNodeTableVO> list = baseMapper.selectNodeTabAndParamList(id, wbsId, projectId);
+        //获取节点参数 id=表单parentId=节点id; id重复,后期可能会出问题,此处建议使用pKeyId与参数的wbsId做绑定;
+        List<WbsParam> paramList = wbsParamServiceImpl.findByNodeId(Long.valueOf(id));
+        resultList.setTabData(list);
+        resultList.setParamData(paramList);
+        return resultList;
+    }
+
 }

+ 52 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/unit/CopyUtil.java

@@ -0,0 +1,52 @@
+package org.springblade.manager.unit;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import java.util.List;
+
+/**
+ * 已json方式转换集合数据
+ */
+public class CopyUtil {
+
+
+    /**
+     * 转换list集合
+     *
+     * @param o   原数据
+     * @param clz 转换类型
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> convert(Object o, Class<T> clz) {
+        return o == null ? null : toJson(o, clz);
+    }
+
+    /**
+     * 转换 Page 分页集合
+     *
+     * @param o   原数据
+     * @param clz 转换类型
+     * @param <T>
+     * @return
+     */
+    public static <S, T> Page<T> convert(Page<S> o, Class<T> clz) {
+        Page<T> t = new Page<>(o.getCurrent(), o.getSize(), o.getTotal());
+        return t.setRecords(toJson(o.getRecords(), clz));
+    }
+
+    /**
+     * 返回转换后的数据
+     *
+     * @param o   原数据
+     * @param clz 转换类型
+     * @param <T>
+     * @return
+     */
+    private static <T> List<T> toJson(Object o, Class<T> clz) {
+        return JSON.parseArray(JSON.toJSONString(o), clz);
+    }
+
+
+}