Explorar o código

Merge remote-tracking branch 'origin/master' into master

yangyj hai 1 ano
pai
achega
14cf1f237a
Modificáronse 13 ficheiros con 281 adicións e 144 borrados
  1. 43 0
      blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/ClearingAgreementInfo.java
  2. 19 0
      blade-service/blade-land/src/main/java/org/springblade/land/controller/ClearingAgreementInfoController.java
  3. 23 15
      blade-service/blade-land/src/main/java/org/springblade/land/controller/CompensationInfoController.java
  4. 34 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/ClearingAgreementInfoMapper.java
  5. 5 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/ClearingAgreementInfoMapper.xml
  6. 2 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.java
  7. 8 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.xml
  8. 35 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/IClearingAgreementInfoService.java
  9. 2 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/ICompensationInfoService.java
  10. 24 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/ClearingAgreementInfoServiceImpl.java
  11. 11 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/CompensationInfoServiceImpl.java
  12. 71 125
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java
  13. 4 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

+ 43 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/ClearingAgreementInfo.java

@@ -0,0 +1,43 @@
+package org.springblade.land.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+
+/**
+ * @Param
+ * @Author wangwl
+ * @Date 2023/10/7 17:31
+ **/
+@Data
+@TableName("l_clearing_agreement_info")
+@EqualsAndHashCode(callSuper = true)
+public class ClearingAgreementInfo extends BaseEntity {
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+    @ApiModelProperty(value = "计量期")
+    private Long periodId;
+
+    @ApiModelProperty(value = "协议名称")
+    private String name;
+
+    @ApiModelProperty(value = "协议类型")
+    private Integer type;
+
+    @ApiModelProperty(value = "协议金额")
+    private BigDecimal agreementMoney;
+
+    @ApiModelProperty(value = "协议PDF路径")
+    private String mergePdfUrl;
+
+    @ApiModelProperty(value = "区域id")
+    private Long areaId;
+
+    @ApiModelProperty(value = "补偿协议ids")
+    private String agreementIds;
+}

+ 19 - 0
blade-service/blade-land/src/main/java/org/springblade/land/controller/ClearingAgreementInfoController.java

@@ -0,0 +1,19 @@
+package org.springblade.land.controller;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Param
+ * @Author wangwl
+ * @Date 2023/10/7 17:40
+ **/
+@RestController
+@AllArgsConstructor
+@RequestMapping("/clearingAgreementInfo")
+@Api(value = "结算协议", tags = "结算协议接口")
+public class ClearingAgreementInfoController {
+
+}

+ 23 - 15
blade-service/blade-land/src/main/java/org/springblade/land/controller/CompensationInfoController.java

@@ -156,7 +156,7 @@ public class CompensationInfoController extends BladeController {
     }
 
     @GetMapping("/get-buss-pdfInfo")
-    @ApiOperationSupport(order = 18)
+    @ApiOperationSupport(order = 9)
     @ApiOperation(value = "单表pdf预览", notes = "单表pdf预览")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "id", value = "当前表单的id", required = true)
@@ -166,7 +166,7 @@ public class CompensationInfoController extends BladeController {
     }
 
     @GetMapping("/get-buss-pdfs")
-    @ApiOperationSupport(order = 21)
+    @ApiOperationSupport(order = 10)
     @ApiOperation(value = "多表预览", notes = "多表预览")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "agreementId", value = "协议的id", required = true),
@@ -175,21 +175,9 @@ public class CompensationInfoController extends BladeController {
         return compensationInfoService.getPdfS(agreementId);
     }
 
-//    @PostMapping("/add-cope-tab")
-//    @ApiOperationSupport(order = 19)
-//    @ApiOperation(value = "表单新增复制", notes = "表单新增复制,,返回协议id")
-//    @ApiImplicitParams(value = {
-//            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
-//            @ApiImplicitParam(name = "areaId", value = "当前树节点id", required = true),
-//            @ApiImplicitParam(name = "tableId", value = "表单的tableId", required = true),
-//            @ApiImplicitParam(name = "nodeType", value = "新增返回的nodeType", required = true)
-//    })
-//    public R addCopeTab(@RequestBody TableCopyVO vo) {
-//        return compensationInfoService.addCopeTab(vo);
-//    }
 
     @GetMapping("/cope-tab")
