| | |
| | | if(!user.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())){ |
| | | companyId=user.getCompanyId(); |
| | | } |
| | | if(startTime==null && endTime==null){ |
| | | endTime=new Date(); |
| | | startTime=DateUtil.offsetDay(endTime,-7); |
| | | }else if(startTime!=null&&endTime==null){ |
| | | endTime=DateUtil.offsetDay(startTime,7); |
| | | }else if(startTime==null&&endTime!=null){ |
| | | startTime=DateUtil.offsetDay(endTime,-7); |
| | | } |
| | | PageUtils.startPage(); |
| | | List<SysCompany> companyList=companyMapper.selectCompanyList(new SysCompany().setId(companyId)); |
| | | CommonPage commonPage= CommonPage.restPage(companyList); |
| | | List<CompanyStatisticVO>companyStatisticVOList=staticData(companyList, DateUtil.formatDateTime(DateUtil.beginOfDay(startTime)),DateUtil.formatDateTime(DateUtil.endOfDay(endTime)),type); |
| | | commonPage.setList(companyStatisticVOList); |
| | | if(companyList.size()>0) { |
| | | List<CompanyStatisticVO> companyStatisticVOList = staticData(companyList, DateUtil.formatDateTime(DateUtil.beginOfDay(startTime)), DateUtil.formatDateTime(DateUtil.endOfDay(endTime)), type); |
| | | commonPage.setList(companyStatisticVOList); |
| | | } |
| | | return commonPage; |
| | | } |
| | | |
| | | public List<CompanyStatisticVO> staticData(List<SysCompany> companyList,String startTime,String endTime,Integer type){ |
| | | List<Long> companyIds=companyList.stream().map(item -> item.getId()).collect(Collectors.toList()); |
| | | |
| | | //统计公司批次数据 |
| | | List<CompanyPhaseVO> companyPhaseVOList=null; |
| | | if(type==1) { |
| | | companyPhaseVOList=companyMapper.getOnlineCompanyPhaseCount(companyIds, startTime, endTime); |
| | |
| | | companyPhaseVOList=companyMapper.getOfflineCompanyPhaseCount(companyIds, startTime, endTime); |
| | | } |
| | | Map<Long,List<CompanyPhaseVO>> companyPhaseVOMap=companyPhaseVOList.stream().collect(Collectors.groupingBy(CompanyPhaseVO::getCompanyId, LinkedHashMap::new,Collectors.toList())); |
| | | |
| | | List<CompanyPhaseStudentVO> companyPhaseStudentVOList=null; |
| | | if(type==1) { |
| | | companyPhaseStudentVOList=companyMapper.getOnlineCompanyPhaseStudentCount(companyIds, startTime, endTime); |
| | | }else{ |
| | | companyPhaseStudentVOList=companyMapper.getOfflineCompanyPhaseStudentCount(companyIds, startTime, endTime); |
| | | } |
| | | Map<Long,List<CompanyPhaseStudentVO>> companyPhaseStudentVOMap=companyPhaseStudentVOList.stream().collect(Collectors.groupingBy(CompanyPhaseStudentVO::getCompanyId,LinkedHashMap::new,Collectors.toList())); |
| | | |
| | | Map<Long,List<CompanyPhaseStudentVO>> companyPhaseStudentVOMap=companyPhaseStudentVOList.stream().collect(Collectors.groupingBy(CompanyPhaseStudentVO::getCompanyId,LinkedHashMap::new,Collectors.toList())); |
| | | List<CompanyPaperStudentVO> companyPaperStudentVOList=null; |
| | | if(type==1) { |
| | | companyPaperStudentVOList=companyMapper.getOnlineCompanyPaperStudentCount(companyIds, startTime, endTime); |
| | |
| | | List<CompanyPhaseVO> companyPhaseVOs=companyPhaseVOMap.get(item.getId()); |
| | | if(companyPhaseVOs!=null&&companyPhaseVOs.size()>0){ |
| | | companyPhaseVOs.forEach(cp -> { |
| | | if(cp.getLevel().equals(PhaseLevelEnum.COMPANY)){ |
| | | if(cp.getLevel().equals(PhaseLevelEnum.COMPANY.getCode())){ |
| | | companyStatisticVO.setLevel1PhaseCount(cp.getPhaseCount()); |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.DEPART)){ |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.DEPART.getCode())){ |
| | | companyStatisticVO.setLevel2PhaseCount(cp.getPhaseCount()); |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.WORkSHOP)) { |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.WORkSHOP.getCode())) { |
| | | companyStatisticVO.setLevel3PhaseCount(cp.getPhaseCount()); |
| | | } |
| | | }); |
| | |
| | | List<CompanyPhaseStudentVO> companyPhaseStudentVOs=companyPhaseStudentVOMap.get(item.getId()); |
| | | if(companyPhaseStudentVOs!=null&&companyPhaseStudentVOs.size()>0){ |
| | | companyPhaseStudentVOs.forEach(cp -> { |
| | | if(cp.getLevel().equals(PhaseLevelEnum.COMPANY)){ |
| | | if(cp.getLevel().equals(PhaseLevelEnum.COMPANY.getCode())){ |
| | | companyStatisticVO.setLevel1StudentCount(cp.getPhaseStudentCount()); |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.DEPART)){ |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.DEPART.getCode())){ |
| | | companyStatisticVO.setLevel2StudentCount(cp.getPhaseStudentCount()); |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.WORkSHOP)) { |
| | | }else if(cp.getLevel().equals(PhaseLevelEnum.WORkSHOP.getCode())) { |
| | | companyStatisticVO.setLevel3StudentCount(cp.getPhaseStudentCount()); |
| | | } |
| | | }); |