liuyc 2 жил өмнө
parent
commit
487866962c

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

@@ -1353,6 +1353,9 @@ public class InformationWriteQueryController extends BladeController {
 
 
     /**
     /**
      * 复制节点
      * 复制节点
+     *
+     * @author liuyc
+     * @date 2023年4月10日18:06:53
      */
      */
     @PostMapping("/copyContractTreeNode")
     @PostMapping("/copyContractTreeNode")
     @ApiOperationSupport(order = 15)
     @ApiOperationSupport(order = 15)
@@ -1556,9 +1559,6 @@ public class InformationWriteQueryController extends BladeController {
 
 
         } else if (("2").equals(vo.getCopyType())) {
         } else if (("2").equals(vo.getCopyType())) {
             /** TODO 多份复制
             /** TODO 多份复制
-             * @Author liuYC
-             * @Date 2023年4月10日18:06:53
-             * @Description
              *  解析复制节点位置信息:
              *  解析复制节点位置信息:
              *  1:同节点复制(同一个父级下)
              *  1:同节点复制(同一个父级下)
              *      1.1 如果点击选择的是当前复制节点的父级,那么就新增一个当前需要复制的节点-新的子级-新的表-新的表数据(根据所属方查询对应数据)。
              *      1.1 如果点击选择的是当前复制节点的父级,那么就新增一个当前需要复制的节点-新的子级-新的表-新的表数据(根据所属方查询对应数据)。

+ 31 - 18
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ContractInfoController.java

@@ -718,40 +718,53 @@ public class ContractInfoController extends BladeController {
      * 资料填报(资料查询)节点搜索输入框查询接口
      * 资料填报(资料查询)节点搜索输入框查询接口
      *
      *
      * @author liuyc
      * @author liuyc
-     * @since 2023年6月15日11:44:36
+     * @date 2023年6月15日11:44:36
      */
      */
     @GetMapping("/getTreeNodeByQueryValueAndContractId")
     @GetMapping("/getTreeNodeByQueryValueAndContractId")
     @ApiOperationSupport(order = 23)
     @ApiOperationSupport(order = 23)
     @ApiOperation(value = "资料填报(资料查询)节点搜索输入框查询接口", notes = "传入合同段id、输入框搜索的queryValue、表单所属方tableOwner")
     @ApiOperation(value = "资料填报(资料查询)节点搜索输入框查询接口", notes = "传入合同段id、输入框搜索的queryValue、表单所属方tableOwner")
-    public R getTreeNodeByValueAndContractId(@RequestParam String queryValue, @RequestParam String contractId, @RequestParam String tableOwner) {
-        R list = contractInfoService.getTreeNodeByValueAndContractId(queryValue, contractId, tableOwner);
-        if (ObjectUtil.isNotEmpty(list) && ObjectUtil.isNotEmpty(list.getData())) {
-            Object data = list.getData();
+    public R<Object> getTreeNodeByValueAndContractId(@RequestParam String queryValue, @RequestParam String contractId, @RequestParam String tableOwner) {
+        R<Object> result = contractInfoService.getTreeNodeByValueAndContractId(queryValue, contractId, tableOwner);
+        if (ObjectUtil.isNotEmpty(result) && ObjectUtil.isNotEmpty(result.getData())) {
+            Object data = result.getData();
             ContractInfo contractInfo = contractInfoService.getBaseMapper().selectById(contractId);
             ContractInfo contractInfo = contractInfoService.getBaseMapper().selectById(contractId);
             if (data instanceof List) {
             if (data instanceof List) {
+                List<?> dataList = (List<?>) data;
                 if (contractInfo.getContractType().equals(1)) {
                 if (contractInfo.getContractType().equals(1)) {
-                    List<WbsTreeContractTreeAllVO> dataList = (List<WbsTreeContractTreeAllVO>) data;
-                    for (WbsTreeContractTreeAllVO wbsTreeContractVO : dataList) {
-                        if (ObjectUtil.isNotEmpty(wbsTreeContractVO.getParentId()) && 0L == wbsTreeContractVO.getParentId()) {
-                            wbsTreeContractVO.setTitle(contractInfo.getContractName());
-                            break;
+                    for (Object item : dataList) {
+                        if (item instanceof WbsTreeContractTreeAllVO) {
+                            WbsTreeContractTreeAllVO wbsTreeContractVO = (WbsTreeContractTreeAllVO) item;
+                            if (ObjectUtil.isNotEmpty(wbsTreeContractVO.getParentId()) && 0L == wbsTreeContractVO.getParentId()) {
+                                wbsTreeContractVO.setTitle(contractInfo.getContractName());
+                                break;
+                            }
                         }
                         }
                     }
                     }
                     return R.data(data);
                     return R.data(data);
                 }
                 }
             } else if (data instanceof Map) {
             } else if (data instanceof Map) {
+                Map<?, ?> dataMap = (Map<?, ?>) data;
                 if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
                 if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
                     List<WbsTreeContractTreeAllVO> jlYzList = new LinkedList<>();
                     List<WbsTreeContractTreeAllVO> jlYzList = new LinkedList<>();
-                    Map<Long, List<WbsTreeContractTreeAllVO>> dataMap = (Map<Long, List<WbsTreeContractTreeAllVO>>) data;
-                    for (Map.Entry<Long, List<WbsTreeContractTreeAllVO>> map : dataMap.entrySet()) {
-                        ContractInfo contractInfoJlYz = contractInfoService.getBaseMapper().selectById(map.getKey());
-                        for (WbsTreeContractTreeAllVO wbsTreeContractVO : map.getValue()) {
-                            if (ObjectUtil.isNotEmpty(wbsTreeContractVO.getParentId()) && 0L == wbsTreeContractVO.getParentId()) {
-                                wbsTreeContractVO.setTitle(contractInfoJlYz.getContractName());
-                                break;
+                    for (Map.Entry<?, ?> entry : dataMap.entrySet()) {
+                        Object key = entry.getKey();
+                        Object value = entry.getValue();
+                        if (key instanceof Long && value instanceof List) {
+                            Long mapKey = (Long) key;
+                            List<?> mapValue = (List<?>) value;
+                            ContractInfo contractInfoJlYz = contractInfoService.getBaseMapper().selectById(mapKey);
+                            List<? extends WbsTreeContractTreeAllVO> typedList = mapValue.stream()
+                                    .filter(item -> item instanceof WbsTreeContractTreeAllVO)
+                                    .map(item -> (WbsTreeContractTreeAllVO) item)
+                                    .collect(Collectors.toList());
+                            for (WbsTreeContractTreeAllVO wbsTreeContractVO : typedList) {
+                                if (ObjectUtil.isNotEmpty(wbsTreeContractVO.getParentId()) && 0L == wbsTreeContractVO.getParentId()) {
+                                    wbsTreeContractVO.setTitle(contractInfoJlYz.getContractName());
+                                    break;
+                                }
                             }
                             }
+                            jlYzList.addAll(typedList);
                         }
                         }
-                        jlYzList.addAll(map.getValue());
                     }
                     }
                     return R.data(jlYzList);
                     return R.data(jlYzList);
                 }
                 }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java

@@ -202,7 +202,7 @@ public class WbsTreeContractController extends BladeController {
      * 获取合同段详情id
      * 获取合同段详情id
      */
      */
     @PostMapping("/getWbsContractById")
     @PostMapping("/getWbsContractById")
-    @ApiOperationSupport(order = 10)
+    @ApiOperationSupport(order = 11)
     @ApiOperation(value = "获取合同段详情", notes = "传入节点pKeyId")
     @ApiOperation(value = "获取合同段详情", notes = "传入节点pKeyId")
     @ApiImplicitParams(value = {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pKeyId", value = "节点pKeyId", required = true)
             @ApiImplicitParam(name = "pKeyId", value = "节点pKeyId", required = true)

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

@@ -79,7 +79,7 @@ public interface IContractInfoService extends BaseService<ContractInfo> {
 
 
     List<ContractInfo> getContractListByProjectId(Long projectId);
     List<ContractInfo> getContractListByProjectId(Long projectId);
 
 
-    R getTreeNodeByValueAndContractId(String queryValue, String contractId, String tableOwner);
+    R<Object> getTreeNodeByValueAndContractId(String queryValue, String contractId, String tableOwner);
 
 
     void updateIsArchivesAutoById(Long id, Integer isArchivesAuto);
     void updateIsArchivesAutoById(Long id, Integer isArchivesAuto);
 
 

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -316,14 +316,14 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     }
     }
 
 
     @Override
     @Override
-    public R getTreeNodeByValueAndContractId(String queryValue, String contractId, String tableOwner) {
+    public R<Object> getTreeNodeByValueAndContractId(String queryValue, String contractId, String tableOwner) {
         Map<Long, List<WbsTreeContractTreeAllVO>> resultMaps = new LinkedHashMap<>();
         Map<Long, List<WbsTreeContractTreeAllVO>> resultMaps = new LinkedHashMap<>();
         if (StringUtils.isNotEmpty(queryValue) && StringUtils.isNotEmpty(contractId)) {
         if (StringUtils.isNotEmpty(queryValue) && StringUtils.isNotEmpty(contractId)) {
             ContractInfo contractInfo = contractInfoMapper.selectById(contractId);
             ContractInfo contractInfo = contractInfoMapper.selectById(contractId);
             if (contractInfo != null) {
             if (contractInfo != null) {
                 //TODO 质检
                 //TODO 质检
                 if (contractInfo.getContractType().equals(1)) {
                 if (contractInfo.getContractType().equals(1)) {
-                    //获取查询有效节点信息,以及所有上级父级节点
+                    //获取查询有效节点信息
                     LambdaQueryWrapper<WbsTreeContract> queryWrapper = new LambdaQueryWrapper<>();
                     LambdaQueryWrapper<WbsTreeContract> queryWrapper = new LambdaQueryWrapper<>();
                     queryWrapper.select(WbsTreeContract::getParentId, WbsTreeContract::getId, WbsTreeContract::getPKeyId);
                     queryWrapper.select(WbsTreeContract::getParentId, WbsTreeContract::getId, WbsTreeContract::getPKeyId);
                     queryWrapper.like(WbsTreeContract::getFullName, queryValue);
                     queryWrapper.like(WbsTreeContract::getFullName, queryValue);