Browse Source

新增需求

master
Jinyuanyuan 18 hours ago
parent
commit
40db67c817
  1. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouPlaninfoMapper.java
  2. 6
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java
  3. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouPlaninfoMapper.xml
  4. 11
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml
  5. 53
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

2
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouPlaninfoMapper.java

@ -17,5 +17,5 @@ public interface HuzhouPlaninfoMapper extends BaseMapper<HuzhouPlaninfo> {
String getTaskName(@Param("projectId") String projectId,@Param("taskLevel") String taskLevel); String getTaskName(@Param("projectId") String projectId,@Param("taskLevel") String taskLevel);
String getIsOffline(@Param("projectId") String projectId,@Param("taskLevel") String taskLevel); List<String> getIsOffline(@Param("projectId") String projectId);
} }

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

@ -91,4 +91,10 @@ 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("taskIds") List<String> taskIds);
} }

2
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouPlaninfoMapper.xml

@ -15,7 +15,7 @@
select task_name from huzhou_planinfo where project_id=#{projectId} and task_level=#{taskLevel} select task_name from huzhou_planinfo where project_id=#{projectId} and task_level=#{taskLevel}
</select> </select>
<select id="getIsOffline" resultType="java.lang.String"> <select id="getIsOffline" resultType="java.lang.String">
select isoffline from huzhou_planinfo where project_id=#{projectId} and task_level=#{taskLevel} select task_level from huzhou_planinfo where project_id=#{projectId} and isoffline=1
</select> </select>
</mapper> </mapper>

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

@ -547,4 +547,15 @@ 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 name_ from act_ru_task where id_ in
<foreach item="taskId" index="index" collection="taskIds" open="(" separator="," close=")">
#{taskId}
</foreach>
</select>
</mapper> </mapper>

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

@ -1556,33 +1556,56 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
LambdaQueryWrapper<HuzhouPlaninfo> query1=new LambdaQueryWrapper<>(); LambdaQueryWrapper<HuzhouPlaninfo> query1=new LambdaQueryWrapper<>();
query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); query1.eq(HuzhouPlaninfo::getProjectId,p.getId());
query1.eq(HuzhouPlaninfo::getIsfinish,"1"); query1.eq(HuzhouPlaninfo::getIsfinish,"1");
List<String[]> onGoingLevelList = planinfoService.list(query1).stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList()); List<HuzhouPlaninfo> onGoingList = planinfoService.list(query1);
List<String[]> onGoingLevelList = onGoingList.stream().map(x -> x.getTaskLevel().split("\\.")).collect(Collectors.toList());
String defaultStepName=""; String defaultStepName="";
String defaultIsUpload=""; String currentIsUpload="";//当前审批节点
String defaultIsOffline="0"; String currentStepName="";
if(!onGoingLevelList.isEmpty()){//有1取1,多1取最大 if(!onGoingLevelList.isEmpty()){//有1取1,多1取最大
List<String[]> onGoingKeyList = onGoingLevelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); 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(); int firstMax = onGoingKeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
List<String[]> onGoingKeyFilterList = onGoingKeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); List<String[]> 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(); int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax();
String level=firstMax+"."+secondMax; String level=firstMax+"."+secondMax;
defaultStepName=planinfoMapper.getTaskName(p.getId(),level); currentStepName=planinfoMapper.getTaskName(p.getId(),level);
defaultIsUpload = planinfoMapper.getIsOffline(p.getId(), level); //当前审批节点
defaultIsOffline="1"; String planId = onGoingList.stream().filter(x -> x.getTaskLevel().equals(level)).collect(Collectors.toList()).get(0).getId();
List<String> taskIds = projectinfoMapper.getTaskIds(planId);
List<String> taskNames = projectinfoMapper.getTaskNames(taskIds);
currentIsUpload= String.join(",", taskNames);
} }
else if(onGoingLevelList.isEmpty() && !levelList.isEmpty()){//没有1,有2 else if(onGoingLevelList.isEmpty() && !levelList.isEmpty()){//没有1,有2,取2的下一个(planList,找到最大2的位置,取该位置+1的值)
List<String[]> keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList()); List<String[]> keyList = levelList.stream().filter(x -> x.length == 2).collect(Collectors.toList());
int firstMax = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax(); int firstMax = keyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
List<String[]> onGoingKeyFilterList = keyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList()); List<String[]> finsishKeyFilterList = keyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax))).collect(Collectors.toList());
int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); int secondMax = finsishKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax();
String level=firstMax+"."+secondMax; String level=firstMax+"."+secondMax;
defaultStepName=planinfoMapper.getTaskName(p.getId(),level); defaultStepName=planinfoMapper.getTaskName(p.getId(),level);
defaultIsUpload = planinfoMapper.getIsOffline(p.getId(), level); LambdaQueryWrapper<HuzhouPlaninfo> query2=new LambdaQueryWrapper<>();
defaultIsOffline="1"; query2.eq(HuzhouPlaninfo::getProjectId,p.getId());
List<HuzhouPlaninfo> allPlanList = planinfoService.list(query2);
List<String> 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<String> executionIds = projectinfoMapper.getTaskIds(planId);
List<String> taskNames = projectinfoMapper.getTaskNames(executionIds);
currentIsUpload= String.join(",", taskNames);
}
projectDetail.setStepName(currentStepName);
projectDetail.setIsUpload(currentIsUpload);
//线下完成情况
String isOfflineStepName="";
List<String[]> isOfflineList = planinfoMapper.getIsOffline(p.getId()).stream().map(x->x.split("\\.")).collect(Collectors.toList());
if(isOfflineList.size()>0){
List<String[]> isOfflinekeyList = isOfflineList.stream().filter(x -> x.length == 2).collect(Collectors.toList());
int firstMax1 = isOfflinekeyList.stream().mapToInt(x -> Integer.parseInt(x[0])).summaryStatistics().getMax();
List<String[]> isOfflineKeyFilterList = isOfflinekeyList.stream().filter(x -> x[0].equals(String.valueOf(firstMax1))).collect(Collectors.toList());
int secondMax1 = isOfflineKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax();
String isOfflineLevel=firstMax1+"."+secondMax1;
isOfflineStepName=planinfoMapper.getTaskName(p.getId(),isOfflineLevel);
} }
projectDetail.setStepName(defaultStepName); projectDetail.setIsOffline(isOfflineStepName);
projectDetail.setIsUpload(defaultIsUpload);
projectDetail.setIsOffline(defaultIsOffline);
// 进度 // 进度
List<String> projectIds=new ArrayList<>(); List<String> projectIds=new ArrayList<>();
projectIds.add(p.getId()); projectIds.add(p.getId());
@ -1860,8 +1883,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
projectInfo.setType(s); projectInfo.setType(s);
//根据项目名称获取id, //根据项目名称获取id,
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper=new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper=new LambdaUpdateWrapper<>();
updateWrapper.set(null,projectInfo); updateWrapper.set(null,projectInfo);
projectinfoMapper.updateById(projectInfo); projectinfoMapper.updateById(projectInfo);

Loading…
Cancel
Save