-    @ApiOperationSupport(order = 19)
+    @ApiOperationSupport(order = 11)
     @ApiOperation(value = "表单复制", notes = "表单复制,传入当前表id,返回协议id")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "id", value = "当前表单的id", required = true)
@@ -198,4 +186,24 @@ public class CompensationInfoController extends BladeController {
         return compensationInfoService.updateCopeTab(id);
     }
 
+
+    /**
+     * 结算获取补偿协议,不分页,不显示已经引用的
+     * @param info
+     * @return
+     */
+    @GetMapping("/getAgreementList")
+    @ApiOperationSupport(order = 12)
+    @ApiOperation(value = "结算查询补偿协议", notes = "结算查询补偿协议")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "areaId", value = "当前树节点id", required = true),
+            @ApiImplicitParam(name = "type", value = "协议类型1征地补偿2坟地补偿3专项设施", required = true),
+            @ApiImplicitParam(name = "number", value = "编号搜索值", required = false)
+    })
+    public R<List<CompensationInfo>> getAgreementList(CompensationInfo info)  {
+        List<CompensationInfo> list = compensationInfoService.getAgreementList(info);
+        return R.data(list);
+    }
+
 }

+ 34 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/ClearingAgreementInfoMapper.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.land.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.land.entity.ClearingAgreementInfo;
+import org.springblade.land.entity.SettlementInterval;
+
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-02-17
+ */
+public interface ClearingAgreementInfoMapper extends BaseMapper<ClearingAgreementInfo> {
+
+
+}

+ 5 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/ClearingAgreementInfoMapper.xml

@@ -0,0 +1,5 @@
+<?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.land.mapper.ClearingAgreementInfoMapper">
+
+</mapper>

+ 2 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.java

@@ -67,4 +67,6 @@ public interface CompensationInfoMapper extends BaseMapper<CompensationInfo> {
     IPage<CompensationInfo> page(IPage<CompensationInfo> iPage,@Param("info") CompensationInfo info);
 
     Integer getNumber(@Param("areaId") Long areaId);
+
+    List<CompensationInfo> getAgreementList(@Param("info") CompensationInfo info);
 }

+ 8 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.xml

@@ -59,6 +59,14 @@
         select count(1)
         from l_compensation_info where area_id = #{areaId}
     </select>
