Browse Source

新增需求

changchun
Jinyuanyuan 2 months ago
parent
commit
a65add6f1f
  1. 14
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java
  2. 4
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java
  3. 115
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java
  4. 31
      huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountStageByRefromOV.java
  5. 32
      huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ShowStageOV.java

14
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java

@ -331,6 +331,20 @@ public class HuzhouProjectController {
IPage<ProjectDetailOV> result = projectinfoService.getProjectDetailPage(projectinfo, pageNo, pageSize,orderBy,orderDir,projectStage,stepName,isUpload,isOffline); IPage<ProjectDetailOV> result = projectinfoService.getProjectDetailPage(projectinfo, pageNo, pageSize,orderBy,orderDir,projectStage,stepName,isUpload,isOffline);
return Result.ok(result); 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<ShowStageOV> 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<CountStageByRefromOV> result = projectinfoService.countStageByRefrom(projectinfo, pageNo, pageSize);
return Result.ok(result);
}
@GetMapping("/countStage") @GetMapping("/countStage")
public Result<?> countStage(HuzhouProjectinfoOV projectinfo){ public Result<?> countStage(HuzhouProjectinfoOV projectinfo){
List<CountStageOV> result = projectinfoService.countStage(projectinfo); List<CountStageOV> result = projectinfoService.countStage(projectinfo);

4
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java

@ -196,6 +196,10 @@ public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo> {
IPage<ProjectDetailOV> getProjectDetailPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir, IPage<ProjectDetailOV> getProjectDetailPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir,
String projectStage,String stepName,String isUpload,String isOffline); String projectStage,String stepName,String isUpload,String isOffline);
IPage<ShowStageOV> showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize);
IPage<CountStageByRefromOV> countStageByRefrom(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize);
List<CountStageOV> countStage(HuzhouProjectinfo projectInfo); List<CountStageOV> countStage(HuzhouProjectinfo projectInfo);
void updateTypeByImportFile (MultipartFile file) throws Exception; void updateTypeByImportFile (MultipartFile file) throws Exception;

115
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

@ -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

31
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;
}

32
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;
}
Loading…
Cancel
Save