浏览代码

修改时间

zs 1 年之前
父节点
当前提交
f55ca0300f
共有 3 个文件被更改,包括 15 次插入12 次删除
  1. 1 1
      src/entity/cpcMessageerror.entity.ts
  2. 4 4
      src/interface/cpcMessageerror.interface.ts
  3. 10 7
      src/service/cpcMessage.service.ts

+ 1 - 1
src/entity/cpcMessageerror.entity.ts

@@ -15,5 +15,5 @@ export class CpcMessageerror extends BaseModel {
   @prop({ required: false, index: false, zh: '导入的zip包' })
   zip_url: string;
   @prop({ required: false, index: true, zh: '导入时间' })
-  create_Date: string;
+  create_date: string;
 }

+ 4 - 4
src/interface/cpcMessageerror.interface.ts

@@ -25,7 +25,7 @@ export class FVO_cpcMessageerror {
   @ApiProperty({ description: '导入的zip包' })
   'zip_url': string = undefined;
   @ApiProperty({ description: '导入时间' })
-  'create_Date': string = undefined;
+  'create_date': string = undefined;
 }
 
 export class QDTO_cpcMessageerror extends SearchBase {
@@ -36,7 +36,7 @@ export class QDTO_cpcMessageerror extends SearchBase {
       'patent_name',
       'patent_key',
       'content',
-      'create_Date',
+      'create_date',
     ];
     const mapping = [];
     super({ like_prop, props, mapping });
@@ -50,7 +50,7 @@ export class QDTO_cpcMessageerror extends SearchBase {
   @ApiProperty({ description: '错误信息' })
   'content': string = undefined;
   @ApiProperty({ description: '导入时间' })
-  'create_Date': string = undefined;
+  'create_date': string = undefined;
 }
 
 export class QVO_cpcMessageerror extends FVO_cpcMessageerror {
@@ -78,7 +78,7 @@ export class CDTO_cpcMessageerror {
   'zip_url': string = undefined;
   @ApiProperty({ description: '导入时间' })
   @Rule(RuleType['string']().empty(''))
-  'create_Date': string = undefined;
+  'create_date': string = undefined;
 }
 
 export class CVO_cpcMessageerror extends FVO_cpcMessageerror {

+ 10 - 7
src/service/cpcMessage.service.ts

@@ -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;
   }