lyhzzz 3 月之前
父节点
当前提交
c0ceb6be8f

+ 3 - 2
src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java

@@ -114,7 +114,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
     }
 
     private ResultData uploadModelZip(String oldName,File file,Integer dictId) {
-
+        Long fileSize = file.length();
         String ossZipPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, UUID.randomUUID().toString().replace("-", ""));
         String unzipPath = CacheUtil.basePath  + ossZipPath;
         ShellUtil.unZip(file.getPath(),unzipPath);
@@ -180,7 +180,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
 
         Integer status = StringUtils.isNotBlank(url) ?1:-1;
         url = StringUtils.isNotBlank(url) ?ossUrlPrefix + url:null;
-        CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(getDirectorySize(unZipFile)),
+        CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(fileSize),
                 null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId);
         if("osgb".equals(modelFileFormat)){
             //commonUploadService.updateStatus(commonUpload.getId(),0);
@@ -327,6 +327,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
                 }
             }
         }catch (Exception e){
+            log.info("getDirectorySize:{}",e);
         }
         return size;
     }

+ 3 - 1
src/main/java/com/fdkankan/fusion/service/impl/DictFileServiceImpl.java

@@ -55,7 +55,9 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
                 || dictFile.getDictId() == null ){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        dictFile.setSysUserId((String) StpUtil.getLoginId());
+        if(dictFile.getId() == null){
+            dictFile.setSysUserId((String) StpUtil.getLoginId());
+        }
         this.saveOrUpdate(dictFile);
     }
 

+ 4 - 2
src/main/java/com/fdkankan/fusion/service/impl/DictServiceImpl.java

@@ -84,8 +84,10 @@ public class DictServiceImpl extends ServiceImpl<IDictMapper, Dict> implements I
         if(StringUtils.isBlank(dict.getDictName()) || StringUtils.isBlank(dict.getDictKey())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        String userId  =(String) StpUtil.getLoginId();
-        dict.setSysUserId(userId);
+        if(dict.getId() == null){
+            String userId  =(String) StpUtil.getLoginId();
+            dict.setSysUserId(userId);
+        }
         this.saveOrUpdate(dict);
     }