+    <select id="getAgreementList" resultType="org.springblade.land.entity.CompensationInfo">
+        select id,number,name,all_money,is_quote from l_compensation_info
+        where project_id = #{info.projectId} and is_deleted = 0 and `type` = #{info.type} and is_quote = 0
+        and area_id in (select id from l_region_tree_info where is_deleted = 0 and (id = #{info.areaId} or ancestors like CONCAT(CONCAT('%', #{info.areaId}), '%')))
+        <if test="info.number != null and info.number != ''">
+            and number like CONCAT(CONCAT('%', #{info.number}), '%')
+        </if>
+    </select>
 
 
 </mapper>

+ 35 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/IClearingAgreementInfoService.java

@@ -0,0 +1,35 @@
+/*
+ *      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.land.service;
+
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.land.dto.SettlementIntervalDTO;
+import org.springblade.land.entity.ClearingAgreementInfo;
+import org.springblade.land.entity.SettlementInterval;
+
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2023-02-17
+ */
+public interface IClearingAgreementInfoService extends BaseService<ClearingAgreementInfo> {
+
+
+}

+ 2 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/ICompensationInfoService.java

@@ -68,4 +68,6 @@ public interface ICompensationInfoService extends BaseService<CompensationInfo>
     Long add(Long projectId, Long areaId, Integer type);
 
     void remove(List<Long> ids);
+
+    List<CompensationInfo> getAgreementList(CompensationInfo info);
 }

+ 24 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/ClearingAgreementInfoServiceImpl.java

@@ -0,0 +1,24 @@
+package org.springblade.land.service.impl;
+
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.land.dto.SettlementIntervalDTO;
+import org.springblade.land.entity.ClearingAgreementInfo;
+import org.springblade.land.entity.SettlementInterval;
+import org.springblade.land.mapper.ClearingAgreementInfoMapper;
+import org.springblade.land.mapper.SettlementIntervalMapper;
+import org.springblade.land.service.IClearingAgreementInfoService;
+import org.springblade.land.service.ISettlementIntervalService;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAgreementInfoMapper, ClearingAgreementInfo> implements IClearingAgreementInfoService {
+
+
+}

+ 11 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/CompensationInfoServiceImpl.java

@@ -474,6 +474,17 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         this.deleteLogic(ids);
     }
 
+    /**
+     * 结算获取补偿协议列表
+     * @param info
+     * @return
+     */
+    @Override
+    public List<CompensationInfo> getAgreementList(CompensationInfo info) {
+        List<CompensationInfo> list = baseMapper.getAgreementList(info);
+        return list;
+    }
+
     //获取当前节点的补偿编号
     private String getNumber(Long areaId) {
         Integer number = baseMapper.getNumber(areaId);

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

@@ -22,6 +22,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.node.ForestNodeMerger;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.manager.bean.NodeVO;
 import org.springblade.manager.dto.FindAllUserByConditionDTO;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.manager.entity.*;
@@ -394,7 +395,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                         Map<Long, Integer> informationQueryMaps = informationQueryList.stream().collect(Collectors.toMap(InformationQuery::getWbsId, InformationQuery::getStatus, (v1, v2) -> v1));
                         List<Long> pKeyIdList = new ArrayList<>(informationQueryMaps.keySet());
 
-                        //填报过的所有最底层节点(并且是查询有效节点的最下级节点)处理数量
+                        //TODO 处理数量
+                        //填报过的所有最底层节点
                         List<WbsTreeContractLazyVO> lowestNodesTB = distinctLowestNodesAll.stream().filter(f -> pKeyIdList.contains(f.getPKeyId()) && resultNodesPKeyIds.contains(f.getPKeyId())).collect(Collectors.toList());
                         List<Long> lowestNodeParentIdsTB = lowestNodesTB.stream().map(WbsTreeContractLazyVO::getParentId).collect(Collectors.toList());
                         List<WbsTreeContractLazyVO> resultParentNodesTB = new ArrayList<>();
@@ -413,6 +415,20 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                     }
                                 }).collect(Collectors.toMap(WbsTreeContractLazyVO::getPKeyId, Function.identity()));
 
+                        //TODO 处理颜色
+                        //先将WbsTreeContractLazyVO转为NodeVO
+                        List<NodeVO> nodeVOList = distinctNodesAll.stream().map(wbsTreeContractServiceImpl::convertToNodeVO).collect(Collectors.toList());
+                        //转为Map<Long, NodeVO>
+                        Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
+                        //把distinctNodesAll把所有节点转为树形结构,再转为List<NodeVO>对象
+                        List<NodeVO> treeNodeVOList = wbsTreeContractServiceImpl.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);
+                        //处理节点颜色
+                        NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
+                        //把树形结构转为普通List集合
+                        List<NodeVO> nodeVOS = wbsTreeContractServiceImpl.flattenTree(treeNodeVOList);
+                        //获取所有节点颜色Map
+                        Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
+
                         //构造vo
                         if (wbsTreeContractList.size() > 0) {
                             //处理填报数量
@@ -425,24 +441,31 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                     countMap.put(key, 1L);
                                 }
                             }
