|
|
@ -1408,19 +1408,43 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
@Override |
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir){ |
|
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
|
List<String> dutyWorkplaceList=List.of("湖州市第一人民医院","湖州市中心医院","湖州市第三人民医院","湖州市妇幼保健院", "湖州市中医院", |
|
|
|
"医政处","妇幼处","科教处","体改处","规信处","中医处","财审处","机关党委","人事处"); |
|
|
|
List<String> adminDivisionList=List.of("吴兴区","南浔区","德清县","长兴县","安吉县"); |
|
|
|
//只要入库项目
|
|
|
|
projectInfo.setType("1"); |
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
Page page = new Page(1, 10000); |
|
|
|
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); |
|
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoList = projectAndChildInfoPageList.getRecords(); |
|
|
|
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()); |
|
|
|
//1、获取带权限的所有数据2、过滤出含有特定责任单位的数据3、针对这些数据去统计
|
|
|
|
//两个records最后合在一起,合完再排序
|
|
|
|
//责任单位
|
|
|
|
List<HuzhouProjectinfoOV> dutyWorkplaceGroup = projectAndChildInfoList.stream().filter(x -> dutyWorkplaceList.contains(x.getDutyWorkplace())).collect(Collectors.toList()); |
|
|
|
List<String> dutyWorkplaceGroupIds = dutyWorkplaceGroup.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
List<ProjectSummaryOV> projectSummaryPageListByDuty = projectinfoMapper.getProjectSummaryPageListByDuty(dutyWorkplaceGroupIds); |
|
|
|
for(ProjectSummaryOV p:projectSummaryPageListByDuty){ |
|
|
|
List<HuzhouProjectinfoOV> groupByDuty = dutyWorkplaceGroup.stream().filter(x -> x.getDutyWorkplace().equals(p.getDutyWorkplace())).collect(Collectors.toList()); |
|
|
|
List<String> projectIds = groupByDuty.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
String progress = this.countProgress(projectIds); |
|
|
|
p.setProjectProgress(progress); |
|
|
|
} |
|
|
|
//区县
|
|
|
|
List<HuzhouProjectinfoOV> adminDivisionGroup = projectAndChildInfoList.stream().filter(x -> adminDivisionList.contains(x.getAdminDivision())).collect(Collectors.toList()); |
|
|
|
List<String> adminDivisionGroupIds = adminDivisionGroup.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
List<ProjectSummaryOV> projectSummaryPageListByDivision = projectinfoMapper.getProjectSummaryPageListByAdminDivision(adminDivisionGroupIds); |
|
|
|
for(ProjectSummaryOV p:projectSummaryPageListByDivision){ |
|
|
|
List<HuzhouProjectinfoOV> groupByDuty = adminDivisionGroup.stream().filter(x -> x.getAdminDivision().equals(p.getAdminDivision())).collect(Collectors.toList()); |
|
|
|
List<String> projectIds = groupByDuty.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
String progress = this.countProgress(projectIds); |
|
|
|
p.setProjectProgress(progress); |
|
|
|
p.setDutyWorkplace(p.getAdminDivision()); |
|
|
|
} |
|
|
|
|
|
|
|
List<ProjectSummaryOV> projectSummaryPageList=new ArrayList<>(); |
|
|
|
projectSummaryPageList.addAll(projectSummaryPageListByDuty); |
|
|
|
projectSummaryPageList.addAll(projectSummaryPageListByDivision); |
|
|
|
//排序
|
|
|
|
if(!orderBy.equals("")&&!orderDir.equals("")){ |
|
|
|
List<ProjectSummaryOV> summarySortedList = this.getSummarySortedList(projectSummaryPageList, orderBy, orderDir); |
|
|
@ -1438,6 +1462,8 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public IPage<ProjectSummaryOV> getProjectSummaryPageByTask(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir){ |
|
|
|
IPage<ProjectSummaryOV> result = new Page<>(); |
|
|
@ -1579,13 +1605,41 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
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()); |
|
|
|
String[] splitArray = projectStage.split(","); |
|
|
|
if(splitArray.length>1){ |
|
|
|
List<String> spiltList = new ArrayList<>(Arrays.asList(splitArray)); |
|
|
|
List<String> paramsList = spiltList.stream().map(stageMap::get).collect(Collectors.toList()); |
|
|
|
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getProjectStage())).collect(Collectors.toList()); |
|
|
|
}else { |
|
|
|
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()); |
|
|
|
String[] splitArray = stepName.split(","); |
|
|
|
if(splitArray.length>1){ |
|
|
|
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray)); |
|
|
|
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getStepName())).collect(Collectors.toList()); |
|
|
|
}else { |
|
|
|
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()); |
|
|
|
String[] splitArray = isUpload.split(","); |
|
|
|
if(splitArray.length>1){ |
|
|
|
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray)); |
|
|
|
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getIsUpload())).collect(Collectors.toList()); |
|
|
|
}else { |
|
|
|
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()); |
|
|
|
String[] splitArray = isOffline.split(","); |
|
|
|
if(splitArray.length>1){ |
|
|
|
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray)); |
|
|
|
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getIsOffline())).collect(Collectors.toList()); |
|
|
|
}else { |
|
|
|
filteredList = tempList.stream().filter(x -> x.getIsOffline().equals(isOffline)).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
tempList.clear(); |
|
|
|
tempList.addAll(filteredList); |
|
|
@ -1629,12 +1683,12 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
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=centralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getCentralMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::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.getContractMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::getCentralMoney).reversed()).collect(Collectors.toList()); |
|
|
|
empList = originalList.stream().filter(x -> x.getContractMoney() == null).collect(Collectors.toList()); |
|
|
|
sortedList=centralMoneyList.isEmpty()?originalList:originalList.stream().filter(x->x.getCentralMoney()!=null).sorted(Comparator.comparing(ProjectSummaryOV::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(ProjectSummaryOV::getEstimateMoney).reversed()).collect(Collectors.toList()); |
|
|
@ -1795,6 +1849,10 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
projectInfo.setProjectName(request.getName()); |
|
|
|
String s = typeMap.get(request.getType()); |
|
|
|
projectInfo.setType(s); |
|
|
|
//根据项目名称获取id,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper=new LambdaUpdateWrapper<>(); |
|
|
|
updateWrapper.set(null,projectInfo); |
|
|
|
projectinfoMapper.updateById(projectInfo); |
|
|
|