StatisticsController.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. package com.xintong.visualinspection.controller;
  2. import java.util.HashMap;
  3. import java.util.List;
  4. import java.util.Map;
  5. import com.xintong.visualinspection.pojo.UserRankingData;
  6. import com.xintong.visualinspection.util.CacheUtil;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.*;
  9. import com.github.pagehelper.PageHelper;
  10. import com.github.pagehelper.PageInfo;
  11. import com.xintong.visualinspection.bean.CheckAppealStatistic;
  12. import com.xintong.visualinspection.bean.CheckmanStatisticsBean;
  13. import com.xintong.visualinspection.bean.Constant;
  14. import com.xintong.visualinspection.bean.StatisticsBean;
  15. import com.xintong.visualinspection.bean.StatisticsBo;
  16. import com.xintong.visualinspection.bean.StatisticsFsWork;
  17. import com.xintong.visualinspection.service.StatisticsService;
  18. import com.xintong.visualinspection.util.CodeUtil;
  19. /**
  20. * 文件名:StatisticsController
  21. * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
  22. */
  23. @RestController
  24. @RequestMapping("/statistics")
  25. public class StatisticsController extends BaseController {
  26. @Autowired
  27. private StatisticsService statisticsService;
  28. /**
  29. * 温馨服务考核情况反馈表(所有员工排名)
  30. * @return
  31. * String
  32. * @exception
  33. * @since 1.0.0
  34. */
  35. @RequestMapping(value = "/employee/order")
  36. public String getEmployeeOrder(@RequestBody StatisticsBean obj){
  37. List<StatisticsBo> lists= statisticsService.getEmployeeCheckedInfo(obj);
  38. return super.returnSuccessResult(lists);
  39. }
  40. @RequestMapping(value = "/employee/order/data")
  41. public String getEmployeeOrder(@RequestParam(required = false) String data){
  42. String res = "";
  43. if(data!=null){
  44. String[] items = data.split("\\$");
  45. //写
  46. if(items.length>1){
  47. CacheUtil.commonDataMap.put(items[0],items[1]);
  48. }else{
  49. //读
  50. res = CacheUtil.commonDataMap.get(items[0]);
  51. }
  52. }
  53. return super.returnSuccessResult((Object) res);
  54. }
  55. /**
  56. * 获取用户排名详情
  57. * @param obj
  58. * @return
  59. */
  60. @RequestMapping(value = "/employee/order/detail")
  61. public String getEmployeeOrderByUserId(@RequestBody StatisticsBean obj){
  62. UserRankingData userRankingData= statisticsService.getEmployeeRankingData(obj);
  63. return super.returnSuccessResult(userRankingData);
  64. }
  65. /**
  66. * 温馨服务检查千分考核扣分情况汇总表
  67. * @param obj
  68. * @return
  69. */
  70. @RequestMapping(value = "/score/info")
  71. public String getScoreInfo(@RequestBody StatisticsBean obj){
  72. List<StatisticsBean> lists= statisticsService.getFeeStationCheckedScore(obj);
  73. int totalMan=0,totalcheckedMan=0,totalcheckedCount=0,total0=0,total15=0,total50=0,totalOver50=0,totalAll = 0;
  74. for(StatisticsBean bean:lists){
  75. totalMan+=bean.getPeople_num();
  76. totalcheckedMan+=bean.getChecked_people_num();
  77. totalcheckedCount+=bean.getChecked_num();
  78. total0+=(bean.getChecked_people_num()-bean.getScore_fifteen()-bean.getScore_fifty()-bean.getScore_over_fifty());
  79. total15+=bean.getScore_fifteen();
  80. total50+=bean.getScore_fifty();
  81. totalOver50+=bean.getScore_over_fifty();
  82. totalAll+=bean.getAll_check_score();
  83. }
  84. Map<String,Object> resultMap = new HashMap<String,Object>();
  85. resultMap.put("list", lists);
  86. resultMap.put("totalMan", totalMan);
  87. resultMap.put("totalcheckedMan", totalcheckedMan);
  88. resultMap.put("totalcheckedCount", totalcheckedCount);
  89. resultMap.put("total0", total0);
  90. resultMap.put("total15", total15);
  91. resultMap.put("total50", total50);
  92. resultMap.put("totalOver50", totalOver50);
  93. resultMap.put("totalAll", totalAll);
  94. return super.returnSuccessResult(resultMap);
  95. }
  96. /**
  97. * 温馨服务检查情况统计表
  98. */
  99. @RequestMapping(value = "/score/item/info")
  100. public String getScoreItemInfo(@RequestBody StatisticsBean obj){
  101. List<StatisticsBean> lists= statisticsService.getFeeStationCheckItemScore(obj);
  102. int totalMan=0,totalcheckedMan=0,totalcheckedCount=0,totalAll=0;
  103. Map<String,Integer> scoreTypeMap = new HashMap<String,Integer>();
  104. for(StatisticsBean bean:lists){
  105. totalMan+=bean.getPeople_num();
  106. totalcheckedMan+=bean.getChecked_people_num();
  107. totalcheckedCount+=bean.getChecked_num();
  108. totalAll+=bean.getAll_check_score();
  109. List<String> names = bean.getChecked_socre_name();
  110. List<Integer> scores = bean.getChecked_score();
  111. for(int i=0;i<names.size();i++){
  112. Integer score = scoreTypeMap.get(names.get(i));
  113. if(score==null) score=0;
  114. score+=scores.get(i);
  115. if(names.get(i)!=null){
  116. scoreTypeMap.put(names.get(i), score);
  117. }
  118. }
  119. // bean.get
  120. }
  121. Map<String,Object> resultMap = new HashMap<String,Object>();
  122. resultMap.put("list", lists);
  123. resultMap.put("totalMan", totalMan);
  124. resultMap.put("totalcheckedMan", totalcheckedMan);
  125. resultMap.put("totalcheckedCount", totalcheckedCount);
  126. resultMap.put("totalAll", totalAll);
  127. resultMap.putAll(scoreTypeMap);
  128. // resultMap.put("total50", total50);
  129. // resultMap.put("totalOver50", totalOver50);
  130. // resultMap.put("totalAll", totalAll);
  131. return super.returnSuccessResult(resultMap);
  132. }
  133. /**
  134. * 12个月考核等分总体
  135. */
  136. @RequestMapping(value = "/score/year/info")
  137. public String selectYearScoreChange(@RequestBody StatisticsBean obj){
  138. List<StatisticsBean> lists= statisticsService.getYearScoreChange(obj);
  139. return super.returnSuccessResult(lists);
  140. }
  141. /**
  142. * 收费站
  143. */
  144. @RequestMapping(value = "/score/tollgate/info")
  145. public String selectTollgateScoreChange(@RequestBody StatisticsBean obj){
  146. List<StatisticsBean> lists= statisticsService.getFeeStationScoreInfo(obj);
  147. return super.returnSuccessResult(lists);
  148. }
  149. /**
  150. * 道管中心3
  151. */
  152. @RequestMapping(value = "/score/center/manage/info")
  153. public String selectCentermanageScoreChange(@RequestBody StatisticsBean obj){
  154. List<StatisticsBean> lists= statisticsService.getCenterManageScoreInfo(obj);
  155. return super.returnSuccessResult(lists);
  156. }
  157. /**
  158. * 道管下收费站
  159. */
  160. @RequestMapping(value = "/score/manage/tollgate/info")
  161. public String selectCentermanageTollgateScoreChange(@RequestBody StatisticsBean obj){
  162. List<StatisticsBean> lists= statisticsService.getSingleFeeStationScoreInfo(obj);
  163. return super.returnSuccessResult(lists);
  164. }
  165. /**
  166. * 考核扣分情况比
  167. */
  168. @RequestMapping(value = "/lost/score/rate")
  169. public String getCheckedInfoRate(@RequestBody StatisticsBean obj){
  170. StatisticsBean returnObj= statisticsService.getCheckedScoreInfo(obj);
  171. return super.returnSuccessResult(returnObj);
  172. }
  173. /**
  174. * 考核扣分项情况比
  175. */
  176. @RequestMapping(value = "/lost/itemscore/rate")
  177. public String getCheckedItemInfoRate(@RequestBody StatisticsBean obj){
  178. List<StatisticsBean> returnList= statisticsService.getCheckedItemScoreInfo(obj);
  179. return super.returnSuccessResult(returnList);
  180. }
  181. /**
  182. * 考核扣分项两次占比
  183. */
  184. @RequestMapping(value = "/lost/twice/itemscore/rate")
  185. public String getTwiceCheckedItemInfoRate(@RequestBody StatisticsBean obj){
  186. Map<String,List<StatisticsBean>> returnMap= statisticsService.get2CheckedItemScoreInfo(obj);
  187. return super.returnSuccessResult(returnMap);
  188. }
  189. /**
  190. * 获取导管中心前10名,后10名 或者收费站排名
  191. */
  192. @RequestMapping(value = "/stuff/score/info")
  193. public String getPersonalStuffItemInfo(@RequestBody StatisticsBean obj){
  194. List<StatisticsBean> returnList= statisticsService.getPersonalScoreInfo(obj);
  195. return super.returnSuccessResult(returnList);
  196. }
  197. /**
  198. * 获取收费站排名前5名
  199. */
  200. @RequestMapping(value = "/fs/up/five")
  201. public String getFsUp5PersonInfo(@RequestBody StatisticsBean obj){
  202. List<StatisticsBean> returnList= statisticsService.getFSUp5Person(obj);
  203. return super.returnSuccessResult(returnList);
  204. }
  205. /**
  206. * 获取收费站中人的12月情况
  207. */
  208. @RequestMapping(value = "/one/person/year/info")
  209. public String getFsOnePersonInfo(@RequestBody StatisticsBean obj){
  210. List<StatisticsBean> returnList= statisticsService.getOneFSCheckedInfo(obj);
  211. return super.returnSuccessResult(returnList);
  212. }
  213. /**
  214. * 获取收费站各项扣分情况
  215. */
  216. @RequestMapping(value = "/one/person/checkedItem/info")
  217. public String getFsOnePersonCheckedItemInfo(@RequestBody StatisticsBean obj){
  218. List<StatisticsBean> returnList= statisticsService.getOneCheckedItemInfo(obj);
  219. return super.returnSuccessResult(returnList);
  220. }
  221. /**
  222. * 获取收费站具体某个人的扣分详情
  223. */
  224. @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}")
  225. public String getFsOnePersonCheckedItemDetailInfo(@RequestBody StatisticsBean obj,@PathVariable Integer page,@PathVariable Integer size){
  226. //PageHelper.offsetPage(page, size);
  227. PageHelper.startPage(page, size);
  228. List<StatisticsBean> returnList= statisticsService.getOneCheckedDetailInfo(obj);
  229. return super.returnSuccessResult(new PageInfo(returnList));
  230. }
  231. /**
  232. * 获取考核列表情况
  233. */
  234. @RequestMapping(value = "/checkman/info")
  235. public String getCheckmanInfo(@RequestBody CheckmanStatisticsBean obj){
  236. CheckmanStatisticsBean returnObj= statisticsService.getCheckmanStatisticInfo(obj);
  237. return super.returnSuccessResult(returnObj);
  238. }
  239. /**
  240. * 获取考勤列表情况
  241. */
  242. @RequestMapping(value = "/fs/work/info")
  243. public String getFsworkInfo(@RequestBody StatisticsFsWork obj){
  244. List<StatisticsFsWork> returnObj= statisticsService.getFsWorkStatisticInfo(obj);
  245. return super.returnSuccessResultTime(returnObj);
  246. }
  247. /**
  248. * 获取顶岗考勤列表情况
  249. */
  250. @RequestMapping(value = "/fs/unregular/work/info")
  251. public String getFsUnregularworkInfo(@RequestBody StatisticsFsWork obj){
  252. List<StatisticsFsWork> returnObj= statisticsService.getUnregularFsWorkStatisticInfo(obj);
  253. return super.returnSuccessResultTime(returnObj);
  254. }
  255. /**
  256. * 正常在岗人数
  257. */
  258. @RequestMapping(value = "/fs/work/person")
  259. public String getFsworkInfoPersonNumber(@RequestBody StatisticsFsWork obj){
  260. List<StatisticsFsWork> returnObj= statisticsService.getFsWorkPerson(obj);
  261. return super.returnSuccessResultTime(returnObj);
  262. }
  263. /**
  264. * 顶岗人数统计
  265. */
  266. @RequestMapping(value = "/fs/unregular/work/person")
  267. public String getFsUnregularworkInfoPersonNumber(@RequestBody StatisticsFsWork obj){
  268. List<StatisticsFsWork> returnObj= statisticsService.getFsWorkUnregularWorkPerson(obj);
  269. return super.returnSuccessResultTime(returnObj);
  270. }
  271. /**
  272. * 申诉统计
  273. */
  274. @RequestMapping(value = "/check/appeal")
  275. public String getCheckAppeal(@RequestBody CheckAppealStatistic obj){
  276. List<CheckAppealStatistic> returnObj= statisticsService.getCheckAppealStatistic(obj);
  277. return super.returnSuccessResultTime(returnObj);
  278. }
  279. }