|
@@ -22,6 +22,7 @@ import org.springblade.manager.feign.ContractClient;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -130,99 +131,41 @@ public class ArchiveFileClientImpl implements ArchiveFileClient {
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getAllArchiveFileByContractType(Long projectId) {
|
|
|
- List<ArchiveFileVO> list = fileMapper.getAllArchiveFileByContractType(projectId);
|
|
|
- List<ContractInfo> infos = contractClient.queryContractListByIds(Arrays.asList(projectId));
|
|
|
+ Integer count = fileMapper.getAllArchiveFileByContractTypeCount(projectId);
|
|
|
+ Map<String, BigDecimal> mapSummary = fileMapper.getAllArchiveFileByContractTypeSummary(projectId);
|
|
|
int key1 = 0, key2 = 0, key3 = 0;
|
|
|
int key4 = 0, key5 = 0, key6 = 0;
|
|
|
- //判断文件属于1施工,2监理,还是3业主
|
|
|
- if (list != null && list.size() > 0) {
|
|
|
- for (ArchiveFileVO l : list) {
|
|
|
- String type = l.getContractType();
|
|
|
- if (StringUtils.isBlank(type)) {
|
|
|
- //业主
|
|
|
- if (l.getSourceType() != null && l.getSourceType() == 1){
|
|
|
- key4++;
|
|
|
- }else {
|
|
|
- key3++;
|
|
|
- }
|
|
|
- } else if ("S".equals(type)) {
|
|
|
- //监理
|
|
|
- if (l.getSourceType() != null && l.getSourceType() == 1){
|
|
|
- key5++;
|
|
|
- }else {
|
|
|
- key2++;
|
|
|
- }
|
|
|
-
|
|
|
- } else if ("C".equals(type)) {
|
|
|
- //施工
|
|
|
- if (l.getSourceType() != null && l.getSourceType() == 1){
|
|
|
- key6++;
|
|
|
- }else {
|
|
|
- key1++;
|
|
|
- }
|
|
|
- } else if (type.length() > 10) {
|
|
|
- for (ContractInfo info : infos) {
|
|
|
- if (type.equals(info.getId() + "")) {
|
|
|
- Integer t = info.getContractType();
|
|
|
- if (t == 1) {
|
|
|
- key1++;
|
|
|
- } else if (t == 2) {
|
|
|
- key2++;
|
|
|
- } else {
|
|
|
- key3++;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- System.out.println(type);
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- List<ArchivesAutoVO> autos = fileMapper.getAllArchiveAutoByContractType(projectId);
|
|
|
- for (ArchivesAutoVO l : autos) {
|
|
|
- String type = l.getContractType();
|
|
|
- if (StringUtils.isBlank(type)) {
|
|
|
- //业主
|
|
|
- key3++;
|
|
|
- } else if ("S".equals(type)) {
|
|
|
- //监理
|
|
|
- key2++;
|
|
|
- } else if ("C".equals(type)) {
|
|
|
- //施工
|
|
|
- key1++;
|
|
|
- } else if (type.length() > 10) {
|
|
|
- for (ContractInfo info : infos) {
|
|
|
- if (type.equals(info.getId() + "")) {
|
|
|
- Integer t = info.getContractType();
|
|
|
- if (t == 1) {
|
|
|
- key1++;
|
|
|
- } else if (t == 2) {
|
|
|
- key2++;
|
|
|
- } else {
|
|
|
- key3++;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- System.out.println(type);
|
|
|
- }
|
|
|
+ if(count> 0 && mapSummary != null){
|
|
|
+ key1 += mapSummary.get("key1") != null ? mapSummary.get("key1").intValue() : 0;
|
|
|
+ key2 += mapSummary.get("key2") != null ? mapSummary.get("key2").intValue() : 0;
|
|
|
+ key3 += mapSummary.get("key3") != null ? mapSummary.get("key3").intValue() : 0;
|
|
|
+ key4 += mapSummary.get("key4") != null ? mapSummary.get("key4").intValue() : 0;
|
|
|
+ key5 += mapSummary.get("key5") != null ? mapSummary.get("key5").intValue() : 0;
|
|
|
+ key6 += mapSummary.get("key6") != null ? mapSummary.get("key6").intValue() : 0;
|
|
|
+ } else {
|
|
|
+ Map<String,BigDecimal> mapAutoSummary = fileMapper.getAllArchiveAutoByContractTypeSummary(projectId);
|
|
|
+ if(mapAutoSummary != null){
|
|
|
+ key1 += mapAutoSummary.get("key1") != null ? mapAutoSummary.get("key1").intValue() : 0;
|
|
|
+ key2 += mapAutoSummary.get("key2") != null ? mapAutoSummary.get("key2").intValue() : 0;
|
|
|
+ key3 += mapAutoSummary.get("key3") != null ? mapAutoSummary.get("key3").intValue() : 0;
|
|
|
+ key4 += mapAutoSummary.get("key4") != null ? mapAutoSummary.get("key4").intValue() : 0;
|
|
|
+ key5 += mapAutoSummary.get("key5") != null ? mapAutoSummary.get("key5").intValue() : 0;
|
|
|
+ key6 += mapAutoSummary.get("key6") != null ? mapAutoSummary.get("key6").intValue() : 0;
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("title", "施工");
|
|
|
- map.put("key1", key6);
|
|
|
- map.put("key2", key1);
|
|
|
+ map.put("key1", key6);//原生
|
|
|
+ map.put("key2", key1);//数据化
|
|
|
Map<String, Object> map2 = new HashMap<>();
|
|
|
map2.put("title", "监理");
|
|
|
- map2.put("key1", key5);
|
|
|
- map2.put("key2", key2);
|
|
|
+ map2.put("key1", key5);//原生
|
|
|
+ map2.put("key2", key2);//数据化
|
|
|
Map<String, Object> map3 = new HashMap<>();
|
|
|
map3.put("title", "业主");
|
|
|
- map3.put("key1", key4);
|
|
|
- map3.put("key2", key3);
|
|
|
+ map3.put("key1", key4);//原生
|
|
|
+ map3.put("key2", key3);//数据化
|
|
|
mapList.add(map);
|
|
|
mapList.add(map2);
|
|
|
mapList.add(map3);
|