|
@@ -60,7 +60,7 @@ export class CpcMessageService extends BaseService<modelType> {
|
|
|
// 修改,多个专利:需要扫描下解压后的文件夹,然后循环处理下面所有的内容
|
|
|
const tempDirRootPath = `${uncompressFilePath}${sep}`;
|
|
|
let tempDir = fs.readdirSync(tempDirRootPath);
|
|
|
- let errorList = [];
|
|
|
+ const errorList = [];
|
|
|
// 2023-02-06: zip格式修改: zip套dir => zip套zip, zip解压出dir;
|
|
|
// 也就是需要将zip再次解压一遍,并将所有的zip删除即可
|
|
|
const isAllZip = tempDir.some(f => f.includes('zip'));
|
|
@@ -200,13 +200,16 @@ export class CpcMessageService extends BaseService<modelType> {
|
|
|
} catch (error) {
|
|
|
this.ctx.logger.error('清除缓存失败');
|
|
|
}
|
|
|
- // 2022-09-05 将错误信息添加到表中
|
|
|
- errorList = errorList.map(i => ({
|
|
|
- ...i,
|
|
|
+ // 将错误信息添加到表中
|
|
|
+ const errorMsg = errorList.map(i => ({
|
|
|
+ create_number: i.create_number || '',
|
|
|
+ patent_name: i.name || '',
|
|
|
+ patent_key: i.patent_key,
|
|
|
+ content: i.content,
|
|
|
zip_url: uri,
|
|
|
create_date: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
}));
|
|
|
- await this.errorModel.insertMany(errorList);
|
|
|
+ await this.errorModel.insertMany(errorMsg);
|
|
|
if (errorList.length > 0) return errorList;
|
|
|
return 'ok';
|
|
|
}
|
|
@@ -340,7 +343,7 @@ export class CpcMessageService extends BaseService<modelType> {
|
|
|
arr.splice(arr.length - 1, 0, '.');
|
|
|
create_number = arr.join('');
|
|
|
const needChange = false;
|
|
|
- // 2022-09-02 改为多条数据查询,不再针对一个数据
|
|
|
+ // 改为多条数据查询,不再针对一个数据
|
|
|
// 1,名称相同,关联人不同:
|
|
|
const listPA = await this.ApplyModel.find({
|
|
|
$or: [{ create_number }, { name }],
|
|
@@ -411,7 +414,7 @@ export class CpcMessageService extends BaseService<modelType> {
|
|
|
result.push(curPath);
|
|
|
}
|
|
|
}
|
|
|
- // 2023-02-07 原来是.tif,现在是.pdf
|
|
|
+ //现在是.pdf
|
|
|
result = result.filter(f => f.includes('.pdf') || f.includes('.xml'));
|
|
|
return result;
|
|
|
}
|