diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java index d8bc0ef..01d7644 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java @@ -331,6 +331,20 @@ public class HuzhouProjectController { IPage result = projectinfoService.getProjectDetailPage(projectinfo, pageNo, pageSize,orderBy,orderDir,projectStage,stepName,isUpload,isOffline); return Result.ok(result); } + @GetMapping("/getStagePage") + public Result getStagePage(HuzhouProjectinfoOV projectinfo, + @RequestParam(name="current", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ + IPage result = projectinfoService.showStagePage(projectinfo, pageNo, pageSize); + return Result.ok(result); + } + @GetMapping("/countStageByRefrom") + public Result countStageByRefrom(HuzhouProjectinfoOV projectinfo, + @RequestParam(name="current", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ + IPage result = projectinfoService.countStageByRefrom(projectinfo, pageNo, pageSize); + return Result.ok(result); + } @GetMapping("/countStage") public Result countStage(HuzhouProjectinfoOV projectinfo){ List result = projectinfoService.countStage(projectinfo); diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java index fa4a986..99b1e62 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java @@ -196,6 +196,10 @@ public interface IHuzhouProjectinfoService extends IService { IPage getProjectDetailPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir, String projectStage,String stepName,String isUpload,String isOffline); + IPage showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize); + + IPage countStageByRefrom(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize); + List countStage(HuzhouProjectinfo projectInfo); void updateTypeByImportFile (MultipartFile file) throws Exception; diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java index b67780e..b7b8b0f 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java @@ -1889,6 +1889,121 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize){ + IPage result = new Page<>(); + List records=new ArrayList<>(); + HashMap stageMap=new HashMap<>(); + stageMap.put("0","项目申报阶段");//申报 + stageMap.put("1","项目立项阶段");//立项 + stageMap.put("2","项目采购阶段");//采购 + stageMap.put("3","项目建设阶段");//建设 + stageMap.put("4","绩效评估阶段");//绩效 + stageMap.put("5","项目验收阶段");//验收 + HashMap 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 projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page, projectInfoAuthSelect); + List 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 query=new LambdaQueryWrapper<>(); + query.eq(HuzhouPlaninfo::getProjectId,p.getId()); + List allPlanList = planinfoService.list(query); + List bigStagePlanList = allPlanList.stream().filter(x -> x.getSuperior().equals("0")).collect(Collectors.toList()); +// Map 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 query1=new LambdaQueryWrapper<>(); + query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); + query1.eq(HuzhouPlaninfo::getSuperior,"0"); + List planList = planinfoService.list(query1); + List 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 currentPageData = records.subList(fromIndex, Math.min(fromIndex + pageSize, records.size())); + result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectAndChildInfoList.size()); + return result; + } + public IPage countStageByRefrom(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize){ + IPage result = new Page<>(); + List re=new ArrayList<>(); + List records = showStagePage(projectInfo, 1, 10000).getRecords(); + Map> reformMap = records.stream().collect(Collectors.groupingBy(x -> x.getReformName())); + for(Map.Entry> entry : reformMap.entrySet()){ + CountStageByRefromOV countStageByRefromOV=new CountStageByRefromOV(); + List 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 currentPageData = re.subList(fromIndex, Math.min(fromIndex + pageSize, re.size())); + result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(reformMap.size()); + return result; + } @Override diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountStageByRefromOV.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountStageByRefromOV.java new file mode 100644 index 0000000..6479947 --- /dev/null +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountStageByRefromOV.java @@ -0,0 +1,31 @@ +package com.easy.admin.modules.huzhou.vo; + + +import lombok.Data; + +@Data +public class CountStageByRefromOV { + + private String reformName; + + private String superLeader; + + private String projectNum; + + private String declareNum; + + private String proposalNum; + + private String purchaseNum; + + private String buildNum; + + private String acceptanceNum; + + + + + + + +} diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ShowStageOV.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ShowStageOV.java new file mode 100644 index 0000000..4669168 --- /dev/null +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ShowStageOV.java @@ -0,0 +1,32 @@ +package com.easy.admin.modules.huzhou.vo; + + +import lombok.Data; + +@Data +public class ShowStageOV { + + private String reformName; + + private String superLeader; + + private String projectName; + + private String dutyWorkplace; + + private String declareStage; + + private String proposalStage; + + private String purchaseStage; + + private String buildStage; + + private String acceptanceStage; + + + + + + +}