package com.ydtech.modules.ins.controller; import com.ydtech.aop.exception.DescribeException; import com.ydtech.core.page.HttpResult; import com.ydtech.modules.ins.service.InsPmainService; import com.ydtech.modules.ins.model.vo.req.InsPminReqVo; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; 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: shixk * @create: 2021/12/30 14:32 * description: */ @Api(tags = {"InsPmainController"}, description = "批单查询控制层") @ApiResponses({ @ApiResponse(code = 500, message = "出现异常"), @ApiResponse(code = 200, message = "请求成功") }) @RestController @RequestMapping("/insPmain") public class InsPmainController { @Autowired private InsPmainService insPmainService; @ApiOperation(value = "根据指定条件查询批单") //@PreAuthorize("hasAuthority('sys:policy:view')") @PostMapping("/selectInsPmain") public HttpResult selectInsPmain(HttpServletRequest request, @RequestBody @ApiParam(name = "reqVo", value = "批单查询请求类") InsPminReqVo reqVo) { HttpResult result = null; try { result = insPmainService.selectInsPmain(request, reqVo); } catch (Exception e) { result = HttpResult.error("查询批单信息失败!" + e.getMessage()); e.printStackTrace(); } return result; } @ApiOperation(value = "批单详细导出(车与非车共用)") //@PreAuthorize("hasAuthority('sys:policy:view')") @PostMapping("/insPmainDetailExport") public void insPmainDetailExport(@RequestBody @ApiParam(name = "reqVo", value = "批单查询请求类") InsPminReqVo reqVo, HttpServletRequest request, HttpServletResponse response) { try { insPmainService.insPmainDetailExport(reqVo, request, response); } catch (Exception e) { e.printStackTrace(); throw new DescribeException("批单导出失败!" + e.getMessage()); } } }