PereonalInsuranceController.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.ydtech.modules.report.controller;
  2. import com.ydtech.aop.exception.DescribeException;
  3. import com.ydtech.core.page.HttpResult;
  4. import com.ydtech.modules.report.service.PereonalInsuranceService;
  5. import com.ydtech.modules.report.model.vo.ReportReq;
  6. import io.swagger.annotations.ApiOperation;
  7. import io.swagger.annotations.ApiParam;
  8. import lombok.extern.slf4j.Slf4j;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.http.HttpRequest;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import javax.servlet.http.HttpServletRequest;
  16. import javax.servlet.http.HttpServletResponse;
  17. /**
  18. * @Author: zy
  19. * @create: 2022/1/5
  20. * description:保险代理机构业务报表—人身险公司业务
  21. */
  22. @Slf4j
  23. @RestController
  24. @RequestMapping("/PereonalReport")
  25. public class PereonalInsuranceController {
  26. @Autowired
  27. private PereonalInsuranceService pereonalInsuranceService;
  28. // @PreAuthorize("hasAuthority('sys:PereonalReport:view')")
  29. @ApiOperation(value = "保险代理机构业务报表—人身险公司业务")
  30. @PostMapping("/selectAll")
  31. public HttpResult selectAll(@RequestBody @ApiParam(name = "req") ReportReq req) {
  32. HttpResult result = null;
  33. try {
  34. result = pereonalInsuranceService.selectAll(req);
  35. } catch (Exception e) {
  36. result = HttpResult.error("保险代理机构业务报表人身险公司业务查询失败!" + e.getMessage());
  37. e.printStackTrace();
  38. }
  39. return result;
  40. }
  41. @ApiOperation("保险代理机构业务报表—人身险公司业务-导出")
  42. // @PreAuthorize("hasAuthority('sys:PereonalReport:export')")
  43. @PostMapping(value = "/exportPage")
  44. public void exportPage(@RequestBody @ApiParam(name = "req") ReportReq req, HttpServletRequest request, HttpServletResponse response) {
  45. try {
  46. pereonalInsuranceService.exportPage(req, request, response);
  47. } catch (Exception e) {
  48. e.printStackTrace();
  49. throw new DescribeException("信息导出失败!" + e.getMessage());
  50. }
  51. }
  52. }