diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java index a138af04e..b20a8fde7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java @@ -20,6 +20,7 @@ import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -77,9 +78,37 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService //时间轴数据 int index = 0; list = projectTaskPlanningService.queryByProjectId(StringUtils.join(projectLibraryBaseIdList, ","), projectLibraryBase.getCut()); + //时间段筛选,过滤数据 + Date startTime = projectLibraryBase.getStartTime(); + Date endTime = projectLibraryBase.getEndTime(); + List> listNew = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime)){ + for (List timeNodeVOS : list) { + List timeNodeVOList = new ArrayList<>(); + for (TimeNodeVO timeNodeVO : timeNodeVOS) { + Date time = timeNodeVO.getTime(); + if(time.after(startTime) && time.before(endTime)){ + TimeNodeVO timeNodeVOTemp = new TimeNodeVO(); + BeanUtils.copyProperties(timeNodeVO,timeNodeVOTemp); + timeNodeVOTemp.setTime(time); + timeNodeVOList.add(timeNodeVOTemp); + } + } + if(timeNodeVOList.size() != 0){ + listNew.add(timeNodeVOList); + } + } + } + for (ProjectLibraryBase libraryBase : projectLibraryBaseList) { Map mapList = new HashMap<>(); - List> collect = list.stream().filter(e -> libraryBase.getId().equals(e.get(0).getProjectId())).collect(Collectors.toList()); + List> collect = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime)){ + collect = listNew.stream().filter(e -> libraryBase.getId().equals(e.get(0).getProjectId())).collect(Collectors.toList()); + }else{ + collect = list.stream().filter(e -> libraryBase.getId().equals(e.get(0).getProjectId())).collect(Collectors.toList()); + } + if(collect.size() != 0){ index ++; mapList.put("index",index);