|
|
@ -1,5 +1,8 @@ |
|
|
|
package com.easy.admin.modules.huzhou.service.impl; |
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
|
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams; |
|
|
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -18,6 +21,7 @@ import com.easy.admin.modules.huzhou.service.*; |
|
|
|
import com.easy.admin.modules.huzhou.vo.*; |
|
|
|
import com.easy.admin.sys.model.SysDict; |
|
|
|
import com.easy.admin.sys.service.SysDictService; |
|
|
|
import groovy.util.logging.Slf4j; |
|
|
|
import kotlin.collections.EmptyList; |
|
|
|
import org.activiti.engine.RuntimeService; |
|
|
|
import org.activiti.engine.TaskService; |
|
|
@ -1401,7 +1405,8 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
//
|
|
|
|
// }
|
|
|
|
|
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize){ |
|
|
|
@Override |
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir){ |
|
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
|
//只要入库项目
|
|
|
|
projectInfo.setType("1"); |
|
|
@ -1416,13 +1421,25 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
String progress = this.countProgress(projectIds); |
|
|
|
p.setProjectProgress(progress); |
|
|
|
} |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectSummaryOV> currentPageData = projectSummaryPageList.subList(fromIndex, Math.min(fromIndex + pageSize, projectSummaryPageList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectSummaryPageList.size()); |
|
|
|
//排序
|
|
|
|
if(!orderBy.equals("")&&!orderDir.equals("")){ |
|
|
|
List<ProjectSummaryOV> summarySortedList = this.getSummarySortedList(projectSummaryPageList, orderBy, orderDir); |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectSummaryOV> currentPageData = summarySortedList.subList(fromIndex, Math.min(fromIndex + pageSize, summarySortedList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(summarySortedList.size()); |
|
|
|
}else { |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectSummaryOV> currentPageData = projectSummaryPageList.subList(fromIndex, Math.min(fromIndex + pageSize, projectSummaryPageList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectSummaryPageList.size()); |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPageByTask(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize){ |
|
|
|
|
|
|
|
@Override |
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPageByTask(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir){ |
|
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
|
//只要入库项目
|
|
|
|
projectInfo.setType("1"); |
|
|
@ -1437,13 +1454,26 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
String progress = this.countProgress(projectIds); |
|
|
|
p.setProjectProgress(progress); |
|
|
|
} |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectSummaryOV> currentPageData = projectSummaryPageList.subList(fromIndex, Math.min(fromIndex + pageSize, projectSummaryPageList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectSummaryPageList.size()); |
|
|
|
//排序
|
|
|
|
if(!orderBy.equals("")&&!orderDir.equals("")){ |
|
|
|
List<ProjectSummaryOV> summarySortedList = this.getSummarySortedList(projectSummaryPageList, orderBy, orderDir); |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectSummaryOV> currentPageData = summarySortedList.subList(fromIndex, Math.min(fromIndex + pageSize, summarySortedList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(summarySortedList.size()); |
|
|
|
}else { |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectSummaryOV> currentPageData = projectSummaryPageList.subList(fromIndex, Math.min(fromIndex + pageSize, projectSummaryPageList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectSummaryPageList.size()); |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
public IPage<ProjectDetailOV> getProjectDetailPage(HuzhouProjectinfo projectInfo,String stage, Integer pageNo, Integer pageSize){ |
|
|
|
|
|
|
|
@Override |
|
|
|
public IPage<ProjectDetailOV> getProjectDetailPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir, |
|
|
|
String projectStage,String stepName,String isUpload,String isOffline){ |
|
|
|
IPage<ProjectDetailOV> result = new Page<>(); |
|
|
|
List<ProjectDetailOV> records=new ArrayList<>(); |
|
|
|
HashMap<String,String> stageMap=new HashMap<>(); |
|
|
@ -1492,18 +1522,18 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); |
|
|
|
query1.eq(HuzhouPlaninfo::getIsfinish,"1"); |
|
|
|
List<String[]> onGoingLevelList = planinfoService.list(query1).stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); |
|
|
|
String stepName=""; |
|
|
|
String isUpload=""; |
|
|
|
String isOffline="0"; |
|
|
|
String defaultStepName=""; |
|
|
|
String defaultIsUpload=""; |
|
|
|
String defaultIsOffline="0"; |
|
|
|
if(!onGoingLevelList.isEmpty()){//有1取1,多1取最大
|
|
|
|
List<String[]> onGoingKeyList = onGoingLevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); |
|
|
|
int firstMax = onGoingKeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); |
|
|
|
List<String[]> onGoingKeyFilterList = onGoingKeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); |
|
|
|
int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); |
|
|
|
String level=firstMax+"."+secondMax; |
|
|
|
stepName=planinfoMapper.getTaskName(p.getId(),level); |
|
|
|
isOffline = planinfoMapper.getIsOffline(p.getId(), level); |
|
|
|
isUpload="1"; |
|
|
|
defaultStepName=planinfoMapper.getTaskName(p.getId(),level); |
|
|
|
defaultIsUpload = planinfoMapper.getIsOffline(p.getId(), level); |
|
|
|
defaultIsOffline="1"; |
|
|
|
} |
|
|
|
else if(onGoingLevelList.isEmpty() && !levelList.isEmpty()){//没有1,有2
|
|
|
|
List<String[]> keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); |
|
|
@ -1511,13 +1541,13 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
List<String[]> onGoingKeyFilterList = keyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); |
|
|
|
int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); |
|
|
|
String level=firstMax+"."+secondMax; |
|
|
|
stepName=planinfoMapper.getTaskName(p.getId(),level); |
|
|
|
isOffline = planinfoMapper.getIsOffline(p.getId(), level); |
|
|
|
isUpload="1"; |
|
|
|
defaultStepName=planinfoMapper.getTaskName(p.getId(),level); |
|
|
|
defaultIsUpload = planinfoMapper.getIsOffline(p.getId(), level); |
|
|
|
defaultIsOffline="1"; |
|
|
|
} |
|
|
|
projectDetail.setStepName(stepName); |
|
|
|
projectDetail.setIsUpload(isUpload); |
|
|
|
projectDetail.setIsOffline(isOffline); |
|
|
|
projectDetail.setStepName(defaultStepName); |
|
|
|
projectDetail.setIsUpload(defaultIsUpload); |
|
|
|
projectDetail.setIsOffline(defaultIsOffline); |
|
|
|
// 进度
|
|
|
|
List<String> projectIds=new ArrayList<>(); |
|
|
|
projectIds.add(p.getId()); |
|
|
@ -1527,22 +1557,182 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
//项目阶段筛选
|
|
|
|
if(!Objects.equals(stage, "")){ |
|
|
|
String queryStage = stageMap.get(stage); |
|
|
|
List<ProjectDetailOV> filterRecords=records.stream().filter(x->x.getProjectStage().equals(queryStage)).collect(Collectors.toList()); |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectDetailOV> currentPageData = filterRecords.subList(fromIndex, Math.min(fromIndex + pageSize, filterRecords.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(filterRecords.size()); |
|
|
|
//先筛再排
|
|
|
|
// List<ProjectDetailOV> filteredList=new ArrayList<>();
|
|
|
|
List<ProjectDetailOV> detailSortedList=new ArrayList<>(); |
|
|
|
List<String> conditionList=new ArrayList<>(); |
|
|
|
//筛选条件集合
|
|
|
|
HashMap<String,String> filterMap= new HashMap<>(); |
|
|
|
filterMap.put("projectStage",projectStage); |
|
|
|
filterMap.put("stepName",stepName); |
|
|
|
filterMap.put("isUpload",isUpload); |
|
|
|
filterMap.put("isOffline",isOffline); |
|
|
|
for (Map.Entry<String, String> entry : filterMap.entrySet()){ |
|
|
|
if (!entry.getValue().equals("")){ |
|
|
|
conditionList.add(entry.getKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
//筛选
|
|
|
|
if(!conditionList.isEmpty()){ |
|
|
|
List<ProjectDetailOV> tempList=new ArrayList<>(); |
|
|
|
tempList.addAll(records); |
|
|
|
List<ProjectDetailOV> filteredList=new ArrayList<>(); |
|
|
|
for(String condition:conditionList){ |
|
|
|
if(condition.equals("projectStage")){ |
|
|
|
filteredList = tempList.stream().filter(x -> x.getProjectStage().equals(stageMap.get(projectStage))).collect(Collectors.toList()); |
|
|
|
}else if (condition.equals("stepName")){ |
|
|
|
filteredList = tempList.stream().filter(x -> x.getStepName().equals(stepName)).collect(Collectors.toList()); |
|
|
|
} else if (condition.equals("isUpload")) { |
|
|
|
filteredList = tempList.stream().filter(x -> x.getIsUpload().equals(isUpload)).collect(Collectors.toList()); |
|
|
|
} else if (condition.equals("isOffline")) { |
|
|
|
filteredList = tempList.stream().filter(x -> x.getIsOffline().equals(isOffline)).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
tempList.clear(); |
|
|
|
tempList.addAll(filteredList); |
|
|
|
} |
|
|
|
records=filteredList; |
|
|
|
} |
|
|
|
if(!orderBy.equals("")&&!orderDir.equals("")){ |
|
|
|
detailSortedList = this.getDetailSortedList(records, orderBy, orderDir); |
|
|
|
|
|
|
|
}else { |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectDetailOV> currentPageData = records.subList(fromIndex, Math.min(fromIndex + pageSize, records.size())); |
|
|
|
result.setCurrent(pageNo).setSize(pageSize).setRecords(currentPageData).setTotal(records.size()); |
|
|
|
detailSortedList=records; |
|
|
|
} |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ProjectDetailOV> currentPageData = detailSortedList.subList(fromIndex, Math.min(fromIndex + pageSize, detailSortedList.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(detailSortedList.size()); |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
public List<ProjectSummaryOV> getSummarySortedList(List<ProjectSummaryOV> originalList,String orderBy,String orderDir){ |
|
|
|
List<ProjectSummaryOV> sortedList=new ArrayList<>(); |
|
|
|
List<Integer> projectNumList = originalList.stream().map(x -> x.getProjectNum()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> totalMoneyList = originalList.stream().map(x -> x.getTotalMoney()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> centralMoneyList = originalList.stream().map(x -> x.getCentralMoney()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> estimateMoneyList = originalList.stream().map(x -> x.getEstimateMoney()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> contractMoneyList = originalList.stream().map(x -> x.getContractMoney()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> contractCentralMoneyList = originalList.stream().map(x -> x.getContractCentralMoney()).collect(Collectors.toList()); |
|
|
|
List<String> projectProgressList = originalList.stream().map(x -> x.getProjectProgress()).collect(Collectors.toList()); |
|
|
|
List<ProjectSummaryOV> empList=new ArrayList<>(); |
|
|
|
|
|
|
|
if (Objects.equals(orderBy, "projectNum")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=projectNumList.isEmpty()?originalList:originalList.stream().sorted(Comparator.comparing(ProjectSummaryOV::getProjectNum).reversed()).collect(Collectors.toList()); |
|
|
|
} else if (Objects.equals(orderBy, "projectNum") && Objects.equals(orderDir, "ascend")) { |
|
|
|
sortedList=projectNumList.isEmpty()?originalList:originalList.stream().sorted(Comparator.comparing(ProjectSummaryOV::getProjectNum)).collect(Collectors.toList()); |
|
|
|
}else if (Objects.equals(orderBy, "totalMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=totalMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getTotalMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getTotalMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getTotalMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
} else if (Objects.equals(orderBy, "totalMoney") && Objects.equals(orderDir, "ascend")) { |
|
|
|
sortedList=totalMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getTotalMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getTotalMoney)).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getTotalMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "centralMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=centralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "centralMoney")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=centralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "estimateMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=estimateMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getEstimateMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getEstimateMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getEstimateMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
} else if (Objects.equals(orderBy, "estimateMoney") && Objects.equals(orderDir, "ascend")) { |
|
|
|
sortedList=estimateMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getEstimateMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getEstimateMoney)).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getEstimateMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=contractMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getContractMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractMoney")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=contractMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getContractMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractCentralMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=contractCentralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractCentralMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getContractCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractCentralMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractCentralMoney")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=contractCentralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractCentralMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getContractCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractCentralMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "projectProgress")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=projectProgressList.isEmpty()?originalList:originalList.stream().filter(x->x.getProjectProgress()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getProjectProgress).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getProjectProgress() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "projectProgress")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=projectProgressList.isEmpty()?originalList:originalList.stream().filter(x->x.getProjectProgress()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getProjectProgress).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getProjectProgress() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
} |
|
|
|
return sortedList; |
|
|
|
} |
|
|
|
public List<ProjectDetailOV> getDetailSortedList(List<ProjectDetailOV> originalList,String orderBy,String orderDir){ |
|
|
|
List<ProjectDetailOV> sortedList=new ArrayList<>(); |
|
|
|
List<Double> totalMoneyList = originalList.stream().map(x -> x.getTotalMoney()).collect(Collectors.toList()); |
|
|
|
List<Double> centralMoneyList = originalList.stream().map(x -> x.getCentralMoney()).collect(Collectors.toList()); |
|
|
|
List<Double> estimateMoneyList = originalList.stream().map(x -> x.getEstimateMoney()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> contractMoneyList = originalList.stream().map(x -> x.getContractMoney()).collect(Collectors.toList()); |
|
|
|
List<BigDecimal> contractCentralMoneyList = originalList.stream().map(x -> x.getContractCentralMoney()).collect(Collectors.toList()); |
|
|
|
List<String> projectProgressList = originalList.stream().map(x -> x.getProjectProgress()).collect(Collectors.toList()); |
|
|
|
List<ProjectDetailOV> empList=new ArrayList<>(); |
|
|
|
if (Objects.equals(orderBy, "totalMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=totalMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getTotalMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getTotalMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getTotalMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
} else if (Objects.equals(orderBy, "totalMoney") && Objects.equals(orderDir, "ascend")) { |
|
|
|
sortedList=totalMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getTotalMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getTotalMoney)).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getTotalMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "centralMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=centralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getCentralMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getCentralMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "centralMoney")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=centralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getCentralMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getCentralMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "estimateMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=estimateMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getEstimateMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getEstimateMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getEstimateMoney()== null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
} else if (Objects.equals(orderBy, "estimateMoney") && Objects.equals(orderDir, "ascend")) { |
|
|
|
sortedList=estimateMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getEstimateMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getEstimateMoney)).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getEstimateMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=contractMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getContractMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractMoney")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=contractMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getContractMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractCentralMoney")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=contractCentralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractCentralMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getContractCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractCentralMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "contractCentralMoney")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=contractCentralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getContractCentralMoney()!=null).sorted(Comparator.comparing(ProjectDetailOV::getContractCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractCentralMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "projectProgress")&& Objects.equals(orderDir, "descend")){ |
|
|
|
sortedList=projectProgressList.isEmpty()?originalList:originalList.stream().filter(x->x.getProjectProgress()!=null).sorted(Comparator.comparing(ProjectDetailOV::getProjectProgress).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getProjectProgress() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
}else if (Objects.equals(orderBy, "projectProgress")&& Objects.equals(orderDir, "ascend")){ |
|
|
|
sortedList=projectProgressList.isEmpty()?originalList:originalList.stream().filter(x->x.getProjectProgress()!=null).sorted(Comparator.comparing(ProjectDetailOV::getProjectProgress).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getProjectProgress() == null).collect(Collectors.toList()); |
|
|
|
sortedList.addAll(empList); |
|
|
|
} |
|
|
|
return sortedList; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<CountStageOV> countStage(HuzhouProjectinfo projectInfo){ |
|
|
|
List<CountStageOV> result = new ArrayList<>(); |
|
|
|
HashMap<String,Integer> stageMap=new HashMap<>(); |
|
|
@ -1588,4 +1778,32 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateTypeByImportFile (MultipartFile file) throws Exception { |
|
|
|
ImportParams importParams = new ImportParams(); |
|
|
|
HashMap<String,String> typeMap=new HashMap<>(); |
|
|
|
typeMap.put("入库项目","1"); |
|
|
|
typeMap.put("配套项目","2"); |
|
|
|
//表格标题行数,默认0
|
|
|
|
importParams.setTitleRows(0); |
|
|
|
//是否需要校验上传的Excel
|
|
|
|
importParams.setNeedVerify(true); |
|
|
|
ExcelImportResult<ImportTypeOV> result = ExcelImportUtil.importExcelMore(file.getInputStream(),ImportTypeOV.class,importParams); |
|
|
|
if (!result.getList().isEmpty()) { |
|
|
|
for (ImportTypeOV request : result.getList()) { |
|
|
|
HuzhouProjectinfo projectInfo=new HuzhouProjectinfo(); |
|
|
|
projectInfo.setProjectName(request.getName()); |
|
|
|
String s = typeMap.get(request.getType()); |
|
|
|
projectInfo.setType(s); |
|
|
|
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper=new LambdaUpdateWrapper<>(); |
|
|
|
updateWrapper.set(null,projectInfo); |
|
|
|
projectinfoMapper.updateById(projectInfo); |
|
|
|
} |
|
|
|
for (ImportTypeOV request : result.getFailList()) { |
|
|
|
System.out.println(request); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|