package com.ydtech.modules.report.controller; import com.ydtech.aop.exception.DescribeException; import com.ydtech.core.page.HttpResult; import com.ydtech.modules.report.service.PereonalInsuranceService; import com.ydtech.modules.report.model.vo.ReportReq; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpRequest; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @Author: zy * @create: 2022/1/5 * description:保险代理机构业务报表—人身险公司业务 */ @Slf4j @RestController @RequestMapping("/PereonalReport") public class PereonalInsuranceController { @Autowired private PereonalInsuranceService pereonalInsuranceService; // @PreAuthorize("hasAuthority('sys:PereonalReport:view')") @ApiOperation(value = "保险代理机构业务报表—人身险公司业务") @PostMapping("/selectAll") public HttpResult selectAll(@RequestBody @ApiParam(name = "req") ReportReq req) { HttpResult result = null; try { result = pereonalInsuranceService.selectAll(req); } catch (Exception e) { result = HttpResult.error("保险代理机构业务报表人身险公司业务查询失败!" + e.getMessage()); e.printStackTrace(); } return result; } @ApiOperation("保险代理机构业务报表—人身险公司业务-导出") // @PreAuthorize("hasAuthority('sys:PereonalReport:export')") @PostMapping(value = "/exportPage") public void exportPage(@RequestBody @ApiParam(name = "req") ReportReq req, HttpServletRequest request, HttpServletResponse response) { try { pereonalInsuranceService.exportPage(req, request, response); } catch (Exception e) { e.printStackTrace(); throw new DescribeException("信息导出失败!" + e.getMessage()); } } }