|
@ -1889,6 +1889,121 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
return result; |
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
public IPage<ShowStageOV> showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize){ |
|
|
|
|
|
IPage<ShowStageOV> result = new Page<>(); |
|
|
|
|
|
List<ShowStageOV> records=new ArrayList<>(); |
|
|
|
|
|
HashMap<String,String> stageMap=new HashMap<>(); |
|
|
|
|
|
stageMap.put("0","项目申报阶段");//申报
|
|
|
|
|
|
stageMap.put("1","项目立项阶段");//立项
|
|
|
|
|
|
stageMap.put("2","项目采购阶段");//采购
|
|
|
|
|
|
stageMap.put("3","项目建设阶段");//建设
|
|
|
|
|
|
stageMap.put("4","绩效评估阶段");//绩效
|
|
|
|
|
|
stageMap.put("5","项目验收阶段");//验收
|
|
|
|
|
|
HashMap<String,String> valueMap=new HashMap<>(); |
|
|
|
|
|
valueMap.put("0","");//申报
|
|
|
|
|
|
valueMap.put("1","");//立项
|
|
|
|
|
|
valueMap.put("2","");//采购
|
|
|
|
|
|
valueMap.put("3","");//建设
|
|
|
|
|
|
valueMap.put("4","");//绩效
|
|
|
|
|
|
valueMap.put("5","");//验收
|
|
|
|
|
|
//只要入库项目
|
|
|
|
|
|
projectInfo.setType("1"); |
|
|
|
|
|
projectInfo.setDutyWorkplace(projectInfo.getDutyWorkplace()); |
|
|
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
|
|
Page page = new Page(1, 10000); |
|
|
|
|
|
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); |
|
|
|
|
|
List<HuzhouProjectinfoOV> projectAndChildInfoList = projectAndChildInfoPageList.getRecords().stream().collect(Collectors.toList()); |
|
|
|
|
|
for(HuzhouProjectinfoOV p:projectAndChildInfoList){ |
|
|
|
|
|
// HuzhouProjectinfoOV p = projectAndChildInfoList.stream().filter(x -> x.getId().equals("1808752649789734913")).collect(Collectors.toList()).get(0);
|
|
|
|
|
|
ShowStageOV showStage=new ShowStageOV(); |
|
|
|
|
|
BeanUtils.copyProperties(p,showStage); |
|
|
|
|
|
String declareStage=""; |
|
|
|
|
|
String proposalStage=""; |
|
|
|
|
|
String purchaseStage=""; |
|
|
|
|
|
String buildStage=""; |
|
|
|
|
|
String acceptanceStage=""; |
|
|
|
|
|
//申报阶段完成情况,项目申报完成2以后的是完成,待申报0的是未完成,申报中1是进行中
|
|
|
|
|
|
if(p.getStage().equals("0")){ |
|
|
|
|
|
declareStage="未完成"; |
|
|
|
|
|
}else if(p.getStage().equals("1")){ |
|
|
|
|
|
declareStage="进行中"; |
|
|
|
|
|
}else { |
|
|
|
|
|
declareStage="已完成"; |
|
|
|
|
|
} |
|
|
|
|
|
showStage.setDeclareStage(declareStage); |
|
|
|
|
|
//申报阶段以后的
|
|
|
|
|
|
//找大阶段,为2则是完成,0是未完成或未开始
|
|
|
|
|
|
//对于0的该大阶段里的小阶段,如果全是0的就是为完成,如果不全是0的就是进行中
|
|
|
|
|
|
LambdaQueryWrapper<HuzhouPlaninfo> query=new LambdaQueryWrapper<>(); |
|
|
|
|
|
query.eq(HuzhouPlaninfo::getProjectId,p.getId()); |
|
|
|
|
|
List<HuzhouPlaninfo> allPlanList = planinfoService.list(query); |
|
|
|
|
|
List<HuzhouPlaninfo> bigStagePlanList = allPlanList.stream().filter(x -> x.getSuperior().equals("0")).collect(Collectors.toList()); |
|
|
|
|
|
// Map<String, HuzhouPlaninfo> bigStagePlanMap = allPlanList.stream().filter(x->x.getSuperior().equals("0")).collect(Collectors.toMap(x -> x.getTaskName(), o -> o));
|
|
|
|
|
|
for(HuzhouPlaninfo plan:bigStagePlanList){ |
|
|
|
|
|
String level = plan.getTaskLevel(); |
|
|
|
|
|
if (plan.getIsfinish().equals("2")){ |
|
|
|
|
|
valueMap.put(level,"已完成"); |
|
|
|
|
|
}else { |
|
|
|
|
|
LambdaQueryWrapper<HuzhouPlaninfo> query1=new LambdaQueryWrapper<>(); |
|
|
|
|
|
query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); |
|
|
|
|
|
query1.eq(HuzhouPlaninfo::getSuperior,"0"); |
|
|
|
|
|
List<HuzhouPlaninfo> planList = planinfoService.list(query1); |
|
|
|
|
|
List<String> collect = planList.stream().map(x -> x.getIsfinish()).collect(Collectors.toList()); |
|
|
|
|
|
if(collect.contains("1")||collect.contains("2")){ |
|
|
|
|
|
valueMap.put(level,"进行中"); |
|
|
|
|
|
}else { |
|
|
|
|
|
valueMap.put(level,"未完成"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
showStage.setProposalStage(valueMap.get("1")); |
|
|
|
|
|
showStage.setPurchaseStage(valueMap.get("2")); |
|
|
|
|
|
showStage.setBuildStage(valueMap.get("3")); |
|
|
|
|
|
showStage.setAcceptanceStage(valueMap.get("5")); |
|
|
|
|
|
records.add(showStage); |
|
|
|
|
|
} |
|
|
|
|
|
//手动分页
|
|
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
|
|
List<ShowStageOV> currentPageData = records.subList(fromIndex, Math.min(fromIndex + pageSize, records.size())); |
|
|
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectAndChildInfoList.size()); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
public IPage<CountStageByRefromOV> countStageByRefrom(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize){ |
|
|
|
|
|
IPage<CountStageByRefromOV> result = new Page<>(); |
|
|
|
|
|
List<CountStageByRefromOV> re=new ArrayList<>(); |
|
|
|
|
|
List<ShowStageOV> records = showStagePage(projectInfo, 1, 10000).getRecords(); |
|
|
|
|
|
Map<String, List<ShowStageOV>> reformMap = records.stream().collect(Collectors.groupingBy(x -> x.getReformName())); |
|
|
|
|
|
for(Map.Entry<String, List<ShowStageOV>> entry : reformMap.entrySet()){ |
|
|
|
|
|
CountStageByRefromOV countStageByRefromOV=new CountStageByRefromOV(); |
|
|
|
|
|
List<ShowStageOV> value = entry.getValue(); |
|
|
|
|
|
Integer projectNum=value.size(); |
|
|
|
|
|
Integer declareNum=0; |
|
|
|
|
|
Integer proposalNum=0; |
|
|
|
|
|
Integer purchaseNum=0; |
|
|
|
|
|
Integer buildNum=0; |
|
|
|
|
|
Integer acceptanceNum=0; |
|
|
|
|
|
countStageByRefromOV.setReformName(value.get(0).getReformName()); |
|
|
|
|
|
countStageByRefromOV.setSuperLeader(value.get(0).getSuperLeader()); |
|
|
|
|
|
declareNum=value.stream().filter(x->x.getDeclareStage().equals("已完成")).collect(Collectors.toList()).size(); |
|
|
|
|
|
proposalNum=value.stream().filter(x->x.getProposalStage().equals("已完成")).collect(Collectors.toList()).size(); |
|
|
|
|
|
purchaseNum=value.stream().filter(x->x.getPurchaseStage().equals("已完成")).collect(Collectors.toList()).size(); |
|
|
|
|
|
buildNum=value.stream().filter(x->x.getBuildStage().equals("已完成")).collect(Collectors.toList()).size(); |
|
|
|
|
|
acceptanceNum=value.stream().filter(x->x.getAcceptanceStage().equals("已完成")).collect(Collectors.toList()).size(); |
|
|
|
|
|
countStageByRefromOV.setProjectNum(projectNum.toString()); |
|
|
|
|
|
countStageByRefromOV.setDeclareNum(declareNum.toString()); |
|
|
|
|
|
countStageByRefromOV.setProposalNum(proposalNum.toString()); |
|
|
|
|
|
countStageByRefromOV.setPurchaseNum(purchaseNum.toString()); |
|
|
|
|
|
countStageByRefromOV.setBuildNum(buildNum.toString()); |
|
|
|
|
|
countStageByRefromOV.setAcceptanceNum(acceptanceNum.toString()); |
|
|
|
|
|
re.add(countStageByRefromOV); |
|
|
|
|
|
} |
|
|
|
|
|
//手动分页
|
|
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
|
|
List<CountStageByRefromOV> currentPageData = re.subList(fromIndex, Math.min(fromIndex + pageSize, re.size())); |
|
|
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(reformMap.size()); |
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|