| | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.service.*; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = {"首页统计接口"}) |
| | | @RestController |
| | | @RequestMapping("/Home") |
| | | public class HomeStatisticsController |
| | | public class HomeStatisticsController extends BaseController |
| | | { |
| | | //导办工单接口 |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | @Autowired |
| | | HomeStatisticsService homeStatisticsService; |
| | | |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | |
| | | @ApiOperation("首页统计不同状态工单数") |
| | | @GetMapping("/getWorkOrder") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("组织排行榜") |
| | | |
| | | |
| | | |
| | | @ApiOperation("组织排行榜 type 1 安评价 2 按办结量") |
| | | @GetMapping("/getOrganization") |
| | | public ResultData getOrganization() |
| | | public TableDataInfo getOrganization(@RequestParam("type") String type) |
| | | { |
| | | List<OrganizationEntity> guidePlates=homeStatisticsService.getDepartment(); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | for (OrganizationEntity bean:guidePlates) |
| | | { |
| | | bean.setNum(0+""); |
| | | List<String> ids=iOrganizationChartService.getIds(bean.getId()+""); |
| | | |
| | | return ResultData.success(); |
| | | //总评分 |
| | | String scoreNum=homeStatisticsService.organizationScore(ids)+""; |
| | | int score=0; |
| | | if(!StringUtils.isEmpty(scoreNum) && !StringUtils.equals("null",scoreNum)) |
| | | { |
| | | score=Integer.valueOf(scoreNum); |
| | | } |
| | | |
| | | //总数量 |
| | | int allNum=homeStatisticsService.organizationNum(ids); |
| | | |
| | | if(allNum>0 && score>0) |
| | | { |
| | | java.text.DecimalFormat weekDf=new java.text.DecimalFormat("##.##");//传入格式模板 |
| | | String workEfficiency=weekDf.format((float)(score/allNum)); |
| | | bean.setNum(workEfficiency); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (OrganizationEntity bean:guidePlates) |
| | | { |
| | | bean.setNum(0+""); |
| | | List<String> ids=iOrganizationChartService.getIds(bean.getId()+""); |
| | | //总数量 |
| | | int allNum=homeStatisticsService.organizationNum(ids); |
| | | if(allNum>0) |
| | | { |
| | | bean.setNum(allNum+""); |
| | | } |
| | | } |
| | | } |
| | | |
| | | OrganizationEntity entity=null; |
| | | for(int i = 0 ;i< guidePlates.size() -1; i++) { |
| | | for (int j = 0; j < guidePlates.size() - 1 - i; j++) { |
| | | |
| | | if(Float.valueOf(guidePlates.get(j).getNum())>Float.valueOf(guidePlates.get(j+1).getNum())) |
| | | { |
| | | entity=guidePlates.get(j); |
| | | guidePlates.set(j,guidePlates.get(j+1)); |
| | | guidePlates.set(j+1,entity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Collections.reverse(guidePlates); |
| | | |
| | | return getDataTable(guidePlates,guidePlates.size()); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("导办人员排行榜 type 1 安评价 2 按办结量 3 按超时") |
| | | @GetMapping("/getGuidePlate") |
| | | public TableDataInfo getGuidePlate(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.staffNum(); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | //安评价 |
| | | return getDataTable(homeStatisticsService.score(),allNum); |
| | | } |
| | | else if(StringUtils.equals("2",type)) |
| | | { |
| | | //2 按办结量 |
| | | return getDataTable(homeStatisticsService.guidePlatePeople(),allNum); |
| | | } |
| | | else |
| | | { |
| | | //3 按超时 |
| | | return getDataTable(homeStatisticsService.timeout(),allNum); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("办事指南排行榜 type 1 按浏览量 2 按办结量") |
| | | @GetMapping("/getGuidance") |
| | | public TableDataInfo getGuidance(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.countWork(); |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceBrowse(),allNum); |
| | | } |
| | | else |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceTransaction(),allNum); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |