diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java index d6ea4aa..636367d 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java @@ -91,9 +91,8 @@ public interface HuzhouProjectinfoMapper extends BaseMapper { List getIds(@Param("reformName") String reformName,@Param("superLeader") String superLeader); - List getTaskIds(@Param("planId") String planId); + List getTaskNames(@Param("planId") String planId); - List getTaskNames(@Param("taskIds") List taskIds); diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml index 4cbf055..c139ec5 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml @@ -543,15 +543,9 @@ order by create_date desc - - + \ No newline at end of file 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 de7cc23..b67780e 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 @@ -1536,14 +1536,26 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl query=new LambdaQueryWrapper<>(); query.eq(HuzhouPlaninfo::getProjectId,p.getId()); - query.eq(HuzhouPlaninfo::getIsfinish,"2"); - List levelList = planinfoService.list(query).stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); - String taskName; - if(!levelList.isEmpty()){ - List keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); + List allPlanList = planinfoService.list(query); + List allLevelList = allPlanList.stream().map(x -> x.getTaskLevel()).collect(Collectors.toList()); + List allLevelSplitList = allPlanList.stream().map(x -> x.getTaskLevel().split("\\.")).filter(x -> x.length == 2).collect(Collectors.toList()); + int globlFirstMax = allLevelSplitList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); + int globlSecondMax = allLevelSplitList.stream().filter(x->Integer.parseInt(x[0])==globlFirstMax).mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); + List onGoingList = allPlanList.stream().filter(x -> x.getIsfinish().equals("1")).collect(Collectors.toList()); + List isFinishList = allPlanList.stream().filter(x -> x.getIsfinish().equals("2")).collect(Collectors.toList()); + List onGoingLevelList = onGoingList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); + List isFinishlevelList = isFinishList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); + if(!isFinishlevelList.isEmpty()){ + List keyList = isFinishlevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); int max = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); String key=String.valueOf(max); taskName=stageMap.get(key); @@ -1551,50 +1563,62 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl query1=new LambdaQueryWrapper<>(); - query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); - query1.eq(HuzhouPlaninfo::getIsfinish,"1"); - List onGoingList = planinfoService.list(query1); - List onGoingLevelList = onGoingList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); - String defaultStepName=""; - String currentIsUpload="";//当前审批节点 - String currentStepName=""; - if(!onGoingLevelList.isEmpty()){//有1取1,多1取最大 - List onGoingKeyList = onGoingLevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); - int firstMax = onGoingKeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); - List onGoingKeyFilterList = onGoingKeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); - int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); - String level=firstMax+"."+secondMax; - currentStepName=planinfoMapper.getTaskName(p.getId(),level); - //当前审批节点 - String planId = onGoingList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId(); - List taskIds = projectinfoMapper.getTaskIds(planId); - List taskNames = projectinfoMapper.getTaskNames(taskIds); - currentIsUpload= String.join(",", taskNames); - } - else if(onGoingLevelList.isEmpty() && !levelList.isEmpty()){//没有1,有2,取2的下一个(planList,找到最大2的位置,取该位置+1的值) - List keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); - int firstMax = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); - List finsishKeyFilterList = keyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); - int secondMax = finsishKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); - String level=firstMax+"."+secondMax; - defaultStepName=planinfoMapper.getTaskName(p.getId(),level); - LambdaQueryWrapper query2=new LambdaQueryWrapper<>(); - query2.eq(HuzhouPlaninfo::getProjectId,p.getId()); - List allPlanList = planinfoService.list(query2); - List taskList = allPlanList.stream().map(x -> x.getTaskName()).collect(Collectors.toList()); - int index = taskList.indexOf(defaultStepName); - currentStepName=taskList.get(index+1); - String planId = allPlanList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId(); - List executionIds = projectinfoMapper.getTaskIds(planId); - List taskNames = projectinfoMapper.getTaskNames(executionIds); - currentIsUpload= String.join(",", taskNames); + //如果当前阶段为项目申报阶段,当前所处节点、当前审批节点和线下完成情况都不显示 + if(!taskName.equals("项目申报阶段")) { + if (!onGoingLevelList.isEmpty()) { + currentLevel = "";//有1取1,多1取最大 + List onGoingKeyList = onGoingLevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); + int firstMax = onGoingKeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); + List onGoingKeyFilterList = onGoingKeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); + int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); + String level = firstMax + "." + secondMax; + currentStepName = planinfoMapper.getTaskName(p.getId(), level); + //当前审批节点 + String planId = onGoingList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId(); + List taskNames = projectinfoMapper.getTaskNames(planId); + if (taskNames.size() > 0) { + currentIsUpload = String.join(",", taskNames); + } + } else {//没有1,有2,取2的下一个(planList,找到最大2的位置,取该位置+1的值) + List isFinishkeyList = isFinishlevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); + int firstMax = isFinishkeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); + List isFinsishKeyFilterList = isFinishkeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); + int secondMax = isFinsishKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); + String level = firstMax + "." + secondMax; + int newSecondMax = secondMax + 1; + String tempLevel=firstMax + "." + newSecondMax; + //如果包含,则说明有这个level,不包含则有两种情况,1是level的fistMax+1,还有一种情况是当前的level已经是最后一个level了 + //怎么判断是不是最后一个level?全局最大 + if (!allLevelList.contains(tempLevel)) { + if (firstMax == globlFirstMax && secondMax == globlSecondMax) {//当前level最后一个level + currentLevel = level; + } else { + int firstIndex = Integer.parseInt(tempLevel.split("\\.")[0])+1; + currentLevel = firstIndex + "." + 1; + } + } + else {//包含,则第二位+1 + currentLevel=tempLevel; + } + currentStepName = planinfoMapper.getTaskName(p.getId(), currentLevel); + String planId = allPlanList.stream().filter(x -> x.getTaskLevel().equals(currentLevel)).collect(Collectors.toList()).get(0).getId(); + List taskNames = projectinfoMapper.getTaskNames(planId); + if (taskNames.size() > 0) { + currentIsUpload = String.join(",", taskNames); + } + } + List stepNameList=List.of("可研报告初稿编制","可研技术审查报告确认","造价评估报告确认"); + if(currentIsUpload.equals("")){ + if(stepNameList.contains(currentStepName)){ + currentIsUpload="总咨询单位"; + }else { + currentIsUpload="发起人"; + } + } + } else { + currentLevel = ""; } - projectDetail.setStepName(currentStepName); - projectDetail.setIsUpload(currentIsUpload); //线下完成情况 - String isOfflineStepName=""; List isOfflineList = planinfoMapper.getIsOffline(p.getId()).stream().map(x->x.split("\\.")).collect(Collectors.toList()); if(isOfflineList.size()>0){ List isOfflinekeyList = isOfflineList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); @@ -1604,6 +1628,10 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl projectIds=new ArrayList<>();