|
|
|
@ -54,11 +54,13 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
@Resource
|
|
|
|
|
private IdcService idcService;
|
|
|
|
|
private String imagePath = "register/file/image2/";
|
|
|
|
|
String pdfPath = "pdf/template/";
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse upload(List<String> list) {
|
|
|
|
|
return fileToUpload(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse download(List<String> list) {
|
|
|
|
|
return fileToDownload(list);
|
|
|
|
@ -124,7 +126,6 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse fileDownload(HttpServletRequest request, Map<String, Object> params) {
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
@ -168,6 +169,7 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
return ResultVOUtils.success(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse receiveFile(HttpServletRequest request, String content, MultipartFile[] files) {
|
|
|
|
|
boolean isRelay = false;
|
|
|
|
@ -181,18 +183,23 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
ArrayList<String> saveFiles = new ArrayList<>();
|
|
|
|
|
Date startTime = new Date();
|
|
|
|
|
if (files != null) {
|
|
|
|
|
if (!FileUtils.makeDirectory(filePath + filePathSlash + imagePath))
|
|
|
|
|
IDCUtils.createDirectory(filePath + filePathSlash + imagePath);
|
|
|
|
|
try {
|
|
|
|
|
for (MultipartFile file : files) {
|
|
|
|
|
String imageName = filePath + filePathSlash + imagePath + file.getOriginalFilename();
|
|
|
|
|
String flodPath;
|
|
|
|
|
if (file.getName().contains(".jrxml") || file.getName().contains(".jasper")) {
|
|
|
|
|
flodPath = pdfPath;
|
|
|
|
|
} else {
|
|
|
|
|
flodPath = imagePath;
|
|
|
|
|
}
|
|
|
|
|
String imageName = filePath + filePathSlash + flodPath + file.getOriginalFilename();
|
|
|
|
|
saveFiles.add(imageName);
|
|
|
|
|
IDCUtils.writeFile(file.getBytes(), filePath + filePathSlash + imagePath, file.getOriginalFilename());
|
|
|
|
|
IDCUtils.writeFile(file.getBytes(), filePath + filePathSlash + flodPath, file.getOriginalFilename());
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|