|
@@ -1,5 +1,10 @@
|
|
package com.boman.report.service.impl;
|
|
package com.boman.report.service.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
|
+import com.boman.domain.SysFile;
|
|
import com.boman.domain.dto.AjaxResult;
|
|
import com.boman.domain.dto.AjaxResult;
|
|
import com.boman.domain.entity.StatisticReport;
|
|
import com.boman.domain.entity.StatisticReport;
|
|
import com.boman.domain.entity.StatisticReportPersonnel;
|
|
import com.boman.domain.entity.StatisticReportPersonnel;
|
|
@@ -7,11 +12,13 @@ import com.boman.domain.entity.vo.StatisticReportVo;
|
|
import com.boman.report.mapper.StatisticReportMapper;
|
|
import com.boman.report.mapper.StatisticReportMapper;
|
|
import com.boman.report.mapper.StatisticReportPersonnelMapper;
|
|
import com.boman.report.mapper.StatisticReportPersonnelMapper;
|
|
import com.boman.report.service.StatisticReportService;
|
|
import com.boman.report.service.StatisticReportService;
|
|
|
|
+import com.google.gson.JsonObject;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.lang.ref.ReferenceQueue;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -41,6 +48,7 @@ public class StatisticReportServiceImpl implements StatisticReportService {
|
|
if (statisticReportPersonnels != null && statisticReportPersonnels.size() > 0){
|
|
if (statisticReportPersonnels != null && statisticReportPersonnels.size() > 0){
|
|
Map<String, List<String>> personnelMap = statisticReportPersonnels.stream().collect(Collectors.groupingBy(StatisticReportPersonnel::getDeptName, Collectors.mapping(StatisticReportPersonnel::getUserName, Collectors.toList())));
|
|
Map<String, List<String>> personnelMap = statisticReportPersonnels.stream().collect(Collectors.groupingBy(StatisticReportPersonnel::getDeptName, Collectors.mapping(StatisticReportPersonnel::getUserName, Collectors.toList())));
|
|
Map<String, List<String>> filledOutMap = statisticReportPersonnels.stream().filter(e -> "1".equals(e.getStatus())).collect(Collectors.groupingBy(StatisticReportPersonnel::getDeptName, Collectors.mapping(StatisticReportPersonnel::getUserName, Collectors.toList())));
|
|
Map<String, List<String>> filledOutMap = statisticReportPersonnels.stream().filter(e -> "1".equals(e.getStatus())).collect(Collectors.groupingBy(StatisticReportPersonnel::getDeptName, Collectors.mapping(StatisticReportPersonnel::getUserName, Collectors.toList())));
|
|
|
|
+ Map<String, List<StatisticReportPersonnel>> filledInMap = statisticReportPersonnels.stream().filter(e -> "2".equals(e.getStatus())).collect(Collectors.groupingBy(StatisticReportPersonnel::getDeptName));
|
|
//参与人员
|
|
//参与人员
|
|
List<Map<String,Object>> personnelList = new ArrayList<>();
|
|
List<Map<String,Object>> personnelList = new ArrayList<>();
|
|
//已填报
|
|
//已填报
|
|
@@ -55,7 +63,6 @@ public class StatisticReportServiceImpl implements StatisticReportService {
|
|
personnelList.add(map);
|
|
personnelList.add(map);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
if (filledOutMap != null && filledOutMap.size() > 0){
|
|
if (filledOutMap != null && filledOutMap.size() > 0){
|
|
filledOutMap.forEach((key, value) -> {
|
|
filledOutMap.forEach((key, value) -> {
|
|
Map<String,Object> map= new HashMap<>();
|
|
Map<String,Object> map= new HashMap<>();
|
|
@@ -64,9 +71,35 @@ public class StatisticReportServiceImpl implements StatisticReportService {
|
|
filledOutList.add(map);
|
|
filledOutList.add(map);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (filledInMap != null && filledInMap.size() > 0){
|
|
|
|
+ Set<String> strings = filledInMap.keySet();
|
|
|
|
+ for (String deptName : strings) {
|
|
|
|
+ List<StatisticReportPersonnel> statisticReportPersonnelList = filledInMap.get(deptName);
|
|
|
|
+ if (statisticReportPersonnelList != null && statisticReportPersonnelList.size() > 0){
|
|
|
|
+ for (StatisticReportPersonnel statisticReportPersonnel : statisticReportPersonnelList) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("deptName",deptName);
|
|
|
|
+ map.put("userNameList",statisticReportPersonnel.getUserName());
|
|
|
|
+ String uploadFile = statisticReportPersonnel.getUploadFile();
|
|
|
|
+ //[{"name":"1627634606200.pdf","url":"http://192.168.101.11:9300/statics/2021/07/30/1627634606200.pdf","status":"success","uid":1627634606225}]
|
|
|
|
+ List<SysFile> sysFileList = JSON.parseObject(uploadFile, new TypeReference<List<SysFile>>() {}.getType());
|
|
|
|
+ List<String> fileName = new ArrayList<>();
|
|
|
|
+ List<String> fileUrl = new ArrayList<>();
|
|
|
|
+ if (sysFileList != null && sysFileList.size() > 0){
|
|
|
|
+ for (SysFile sysFile : sysFileList) {
|
|
|
|
+ fileName.add(sysFile.getName());
|
|
|
|
+ fileUrl.add(sysFile.getUrl());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put("fileNameList",fileName);
|
|
|
|
+ map.put("fileUrlList",fileUrl);
|
|
|
|
+ filledInList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
reportInfo.setPersonnelList(personnelList);
|
|
reportInfo.setPersonnelList(personnelList);
|
|
- //reportInfo.setFilledInList();
|
|
|
|
|
|
+ reportInfo.setFilledInList(filledInList);
|
|
reportInfo.setFilledOutList(filledOutList);
|
|
reportInfo.setFilledOutList(filledOutList);
|
|
}
|
|
}
|
|
return AjaxResult.success(reportInfo);
|
|
return AjaxResult.success(reportInfo);
|