|
@ -1330,55 +1330,77 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize){ |
|
|
// public IPage<ProjectSummaryOV> getProjectSummaryPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize){
|
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
// IPage<ProjectSummaryOV> result = new Page<>();
|
|
|
List<ProjectSummaryOV> records=new ArrayList<>(); |
|
|
// List<ProjectSummaryOV> records=new ArrayList<>();
|
|
|
//只要入库项目
|
|
|
// //只要入库项目
|
|
|
projectInfo.setType("1"); |
|
|
// projectInfo.setType("1");
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
// ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo);
|
|
|
Page page = new Page(1, 10000); |
|
|
// Page page = new Page(1, 10000);
|
|
|
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); |
|
|
// Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect);
|
|
|
Map<String, List<HuzhouProjectinfoOV>> projectsMap = projectAndChildInfoPageList.getRecords().stream().collect(Collectors.groupingBy(x -> x.getDutyWorkplace())); |
|
|
// Map<String, List<HuzhouProjectinfoOV>> projectsMap = projectAndChildInfoPageList.getRecords().stream().collect(Collectors.groupingBy(x -> x.getDutyWorkplace()));
|
|
|
for(Map.Entry<String, List<HuzhouProjectinfoOV>> entry : projectsMap.entrySet()){ |
|
|
// for(Map.Entry<String, List<HuzhouProjectinfoOV>> entry : projectsMap.entrySet()){
|
|
|
ProjectSummaryOV projectSummary=new ProjectSummaryOV(); |
|
|
// ProjectSummaryOV projectSummary=new ProjectSummaryOV();
|
|
|
projectSummary.setDutyWorkplace(entry.getKey()); |
|
|
// projectSummary.setDutyWorkplace(entry.getKey());
|
|
|
projectSummary.setProjectNum(entry.getValue().size()); |
|
|
// projectSummary.setProjectNum(entry.getValue().size());
|
|
|
List<Double> totalList = entry.getValue().stream().map(x->Optional.ofNullable(x.getTotalMoney()).orElse(0.00)).collect(Collectors.toList()); |
|
|
// List<Double> totalList = entry.getValue().stream().map(x->Optional.ofNullable(x.getTotalMoney()).orElse(0.00)).collect(Collectors.toList());
|
|
|
double total = totalList.isEmpty()? 0.00 : totalList.stream().reduce(0.00, Double::sum); |
|
|
// double total = totalList.isEmpty()? 0.00 : totalList.stream().reduce(0.00, Double::sum);
|
|
|
BigDecimal totalMoney = new BigDecimal(String.valueOf(total)); |
|
|
// BigDecimal totalMoney = new BigDecimal(String.valueOf(total));
|
|
|
projectSummary.setTotalMoney(totalMoney); |
|
|
// projectSummary.setTotalMoney(totalMoney);
|
|
|
List<Double> estimatedList = entry.getValue().stream().map(x->Optional.ofNullable(x.getUrtEstimatedAmount()).orElse(0.00)).collect(Collectors.toList()); |
|
|
// List<Double> estimatedList = entry.getValue().stream().map(x->Optional.ofNullable(x.getUrtEstimatedAmount()).orElse(0.00)).collect(Collectors.toList());
|
|
|
Double estimate = estimatedList.isEmpty()? 0.00 : estimatedList.stream().reduce(0.00, Double::sum); |
|
|
// Double estimate = estimatedList.isEmpty()? 0.00 : estimatedList.stream().reduce(0.00, Double::sum);
|
|
|
BigDecimal estimateMoney = new BigDecimal(String.valueOf(estimate)); |
|
|
// BigDecimal estimateMoney = new BigDecimal(String.valueOf(estimate));
|
|
|
projectSummary.setEstimateMoney(estimateMoney); |
|
|
// projectSummary.setEstimateMoney(estimateMoney);
|
|
|
List<Double> centralList = entry.getValue().stream().map(x->Optional.ofNullable(x.getCentralMoney()).orElse(0.00)).collect(Collectors.toList()); |
|
|
// List<Double> centralList = entry.getValue().stream().map(x->Optional.ofNullable(x.getCentralMoney()).orElse(0.00)).collect(Collectors.toList());
|
|
|
double central = centralList.isEmpty()? 0.00 : centralList.stream().reduce(0.00, Double::sum); |
|
|
// double central = centralList.isEmpty()? 0.00 : centralList.stream().reduce(0.00, Double::sum);
|
|
|
BigDecimal centralMoney = new BigDecimal(String.valueOf(central)); |
|
|
// BigDecimal centralMoney = new BigDecimal(String.valueOf(central));
|
|
|
projectSummary.setCentralMoney(centralMoney); |
|
|
// projectSummary.setCentralMoney(centralMoney);
|
|
|
List<String> ids = entry.getValue().stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
// List<String> ids = entry.getValue().stream().map(x -> x.getId()).collect(Collectors.toList());
|
|
|
BigDecimal contractMoney=new BigDecimal("0"); |
|
|
// BigDecimal contractMoney=new BigDecimal("0");
|
|
|
BigDecimal contractCentralMoney=new BigDecimal("0"); |
|
|
// BigDecimal contractCentralMoney=new BigDecimal("0");
|
|
|
if(!ids.isEmpty()){ |
|
|
// if(!ids.isEmpty()){
|
|
|
Map<String, BigDecimal> moneyMap = projectinfoMapper.countMoneyByIds(ids); |
|
|
// Map<String, BigDecimal> moneyMap = projectinfoMapper.countMoneyByIds(ids);
|
|
|
if(moneyMap != null && moneyMap.isEmpty()){ |
|
|
// if(moneyMap != null && moneyMap.isEmpty()){
|
|
|
contractMoney=Optional.ofNullable(moneyMap.get("contractMoney")).orElse(new BigDecimal("0")); |
|
|
// contractMoney=Optional.ofNullable(moneyMap.get("contractMoney")).orElse(new BigDecimal("0"));
|
|
|
contractCentralMoney=Optional.ofNullable(moneyMap.get("contractCentralMoney")).orElse(new BigDecimal("0")); |
|
|
// contractCentralMoney=Optional.ofNullable(moneyMap.get("contractCentralMoney")).orElse(new BigDecimal("0"));
|
|
|
} |
|
|
// }
|
|
|
projectSummary.setContractMoney(contractMoney); |
|
|
// projectSummary.setContractMoney(contractMoney);
|
|
|
projectSummary.setContractCentralMoney(contractCentralMoney); |
|
|
// projectSummary.setContractCentralMoney(contractCentralMoney);
|
|
|
} |
|
|
// }
|
|
|
ProjectProgressOV progress = this.getProgress(ids); |
|
|
// ProjectProgressOV progress = this.getProgress(ids);
|
|
|
projectSummary.setProjectProgress(progress.getProjectProgress()); |
|
|
// projectSummary.setProjectProgress(progress.getProjectProgress());
|
|
|
records.add(projectSummary); |
|
|
// records.add(projectSummary);
|
|
|
} |
|
|
// }
|
|
|
//手动分页
|
|
|
// //手动分页
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
// int fromIndex = (pageNo - 1) * pageSize;
|
|
|
List<ProjectSummaryOV> currentPageData = records.subList(fromIndex, Math.min(fromIndex + pageSize, records.size())); |
|
|
// List<ProjectSummaryOV> currentPageData = records.subList(fromIndex, Math.min(fromIndex + pageSize, records.size()));
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(records.size()); |
|
|
// result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(records.size());
|
|
|
return result; |
|
|
// return result;
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
} |
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize){ |
|
|
|
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
|
|
|
//只要入库项目
|
|
|
|
|
|
projectInfo.setType("1"); |
|
|
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
|
|
Page page = new Page(1, 10000); |
|
|
|
|
|
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); |
|
|
|
|
|
List<String> ids = projectAndChildInfoPageList.getRecords().stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
|
|
List<ProjectSummaryOV> projectSummaryPageList = projectinfoMapper.getProjectSummaryPageListByDuty(ids); |
|
|
|
|
|
for(ProjectSummaryOV p:projectSummaryPageList){ |
|
|
|
|
|
List<HuzhouProjectinfoOV> groupByDuty = projectAndChildInfoPageList.getRecords().stream().filter(x -> x.getDutyWorkplace().equals(p.getDutyWorkplace())).collect(Collectors.toList()); |
|
|
|
|
|
List<String> projectIds = groupByDuty.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
|
|
ProjectProgressOV progress = this.getProgress(projectIds); |
|
|
|
|
|
p.setProjectProgress(progress.getProjectProgress()); |
|
|
|
|
|
} |
|
|
|
|
|
//手动分页
|
|
|
|
|
|
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){ |
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPageByTask(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize){ |
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
//只要入库项目
|
|
|
//只要入库项目
|
|
@ -1387,9 +1409,10 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
Page page = new Page(1, 10000); |
|
|
Page page = new Page(1, 10000); |
|
|
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); |
|
|
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); |
|
|
List<String> ids = projectAndChildInfoPageList.getRecords().stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
List<String> ids = projectAndChildInfoPageList.getRecords().stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
List<ProjectSummaryOV> projectSummaryPageList = projectinfoMapper.getProjectSummaryPageList(ids); |
|
|
List<ProjectSummaryOV> projectSummaryPageList = projectinfoMapper.getProjectSummaryPageListByTask(ids); |
|
|
for(ProjectSummaryOV p:projectSummaryPageList){ |
|
|
for(ProjectSummaryOV p:projectSummaryPageList){ |
|
|
List<String> projectIds = projectinfoMapper.getIds(p.getReformName(), p.getSuperLeader()); |
|
|
List<HuzhouProjectinfoOV> groupByTask = projectAndChildInfoPageList.getRecords().stream().filter(x -> x.getReformName().equals(p.getReformName()) && x.getSuperLeader().equals(p.getSuperLeader())).collect(Collectors.toList()); |
|
|
|
|
|
List<String> projectIds = groupByTask.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
ProjectProgressOV progress = this.getProgress(projectIds); |
|
|
ProjectProgressOV progress = this.getProgress(projectIds); |
|
|
p.setProjectProgress(progress.getProjectProgress()); |
|
|
p.setProjectProgress(progress.getProjectProgress()); |
|
|
} |
|
|
} |
|
|