c391096b4c52a2a7a2133d0a4a23a664ff4694a3.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. package cn.com.goldenwater.dcproj.controller.homepage;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.dto.*;
  5. import cn.com.goldenwater.dcproj.model.BisInspPblm;
  6. import cn.com.goldenwater.dcproj.model.DuchaObj;
  7. import cn.com.goldenwater.dcproj.model.ObjPerson;
  8. import cn.com.goldenwater.dcproj.param.IndexParam;
  9. import cn.com.goldenwater.dcproj.param.IndexParamPage;
  10. import cn.com.goldenwater.dcproj.param.IndexPblmParam;
  11. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  12. import cn.com.goldenwater.dcproj.service.PcIndexService;
  13. import com.github.pagehelper.PageInfo;
  14. import io.swagger.annotations.Api;
  15. import io.swagger.annotations.ApiOperation;
  16. import org.apache.commons.lang3.StringUtils;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.web.bind.annotation.*;
  19. import java.time.LocalDate;
  20. import java.time.format.DateTimeFormatter;
  21. import java.util.List;
  22. import java.util.Map;
  23. @Api(value = "PC后台首页", tags = "PC后台首页接口")
  24. @RestController
  25. @RequestMapping("/pc/index")
  26. public class PcIndexController extends BaseController {
  27. @Autowired
  28. private PcIndexService pcIndexService;
  29. @Autowired
  30. private OlBisInspOrgService inspOrgService;
  31. @ApiOperation(value = "统计当前时间,日,周,月累计新增问题")
  32. @RequestMapping(value = "/timeCount", method = RequestMethod.GET)
  33. public BaseResponse<Map<String, String>> timeCount() {
  34. Map<String, String> params = pcIndexService.timeCount(getCurrentOrgId());
  35. return buildSuccessResponse(params);
  36. }
  37. @ApiOperation(value = "根据开始时间,结束时间,所选机构返回督查对象所排除的督查组")
  38. @RequestMapping(value = "/countGroup", method = RequestMethod.POST)
  39. public BaseResponse<List<DcTypeDto>> countGroup(@RequestBody IndexParam indexParam) {
  40. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  41. indexParam.setOrgId(getCurrentOrgId());
  42. List<DcTypeDto> typeDtoList = pcIndexService.countGroup(indexParam);
  43. return buildSuccessResponse(typeDtoList);
  44. }
  45. @ApiOperation(value = "根据开始时间,结束时间,所选机构返回督查对象所排除的督查人员数量")
  46. @RequestMapping(value = "/countPerson", method = RequestMethod.POST)
  47. public BaseResponse<List<DcTypeDto>> countPerson(@RequestBody IndexParam indexParam) {
  48. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  49. List<DcTypeDto> typeDtoList = pcIndexService.countPerson(indexParam);
  50. return buildSuccessResponse(typeDtoList);
  51. }
  52. @ApiOperation(value = "根据开始时间,结束时间,所选机构返回全部类型督查对象个数(已督查)")
  53. @RequestMapping(value = "/countDucha", method = RequestMethod.POST)
  54. public BaseResponse<List<DcTypeDto>> countDucha(@RequestBody IndexParam indexParam) {
  55. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  56. List<DcTypeDto> typeDtoList = pcIndexService.countDucha(indexParam);
  57. return buildSuccessResponse(typeDtoList);
  58. }
  59. @ApiOperation(value = "根据开始时间,结束时间,所选机构返回全部类别督查对象,发现问题统计")
  60. @RequestMapping(value = "/countPblmByType", method = RequestMethod.POST)
  61. public BaseResponse<List<DcTypeDto>> countPblmByType(@RequestBody IndexParam indexParam) {
  62. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  63. List<DcTypeDto> typeDtoList = pcIndexService.countPblmByType(indexParam);
  64. return buildSuccessResponse(typeDtoList);
  65. }
  66. @ApiOperation(value = "返回不同机构,不同督查对象类型计划全部督查个数,按机构对象类型分,type=org为机构统计,type=pType为按对象类型统计")
  67. @RequestMapping(value = "/countPlanByOrgOrType/{type}", method = RequestMethod.POST)
  68. public BaseResponse<List<DcTypeDto>> countPlanByOrgOrType(@PathVariable String type) {
  69. List<DcTypeDto> typeDtoList = pcIndexService.countPlanByOrgOrType(type, getCurrentOrgId());
  70. return buildSuccessResponse(typeDtoList);
  71. }
  72. @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,返回督查对象个数统计")
  73. @RequestMapping(value = "/countPlan", method = RequestMethod.POST)
  74. public BaseResponse<List<DcTypeDto>> countPlan(@RequestBody IndexParam indexParam) {
  75. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  76. List<DcTypeDto> typeDtoList = pcIndexService.countPlan(indexParam);
  77. return buildSuccessResponse(typeDtoList);
  78. }
  79. @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,按行政省统计督查对象个数")
  80. @RequestMapping(value = "/countPlanByPro", method = RequestMethod.POST)
  81. public BaseResponse<List<DcTypeDto>> countPlanByPro(@RequestBody IndexParam indexParam) {
  82. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  83. List<DcTypeDto> typeDtoList = pcIndexService.countPlanByPro(indexParam);
  84. return buildSuccessResponse(typeDtoList);
  85. }
  86. @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,返回督查问题个数统计")
  87. @RequestMapping(value = "/countPblm", method = RequestMethod.POST)
  88. public BaseResponse<List<DcTypeDto>> countPblm(@RequestBody IndexParam indexParam) {
  89. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  90. List<DcTypeDto> typeDtoList = pcIndexService.countPblm(indexParam);
  91. return buildSuccessResponse(typeDtoList);
  92. }
  93. @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,按照行政省返回督查组统计")
  94. @RequestMapping(value = "/countGroupByPro", method = RequestMethod.POST)
  95. public BaseResponse<List<DcTypeDto>> countGroupByPro(@RequestBody IndexParam indexParam) {
  96. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  97. List<DcTypeDto> typeDtoList = pcIndexService.countGroupByPro(indexParam);
  98. return buildSuccessResponse(typeDtoList);
  99. }
  100. @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,按照行政省返回督查人员统计")
  101. @RequestMapping(value = "/countPersonByPro", method = RequestMethod.POST)
  102. public BaseResponse<List<DcTypeDto>> countPersonByPro(@RequestBody IndexParam indexParam) {
  103. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  104. List<DcTypeDto> typeDtoList = pcIndexService.countPersonByPro(indexParam);
  105. return buildSuccessResponse(typeDtoList);
  106. }
  107. @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,返回督查问题个数统计(按照严重程度,行政省统计)")
  108. @RequestMapping(value = "/countPblmByPro", method = RequestMethod.POST)
  109. public BaseResponse<List<DcPblmDto>> countPblmByPro(@RequestBody IndexParam indexParam) {
  110. indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  111. List<DcPblmDto> typeDtoList = pcIndexService.countPblmByPro(indexParam);
  112. return buildSuccessResponse(typeDtoList);
  113. }
  114. @ApiOperation(value = "获取在线人数和所在组")
  115. @RequestMapping(value = "/countPersOnline", method = RequestMethod.POST)
  116. public BaseResponse<PersOnlineDto> countPersOnline(@RequestBody IndexParam indexParam) {
  117. indexParam.setOrgId(getCurrentOrgId());
  118. PersOnlineDto pers = pcIndexService.countPersOnline(indexParam);
  119. return buildSuccessResponse(pers);
  120. }
  121. @ApiOperation(value = "按照当前时间,统计问题数量")
  122. @RequestMapping(value = "/countPblmByTime", method = RequestMethod.POST)
  123. public BaseResponse<List<CountTime>> countPblmByTime(@RequestBody IndexPblmParam indexPblmParam) {
  124. indexPblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  125. if (StringUtils.isEmpty(indexPblmParam.getSttm())) {
  126. if (StringUtils.isEmpty(indexPblmParam.getEttm())) {
  127. LocalDate dttm = LocalDate.now();
  128. DateTimeFormatter dtfDay = DateTimeFormatter.ofPattern("yyyy-MM-dd");
  129. indexPblmParam.setEttm(dttm.format(dtfDay));
  130. }
  131. } else {
  132. if (StringUtils.isEmpty(indexPblmParam.getEttm())) {
  133. indexPblmParam.setEttm(indexPblmParam.getSttm());
  134. indexPblmParam.setSttm("");
  135. }
  136. }
  137. List<CountTime> list = pcIndexService.countPblmByTime(indexPblmParam);
  138. return buildSuccessResponse(list);
  139. }
  140. @ApiOperation(value = "按照行政区划督查类型下督查组数量")
  141. @RequestMapping(value = "/findGroupByAdCode", method = RequestMethod.POST)
  142. public BaseResponse<PageInfo<ObjGroup>> findGroupByAdCode(@RequestBody IndexParamPage indexParamPage) {
  143. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  144. return buildSuccessResponse(pcIndexService.countGroupByAdCode(indexParamPage));
  145. }
  146. @ApiOperation(value = "按照行政区划督查类型下督查人员数量")
  147. @RequestMapping(value = "/findPerByAdCode", method = RequestMethod.POST)
  148. public BaseResponse<PageInfo<ObjPerson>> findPerByAdCode(@RequestBody IndexParamPage indexParamPage) {
  149. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  150. return buildSuccessResponse(pcIndexService.findPerByAdCode(indexParamPage));
  151. }
  152. @ApiOperation(value = "按照行政区划督查类型下督查对象数量")
  153. @RequestMapping(value = "/findObjByAdCode", method = RequestMethod.POST)
  154. public BaseResponse<PageInfo<DuchaObj>> findObjByAdCode(@RequestBody IndexParamPage indexParamPage) {
  155. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  156. return buildSuccessResponse(pcIndexService.findObjByAdCode(indexParamPage));
  157. }
  158. @ApiOperation(value = "按照行政区划督查类型下督查对象数量")
  159. @RequestMapping(value = "/findPblmByAdCode", method = RequestMethod.POST)
  160. public BaseResponse<PageInfo<BisInspPblm>> findPblmByAdCode(@RequestBody IndexParamPage indexParamPage) {
  161. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  162. return buildSuccessResponse(pcIndexService.findPblmByAdCode(indexParamPage));
  163. }
  164. @ApiOperation(value = "按照行政区划督查类型下督查组数量")
  165. @RequestMapping(value = "/findGroupCountByAdCode", method = RequestMethod.POST)
  166. public BaseResponse<List<DcTypeDto>> findGroupCountByAdCode(@RequestBody IndexParamPage indexParamPage) {
  167. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  168. return buildSuccessResponse(pcIndexService.findGroupCountByAdCode(indexParamPage));
  169. }
  170. @ApiOperation(value = "按照行政区划督查类型下督查人员数量")
  171. @RequestMapping(value = "/findPerCountByAdCode", method = RequestMethod.POST)
  172. public BaseResponse<List<DcTypeDto>> findPerCountByAdCode(@RequestBody IndexParamPage indexParamPage) {
  173. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  174. return buildSuccessResponse(pcIndexService.findPerCountByAdCode(indexParamPage));
  175. }
  176. @ApiOperation(value = "按照行政区划督查类型下督查对象数量")
  177. @RequestMapping(value = "/findObjCountByAdCode", method = RequestMethod.POST)
  178. public BaseResponse<List<DcTypeDto>> findObjCountByAdCode(@RequestBody IndexParamPage indexParamPage) {
  179. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  180. return buildSuccessResponse(pcIndexService.findObjCountByAdCode(indexParamPage));
  181. }
  182. @ApiOperation(value = "按照行政区划督查类型下督查对象数量")
  183. @RequestMapping(value = "/findPblmCountByAdCode", method = RequestMethod.POST)
  184. public BaseResponse<List<DcTypeDto>> findPblmCountByAdCode(@RequestBody IndexParamPage indexParamPage) {
  185. indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  186. return buildSuccessResponse(pcIndexService.findPblmCountByAdCode(indexParamPage));
  187. }
  188. }