This commit is contained in:
parent
0964332247
commit
810a72b47f
|
|
@ -96,6 +96,7 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
file.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
file.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||||
file.setCreateTime(new Date());
|
file.setCreateTime(new Date());
|
||||||
dao.insertFileInfo(file);
|
dao.insertFileInfo(file);
|
||||||
|
log.info("文件对象:#{}", file);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -161,6 +162,7 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
String tmpName = multipartFile.getOriginalFilename();
|
String tmpName = multipartFile.getOriginalFilename();
|
||||||
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
|
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
|
||||||
tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length());
|
tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length());
|
||||||
|
log.error("完整路径 IE:#{}" , tmpName);
|
||||||
String imageFiles = localFilePath + fileType + "/";
|
String imageFiles = localFilePath + fileType + "/";
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) {
|
if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) {
|
||||||
|
|
@ -176,6 +178,7 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
}
|
}
|
||||||
url = "/" + fileType + "/" + year + "/" + month + "/" + day + "/" + tmpName;
|
url = "/" + fileType + "/" + year + "/" + month + "/" + day + "/" + tmpName;
|
||||||
|
log.error("文件保存路径:#{}" , url);
|
||||||
if (!multipartFile.isEmpty()) {
|
if (!multipartFile.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
FileOutputStream fos = new FileOutputStream(file);
|
FileOutputStream fos = new FileOutputStream(file);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue