|
@@ -393,7 +393,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
byte[] res = RSAEncrypt.decrypt(RSAEncrypt.loadPrivateKeyByStr(RSAEncrypt.loadPrivateKeyByFile()),
|
|
byte[] res = RSAEncrypt.decrypt(RSAEncrypt.loadPrivateKeyByStr(RSAEncrypt.loadPrivateKeyByFile()),
|
|
base64.decode(cipher));
|
|
base64.decode(cipher));
|
|
String restr = new String(res, "UTF-8");
|
|
String restr = new String(res, "UTF-8");
|
|
- log.info("uploadSuccessBuild-params解密结果:" + restr);
|
|
|
|
|
|
+ log.info("turntableUploadSuccess-params:解密结果:" + restr);
|
|
String[] strArr = restr.split(SPLICE);
|
|
String[] strArr = restr.split(SPLICE);
|
|
if (strArr.length != 3) {
|
|
if (strArr.length != 3) {
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
@@ -745,7 +745,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
if (yunFile.exists()){
|
|
if (yunFile.exists()){
|
|
String fileMD5 = FileMd5Util.getFileMD5(yunFile);
|
|
String fileMD5 = FileMd5Util.getFileMD5(yunFile);
|
|
if (md5.equals(fileMD5) && yunFile.length() == size){
|
|
if (md5.equals(fileMD5) && yunFile.length() == size){
|
|
- log.warn("文件已存在,MD5和文件大小一致。");
|
|
|
|
|
|
+ log.info("文件已存在,MD5和文件大小一致。");
|
|
SceneFileUpload uploadEntity = sceneFileUploadService.findByFileIdAndChunk(fileId, Integer.valueOf(chunk));
|
|
SceneFileUpload uploadEntity = sceneFileUploadService.findByFileIdAndChunk(fileId, Integer.valueOf(chunk));
|
|
if (uploadEntity != null){
|
|
if (uploadEntity != null){
|
|
uploadEntity.setSize((int) size);
|
|
uploadEntity.setSize((int) size);
|
|
@@ -767,16 +767,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
}
|
|
}
|
|
result = ResultData.ok();
|
|
result = ResultData.ok();
|
|
}else if (!md5.equals(fileMD5)) {
|
|
}else if (!md5.equals(fileMD5)) {
|
|
- log.warn("文件已上传,上传MD5:"+md5+",服务器MD5:"+fileMD5+"。不一致。上传失败");
|
|
|
|
|
|
+ log.info("文件已上传,上传MD5:"+md5+",服务器MD5:"+fileMD5+"。不一致。上传失败");
|
|
FileUtils.delFile(yunFilePath.toString());
|
|
FileUtils.delFile(yunFilePath.toString());
|
|
needUpload = true;
|
|
needUpload = true;
|
|
}else if (yunFile.length() != size){
|
|
}else if (yunFile.length() != size){
|
|
- log.warn("文件已上传,文件大小不一致。上传失败");
|
|
|
|
|
|
+ log.info("文件已上传,文件大小不一致。上传失败");
|
|
FileUtils.delFile(yunFilePath.toString());
|
|
FileUtils.delFile(yunFilePath.toString());
|
|
needUpload = true;
|
|
needUpload = true;
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- log.warn("文件不存在,需要重新上传");
|
|
|
|
|
|
+ log.info("文件不存在,需要重新上传");
|
|
needUpload = true;
|
|
needUpload = true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -784,31 +784,31 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
// 5. 如果相等,更新数据记录。如果不相等,返回上传失败结果。
|
|
// 5. 如果相等,更新数据记录。如果不相等,返回上传失败结果。
|
|
try {
|
|
try {
|
|
if (needUpload){
|
|
if (needUpload){
|
|
- fYunFileService.uploadFile(file.getInputStream(),ConstantFilePath.OSS_PREFIX.concat(filePath).concat(fileName));
|
|
|
|
|
|
+ fYunFileService.uploadFile(file.getInputStream(),ConstantFilePath.OSS_PREFIX.concat(filePath).concat(File.separator).concat(fileName));
|
|
File uploadFile = new File(yunFilePath);
|
|
File uploadFile = new File(yunFilePath);
|
|
String fileMD5 = FileMd5Util.getFileMD5(uploadFile);
|
|
String fileMD5 = FileMd5Util.getFileMD5(uploadFile);
|
|
|
|
|
|
SceneFileUpload sceneFileUploadEntity = new SceneFileUpload();
|
|
SceneFileUpload sceneFileUploadEntity = new SceneFileUpload();
|
|
sceneFileUploadEntity.setSize((int) size);
|
|
sceneFileUploadEntity.setSize((int) size);
|
|
sceneFileUploadEntity.setMd5(md5);
|
|
sceneFileUploadEntity.setMd5(md5);
|
|
- sceneFileUploadEntity.setFilePath(yunFilePath.toString());
|
|
|
|
|
|
+ sceneFileUploadEntity.setFilePath(yunFilePath);
|
|
sceneFileUploadEntity.setFileSourceName(fileName);
|
|
sceneFileUploadEntity.setFileSourceName(fileName);
|
|
sceneFileUploadEntity.setFileId(fileId);
|
|
sceneFileUploadEntity.setFileId(fileId);
|
|
sceneFileUploadEntity.setChunk(Integer.valueOf(chunk));
|
|
sceneFileUploadEntity.setChunk(Integer.valueOf(chunk));
|
|
|
|
|
|
if (md5.equals(fileMD5) && uploadFile.length() == size){
|
|
if (md5.equals(fileMD5) && uploadFile.length() == size){
|
|
- log.warn("文件已上传,MD5和文件大小一致。上传成功");
|
|
|
|
|
|
+ log.info("文件已上传,MD5和文件大小一致。上传成功");
|
|
|
|
|
|
sceneFileUploadEntity.setUploadStatus(1);
|
|
sceneFileUploadEntity.setUploadStatus(1);
|
|
sceneFileUploadService.save(sceneFileUploadEntity);
|
|
sceneFileUploadService.save(sceneFileUploadEntity);
|
|
result = ResultData.ok();
|
|
result = ResultData.ok();
|
|
}else if (!md5.equals(fileMD5)) {
|
|
}else if (!md5.equals(fileMD5)) {
|
|
- log.warn("文件已上传,上传MD5:"+md5+",服务器MD5:"+fileMD5+"。不一致。上传失败");
|
|
|
|
|
|
+ log.info("文件已上传,上传MD5:"+md5+",服务器MD5:"+fileMD5+"。不一致。上传失败");
|
|
sceneFileUploadEntity.setUploadStatus(-1);
|
|
sceneFileUploadEntity.setUploadStatus(-1);
|
|
sceneFileUploadService.save(sceneFileUploadEntity);
|
|
sceneFileUploadService.save(sceneFileUploadEntity);
|
|
result = ResultData.error(ErrorCode.SYSTEM_ERROR,"上传失败, 请重新上传。");
|
|
result = ResultData.error(ErrorCode.SYSTEM_ERROR,"上传失败, 请重新上传。");
|
|
}else if (uploadFile.length() != size){
|
|
}else if (uploadFile.length() != size){
|
|
- log.warn("文件已上传,文件大小不一致。上传失败");
|
|
|
|
|
|
+ log.info("文件已上传,文件大小不一致。上传失败");
|
|
sceneFileUploadEntity.setUploadStatus(-1);
|
|
sceneFileUploadEntity.setUploadStatus(-1);
|
|
sceneFileUploadService.save(sceneFileUploadEntity);
|
|
sceneFileUploadService.save(sceneFileUploadEntity);
|
|
result = ResultData.error(ErrorCode.SYSTEM_ERROR,"上传失败, 请重新上传。");
|
|
result = ResultData.error(ErrorCode.SYSTEM_ERROR,"上传失败, 请重新上传。");
|