Procházet zdrojové kódy

Merge branch 'main' of http://git.cc-lotus.info/Information/cxyy-service

lrf před 8 měsíci
rodič
revize
d7948fe451

+ 3 - 0
src/config/config.default.ts

@@ -17,4 +17,7 @@ export default {
     es: 'http://127.0.0.1:9701/cxyy/es',
     mq: 'http://127.0.0.1:9702/cxyy/mq',
   },
+  PathConfig: {
+    path: 'C:\\temp\\cxyy\\',
+  },
 } as MidwayConfig;

+ 3 - 0
src/config/config.local.ts

@@ -72,4 +72,7 @@ export default {
   upload: {
     whitelist: null,
   },
+  PathConfig: {
+    path: 'C:\\temp\\cxyy\\',
+  },
 } as MidwayConfig;

+ 3 - 0
src/config/config.prod.ts

@@ -74,4 +74,7 @@ export default {
   upload: {
     whitelist: null,
   },
+  PathConfig: {
+    path: '/home/workspace/service/proxy/upload/cxyy/export',
+  },
 } as MidwayConfig;

+ 4 - 1
src/config/config.self.ts

@@ -72,6 +72,9 @@ export default {
     },
   },
   upload: {
-    whitelist: null,
+    // whitelist: null,
+  },
+  PathConfig: {
+    path: 'D:\\temp\\cxyy\\',
   },
 } as MidwayConfig;

+ 1 - 0
src/controller/platform/match.controller.ts

