| | |
| | | @Override |
| | | public R serviceStatic(ServiceStaticDTO serviceStaticDTO) { |
| | | ServiceStaticsVO serviceStaticsVO = new ServiceStaticsVO(); |
| | | if (serviceStaticDTO.getCheckUnitId() != null) |
| | | if (serviceStaticDTO.getCheckUnitId() != null && serviceStaticDTO.getCheckUnitId()> 0) |
| | | { |
| | | //单位服务统计 |
| | | serviceStaticsVO = |
| | |
| | | else |
| | | { |
| | | //个人服务统计 |
| | | serviceStaticsVO = this.baseMapper.selectStatsUser(serviceStaticDTO.getPhone(), serviceStaticDTO.getYear()); |
| | | |
| | | |
| | | ComPbMemberDO comPbMemberDO = comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getPhone, serviceStaticDTO.getPhone()).last("limit 1")); |
| | | Long checkUnitId = null; |
| | |
| | | checkUnitId = comPbMemberDO.getCheckUnitId(); |
| | | } |
| | | |
| | | serviceStaticsVO = this.baseMapper.selectStatsUser(serviceStaticDTO.getPhone(),checkUnitId+"", serviceStaticDTO.getYear()); |
| | | |
| | | List<ServiceDetailStaticsVO> serviceDetailStaticsVOList=this.baseMapper.selectServiceDetailListForPersonal(checkUnitId, serviceStaticDTO.getPhone(), |
| | | serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType()); |
| | |
| | | activityVO.setPartyMemberCount(comActDAO.selectUnitCount()); |
| | | activityVO.setUnitCount(comActDAO.selectMemberCount()); |
| | | //获取单位活动统计数据(邻里圈) |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime, endTime, belongTo,communityId); |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime, endTime, belongTo,communityId,unitId); |
| | | //获取单位活动统计数据(活动) |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS1 = comActNeighborCircleDAO.institutionalUnitActivityAnalysis(beginTime, endTime, belongTo,communityId); |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS1 = comActNeighborCircleDAO.institutionalUnitActivityAnalysis(beginTime, endTime, belongTo,communityId,unitId); |
| | | //获取新双挣双评清单任务 |
| | | List<UnitActivityAnalysisVO> newTaskList=comActNeighborCircleDAO.getNewTaskList(beginTime, endTime, belongTo,communityId); |
| | | |
| | |
| | | Integer serviceTimes = item.getServiceTimes(); |
| | | |
| | | DecimalFormat df2 = new DecimalFormat("#.##"); |
| | | String formattedNumber2 = df2.format(serviceTimes); |
| | | String formattedNumber2 = df2.format(serviceTime); |
| | | Double result2 = Double.parseDouble(formattedNumber2); |
| | | |
| | | unitActivityAnalysisVOS.get(param.get("index")).setServiceTime(result2); |
| | |
| | | Map<String, Long> collectMap = inventories.stream() |
| | | .collect(Collectors.groupingBy(NewFightNeedProblemClaim::getTaskId, Collectors.counting())); |
| | | long sum = 0l; |
| | | if(unitVO.getAwardSum()!=null || unitVO.getAwardSum()!=0l ) |
| | | if(unitVO.getAwardSum()!=null) |
| | | { |
| | | sum=unitVO.getAwardSum(); |
| | | } |
| | |
| | | // String award = newFightNeedProblemInventory.getAward(); |
| | | String award = awardMap.get(Long.parseLong(taskId)); |
| | | Long count = collectMap.get(taskId); |
| | | long i = Long.parseLong(award) * count; |
| | | sum = sum + i; |
| | | if(!StringUtils.isEmpty(award) ) |
| | | { |
| | | long i = Long.parseLong(award) * count; |
| | | sum = sum + i; |
| | | } |
| | | } |
| | | unitVO.setAwardSum(sum); |
| | | } |
| | | |
| | | //报道党员统计积分 |
| | | for (PartyMemberAnalysisVO memberAnalysisVO : partyMemberAnalysisVOS) { |
| | | Long userId = memberAnalysisVO.getMemberId(); |
| | | LambdaQueryWrapper<NewFightNeedProblemClaim> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(NewFightNeedProblemClaim::getUserId,userId); |
| | | List<NewFightNeedProblemClaim> newFightNeedProblemInventories = newFightNeedProblemClaimMapper.selectList(wrapper); |
| | | long sumAward = 0l; |
| | | |
| | | if(memberAnalysisVO.getPartyCount()!=null || memberAnalysisVO.getPartyCount()!=0l ) |
| | | for (PartyMemberAnalysisVO memberAnalysisVO : partyMemberAnalysisVOS) |
| | | { |
| | | if(memberAnalysisVO!=null) |
| | | { |
| | | sumAward=memberAnalysisVO.getPartyCount(); |
| | | } |
| | | Long userId = memberAnalysisVO.getMemberId(); |
| | | LambdaQueryWrapper<NewFightNeedProblemClaim> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(NewFightNeedProblemClaim::getUserId,userId); |
| | | List<NewFightNeedProblemClaim> newFightNeedProblemInventories = newFightNeedProblemClaimMapper.selectList(wrapper); |
| | | long sumAward = 0l; |
| | | |
| | | for (NewFightNeedProblemClaim inventory : newFightNeedProblemInventories) { |
| | | String taskId = inventory.getTaskId(); |
| | | NewFightNeedProblemInventory newFightNeedProblemInventory = newFightNeedProblemInventoryMapper.selectById(taskId); |
| | | |
| | | if(newFightNeedProblemInventory!=null && !StringUtils.isEmpty(newFightNeedProblemInventory.getAward())) |
| | | if(memberAnalysisVO.getPartyCount()!=null) |
| | | { |
| | | String award = newFightNeedProblemInventory.getAward(); |
| | | sumAward = Long.parseLong(award) + sumAward; |
| | | sumAward=memberAnalysisVO.getPartyCount(); |
| | | } |
| | | |
| | | for (NewFightNeedProblemClaim inventory : newFightNeedProblemInventories) { |
| | | String taskId = inventory.getTaskId(); |
| | | NewFightNeedProblemInventory newFightNeedProblemInventory = newFightNeedProblemInventoryMapper.selectById(taskId); |
| | | |
| | | if(newFightNeedProblemInventory!=null && !StringUtils.isEmpty(newFightNeedProblemInventory.getAward())) |
| | | { |
| | | String award = newFightNeedProblemInventory.getAward(); |
| | | |
| | | if(!StringUtils.isEmpty(award) ) |
| | | { |
| | | sumAward = Long.parseLong(award) + sumAward; |
| | | } |
| | | } |
| | | |
| | | } |
| | | memberAnalysisVO.setPartyCount(sumAward); |
| | | } |
| | | memberAnalysisVO.setPartyCount(sumAward); |
| | | } |
| | | |
| | | //统计总时长和总次数 |
| | |
| | | // ListUtil.sortByProperty(unitActivityAnalysisVOS,""); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //按时长排序 |
| | | ListUtil.sortByProperty(unitActivityAnalysisVOS, "serviceTime"); |
| | | ListUtil.sortByProperty(partyMemberAnalysisVOS, "serviceTime"); |
| | | |
| | | ListUtil.reverse(unitActivityAnalysisVOS); |
| | | ListUtil.reverse(partyMemberAnalysisVOS); |
| | | } |
| | | //处理分页 |
| | | PageVO<List<UnitActivityAnalysisVO>> unitPage=new PageVO<>(); |
| | | PageVO<List<PartyMemberAnalysisVO>> memberPage=new PageVO<>(); |
| | |
| | | endTime=year.toString().concat("-12-31"); |
| | | } |
| | | //获取单位活动统计数据(邻里圈) |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime, endTime, belongTo,communityId); |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime, endTime, belongTo,communityId,null); |
| | | //获取单位活动统计数据(活动) |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS1 = comActNeighborCircleDAO.institutionalUnitActivityAnalysis(beginTime, endTime, belongTo,communityId); |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS1 = comActNeighborCircleDAO.institutionalUnitActivityAnalysis(beginTime, endTime, belongTo,communityId,null); |
| | | if (!unitActivityAnalysisVOS.isEmpty()){ |
| | | for (UnitActivityAnalysisVO unitActivityAnalysisVO : unitActivityAnalysisVOS){ |
| | | if (ObjectUtils.isNotEmpty(unitActivityAnalysisVO)){ |