zhouhaibin 4 weeks ago
parent
commit
ebe2e82d12
  1. 13
      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. 150
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

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

@ -334,8 +334,17 @@ public class HuzhouProjectController {
@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);
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@RequestParam(name="declareStage", defaultValue="") String declareStage,
@RequestParam(name="reviewStage", defaultValue="") String reviewStage,
@RequestParam(name="verifyStage", defaultValue="") String verifyStage,
@RequestParam(name="approvalStage", defaultValue="") String approvalStage,
@RequestParam(name="purchaseStage", defaultValue="") String purchaseStage,
@RequestParam(name="buildStage", defaultValue="") String buildStage,
@RequestParam(name="acceptanceStage", defaultValue="") String acceptanceStage){
IPage<ShowStageOV> result = projectinfoService.showStagePage(projectinfo, pageNo, pageSize,
declareStage,reviewStage,verifyStage,approvalStage,
purchaseStage,buildStage,acceptanceStage);
return Result.ok(result);
}
@GetMapping("/countStageByRefrom")

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

@ -196,7 +196,9 @@ public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo> {
IPage<ProjectDetailOV> getProjectDetailPage(HuzhouProjectinfo projectInfo, Integer pageNo, Integer pageSize,String orderBy,String orderDir,
String projectStage,String stepName,String isUpload,String isOffline);
IPage<ShowStageOV> showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize);
IPage<ShowStageOV> showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize,
String declareStage,String reviewStage,String verifyStage, String approvalStage,
String purchaseStage,String buildStage,String acceptanceStage);
IPage<CountStageByRefromOV> countStageByRefrom(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize);

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

