| | |
| | | @Override |
| | | public R serviceStatic(ServiceStaticDTO serviceStaticDTO) { |
| | | ServiceStaticsVO serviceStaticsVO = new ServiceStaticsVO(); |
| | | if (serviceStaticDTO.getCheckUnitId() != null) { |
| | | if (serviceStaticDTO.getCheckUnitId() != null) |
| | | { |
| | | //单位服务统计 |
| | | serviceStaticsVO = |
| | | this.baseMapper.selectStatsCheckUnit(serviceStaticDTO.getCheckUnitId(), serviceStaticDTO.getYear()); |
| | | serviceStaticsVO.setServiceDetailStaticsList(this.baseMapper.selectServiceDetailList(serviceStaticDTO.getCheckUnitId(), |
| | | serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType())); |
| | | } else { |
| | | |
| | | List<ServiceDetailStaticsVO> serviceDetailStaticsVOList=this.baseMapper.selectServiceDetailList(serviceStaticDTO.getCheckUnitId(), |
| | | serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType()); |
| | | |
| | | |
| | | List<NewFightNeedProblemClaim> list=baseMapper.getNewServiceNum("",serviceStaticDTO.getCheckUnitId()+""); |
| | | |
| | | if(list.size()>0) |
| | | { |
| | | //设置次数 |
| | | int timeNum=serviceStaticsVO.getTimes()+list.size(); |
| | | serviceStaticsVO.setTimes(timeNum); |
| | | //设置服务时间 |
| | | int hours=serviceStaticsVO.getHours(); |
| | | |
| | | for (NewFightNeedProblemClaim item:list) |
| | | { |
| | | ServiceDetailStaticsVO newItem=new ServiceDetailStaticsVO(); |
| | | |
| | | String Ltime=item.getServiceTime(); |
| | | if(!StringUtils.isEmpty(Ltime)) |
| | | { |
| | | int time=(int)(Long.valueOf(Ltime)/3600000); |
| | | newItem.setServiceTime(time); |
| | | hours=hours+(time); |
| | | item.setServiceTime(time+""); |
| | | } |
| | | newItem.setServiceId(Long.valueOf(item.getTaskId())); |
| | | newItem.setServiceType(1); |
| | | newItem.setServiceAt(item.getCreationTime()); |
| | | serviceDetailStaticsVOList.add(newItem); |
| | | } |
| | | serviceStaticsVO.setHours(hours); |
| | | } |
| | | serviceStaticsVO.setServiceDetailStaticsList(serviceDetailStaticsVOList); |
| | | |
| | | } |
| | | 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")); |
| | |
| | | if (comPbMemberDO != null) { |
| | | checkUnitId = comPbMemberDO.getCheckUnitId(); |
| | | } |
| | | serviceStaticsVO.setServiceDetailStaticsList(this.baseMapper.selectServiceDetailListForPersonal(checkUnitId, serviceStaticDTO.getPhone(), |
| | | serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType())); |
| | | |
| | | |
| | | List<ServiceDetailStaticsVO> serviceDetailStaticsVOList=this.baseMapper.selectServiceDetailListForPersonal(checkUnitId, serviceStaticDTO.getPhone(), |
| | | serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType()); |
| | | |
| | | //获取新需求服务列表 |
| | | List<NewFightNeedProblemClaim> list=baseMapper.getNewServiceNum(serviceStaticDTO.getPhone(),""); |
| | | |
| | | if(list.size()>0) |
| | | { |
| | | //设置次数 |
| | | int timeNum=serviceStaticsVO.getTimes()+list.size(); |
| | | //设置服务时间 |
| | | int hours=serviceStaticsVO.getHours(); |
| | | serviceStaticsVO.setTimes(timeNum); |
| | | for (NewFightNeedProblemClaim item:list) |
| | | { |
| | | ServiceDetailStaticsVO newItem=new ServiceDetailStaticsVO(); |
| | | |
| | | String Ltime=item.getServiceTime(); |
| | | if(!StringUtils.isEmpty(Ltime)) |
| | | { |
| | | int time=(int)(Long.valueOf(Ltime)/3600000); |
| | | newItem.setServiceTime(time); |
| | | hours=hours+(time); |
| | | item.setServiceTime(time+""); |
| | | } |
| | | newItem.setServiceId(Long.valueOf(item.getTaskId())); |
| | | newItem.setServiceType(1); |
| | | newItem.setServiceAt(item.getCreationTime()); |
| | | serviceDetailStaticsVOList.add(newItem); |
| | | } |
| | | } |
| | | serviceStaticsVO.setServiceDetailStaticsList(serviceDetailStaticsVOList); |
| | | } |
| | | return R.ok(serviceStaticsVO); |
| | | } |