-                            List<WbsTreeContractTreeAllVO> wbsTreeContractTreeAllVOS = wbsTreeContractList.stream().map(node -> {
-                                WbsTreeContractTreeAllVO vo = BeanUtil.copyProperties(node, WbsTreeContractTreeAllVO.class);
-                                if (vo != null) {
-                                    vo.setContractIdRelation(node.getContractId());
-                                    vo.setType(ObjectUtils.isNotEmpty(node.getNodeType()) ? node.getNodeType() : 0);
-                                    vo.setTitle(ObjectUtil.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
-                                    vo.setPrimaryKeyId(node.getPKeyId());
-                                    vo.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(vo.getPrimaryKeyId())) ? countMap.get(vo.getPrimaryKeyId()) : (ObjectUtil.isNotEmpty(informationQueryMaps.get(vo.getPrimaryKeyId())) ? 1L : 0L));
-                                    if (vo.getSubmitCounts() >= 1L) {
-                                        vo.setColorStatus(2);
-                                    }
-                                    WbsTreeContractLazyVO lowestNode = lowestNodesMap.get(vo.getPrimaryKeyId());
-                                    if (lowestNode != null) {
-                                        vo.setColorStatus(lowestNode.getColorStatus());
-                                    }
-                                }
-                                return vo;
-                            }).collect(Collectors.toList());
+                            List<WbsTreeContractTreeAllVO> wbsTreeContractTreeAllVOS = wbsTreeContractList.stream()
+                                    .map(node -> {
+                                        WbsTreeContractTreeAllVO vo = BeanUtil.copyProperties(node, WbsTreeContractTreeAllVO.class);
+                                        if (vo != null) {
+                                            vo.setContractIdRelation(node.getContractId());
+                                            vo.setType(ObjectUtils.isNotEmpty(node.getNodeType()) ? node.getNodeType() : 0);
+                                            vo.setTitle(ObjectUtil.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
+                                            vo.setPrimaryKeyId(node.getPKeyId());
+
+                                            //设置数量
+                                            vo.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(vo.getPrimaryKeyId())) ? countMap.get(vo.getPrimaryKeyId()) : (ObjectUtil.isNotEmpty(informationQueryMaps.get(vo.getPrimaryKeyId())) ? 1L : 0L));
+
+                                            //设置颜色
+                                            Integer parentColorStatus = nodeColorStatusMap.get(vo.getPrimaryKeyId());
+                                            if (parentColorStatus != null) {
+                                                vo.setColorStatus(parentColorStatus);
+                                            } else {
+                                                WbsTreeContractLazyVO lowestNode = lowestNodesMap.get(vo.getPrimaryKeyId());
+                                                if (lowestNode != null) {
+                                                    vo.setColorStatus(lowestNode.getColorStatus());
+                                                }
+                                            }
+                                        }
+                                        return vo;
+                                    }).collect(Collectors.toList());
                             return R.data(this.buildWbsTreeByStreamByTreeAll(wbsTreeContractTreeAllVOS));
                         }
                     }
@@ -514,6 +537,13 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                         }
                                     }).collect(Collectors.toMap(WbsTreeContractLazyVO::getPKeyId, Function.identity()));
 
+                            List<NodeVO> nodeVOList = distinctNodesAll.stream().map(wbsTreeContractServiceImpl::convertToNodeVO).collect(Collectors.toList());
+                            Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
+                            List<NodeVO> treeNodeVOList = wbsTreeContractServiceImpl.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);
+                            NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
+                            List<NodeVO> nodeVOS = wbsTreeContractServiceImpl.flattenTree(treeNodeVOList);
+                            Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
+
                             if (wbsTreeContractList.size() > 0) {
                                 Map<Long, Long> countMap = new HashMap<>();
                                 for (WbsTreeContractLazyVO node : resultParentNodesTB) {
@@ -524,24 +554,28 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                         countMap.put(key, 1L);
                                     }
                                 }
