9198b0a7b3635e0599cfa3559825ca93428229eb.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package cn.com.goldenwater.dcproj.service.impl.tac;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.dto.TacCountDto;
  5. import cn.com.goldenwater.dcproj.model.TacEvalationInform;
  6. import cn.com.goldenwater.dcproj.param.TacIndexParam;
  7. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  8. import cn.com.goldenwater.dcproj.service.TacIndexService;
  9. import cn.com.goldenwater.dcproj.target.Authority;
  10. import io.swagger.annotations.Api;
  11. import io.swagger.annotations.ApiOperation;
  12. import org.apache.commons.lang3.StringUtils;
  13. import org.slf4j.Logger;
  14. import org.slf4j.LoggerFactory;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.RequestBody;
  17. import org.springframework.web.bind.annotation.RequestMapping;
  18. import org.springframework.web.bind.annotation.RequestMethod;
  19. import org.springframework.web.bind.annotation.RestController;
  20. import javax.servlet.http.HttpServletRequest;
  21. import java.util.List;
  22. /**
  23. * Created by jinshui on 2019/12/2.
  24. */
  25. @Api(value = "稽察首页", tags = "稽察首页")
  26. @RestController
  27. @RequestMapping(value = "/tac/index")
  28. public class TacIndexController extends BaseController {
  29. private Logger logger = LoggerFactory.getLogger(getClass());
  30. @Autowired
  31. private TacIndexService tacIndexService;
  32. @Autowired
  33. private OlBisInspOrgService olBisInspOrgService;
  34. @ApiOperation("本年度问题")
  35. @RequestMapping(value = "/countPblmByYear", method = RequestMethod.POST)
  36. public BaseResponse<TacCountDto> countPblmByYear(@RequestBody TacIndexParam tacIndexParam) {
  37. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  38. TacCountDto tacCountDto = tacIndexService.countPblmByYear(tacIndexParam);
  39. return buildSuccessResponse(tacCountDto);
  40. }
  41. @ApiOperation("稽察进度")
  42. @RequestMapping(value = "/countAuditByYear", method = RequestMethod.POST)
  43. public BaseResponse<TacCountDto> countAuditByYear(@RequestBody TacIndexParam tacIndexParam) {
  44. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  45. TacCountDto tacCountDto = tacIndexService.countAuditByYear(tacIndexParam);
  46. return buildSuccessResponse(tacCountDto);
  47. }
  48. @ApiOperation("项目类型")
  49. @RequestMapping(value = "/countObjByYear", method = RequestMethod.POST)
  50. public BaseResponse<List<TacCountDto>> countObjByYear(@RequestBody TacIndexParam tacIndexParam) {
  51. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  52. List<TacCountDto> list = tacIndexService.countObjByYear(tacIndexParam);
  53. return buildSuccessResponse(list);
  54. }
  55. @Authority
  56. @ApiOperation("地区稽察次数统计")
  57. @RequestMapping(value = "/countAdcodeAuditByYear", method = RequestMethod.POST)
  58. public BaseResponse<List<TacCountDto>> countAdcodeAuditByYear(@RequestBody TacIndexParam tacIndexParam) {
  59. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  60. List<TacCountDto> list = tacIndexService.countAdcodeAuditByYear(tacIndexParam);
  61. return buildSuccessResponse(list);
  62. }
  63. @ApiOperation(value = "稽察问题统计")
  64. @RequestMapping(value = "/countPblmInfoByYear", method = RequestMethod.POST)
  65. public BaseResponse<List<TacCountDto>> countPblmInfoByStb(@RequestBody TacIndexParam tacIndexParam) {
  66. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  67. List<TacCountDto> list = tacIndexService.countPblmInfoByYear(tacIndexParam);
  68. return buildSuccessResponse(list);
  69. }
  70. @ApiOperation(value = "获取我的消息列表")
  71. @RequestMapping(value = "/getPersMessagePage", method = RequestMethod.POST)
  72. public BaseResponse<List<TacEvalationInform>> getPersMessagePage(@RequestBody TacIndexParam tacIndexParam, HttpServletRequest request) {
  73. if (StringUtils.isBlank(tacIndexParam.getPersId())) {
  74. tacIndexParam.setPersId(getCurrentPersId());
  75. }
  76. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  77. List<TacEvalationInform> pageInfo = tacIndexService.getPersMessagePage(tacIndexParam);
  78. return buildSuccessResponse(pageInfo);
  79. }
  80. @ApiOperation(value = "稽察首页地图")
  81. @RequestMapping(value = "/getAreaList", method = RequestMethod.POST)
  82. public BaseResponse<List<TacCountDto>> getAreaList(@RequestBody TacIndexParam tacIndexParam, HttpServletRequest request) {
  83. if (StringUtils.isBlank(tacIndexParam.getPersId())) {
  84. String persId = getCurrentPersId();
  85. if (StringUtils.isBlank(persId)) {
  86. return buildFailResponse();
  87. }
  88. tacIndexParam.setPersId(persId);
  89. }
  90. tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  91. List<TacCountDto> result = tacIndexService.getAreaList(tacIndexParam);
  92. return buildSuccessResponse(result);
  93. }
  94. }