| | |
| | | } |
| | | @GetMapping("/applications") @PreAuthorize("@ss.hasPermission('mes:pd-project:export')") |
| | | public CommonResult<List<Map<String,Object>>> applications(@RequestParam(required=false) Long projectId){ return success(service.applications(getLoginUserId(),projectId)); } |
| | | /** 审批详情使用:登录即可访问,可见范围在 Service 内按申请人/审批人/管理权限校验 */ |
| | | @GetMapping("/application") |
| | | public CommonResult<Map<String,Object>> application(@RequestParam long id){ return success(service.applicationDetail(id,getLoginUserId())); } |
| | | @GetMapping("/application/image") |
| | | public void applicationImage(@RequestParam long id,HttpServletResponse response) throws java.io.IOException { |
| | | byte[] image=service.applicationImage(id,getLoginUserId()); |
| | | response.setContentType("image/png"); |
| | | response.setHeader("Cache-Control","no-store, private"); |
| | | response.setHeader("X-Content-Type-Options","nosniff"); |
| | | response.getOutputStream().write(image); |
| | | } |
| | | @GetMapping("/download") @PreAuthorize("@ss.hasPermission('mes:pd-project:export')") |
| | | public void download(@RequestParam long id,HttpServletResponse response) throws Exception {byte[] bytes=service.download(id,getLoginUserId()); response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document"); response.setHeader("Content-Disposition","attachment; filename=tracking.docx"); response.getOutputStream().write(bytes);} |
| | | } |