|
|
|
@ -52,6 +52,7 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
@Resource
|
|
|
|
|
private IdcService idcService;
|
|
|
|
|
private String imagePath = "register/file/image2/";
|
|
|
|
|
private String devImagePath = "register/file/device/";
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse fileUpload(HttpServletRequest request,Map<String,Object> params) {
|
|
|
|
|
String host="";
|
|
|
|
@ -128,13 +129,13 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
ArrayList<String> saveFiles = new ArrayList<>();
|
|
|
|
|
Date startTime = new Date();
|
|
|
|
|
if (files != null) {
|
|
|
|
|
if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath))
|
|
|
|
|
IDCUtils.createDirectory(filePath + filePathSlash + imagePath);
|
|
|
|
|
if(!FileUtils.makeDirectory(filePath + filePathSlash + devImagePath))
|
|
|
|
|
IDCUtils.createDirectory(filePath + filePathSlash + devImagePath);
|
|
|
|
|
try {
|
|
|
|
|
for (MultipartFile file : files) {
|
|
|
|
|
String imageName = filePath + filePathSlash + imagePath + file.getOriginalFilename();
|
|
|
|
|
String imageName = filePath + filePathSlash + devImagePath + file.getOriginalFilename();
|
|
|
|
|
saveFiles.add(imageName);
|
|
|
|
|
IDCUtils.writeFile(file.getBytes(), filePath + filePathSlash + imagePath, file.getOriginalFilename());
|
|
|
|
|
IDCUtils.writeFile(file.getBytes(), filePath + filePathSlash + devImagePath, file.getOriginalFilename());
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|