@@ -53,6 +53,7 @@ export class MatchController implements BaseController {
   async update(@Param('id') id: number, @Body() data: object) {
     if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
     const result = await this.service.update({ id }, data);
+    await this.service.updateProject({ id }, data);
     return result;
   }
 

+ 0 - 1
src/controller/users/cirelation.controller.ts

@@ -67,7 +67,6 @@ export class cirelationController implements BaseController {
   async update(@Param('id') id: number, @Body() data: object) {
     if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
     const result = await this.service.update({ id }, data);
-    this.serviceUtil.fillIdentity(data, 'cirelation');
     return result;
   }
 

+ 14 - 15
src/public/importMapping.ts

@@ -43,20 +43,19 @@ const demand = [
   { index: 3, field: 'start_time', type: 'date', zh: '开始时间' },
   { index: 4, field: 'end_time', type: 'date', zh: '结束时间' },
   { index: 5, field: 'money', type: 'date', zh: '价格' },
-  { index: 6, field: 'type', type: 'dict', code: 'type', zh: '类型' },
-  { index: 7, field: 'field', type: 'dict', code: 'field', zh: '行业领域' },
-  { index: 8, field: 'urgent', type: 'dict', code: 'urgent', zh: '需求紧急度' },
-  { index: 9, field: 'method', type: 'dict', code: 'method', zh: '合作方式' },
-  { index: 10, field: 'area', type: 'area', zh: '地区' },
-  { index: 11, field: 'company', zh: '所属企业' },
-  { index: 12, field: 'company_brief', zh: '企业简况' },
-  { index: 13, field: 'contacts', zh: '联系人' },
-  { index: 14, field: 'tel', zh: '联系电话' },
-  { index: 15, field: 'year', zh: '年份' },
-  { index: 16, field: 'month', zh: '月份' },
-  { index: 17, field: 'tec_name', zh: '技术需求名称' },
-  { index: 18, field: 'question', zh: '待解决问题' },
-  { index: 19, field: 'brief', zh: '简介' },
+  { index: 6, field: 'field', zh: '行业领域' },
+  { index: 7, field: 'urgent', type: 'dict', code: 'urgent', zh: '需求紧急度' },
+  { index: 8, field: 'method', type: 'dict', code: 'method', zh: '合作方式' },
+  { index: 9, field: 'area', type: 'area', zh: '地区' },
+  { index: 10, field: 'company', zh: '所属企业' },
+  { index: 11, field: 'company_brief', zh: '企业简况' },
+  { index: 12, field: 'contacts', zh: '联系人' },
+  { index: 13, field: 'tel', zh: '联系电话' },
+  { index: 14, field: 'year', zh: '年份' },
+  { index: 15, field: 'month', zh: '月份' },
+  { index: 16, field: 'tec_name', zh: '技术需求名称' },
+  { index: 17, field: 'question', zh: '待解决问题' },
+  { index: 18, field: 'brief', zh: '简介' },
 ];
 
 // supply
@@ -67,7 +66,7 @@ const supply = [
   { index: 4, field: 'end_time', type: 'date', zh: '结束时间' },
   { index: 5, field: 'money', type: 'date', zh: '价格' },
   { index: 6, field: 'type', type: 'dict', code: 'type', zh: '类型' },
-  { index: 7, field: 'field', type: 'dict', code: 'field', zh: '行业领域' },
+  { index: 7, field: 'field', zh: '行业领域' },
   { index: 8, field: 'urgent', type: 'dict', code: 'urgent', zh: '需求紧急度' },
   { index: 9, field: 'method', type: 'dict', code: 'method', zh: '合作方式' },
   { index: 10, field: 'area', type: 'area', zh: '地区' },

+ 13 - 0
src/service/initData/dataDeal.service.ts

@@ -236,6 +236,19 @@ export class DataDealService {
         is_use: '0',
         icon: 'Reading',
       },
+      {
+        order_num: 13,
+        name: '企业选择',
+        route_name: 'center_company',
+        i18n_code: 'menus.center_company',
+        path: '/center/company',
+        component: '/center/company',
+        type: '1',
+        config: [],
+        is_default: '0',
+        is_use: '0',
+        icon: 'SwitchFilled',
+      },
       {
         order_num: 998,
         name: '我的收藏',

+ 20 - 1
src/service/platform/match.service.ts

@@ -1,16 +1,35 @@
 import { Match } from '../../entity/platform/match.entity';
-import { Provide } from '@midwayjs/core';
+import { Provide, Inject } from '@midwayjs/core';
 import { InjectEntityModel } from '@midwayjs/typeorm';
 import { Repository } from 'typeorm';
 import { BaseServiceV2 } from '../../frame/BaseServiceV2';
+import { ProjectService } from './project.service';
+import dayjs = require('dayjs');
 @Provide()
 export class MatchService extends BaseServiceV2 {
   @InjectEntityModel(Match)
   model: Repository<Match>;
+
+  @Inject()
+  projectService: ProjectService;
   getQueryColumnsOpera() {
     const obj = {
       tags: this.Opera.Json,
     };
     return obj;
   }
+  // 赛事完成后,导入项目库,贴 赛事 标签,支持筛选
+  async updateProject({ id }, data) {
+    const builder = this.model.createQueryBuilder();
+    this.completeBuilderCondition({ id });
+    const match = await builder.getOne();
+    if (match && match.match_status === '2') {
+      const result = await this.projectService.query({ user: match.user, name: match.name });
+      if (result && result.total > 0) {
+        await this.projectService.update({ id: result.data[0].id }, { user: match.user, name: match.name, industry: match.industry, tags: ['赛事'], time: dayjs().format('YYYY-MM-DD'), source: '赛事', status: '1' });
+      } else {
+        await this.projectService.create({ user: match.user, name: match.name, industry: match.industry, tags: ['赛事'], time: dayjs().format('YYYY-MM-DD'), source: '赛事', status: '1' });
+      }
+    }
+  }
 }

+ 3 - 3
src/service/util.service.ts

@@ -39,15 +39,15 @@ export class UtilService {
   @Inject()
   dictDataService: DictDataService;
 
-  @Config('upload.realdir')
-  uploadDir;
+  @Config('PathConfig.path')
+  path;
 
   // 导出
   async toExport(query) {
     const { table, config, user } = query;
     const nowDate = new Date().getTime();
     const filename = `产学研用导出-${table}-${nowDate}.xlsx`;
-    const path = 'D:\\temp\\cxyy\\';
+    const path = this.path;
     if (!path) {
       throw new ServiceError('服务端没有设置存储路径');
     }