|
@@ -73,8 +73,9 @@ class PatentwarningService extends CrudService {
|
|
|
throw new BusinessError(ErrorCode.SERVICE_FAULT, '组织专利信息警告数据失败');
|
|
|
}
|
|
|
const tifPaths = filePaths.filter(f => f.includes('.tif'));
|
|
|
- if (tifPaths && tifPaths.length > 0) this.toUploadTif(warningData, tifPaths);
|
|
|
- // await this.dirDelete(`${uncompressFilePath}${fileName}`);
|
|
|
+ let lastResult;
|
|
|
+ if (tifPaths && tifPaths.length > 0) lastResult = this.toUploadTif(warningData, tifPaths);
|
|
|
+ if (lastResult) { await this.dirDelete(`${uncompressFilePath}${fileName}`); }
|
|
|
return 'ok';
|
|
|
}
|
|
|
|
|
@@ -105,7 +106,6 @@ class PatentwarningService extends CrudService {
|
|
|
// 检查上传全路径是否存在,不存在就创建文件夹
|
|
|
await this.checkPathAndCreate(path);
|
|
|
// 另存文件
|
|
|
- console.log(`${path}${newFileName}`);
|
|
|
await fs.writeFileSync(`${path}${newFileName}`, buffer);
|
|
|
// 替换为files开头
|
|
|
let dataPath = path.replace(this.import_root_path, '/files');
|