lrf 9 ماه پیش
والد
کامیت
5a715d921f
3فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 3 2
      src/controller/home.controller.ts
  2. 1 0
      src/service/initData/initOne.service.ts
  3. 4 2
      src/service/initData/initThree.service.ts

+ 3 - 2
src/controller/home.controller.ts

@@ -30,8 +30,9 @@ export class HomeController {
     // await this.oneService.addImportDataTags();
     // await this.twoService.addTags();
     // await this.twoService.addImportDataTags();
-    // await this.oneService.dataToUse();
-    // await this.twoService.dataToUse();
+    await this.oneService.dataToUse();
+    await this.twoService.dataToUse();
+    await this.threeService.dataToUse();
     // const data = await this.qichachaService.searchByName('长春市福瑞科技');
     // await this.threeService.import2021Company();
     // await this.threeService.import2024Company();

+ 1 - 0
src/service/initData/initOne.service.ts

@@ -29,6 +29,7 @@ export class InitOneService {
   }
   async dataToUse() {
     await this.achievementModel.update({}, { is_use: '0' });
+    await this.expertModel.update({}, { status: '1' });
   }
   async addTags() {
     const list = [{ title: '20240611' }, { title: '成果' }, { title: '专家' }, { title: '需求' }];

+ 4 - 2
src/service/initData/initThree.service.ts

@@ -24,7 +24,9 @@ export class InitThreeService {
   @InjectEntityModel(Sign)
   signModel: Repository<Sign>;
 
-  async initData() {}
+  async dataToUse() {
+    await this.companyModel.update({}, { status: '1' });
+  }
 
   /**
    * 获取excel表头对应的字段
@@ -201,7 +203,7 @@ export class InitThreeService {
         if (num <= 0) await this.signModel.insert(obj);
       }
     }
-    await this.addTags(this.tags)
+    await this.addTags(this.tags);
   }
 
   async addTags(tags: Array<string>) {