|
|
@ -1556,33 +1556,56 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
LambdaQueryWrapper<HuzhouPlaninfo> query1=new LambdaQueryWrapper<>(); |
|
|
|
query1.eq(HuzhouPlaninfo::getProjectId,p.getId()); |
|
|
|
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 defaultIsUpload=""; |
|
|
|
String defaultIsOffline="0"; |
|
|
|
String currentIsUpload="";//当前审批节点
|
|
|
|
String currentStepName=""; |
|
|
|
if(!onGoingLevelList.isEmpty()){//有1取1,多1取最大
|
|
|
|
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(); |
|
|
|
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(); |
|
|
|
String level=firstMax+"."+secondMax; |
|
|
|
defaultStepName=planinfoMapper.getTaskName(p.getId(),level); |
|
|
|
defaultIsUpload = planinfoMapper.getIsOffline(p.getId(), level); |
|
|
|
defaultIsOffline="1"; |
|
|
|
currentStepName=planinfoMapper.getTaskName(p.getId(),level); |
|
|
|
//当前审批节点
|
|
|
|
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()); |
|
|
|
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()); |
|
|
|
int secondMax = onGoingKeyFilterList.stream().mapToInt(x -> Integer.parseInt(x[1])).summaryStatistics().getMax(); |
|
|
|
List<String[]> 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); |
|
|
|
defaultIsUpload = planinfoMapper.getIsOffline(p.getId(), level); |
|
|
|
defaultIsOffline="1"; |
|
|
|
LambdaQueryWrapper<HuzhouPlaninfo> query2=new LambdaQueryWrapper<>(); |
|
|
|
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.setIsUpload(defaultIsUpload); |
|
|
|
projectDetail.setIsOffline(defaultIsOffline); |
|
|
|
projectDetail.setIsOffline(isOfflineStepName); |
|
|
|
// 进度
|
|
|
|
List<String> projectIds=new ArrayList<>(); |
|
|
|
projectIds.add(p.getId()); |
|
|
@ -1860,8 +1883,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
projectInfo.setType(s); |
|
|
|
//根据项目名称获取id,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper=new LambdaUpdateWrapper<>(); |
|
|
|
updateWrapper.set(null,projectInfo); |
|
|
|
projectinfoMapper.updateById(projectInfo); |
|
|
|