@ -1890,7 +1890,9 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
}
public IPage<ShowStageOV> showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize){
public IPage<ShowStageOV> showStagePage(HuzhouProjectinfo projectInfo,Integer pageNo, Integer pageSize,
String declareStage,String reviewStage,String verifyStage, String approvalStage,
String purchaseStage,String buildStage,String acceptanceStage){
IPage<ShowStageOV> result = new Page<>();
List<ShowStageOV> records=new ArrayList<>();
HashMap<String,String> stageMap=new HashMap<>();
@ -1915,23 +1917,19 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
for(HuzhouProjectinfoOV p:projectAndChildInfoList){
ShowStageOV showStage=new ShowStageOV();
BeanUtils.copyProperties(p,showStage);
String declareStage="";
String proposalStage="";
String purchaseStage="";
String buildStage="";
String acceptanceStage="";
String reviewStage;
String verifyStage;
String approvalStage;
String declareStageName="";
String reviewStageName;
String verifyStageName;
String approvalStageName;
//申报阶段完成情况,项目申报完成2以后的是完成,待申报0的是未完成,申报中1是进行中
if(p.getStage().equals("0")){
declareStage="未完成";
declareStageName="未完成";
}else if(p.getStage().equals("1")){
declareStage="进行中";
declareStageName="进行中";
}else {
declareStage="已完成";
declareStageName="已完成";
}
showStage.setDeclareStage(declareStage);
showStage.setDeclareStage(declareStageName);
//申报阶段以后的
//找大阶段,为2则是完成,0是未完成或未开始
//对于0的该大阶段里的小阶段,如果全是0的就是为完成,如果不全是0的就是进行中
@ -1968,57 +1966,149 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
if(reviewList.size()>0){
String review =reviewList.get(0).getIsfinish();
if(review.equals("2")){
reviewStage="已完成";
reviewStageName="已完成";
} else if (review.equals("1")) {
reviewStage="进行中";
reviewStageName="进行中";
}else {
reviewStage="未完成";
reviewStageName="未完成";
}
}else {
reviewStage="未完成";
reviewStageName="未完成";
}
if(verifyList.size()>0){
String verify =verifyList.get(0).getIsfinish();
if(verify.equals("2")){
verifyStage="已完成";
verifyStageName="已完成";
} else if (verify.equals("1")) {
verifyStage="进行中";
verifyStageName="进行中";
}else {
verifyStage="未完成";
verifyStageName="未完成";
}
}else {
verifyStage="未完成";
verifyStageName="未完成";
}
if(approvalList.size()>0){
String approval =approvalList.get(0).getIsfinish();
if(approval.equals("2")){
approvalStage="已完成";
approvalStageName="已完成";
} else if (approval.equals("1")) {
approvalStage="进行中";
approvalStageName="进行中";
}else {
approvalStage="未完成";
approvalStageName="未完成";
}
}else {
approvalStage="未完成";
approvalStageName="未完成";
}
showStage.setReviewStage(reviewStage);
showStage.setVerifyStage(verifyStage);
showStage.setApprovalStage(approvalStage);
showStage.setReviewStage(reviewStageName);
showStage.setVerifyStage(verifyStageName);
showStage.setApprovalStage(approvalStageName);
records.add(showStage);
}
//先筛选再排序
List<ShowStageOV> detailSortedList=new ArrayList<>();
List<String> conditionList=new ArrayList<>();
//筛选条件集合
HashMap<String,String> filterMap= new HashMap<>();
filterMap.put("declareStage",declareStage);
filterMap.put("reviewStage",reviewStage);
filterMap.put("verifyStage",verifyStage);
filterMap.put("approvalStage",approvalStage);
filterMap.put("purchaseStage",purchaseStage);
filterMap.put("buildStage",buildStage);
filterMap.put("acceptanceStage",acceptanceStage);
for (Map.Entry<String, String> entry : filterMap.entrySet()){
if (!entry.getValue().equals("")){
conditionList.add(entry.getKey());
}
}
//筛选
if(!conditionList.isEmpty()){
List<ShowStageOV> tempList=new ArrayList<>();
tempList.addAll(records);
List<ShowStageOV> filteredList=new ArrayList<>();
for(String condition:conditionList){
if(condition.equals("declareStage")){
String[] splitArray = declareStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getDeclareStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getDeclareStage().equals(declareStage)).collect(Collectors.toList());
}
}else if (condition.equals("reviewStage")){
String[] splitArray = reviewStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getReviewStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getReviewStage().equals(reviewStage)).collect(Collectors.toList());
}
} else if (condition.equals("verifyStage")) {
String[] splitArray = verifyStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getVerifyStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getVerifyStage().equals(verifyStage)).collect(Collectors.toList());
}
}else if (condition.equals("approvalStage")){
String[] splitArray = approvalStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getApprovalStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getApprovalStage().equals(approvalStage)).collect(Collectors.toList());
}
} else if (condition.equals("purchaseStage")) {
String[] splitArray = purchaseStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getPurchaseStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getPurchaseStage().equals(purchaseStage)).collect(Collectors.toList());
}
}else if (condition.equals("buildStage")){
String[] splitArray = buildStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getBuildStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getBuildStage().equals(buildStage)).collect(Collectors.toList());
}
} else if (condition.equals("acceptanceStage")) {
String[] splitArray = acceptanceStage.split(",");
if(splitArray.length>1){
List<String> paramsList = new ArrayList<>(Arrays.asList(splitArray));
filteredList = tempList.stream().filter(x -> paramsList.contains(x.getAcceptanceStage())).collect(Collectors.toList());
}else {
filteredList = tempList.stream().filter(x -> x.getAcceptanceStage().equals(acceptanceStage)).collect(Collectors.toList());
}
}
tempList.clear();
tempList.addAll(filteredList);
}
records=filteredList;
}
List<ShowStageOV> sortedRecord = records.stream().filter(x -> x.getSort() != null).sorted(Comparator.comparingInt(ShowStageOV::getSort)).collect(Collectors.toList());
List<ShowStageOV> commonRecord = records.stream().filter(x -> x.getSort() == null).collect(Collectors.toList());
sortedRecord.addAll(commonRecord);
//手动分页
int fromIndex = (pageNo - 1) * pageSize;
List<ShowStageOV> currentPageData = sortedRecord.subList(fromIndex, Math.min(fromIndex + pageSize, records.size()));
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectAndChildInfoList.size());
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(records.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();
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();

Loading…
Cancel
Save