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