Browse Source

需求优化

changchun
Jinyuanyuan 2 months ago
parent
commit
7d7b1d4400
  1. 3
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java
  2. 12
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml
  3. 124
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

3
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java

@ -91,9 +91,8 @@ public interface HuzhouProjectinfoMapper extends BaseMapper<HuzhouProjectinfo> {
List<String> getIds(@Param("reformName") String reformName,@Param("superLeader") String superLeader); List<String> getIds(@Param("reformName") String reformName,@Param("superLeader") String superLeader);
List<String> getTaskIds(@Param("planId") String planId); List<String> getTaskNames(@Param("planId") String planId);
List<String> getTaskNames(@Param("taskIds") List<String> taskIds);

12
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml

@ -543,15 +543,9 @@ order by create_date desc
<select id="getIds" resultType="java.lang.String" > <select id="getIds" resultType="java.lang.String" >
select id from huzhou_projectinfo where reform_name=#{reformName} and super_leader=#{superLeader} select id from huzhou_projectinfo where reform_name=#{reformName} and super_leader=#{superLeader}
</select> </select>
<select id="getTaskIds" resultType="java.lang.String" >
select ta.id_ from act_ru_task ta where ta.execution_id_=(select ex.id_ from act_ru_execution ex where
ex.proc_inst_id_=(select pro.processInstanceId from huzhou_processinfo pro where pro.projectId=#{planId}))
</select>
<select id="getTaskNames" resultType="java.lang.String" > <select id="getTaskNames" resultType="java.lang.String" >
select name_ from act_ru_task where id_ in select distinct(ta.name_) from act_ru_task ta where ta.execution_id_ in
<foreach item="taskId" index="index" collection="taskIds" open="(" separator="," close=")"> (select ex.id_ from act_ru_execution ex where ex.proc_inst_id_=(select pro.processInstanceId from huzhou_processinfo pro where pro.projectId=#{planId}))
#{taskId}
</foreach>
</select> </select>
</mapper> </mapper>

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

@ -1536,14 +1536,26 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
} }
projectDetail.setContractMoney(contractMoney); projectDetail.setContractMoney(contractMoney);
projectDetail.setContractCentralMoney(contractCentralMoney); projectDetail.setContractCentralMoney(contractCentralMoney);
//当前阶段 //当前阶段,当前所处节点,当前审批节点,线下完成情况
String taskName;//当前阶段
String defaultStepName="";
String currentStepName = "";//当前所处节点
String currentIsUpload="";//当前审批节点
String currentLevel;
String isOfflineStepName="";//线下完成情况
LambdaQueryWrapper<HuzhouPlaninfo> query=new LambdaQueryWrapper<>(); LambdaQueryWrapper<HuzhouPlaninfo> query=new LambdaQueryWrapper<>();
query.eq(HuzhouPlaninfo::getProjectId,p.getId()); query.eq(HuzhouPlaninfo::getProjectId,p.getId());
query.eq(HuzhouPlaninfo::getIsfinish,"2"); List<HuzhouPlaninfo> allPlanList = planinfoService.list(query);
List<String[]> levelList = planinfoService.list(query).stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); List<String> allLevelList = allPlanList.stream().map(x -> x.getTaskLevel()).collect(Collectors.toList());
String taskName; List<String[]> allLevelSplitList = allPlanList.stream().map(x -> x.getTaskLevel().split("\\.")).filter(x -> x.length == 2).collect(Collectors.toList());
if(!levelList.isEmpty()){ int globlFirstMax = allLevelSplitList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
List<String[]> keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); int globlSecondMax = allLevelSplitList.stream().filter(x->Integer.parseInt(x[0])==globlFirstMax).mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax();
List<HuzhouPlaninfo> onGoingList = allPlanList.stream().filter(x -> x.getIsfinish().equals("1")).collect(Collectors.toList());
List<HuzhouPlaninfo> isFinishList = allPlanList.stream().filter(x -> x.getIsfinish().equals("2")).collect(Collectors.toList());
List<String[]> onGoingLevelList = onGoingList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList());
List<String[]> isFinishlevelList = isFinishList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList());
if(!isFinishlevelList.isEmpty()){
List<String[]> keyList = isFinishlevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList());
int max = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); int max = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
String key=String.valueOf(max); String key=String.valueOf(max);
taskName=stageMap.get(key); taskName=stageMap.get(key);
@ -1551,50 +1563,62 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
taskName="项目申报阶段"; taskName="项目申报阶段";
} }
projectDetail.setProjectStage(taskName); projectDetail.setProjectStage(taskName);
//当前节点 //如果当前阶段为项目申报阶段,当前所处节点、当前审批节点和线下完成情况都不显示
LambdaQueryWrapper<HuzhouPlaninfo> query1=new LambdaQueryWrapper<>(); if(!taskName.equals("项目申报阶段")) {
query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); if (!onGoingLevelList.isEmpty()) {
query1.eq(HuzhouPlaninfo::getIsfinish,"1"); currentLevel = "";//有1取1,多1取最大
List<HuzhouPlaninfo> onGoingList = planinfoService.list(query1); List<String[]> onGoingKeyList = onGoingLevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList());
List<String[]> onGoingLevelList = onGoingList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); int firstMax = onGoingKeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
String defaultStepName=""; List<String[]> onGoingKeyFilterList = onGoingKeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList());
String currentIsUpload="";//当前审批节点 int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax();
String currentStepName=""; String level = firstMax + "." + secondMax;
if(!onGoingLevelList.isEmpty()){//有1取1,多1取最大 currentStepName = planinfoMapper.getTaskName(p.getId(), level);
List<String[]> onGoingKeyList = onGoingLevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); //当前审批节点
int firstMax = onGoingKeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); String planId = onGoingList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId();
List<String[]> onGoingKeyFilterList = onGoingKeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); List<String> taskNames = projectinfoMapper.getTaskNames(planId);
int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); if (taskNames.size() > 0) {
String level=firstMax+"."+secondMax; currentIsUpload = String.join(",", taskNames);
currentStepName=planinfoMapper.getTaskName(p.getId(),level); }
//当前审批节点 } else {//没有1,有2,取2的下一个(planList,找到最大2的位置,取该位置+1的值)
String planId = onGoingList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId(); List<String[]> isFinishkeyList = isFinishlevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList());
List<String> taskIds = projectinfoMapper.getTaskIds(planId); int firstMax = isFinishkeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
List<String> taskNames = projectinfoMapper.getTaskNames(taskIds); List<String[]> isFinsishKeyFilterList = isFinishkeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList());
currentIsUpload= String.join(",", taskNames); int secondMax = isFinsishKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax();
} String level = firstMax + "." + secondMax;
else if(onGoingLevelList.isEmpty() && !levelList.isEmpty()){//没有1,有2,取2的下一个(planList,找到最大2的位置,取该位置+1的值) int newSecondMax = secondMax + 1;
List<String[]> keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); String tempLevel=firstMax + "." + newSecondMax;
int firstMax = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); //如果包含,则说明有这个level,不包含则有两种情况,1是level的fistMax+1,还有一种情况是当前的level已经是最后一个level了
List<String[]> finsishKeyFilterList = keyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); //怎么判断是不是最后一个level?全局最大
int secondMax = finsishKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); if (!allLevelList.contains(tempLevel)) {
String level=firstMax+"."+secondMax; if (firstMax == globlFirstMax && secondMax == globlSecondMax) {//当前level最后一个level
defaultStepName=planinfoMapper.getTaskName(p.getId(),level); currentLevel = level;
LambdaQueryWrapper<HuzhouPlaninfo> query2=new LambdaQueryWrapper<>(); } else {
query2.eq(HuzhouPlaninfo::getProjectId,p.getId()); int firstIndex = Integer.parseInt(tempLevel.split("\\.")[0])+1;
List<HuzhouPlaninfo> allPlanList = planinfoService.list(query2); currentLevel = firstIndex + "." + 1;
List<String> taskList = allPlanList.stream().map(x -> x.getTaskName()).collect(Collectors.toList()); }
int index = taskList.indexOf(defaultStepName); }
currentStepName=taskList.get(index+1); else {//包含,则第二位+1
String planId = allPlanList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId(); currentLevel=tempLevel;
List<String> executionIds = projectinfoMapper.getTaskIds(planId); }
List<String> taskNames = projectinfoMapper.getTaskNames(executionIds); currentStepName = planinfoMapper.getTaskName(p.getId(), currentLevel);
currentIsUpload= String.join(",", taskNames); String planId = allPlanList.stream().filter(x -> x.getTaskLevel().equals(currentLevel)).collect(Collectors.toList()).get(0).getId();
List<String> taskNames = projectinfoMapper.getTaskNames(planId);
if (taskNames.size() > 0) {
currentIsUpload = String.join(",", taskNames);
}
}
List<String> stepNameList=List.of("可研报告初稿编制","可研技术审查报告确认","造价评估报告确认");
if(currentIsUpload.equals("")){
if(stepNameList.contains(currentStepName)){
currentIsUpload="总咨询单位";
}else {
currentIsUpload="发起人";
}
}
} else {
currentLevel = "";
} }
projectDetail.setStepName(currentStepName);
projectDetail.setIsUpload(currentIsUpload);
//线下完成情况 //线下完成情况
String isOfflineStepName="";
List<String[]> isOfflineList = planinfoMapper.getIsOffline(p.getId()).stream().map(x->x.split("\\.")).collect(Collectors.toList()); List<String[]> isOfflineList = planinfoMapper.getIsOffline(p.getId()).stream().map(x->x.split("\\.")).collect(Collectors.toList());
if(isOfflineList.size()>0){ if(isOfflineList.size()>0){
List<String[]> isOfflinekeyList = isOfflineList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); List<String[]> isOfflinekeyList = isOfflineList.stream().filter(x -> x.length == 2).collect(Collectors.toList());
@ -1604,6 +1628,10 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
String isOfflineLevel=firstMax1+"."+secondMax1; String isOfflineLevel=firstMax1+"."+secondMax1;
isOfflineStepName=planinfoMapper.getTaskName(p.getId(),isOfflineLevel); isOfflineStepName=planinfoMapper.getTaskName(p.getId(),isOfflineLevel);
} }
projectDetail.setStepName(currentStepName);
projectDetail.setIsUpload(currentIsUpload);
projectDetail.setIsOffline(isOfflineStepName); projectDetail.setIsOffline(isOfflineStepName);
// 进度 // 进度
List<String> projectIds=new ArrayList<>(); List<String> projectIds=new ArrayList<>();

Loading…
Cancel
Save