浏览代码

更新报表

jihs 4 年之前
父节点
当前提交
e4c0ed136d

+ 11 - 2
src/main/java/org/jeecg/common/dto/report/ProStatisticsRespDTO.java

@@ -1,8 +1,11 @@
 package org.jeecg.common.dto.report;
 
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
 
 import java.util.List;
 
@@ -19,8 +22,12 @@ public class ProStatisticsRespDTO {
     @ApiModelProperty("parentId")
     private String parentId;
 
-    private Boolean isLeaf;
+    private String key;
 
+    private Boolean isLeaf;
+    @Getter
+    @Setter
+    private String member;
 
     private List<ProStatisticsTwoRespDTO> children;
 
@@ -28,13 +35,15 @@ public class ProStatisticsRespDTO {
     }
 
     public ProStatisticsRespDTO(String id, String proName, String proCode, String title,
-        String parentId) {
+        String parentId, String member) {
         this.id = id;
+        this.key = id;
         this.proName = proName;
         this.proCode = proCode;
         this.title = title;
         this.parentId = parentId;
         this.isLeaf = false;
+        this.member = member;
     }
 
     public String getId() {

+ 4 - 0
src/main/java/org/jeecg/common/dto/report/ProStatisticsThreeRespDTO.java

@@ -47,6 +47,9 @@ public class ProStatisticsThreeRespDTO {
     private String parentId;
     @ApiModelProperty("isLeaf")
     private Boolean isLeaf;
+    @Getter
+    @Setter
+    private String key;
     @JsonInclude(JsonInclude.Include.NON_NULL)
     private List<ProStatisticsThreeRespDTO> childeren;
 
@@ -54,6 +57,7 @@ public class ProStatisticsThreeRespDTO {
     }
 
     public ProStatisticsThreeRespDTO(ProjectManageBusinessOther other, ProStatisticsTwoRespDTO twoRespDTO) {
+        this.key = other.getId();
         this.milesName = other.getMuilesName();
         this.mileStartDate = other.getStartDate();
         this.mileEndDate = other.getEndDate();

+ 7 - 0
src/main/java/org/jeecg/common/dto/report/ProStatisticsTwoRespDTO.java

@@ -15,6 +15,9 @@ public class ProStatisticsTwoRespDTO {
     @ApiModelProperty("id")
     private String id;
     @ApiModelProperty("项目组成员")
+    @Getter
+    @Setter
+    @JsonIgnore
     private String proMember;
     @ApiModelProperty("收付款条线编码")
     private String coArchivesCode;
@@ -26,6 +29,9 @@ public class ProStatisticsTwoRespDTO {
     private String parentId;
     @ApiModelProperty("isLeaf")
     private Boolean isLeaf;
+    @Getter
+    @Setter
+    private String key;
     /**
      * @desc 里程碑id
      */
@@ -55,6 +61,7 @@ public class ProStatisticsTwoRespDTO {
 
     public ProStatisticsTwoRespDTO(ProjectManageArchivesAndBusiness business, String proMember, String parentId) {
         this.id = business.getId();
+        this.key = business.getId();
         this.coArchivesName = business.getPlanName();
         this.title = business.getPlanName();
         this.parentId = parentId;

+ 25 - 1
src/main/java/org/jeecg/modules/report/service/impl/ProReportServiceImpl.java

@@ -11,6 +11,7 @@ import org.jeecg.common.dto.report.CostAccountingRespDTO;
 import org.jeecg.common.dto.report.ProStatisticsRespDTO;
 import org.jeecg.common.dto.report.ProStatisticsThreeRespDTO;
 import org.jeecg.common.dto.report.ProStatisticsTwoRespDTO;
+import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.modules.archives.entity.ProjectManageArchives;
 import org.jeecg.modules.archives.entity.ProjectManageArchivesAndBusiness;
 import org.jeecg.modules.archives.entity.ProjectManageBusinessOther;
@@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -128,15 +130,32 @@ public class ProReportServiceImpl implements ProReportService {
          //项目日志
          Map<String, List<ProWorkLogic>>  logicMap = getProLogic(id);
 
+         //项目成员
+         String member = getMember(archives);
+
          //逻辑处理
              ProStatisticsRespDTO respDTO =  new ProStatisticsRespDTO(archives.getId(), archives.getProName(),
-                     archives.getProCode(), archives.getProName(), "0");
+                     archives.getProCode(), archives.getProName(), "0", member);
              //配置收付款条线数据
              setSecondChildren(businesses, respDTO, CoLineMap, otherList, businessMap, logicMap, milestoneMap, purchaseDataMap, slipMap);
 
          return respDTO;
      }
 
+
+
+    /**
+     * @desc 获取项目组成员
+     */
+    private String getMember(ProjectManageArchives archives) {
+        String[] member = {archives.getSaleManager(), archives.getSaleMan(), archives.getImpManager(), archives.getImpConsultant(),
+        archives.getDeManager(), archives.getDeEngineer(), archives.getSeManager(), archives.getSeEngineer()};
+        if(member.length == 0){
+            throw new JeecgBootException("项目编码为:" + archives.getProCode() + " 的成员为空");
+        }
+           return String.join(",", Arrays.asList(String.join("、", Arrays.asList(member).stream().filter(t-> StringUtils.isNotBlank(t)).collect(Collectors.toList())).split("、")).stream().distinct().collect(Collectors.toList()));
+    }
+
     /**
      * @desc 日志map
      */
@@ -358,5 +377,10 @@ public class ProReportServiceImpl implements ProReportService {
          List<ProjectManageArchivesAndBusiness> list = projectManageArchivesAndBusinessService.list(queryWrapper);
          return list;
      }
+
+    public static void main(String[] args) {
+                String[] str = {"a", "b", null, "3"};
+                System.out.println(String.join(",", Arrays.asList(str).stream().filter(t -> StringUtils.isNotBlank(t)).collect(Collectors.toList())));
+    }
  }