|
@@ -3,7 +3,7 @@ import { InjectEntityModel } from '@midwayjs/typeorm';
|
|
|
import { Repository } from 'typeorm';
|
|
|
import { BaseServiceV2 } from '../../frame/BaseServiceV2';
|
|
|
import { MatchRegistration } from '../../entity/match/matchRegistration.entity';
|
|
|
-import { get, orderBy } from 'lodash';
|
|
|
+import { get, isArray, orderBy, replace } from 'lodash';
|
|
|
@Provide()
|
|
|
export class MatchRegistrationService extends BaseServiceV2 {
|
|
|
@InjectEntityModel(MatchRegistration)
|
|
@@ -31,4 +31,26 @@ export class MatchRegistrationService extends BaseServiceV2 {
|
|
|
}
|
|
|
return freeOrderList;
|
|
|
}
|
|
|
+
|
|
|
+ async dealData(data) {
|
|
|
+ const info = get(data, 'info')
|
|
|
+ if (!info) return data;
|
|
|
+ if (!isArray(data)) return data;
|
|
|
+ // 特化查询: 找出 项目名称 和 负责人补充信息单位
|
|
|
+ const nameList = [{ key: 'project_name', problem: '项目名称' }, { key: 'person_unit', problem: '负责人单位' }]
|
|
|
+ for (const i of nameList) {
|
|
|
+ const targetProblem = get(i, 'problem')
|
|
|
+ const problemData = info.find(f => {
|
|
|
+ let problem = get(f, 'problem')
|
|
|
+ // 清除所有空格
|
|
|
+ problem = replace(problem, /\s+/g, '');
|
|
|
+ return targetProblem === problem;
|
|
|
+ })
|
|
|
+ if (!problemData) continue;
|
|
|
+ const key = get(i, 'key')
|
|
|
+ const reply = get(problemData, 'reply')
|
|
|
+ data[key] = reply
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|