-                                List<WbsTreeContractTreeAllVO> wbsTreeContractTreeAllVOS = wbsTreeContractList.stream().map(node -> {
-                                    WbsTreeContractTreeAllVO vo = BeanUtil.copyProperties(node, WbsTreeContractTreeAllVO.class);
-                                    if (vo != null) {
-                                        vo.setContractIdRelation(node.getContractId());
-                                        vo.setType(ObjectUtils.isNotEmpty(node.getNodeType()) ? node.getNodeType() : 0);
-                                        vo.setTitle(ObjectUtil.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
-                                        vo.setPrimaryKeyId(node.getPKeyId());
-                                        vo.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(vo.getPrimaryKeyId())) ? countMap.get(vo.getPrimaryKeyId()) : (ObjectUtil.isNotEmpty(informationQueryMaps.get(vo.getPrimaryKeyId())) ? 1L : 0L));
-                                        if (vo.getSubmitCounts() >= 1L) {
-                                            vo.setColorStatus(2);
-                                        }
-                                        WbsTreeContractLazyVO lowestNode = lowestNodesMap.get(vo.getPrimaryKeyId());
-                                        if (lowestNode != null) {
-                                            vo.setColorStatus(lowestNode.getColorStatus());
-                                        }
-                                    }
-                                    return vo;
-                                }).collect(Collectors.toList());
+                                List<WbsTreeContractTreeAllVO> wbsTreeContractTreeAllVOS = wbsTreeContractList.stream()
+                                        .map(node -> {
+                                            WbsTreeContractTreeAllVO vo = BeanUtil.copyProperties(node, WbsTreeContractTreeAllVO.class);
+                                            if (vo != null) {
+                                                vo.setContractIdRelation(node.getContractId());
+                                                vo.setType(ObjectUtils.isNotEmpty(node.getNodeType()) ? node.getNodeType() : 0);
+                                                vo.setTitle(ObjectUtil.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
+                                                vo.setPrimaryKeyId(node.getPKeyId());
+                                                vo.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(vo.getPrimaryKeyId())) ? countMap.get(vo.getPrimaryKeyId()) : (ObjectUtil.isNotEmpty(informationQueryMaps.get(vo.getPrimaryKeyId())) ? 1L : 0L));
+
+                                                Integer parentColorStatus = nodeColorStatusMap.get(vo.getPrimaryKeyId());
+                                                if (parentColorStatus != null) {
+                                                    vo.setColorStatus(parentColorStatus);
+                                                } else {
+                                                    WbsTreeContractLazyVO lowestNode = lowestNodesMap.get(vo.getPrimaryKeyId());
+                                                    if (lowestNode != null) {
+                                                        vo.setColorStatus(lowestNode.getColorStatus());
+                                                    }
+                                                }
+                                            }
+                                            return vo;
+                                        }).collect(Collectors.toList());
                                 resultMaps.put(contractRelationJlyz.getContractIdSg(), this.buildWbsTreeByStreamByTreeAll(wbsTreeContractTreeAllVOS));
                             }
                         }
@@ -553,94 +587,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
         return null;
     }
 
-    /**
-     * 处理submitCounts计数、colorStatus颜色问题
-     *
-     * @param reNodes 数据源
-     */
-    private void reSetSubmitCountsAndColorStatus(List<WbsTreeContractTreeAllVO> reNodes) {
-        //反向for循环解决顺序问题,最底层节点才是数据源
-        for (int i = reNodes.size() - 1; i >= 0; i--) {
-            WbsTreeContractTreeAllVO node = reNodes.get(i);
-            if (node.getChildren() != null && !node.getChildren().isEmpty()) {
-                //计数
-                long childSubmitCounts = 0L;
-                for (WbsTreeContractTreeAllVO child : node.getChildren()) {
-                    if (child.getSubmitCounts() == 1L) {
-                        childSubmitCounts++;
-                    } else if (child.getSubmitCounts() > 1L) {
-                        childSubmitCounts = child.getSubmitCounts();
-                    }
-                }
-                node.setSubmitCounts(childSubmitCounts);
-
-                //颜色
-                boolean allThree = true; //是否所有子节点的getColorStatus都等于3
-                boolean allFour = true; //是否所有子节点的getColorStatus都等于4
-                boolean hasTwo = false; //是否存在子节点的getColorStatus等于2
-                boolean hasOne = false; //是否存在子节点的getColorStatus等于1
-                boolean hasThreeOrFour = false; //是否存在子节点的getColorStatus等于3或4
-                for (WbsTreeContractTreeAllVO child : node.getChildren()) {
-                    if (child.getColorStatus() != 3) {
-                        allThree = false;
-                    }
-                    if (child.getColorStatus() != 4) {
-                        allFour = false;
-                    }
-                    if (child.getColorStatus() == 2) {
-                        hasTwo = true;
-                    }
-                    if (child.getColorStatus() == 1) {
-                        hasOne = true;
-                    }
-                    if (child.getColorStatus() == 3 || child.getColorStatus() == 4) {
-                        hasThreeOrFour = true;
-                    }
-                }
-                if (allThree) {
-                    node.setColorStatus(3);
-                } else if (allFour) {
-                    node.setColorStatus(4);
-                } else if (hasTwo || (hasOne && hasThreeOrFour)) {
-                    node.setColorStatus(2);
-                } else {
-                    node.setColorStatus(1);
-                }
-
-            } else if (node.getSubmitCounts() == 1L) {
-                node.setSubmitCounts(1L);
-                //最底层节点颜色
-                if (ObjectUtils.isNotEmpty(node.getColorStatus())) {
-                    if (node.getColorStatus().equals(0)) { //任务状态=0,未上报
-                        node.setColorStatus(2); //蓝色
-                    } else if (node.getColorStatus().equals(1)) { //任务状态=1,待审批
-                        node.setColorStatus(3); //橙色
-                    } else if (node.getColorStatus().equals(2)) { //任务状态=2,已审批
-                        node.setColorStatus(4); //绿色
-                    }
-                }
-            } else if (node.getSubmitCounts() == 0L && ObjectUtils.isEmpty(node.getColorStatus())) {
-                node.setColorStatus(1); //黑色 //任务状态=null,未填报
-            }
-        }
-    }
-
-
-    /**
-     * 获取构造完的List集合
-     *
-     * @param reNodes 数据源
-     * @param result  结果集
-     */
-    private void getNodesAll(List<WbsTreeContractTreeAllVO> reNodes, LinkedList<WbsTreeContractTreeAllVO> result) {
-        for (WbsTreeContractTreeAllVO node : reNodes) {
-            if (node.getChildren() != null && !node.getChildren().isEmpty()) {
-                result.addAll(node.getChildren());
-                this.getNodesAll(node.getChildren(), result);
-            }
-        }
-    }
-
     /**
      * 反向递归获取父级
      *

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

@@ -2326,13 +2326,13 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
      * @param distinctNodesAll 去重后所有节点数据
      * @return
      */
