package com.xintong.visualinspection.controller; import java.util.*; import com.xintong.system.err.BusinessException; import com.xintong.visualinspection.bean.*; import com.xintong.visualinspection.pojo.StatisiticPojo; import com.xintong.visualinspection.pojo.StatisticExUser; import com.xintong.visualinspection.pojo.UserRankingData; import com.xintong.visualinspection.service.CommonService; import com.xintong.visualinspection.util.AuthorUtil; import com.xintong.visualinspection.util.CacheUtil; import com.xintong.visualinspection.util.Constants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.xintong.visualinspection.service.StatisticsService; import com.xintong.visualinspection.util.CodeUtil; import javax.servlet.http.HttpServletRequest; /** * 文件名:StatisticsController * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有. */ @RestController @RequestMapping("/statistics") public class StatisticsController extends BaseController { @Autowired private StatisticsService statisticsService; @Autowired private CommonService commonService; /** * 温馨服务考核情况反馈表(所有员工排名) * @return * String * @exception * @since 1.0.0 */ @RequestMapping(value = "/employee/order") public String getEmployeeOrder(@RequestBody StatisticsBean obj){ List lists= statisticsService.getEmployeeCheckedInfo(obj); List userChangeStations = statisticsService.getUserChangeStation(obj); Map m = new HashMap<>(); m.put("lists",lists); m.put("userChangeStations",userChangeStations); return super.returnSuccessResult(m); } @RequestMapping(value = "/employee/order/data") public String getEmployeeOrder(@RequestParam(required = false) String data){ String res = ""; if(data!=null){ String[] items = data.split("\\$"); //写 if(items.length>1){ CacheUtil.commonDataMap.put(items[0],items[1]); }else{ //读 res = CacheUtil.commonDataMap.get(items[0]); } } return super.returnSuccessResult((Object) res); } /** * 获取用户排名详情 * @param obj * @return */ @RequestMapping(value = "/employee/order/detail") public String getEmployeeOrderByUserId(@RequestBody StatisticsBean obj){ UserRankingData userRankingData= statisticsService.getEmployeeRankingData(obj); return super.returnSuccessResult(userRankingData); } /** * 温馨服务检查千分考核扣分情况汇总表 * @param obj * @return */ @RequestMapping(value = "/score/info") public String getScoreInfo(@RequestBody StatisticsBean obj){ List lists= statisticsService.getFeeStationCheckedScore(obj); int totalMan=0,totalcheckedMan=0,totalcheckedCount=0,total0=0,total15=0,total50=0,totalOver50=0,totalAll = 0; for(StatisticsBean bean:lists){ totalMan+=bean.getPeople_num(); totalcheckedMan+=bean.getChecked_people_num(); totalcheckedCount+=bean.getChecked_num(); total0+=(bean.getChecked_people_num()-bean.getScore_fifteen()-bean.getScore_fifty()-bean.getScore_over_fifty()); total15+=bean.getScore_fifteen(); total50+=bean.getScore_fifty(); totalOver50+=bean.getScore_over_fifty(); totalAll+=bean.getAll_check_score(); } Map resultMap = new HashMap(); resultMap.put("list", lists); resultMap.put("totalMan", totalMan); resultMap.put("totalcheckedMan", totalcheckedMan); resultMap.put("totalcheckedCount", totalcheckedCount); resultMap.put("total0", total0); resultMap.put("total15", total15); resultMap.put("total50", total50); resultMap.put("totalOver50", totalOver50); resultMap.put("totalAll", totalAll); return super.returnSuccessResult(resultMap); } /** * 温馨服务检查情况统计表 */ @RequestMapping(value = "/score/item/info") public String getScoreItemInfo(@RequestBody StatisticsBean obj){ List lists= statisticsService.getFeeStationCheckItemScore(obj); int totalMan=0,totalcheckedMan=0,totalcheckedCount=0,totalAll=0; Map scoreTypeMap = new HashMap(); for(StatisticsBean bean:lists){ totalMan+=bean.getPeople_num(); totalcheckedMan+=bean.getChecked_people_num(); totalcheckedCount+=bean.getChecked_num(); totalAll+=bean.getAll_check_score(); List names = bean.getChecked_socre_name(); List scores = bean.getChecked_score(); for(int i=0;i resultMap = new HashMap(); resultMap.put("list", lists); resultMap.put("totalMan", totalMan); resultMap.put("totalcheckedMan", totalcheckedMan); resultMap.put("totalcheckedCount", totalcheckedCount); resultMap.put("totalAll", totalAll); resultMap.putAll(scoreTypeMap); // resultMap.put("total50", total50); // resultMap.put("totalOver50", totalOver50); // resultMap.put("totalAll", totalAll); return super.returnSuccessResult(resultMap); } /** * 运营管理综合检查情况统计表 */ @RequestMapping(value = "/operation/manage/integration") public String getOperationInfo(@RequestBody StatisticsBean obj){ Map deptMap = commonService.getDeptMap(); List rmList = commonService.getAllDeptByLayer("RM"); List lists= statisticsService.getOperationInfo(obj); int totalMan=0,totalCompanyNum=0,totalCompanyScore=0,totalThirdNum=0, totalThirdScore=0,totalSpecialNum=0,totalSpecialScore=0,totalOnsiteNum=0, totalOnsiteScore=0,totalDataNum=0,totalDataScore=0; for(StatisticsBean bean:lists){ bean.setParent_dept_id(deptMap.get(bean.getDept_id().longValue()).getParentid().longValue()); bean.setParent_name(deptMap.get(bean.getParent_dept_id()).getOrganname()); totalMan+=bean.getPeople_num(); totalCompanyNum += bean.getCompany_check_num(); totalCompanyScore += bean.getCompany_total_score(); totalThirdNum += bean.getThird_check_num(); totalThirdScore += bean.getThird_total_score(); totalSpecialNum += bean.getSpecial_check_num(); totalSpecialScore += bean.getSpecial_total_score(); totalOnsiteNum += bean.getOnsite_check_num(); totalOnsiteScore += bean.getOnsite_total_score(); totalDataNum += bean.getData_check_num(); totalDataScore += bean.getData_total_score(); } Map resultMap = new HashMap(); resultMap.put("list", lists); resultMap.put("rmlist", rmList); resultMap.put("totalMan", totalMan); resultMap.put("totalCompanyNum", totalCompanyNum); resultMap.put("totalCompanyScore", totalCompanyScore); resultMap.put("totalThirdNum", totalThirdNum); resultMap.put("totalThirdScore", totalThirdScore); resultMap.put("totalSpecialNum", totalSpecialNum); resultMap.put("totalSpecialScore", totalSpecialScore); resultMap.put("totalOnsiteNum", totalOnsiteNum); resultMap.put("totalOnsiteScore", totalOnsiteScore); resultMap.put("totalDataNum", totalDataNum); resultMap.put("totalDataScore", totalDataScore); return super.returnSuccessResult(resultMap); } /** * 12个月考核等分总体 */ @RequestMapping(value = "/score/year/info") public String selectYearScoreChange(@RequestBody StatisticsBean obj){ List lists= statisticsService.getYearScoreChange(obj); return super.returnSuccessResult(lists); } /** * 收费站 */ @RequestMapping(value = "/score/tollgate/info") public String selectTollgateScoreChange(@RequestBody StatisticsBean obj){ List lists= statisticsService.getFeeStationScoreInfo(obj); return super.returnSuccessResult(lists); } /** * 道管中心3 */ @RequestMapping(value = "/score/center/manage/info") public String selectCentermanageScoreChange(@RequestBody StatisticsBean obj){ List lists= statisticsService.getCenterManageScoreInfo(obj); return super.returnSuccessResult(lists); } /** * 道管下收费站 */ @RequestMapping(value = "/score/manage/tollgate/info") public String selectCentermanageTollgateScoreChange(@RequestBody StatisticsBean obj){ List lists= statisticsService.getSingleFeeStationScoreInfo(obj); return super.returnSuccessResult(lists); } /** * 考核扣分情况比 */ @RequestMapping(value = "/lost/score/rate") public String getCheckedInfoRate(@RequestBody StatisticsBean obj){ StatisticsBean returnObj= statisticsService.getCheckedScoreInfo(obj); return super.returnSuccessResult(returnObj); } /** * 考核扣分项情况比 */ @RequestMapping(value = "/lost/itemscore/rate") public String getCheckedItemInfoRate(@RequestBody StatisticsBean obj){ List returnList= statisticsService.getCheckedItemScoreInfo(obj); return super.returnSuccessResult(returnList); } /** * 考核扣分项两次占比 */ @RequestMapping(value = "/lost/twice/itemscore/rate") public String getTwiceCheckedItemInfoRate(@RequestBody StatisticsBean obj){ Map> returnMap= statisticsService.get2CheckedItemScoreInfo(obj); return super.returnSuccessResult(returnMap); } /** * 获取导管中心前10名,后10名 或者收费站排名 */ @RequestMapping(value = "/stuff/score/info") public String getPersonalStuffItemInfo(@RequestBody StatisticsBean obj){ List returnList= statisticsService.getPersonalScoreInfo(obj); return super.returnSuccessResult(returnList); } /** * 获取收费站排名前5名 */ @RequestMapping(value = "/fs/up/five") public String getFsUp5PersonInfo(@RequestBody StatisticsBean obj){ List returnList= statisticsService.getFSUp5Person(obj); return super.returnSuccessResult(returnList); } /** * 获取收费站中人的12月情况 */ @RequestMapping(value = "/one/person/year/info") public String getFsOnePersonInfo(@RequestBody StatisticsBean obj){ List returnList= statisticsService.getOneFSCheckedInfo(obj); return super.returnSuccessResult(returnList); } /** * 获取收费站各项扣分情况 */ @RequestMapping(value = "/one/person/checkedItem/info") public String getFsOnePersonCheckedItemInfo(@RequestBody StatisticsBean obj){ List returnList= statisticsService.getOneCheckedItemInfo(obj); return super.returnSuccessResult(returnList); } /** * 获取收费站具体某个人的扣分详情 */ @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}") public String getFsOnePersonCheckedItemDetailInfo(HttpServletRequest request, @RequestBody StatisticsBean obj, @PathVariable Integer page, @PathVariable Integer size){ //PageHelper.offsetPage(page, size); boolean isshow = true; //获取个人权限 User user = getCurrentUser(request); if(AuthorUtil.hasRole(user, Constants.ROLE_STATION_ADMIN) ||AuthorUtil.hasRole(user, Constants.ROLE_STATION) ||AuthorUtil.hasRole(user, Constants.ROLE_STATION_AGENT) ||AuthorUtil.containsRole(user, "ROLE_STATION")){ //判断是否是单钱周期 Date a = new Date(); if(obj.getEnd_date()!=null && obj.getEnd_date().getTime()>a.getTime()){ isshow = false; } } if(isshow){ PageHelper.startPage(page, size); List returnList= statisticsService.getOneCheckedDetailInfo(obj); return super.returnSuccessResult(new PageInfo(returnList)); }else{ return super.returnSuccessResult(new PageInfo(new ArrayList())); } } /** * 获取考核列表情况 */ @RequestMapping(value = "/checkman/info") public String getCheckmanInfo(@RequestBody CheckmanStatisticsBean obj){ CheckmanStatisticsBean returnObj= statisticsService.getCheckmanStatisticInfo(obj); return super.returnSuccessResult(returnObj); } /** * 获取考勤列表情况 */ @RequestMapping(value = "/fs/work/info") public String getFsworkInfo(@RequestBody StatisticsFsWork obj){ List returnObj= statisticsService.getFsWorkStatisticInfo(obj); return super.returnSuccessResultTime(returnObj); } /** * 获取顶岗考勤列表情况 */ @RequestMapping(value = "/fs/unregular/work/info") public String getFsUnregularworkInfo(@RequestBody StatisticsFsWork obj){ List returnObj= statisticsService.getUnregularFsWorkStatisticInfo(obj); return super.returnSuccessResultTime(returnObj); } /** * 正常在岗人数 */ @RequestMapping(value = "/fs/work/person") public String getFsworkInfoPersonNumber(@RequestBody StatisticsFsWork obj){ List returnObj= statisticsService.getFsWorkPerson(obj); return super.returnSuccessResultTime(returnObj); } /** * 顶岗人数统计 */ @RequestMapping(value = "/fs/unregular/work/person") public String getFsUnregularworkInfoPersonNumber(@RequestBody StatisticsFsWork obj){ List returnObj= statisticsService.getFsWorkUnregularWorkPerson(obj); return super.returnSuccessResultTime(returnObj); } /** * 申诉统计 */ @RequestMapping(value = "/check/appeal") public String getCheckAppeal(@RequestBody CheckAppealStatistic obj){ List returnObj= statisticsService.getCheckAppealStatistic(obj); return super.returnSuccessResultTime(returnObj); } /** * 业务提升情况反馈表(所有员工排名) * @return * String * @exception * @since 1.0.0 */ @RequestMapping(value = "/business/feedback") public String getBusinessFeedback(@RequestBody StatisticsBean obj){ List lists= statisticsService.getBusinessFeedbackInfo(obj); return super.returnSuccessResult(lists); } @RequestMapping(value = "/check/wrecker") public String getCheckWrecker(@RequestBody StatisticsBean obj){ List lists= statisticsService.getWreckerCheckInfo(obj); return super.returnSuccessResult(lists); } @RequestMapping(value = "/check/wrecker/staff") public String getCheckWreckerStaff(@RequestBody WreckerStatisticsBO obj){ List lists= statisticsService.getWreckerStaffInfo(obj); return super.returnSuccessResult(lists); } @RequestMapping(value = "/user/score") public String getFsOnePersonCheckedItemDetailInfo(@RequestBody UserStatistic obj){ List returnList= statisticsService.getuserStatistic(obj); return super.returnSuccessResult((returnList)); } @RequestMapping(value = "/userex/add") public String addcheckSExUser(@RequestBody StatisticExUser obj){ Object s = statisticsService.addcheckSExUser(obj); if(s==null) throw new BusinessException(20001,"发生错误"); return super.returnSuccessResult(); } @RequestMapping(value = "/userex/delete") public String deletecheckSExUser(@RequestBody StatisticExUser obj){ Object s=statisticsService.deletecheckSExUser(obj); if(s==null) throw new BusinessException(20001,"发生错误"); return super.returnSuccessResult(); } @RequestMapping(value = "/dept") public String getDeptStatistic(@RequestBody DeptStatistic obj){ Map> s=statisticsService.getDeptStatistic(obj); if(s==null) throw new BusinessException(20002,"参数不对"); return super.returnSuccessResult(s); } }