|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dg.core.ResultData; | 
|---|
|  |  |  | import com.dg.core.db.gen.entity.*; | 
|---|
|  |  |  | import com.dg.core.db.manual.pojo.AppletUserCount; | 
|---|
|  |  |  | import com.dg.core.service.*; | 
|---|
|  |  |  | import com.dg.core.util.TableDataInfo; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | IGuideEvolveService iGuideEvolveService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //分类 | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | IClassifyAdministrationService iClassifyAdministrationService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ITransactionEventService iTransactionEventService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | HomeStatisticsService homeStatisticsService; | 
|---|
|  |  |  | 
|---|
|  |  |  | IOrganizationChartService iOrganizationChartService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | IAreaCodeService iAreaCodeService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ISysUserRecordService iSysUserRecordService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("首页统计不同状态工单数") | 
|---|
|  |  |  | @GetMapping("/getWorkOrder") | 
|---|
|  |  |  | public ResultData getWorkOrder() | 
|---|
|  |  |  | public ResultData<WorkOrder> getWorkOrder() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | WorkOrder workOrder=new WorkOrder(); | 
|---|
|  |  |  | //状态(1待分配  2 待办结 3 已办结 4 待评价 5 已取消  6未解决  7已解决) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("首页统计不同时间段的工单数量") | 
|---|
|  |  |  | @GetMapping("/getTimeWorkOrder") | 
|---|
|  |  |  | public ResultData getTimeWorkOrder() | 
|---|
|  |  |  | public ResultData<TimeWorkOrder> getTimeWorkOrder() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //1 今天   2昨天   3本月   4本年度 | 
|---|
|  |  |  | //累计全部 本年 本月 今日 昨日 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据选择的时间段 筛选导办工单数 timeType:1 本年度 15 近15天的   30 近30天的") | 
|---|
|  |  |  | @GetMapping("/getSelectionTimeOrder") | 
|---|
|  |  |  | public ResultData getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) | 
|---|
|  |  |  | public ResultData<CountList> getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if(timeType<1) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取效率比值") | 
|---|
|  |  |  | @GetMapping("/getEfficiency") | 
|---|
|  |  |  | public ResultData getEfficiency() | 
|---|
|  |  |  | public ResultData<EfficiencyEntity> getEfficiency() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | EfficiencyEntity entity=new EfficiencyEntity(); | 
|---|
|  |  |  | //总工单数 | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //        好评率=评价为满意的导办工单数量/已办结状态工单数量 | 
|---|
|  |  |  | String goodReputationEfficiency=weekDf.format((float)(iGuideRepairOrderService.countStatisticsNum(null,null,null,null,"1",null) | 
|---|
|  |  |  | /bj)); | 
|---|
|  |  |  | /(float)bj)); | 
|---|
|  |  |  | entity.setGoodReputationEfficiency(goodReputationEfficiency); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //      解决率=已解决状态的导办工单数量/已办结状态工单数量 | 
|---|
|  |  |  | String resolveEfficiency=weekDf.format((float)(iGuideRepairOrderService.countStatisticsNum("7",null,null,null,null,null) | 
|---|
|  |  |  | /bj)); | 
|---|
|  |  |  | /(float)bj)); | 
|---|
|  |  |  | entity.setResolveEfficiency(resolveEfficiency); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(allNum!=0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //              办结率=待评价+已办结状态的导办工单数量/总工单数量 | 
|---|
|  |  |  | String workEfficiency=weekDf.format((float)((iGuideRepairOrderService.countStatisticsNum("4",null,null,null,null,null) | 
|---|
|  |  |  | +bj)/allNum)); | 
|---|
|  |  |  | +bj)/(float)allNum)); | 
|---|
|  |  |  | entity.setWorkEfficiency(workEfficiency); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //        超时办结率=超时状态下的待评价+已办结状态的导办工单数量/超时状态的导办工单数量 | 
|---|
|  |  |  | String timeoutEfficiency=weekDf.format((float)((iGuideRepairOrderService.countStatisticsNum("4",null,null,"2",null,null) | 
|---|
|  |  |  | +iGuideRepairOrderService.countStatisticsNum("3",null,null,null,null,null)) | 
|---|
|  |  |  | /cs)); | 
|---|
|  |  |  | /(float)cs)); | 
|---|
|  |  |  | entity.setTimeoutEfficiency(timeoutEfficiency); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //        回复率=最新进展里0条回复的导办工单数量/总工单数量 | 
|---|
|  |  |  | //状态(1待分配  2 待办结 3 已办结 4 待评价 5 已取消 6未解决  7已解决  8 系统自动分配 9 回复   10转派    11手动分配) | 
|---|
|  |  |  | String reversionRate=weekDf.format((float)(iGuideEvolveService.countStatisticsNum("9",null)/allNum)); | 
|---|
|  |  |  | String reversionRate=weekDf.format((float)(iGuideEvolveService.countStatisticsNum("9",null)/(float)allNum)); | 
|---|
|  |  |  | entity.setReversionRate(reversionRate); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("工单  办事指南饼状图数据") | 
|---|
|  |  |  | @GetMapping("/getPieChart") | 
|---|
|  |  |  | public ResultData getPieChart() | 
|---|
|  |  |  | public ResultData<PieChartAll> getPieChart() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | PieChartAll pieChartAll=new PieChartAll(); | 
|---|
|  |  |  | pieChartAll.setWorkOrderNum(iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null)+""); | 
|---|
|  |  |  | pieChartAll.setFingerpostNum(iTransactionEventService.countStatisticsNum(null)+""); | 
|---|
|  |  |  | pieChartAll.setFingerpostNum(homeStatisticsService.countStatisticsNum(null)+""); | 
|---|
|  |  |  | List<PieChart> workOrderList=new ArrayList<>(); | 
|---|
|  |  |  | List<PieChart> fingerpostList=new ArrayList<>(); | 
|---|
|  |  |  | List<ClassifyAdministration> oneIds=iClassifyAdministrationService.getClassify(null,"1"); | 
|---|
|  |  |  | List<ClassifyAdministration> oneIds=homeStatisticsService.getClassify(null,"1"); | 
|---|
|  |  |  | for (ClassifyAdministration oneClassify:oneIds) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | PieChart workOrder=new PieChart(); | 
|---|
|  |  |  | PieChart fingerpost=new PieChart(); | 
|---|
|  |  |  | workOrder.setName(oneClassify.getClassifyName()); | 
|---|
|  |  |  | fingerpost.setName(oneClassify.getClassifyName()); | 
|---|
|  |  |  | List<ClassifyAdministration> twoIds = iClassifyAdministrationService.getClassify(oneClassify.getId()+"",null); | 
|---|
|  |  |  | List<ClassifyAdministration> twoIds = homeStatisticsService.getClassify(oneClassify.getId()+"",null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List clasIds=new ArrayList(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if(clasIds.size()>0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | workOrderNum=iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,clasIds); | 
|---|
|  |  |  | fingerpostNum=iTransactionEventService.countStatisticsNum(clasIds); | 
|---|
|  |  |  | fingerpostNum=homeStatisticsService.countStatisticsNum(clasIds); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | workOrder.setNum(workOrderNum+""); | 
|---|
|  |  |  | fingerpost.setNum(fingerpostNum+""); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("组织排行榜  type 1 安评价   2 按办结量") | 
|---|
|  |  |  | @GetMapping("/getOrganization") | 
|---|
|  |  |  | public TableDataInfo getOrganization(@RequestParam("type") String type) | 
|---|
|  |  |  | public TableDataInfo<OrganizationEntity> getOrganization(@RequestParam("type") String type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | List<OrganizationEntity> guidePlates=homeStatisticsService.getDepartment(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导办人员排行榜 type 1 安评价   2 按办结量 3 按超时") | 
|---|
|  |  |  | @GetMapping("/getGuidePlate") | 
|---|
|  |  |  | public TableDataInfo getGuidePlate(@RequestParam("type") String type) | 
|---|
|  |  |  | public TableDataInfo<GuidePlate> getGuidePlate(@RequestParam("type") String type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | int allNum=homeStatisticsService.staffNum(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("办事指南排行榜 type 1 按浏览量   2 按办结量") | 
|---|
|  |  |  | @GetMapping("/getGuidance") | 
|---|
|  |  |  | public TableDataInfo getGuidance(@RequestParam("type") String type) | 
|---|
|  |  |  | public TableDataInfo<Guidance> getGuidance(@RequestParam("type") String type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | int allNum=homeStatisticsService.countWork(); | 
|---|
|  |  |  | if(StringUtils.equals("1",type)) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导办工单按区域统计") | 
|---|
|  |  |  | @GetMapping("/getRangeStatistics") | 
|---|
|  |  |  | public TableDataInfo<RangeStatistics> getRangeStatistics() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | List<AreaCode2022> code2022s=iAreaCodeService.getListByPCode("510400000000"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<RangeStatistics> rangeStatistics=new ArrayList<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (AreaCode2022 bean:code2022s) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | RangeStatistics range=new RangeStatistics(); | 
|---|
|  |  |  | range.setName(bean.getName()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<String> ids; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(bean.getCode()==510401000000L) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ids=homeStatisticsService.countId(""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ids=homeStatisticsService.countId(bean.getCode()+""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int num=0; | 
|---|
|  |  |  | if(ids!=null&&ids.size()>0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | num=iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | range.setNum(num+""); | 
|---|
|  |  |  | rangeStatistics.add(range); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return getDataTable(rangeStatistics); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation(value = "小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问",response = AppletUserCount.class) | 
|---|
|  |  |  | @GetMapping("/selectUserRecordCount") | 
|---|
|  |  |  | public ResultData selectUserRecordCount(){ | 
|---|
|  |  |  | return  iSysUserRecordService.selectUserRecordCount(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation(value = "小程序用户访问量统计1.近15天 2.近30天 3.近一年",response = AppletUserCount.class) | 
|---|
|  |  |  | @GetMapping("/selectByDateType") | 
|---|
|  |  |  | public ResultData selectByDateType(@RequestParam("dateType") Integer dateType){ | 
|---|
|  |  |  | return  iSysUserRecordService.selectByDateType(dateType); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|