fix(inspect): 修复文件下载接口空指针异常并补充文件名返回
| | |
| | | @GetMapping("/downFile") |
| | | public Result<?> downFile(Integer id) { |
| | | InsOrderFile insOrderFile = insOrderFileService.getById(id); |
| | | if (insOrderFile == null) { |
| | | return Result.fail("附件不存在或已被删除"); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("type", insOrderFile.getType()); |
| | | map.put("fileUrl", insOrderFile.getFileUrl()); |
| | | map.put("fileName", insOrderFile.getFileName()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | |
| | | @GetMapping("/downFile") |
| | | public Result<?> oaDownFile(Integer id) { |
| | | InsUnqualifiedHandlerFile insUnqualifiedHandlerFile = unqualifiedHandlerFileService.getById(id); |
| | | if (insUnqualifiedHandlerFile == null) { |
| | | return Result.fail("附件不存在或已被删除"); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("type", insUnqualifiedHandlerFile.getType()); |
| | | map.put("fileUrl", insUnqualifiedHandlerFile.getFileUrl()); |
| | | map.put("fileName", insUnqualifiedHandlerFile.getFileName()); |
| | | return Result.success(map); |
| | | } |
| | | |