|
@@ -237,19 +237,19 @@ public class SystemFileController extends BaseRESTfulController {
|
|
|
|
|
|
|
|
@PostMapping("/previewfile2")
|
|
@PostMapping("/previewfile2")
|
|
|
public RESTfulResult previewfile2(@RequestBody HashMap parmas) {
|
|
public RESTfulResult previewfile2(@RequestBody HashMap parmas) {
|
|
|
-
|
|
|
|
|
|
|
+ try {
|
|
|
SystemFile value = systemFileMapper.selectByPrimaryKey(parmas.get("id").toString());
|
|
SystemFile value = systemFileMapper.selectByPrimaryKey(parmas.get("id").toString());
|
|
|
-
|
|
|
|
|
|
|
+ if (value==null){
|
|
|
|
|
+ return failed(1,"该文件不存在!请查验文件是否被清除或已损坏!");
|
|
|
|
|
+ }
|
|
|
String fileName = value.getFilename();
|
|
String fileName = value.getFilename();
|
|
|
String filepath = value.getFilepath();
|
|
String filepath = value.getFilepath();
|
|
|
if (fileName == null || fileName.isEmpty()) {
|
|
if (fileName == null || fileName.isEmpty()) {
|
|
|
- return failed("该图片不存在!");
|
|
|
|
|
|
|
+ return failed(1,"该文件不存在!");
|
|
|
}
|
|
}
|
|
|
if (filepath == null || filepath.isEmpty()) {
|
|
if (filepath == null || filepath.isEmpty()) {
|
|
|
- return failed("该图片地址不存在!");
|
|
|
|
|
|
|
+ return failed(1,"该文件地址不存在!");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
String result = ftpFileUtil.downloadFile(fileName, filepath);
|
|
String result = ftpFileUtil.downloadFile(fileName, filepath);
|
|
|
return success(result);
|
|
return success(result);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|