|
@@ -59,7 +59,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
@Autowired
|
|
|
RabbitMqProducer rabbitMqProducer;
|
|
|
@Override
|
|
|
- public ResultData uploadFileNew( Integer dictId,MultipartFile file) {
|
|
|
+ public ResultData uploadFileNew( Integer dictId,MultipartFile file,Long userId) {
|
|
|
if( file.isEmpty() ){
|
|
|
throw new BusinessException(ResultCode.UPLOAD_ERROR);
|
|
|
}
|
|
@@ -77,7 +77,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
}
|
|
|
file.transferTo(tempFile);
|
|
|
if(extName.equals(".zip")){
|
|
|
- return uploadModelZip(name.replace(extName, ""),tempFile,dictId);
|
|
|
+ return uploadModelZip(name.replace(extName, ""),tempFile,dictId,userId);
|
|
|
}
|
|
|
fYunFileServiceInterface.uploadFile(tempFile.getPath(), ossPath);
|
|
|
//String url = this.ossUrlPrefix + ossPath;
|
|
@@ -88,7 +88,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
|
|
|
}
|
|
|
String format = extName.replace(".", "");
|
|
|
- CommonUpload commonUpload = commonUploadService.add(name.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum, format,format,1,null,dictId);
|
|
|
+ CommonUpload commonUpload = commonUploadService.add(name.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum, format,format,1,null,dictId,userId);
|
|
|
return ResultData.ok(commonUpload);
|
|
|
}catch ( BusinessException e){
|
|
|
log.info("upload-file-error:{}",e);
|
|
@@ -99,7 +99,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private ResultData uploadModelZip(String oldName,File file,Integer dictId) {
|
|
|
+ private ResultData uploadModelZip(String oldName,File file,Integer dictId,Long userId) {
|
|
|
|
|
|
String ossZipPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, UUID.randomUUID().toString().replace("-", ""));
|
|
|
String unzipPath = OssPath.localPath + ossZipPath;
|
|
@@ -153,7 +153,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
Integer status = StringUtils.isNotBlank(url) ? 1: -1;
|
|
|
url = StringUtils.isNotBlank(url) ? fusionConfig.getOssUrlPrefix() + url : null;
|
|
|
CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(getDirectorySize(unZipFile)),
|
|
|
- null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId);
|
|
|
+ null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId,userId);
|
|
|
if("osgb".equals(modelFileFormat)){
|
|
|
uploadOsgb(commonUpload.getId()) ;
|
|
|
}
|
|
@@ -232,7 +232,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public CommonUpload add(String fileName, String url, String fileSize, String uuid, FileTypeEnum fileTypeEnum, String resultFormat,String replace1, Integer status, String unzipPath, Integer dictId) {
|
|
|
+ public CommonUpload add(String fileName, String url, String fileSize, String uuid, FileTypeEnum fileTypeEnum, String resultFormat,String replace1, Integer status, String unzipPath, Integer dictId,Long userId) {
|
|
|
CommonUpload upload = new CommonUpload();
|
|
|
upload.setFileName(fileName);
|
|
|
upload.setFileUrl(url);
|
|
@@ -251,6 +251,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
dictFile.setTypeKey("media-library");
|
|
|
dictFile.setUploadId(upload.getId());
|
|
|
dictFile.setDictId(dictId);
|
|
|
+ dictFile.setSysUserId(userId);
|
|
|
dictFileService.saveOrUpdate(dictFile);
|
|
|
|
|
|
return upload;
|