-    private List<NodeVO> buildNodeTreeByStream(List<WbsTreeContractLazyVO> distinctNodesAll, Map<Long, WbsTreeContractLazyVO> lowestNodesMap) {
+    public List<NodeVO> buildNodeTreeByStream(List<WbsTreeContractLazyVO> distinctNodesAll, Map<Long, WbsTreeContractLazyVO> lowestNodesMap) {
         List<WbsTreeContractLazyVO> list = distinctNodesAll.stream().filter(f -> f.getParentId().equals(0L)).collect(Collectors.toList());
         Map<Long, List<WbsTreeContractLazyVO>> map = distinctNodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
         return recursionFnNodeTree(list, map, lowestNodesMap);
     }
 
-    private List<NodeVO> recursionFnNodeTree(List<WbsTreeContractLazyVO> list, Map<Long, List<WbsTreeContractLazyVO>> map, Map<Long, WbsTreeContractLazyVO> lowestNodesMap) {
+    public List<NodeVO> recursionFnNodeTree(List<WbsTreeContractLazyVO> list, Map<Long, List<WbsTreeContractLazyVO>> map, Map<Long, WbsTreeContractLazyVO> lowestNodesMap) {
         List<NodeVO> result = new ArrayList<>();
         for (WbsTreeContractLazyVO vo : list) {
             if (vo.getHasChildren().equals(0)) {
@@ -2357,7 +2357,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
     }
 
     //转换VO
-    private NodeVO convertToNodeVO(WbsTreeContractLazyVO wbsTreeContractLazyVO) {
+    public NodeVO convertToNodeVO(WbsTreeContractLazyVO wbsTreeContractLazyVO) {
         NodeVO nodeVO = new NodeVO();
         nodeVO.setId(wbsTreeContractLazyVO.getId());
         nodeVO.setParentId(wbsTreeContractLazyVO.getParentId());
@@ -2367,7 +2367,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
     }
 
     //把树形结构转为普通List
-    private List<NodeVO> flattenTree(List<NodeVO> tree) {
+    public List<NodeVO> flattenTree(List<NodeVO> tree) {
         List<NodeVO> result = new ArrayList<>();
         for (NodeVO node : tree) {
             result.add(node);