|
@@ -17,6 +17,7 @@ import { Sector } from '../../entity/platform/sector.entity';
|
|
import { Project } from '../../entity/platform/project.entity';
|
|
import { Project } from '../../entity/platform/project.entity';
|
|
import { Achievement } from '../../entity/platform/achievement.entity';
|
|
import { Achievement } from '../../entity/platform/achievement.entity';
|
|
import { Sign } from '../../entity/platform/sign.entity';
|
|
import { Sign } from '../../entity/platform/sign.entity';
|
|
|
|
+import { Match } from '../../entity/platform/match.entity';
|
|
|
|
|
|
@Provide()
|
|
@Provide()
|
|
export class ContactApplyService extends BaseServiceV2 {
|
|
export class ContactApplyService extends BaseServiceV2 {
|
|
@@ -43,7 +44,8 @@ export class ContactApplyService extends BaseServiceV2 {
|
|
sector: Repository<Sector>;
|
|
sector: Repository<Sector>;
|
|
@InjectEntityModel(Sign)
|
|
@InjectEntityModel(Sign)
|
|
sign: Repository<Sign>;
|
|
sign: Repository<Sign>;
|
|
-
|
|
|
|
|
|
+ @InjectEntityModel(Match)
|
|
|
|
+ match: Repository<Match>;
|
|
@InjectEntityModel(Expert)
|
|
@InjectEntityModel(Expert)
|
|
expert: Repository<Expert>;
|
|
expert: Repository<Expert>;
|
|
|
|
|
|
@@ -51,7 +53,6 @@ export class ContactApplyService extends BaseServiceV2 {
|
|
user: Repository<User>;
|
|
user: Repository<User>;
|
|
@InjectEntityModel(Admin)
|
|
@InjectEntityModel(Admin)
|
|
admin: Repository<Admin>;
|
|
admin: Repository<Admin>;
|
|
-
|
|
|
|
|
|
|
|
/**不需要对象用户和匹配度计算数据类型:孵化基地,产业集群 */
|
|
/**不需要对象用户和匹配度计算数据类型:孵化基地,产业集群 */
|
|
skipCheckList = ['incubator', 'sector'];
|
|
skipCheckList = ['incubator', 'sector'];
|
|
@@ -122,7 +123,15 @@ export class ContactApplyService extends BaseServiceV2 {
|
|
const otherData = await this.searchCompleteData(get(i, 'source'), get(i, 'source_id'));
|
|
const otherData = await this.searchCompleteData(get(i, 'source'), get(i, 'source_id'));
|
|
const sourceData = get(otherData, 'sourceData');
|
|
const sourceData = get(otherData, 'sourceData');
|
|
const propName = this.getSourceProp(get(i, 'source'));
|
|
const propName = this.getSourceProp(get(i, 'source'));
|
|
- const sourcePropValue = get(sourceData, propName);
|
|
|
|
|
|
+ let sourcePropValue = get(sourceData, propName);
|
|
|
|
+ if (get(i, 'source') === 'sign') {
|
|
|
|
+ // 路演类型: 是从报名id为source_id,但是来源应该是路演标题
|
|
|
|
+ const match_id = get(sourceData, 'match');
|
|
|
|
+ if (match_id) {
|
|
|
|
+ const match = await this.match.createQueryBuilder().where(`id =:id`, { id: match_id }).getOne();
|
|
|
|
+ sourcePropValue = get(match, propName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if (sourcePropValue) obj.source_name = sourcePropValue;
|
|
if (sourcePropValue) obj.source_name = sourcePropValue;
|
|
// exam_admin
|
|
// exam_admin
|
|
if (get(i, 'exam_admin')) {
|
|
if (get(i, 'exam_admin')) {
|
|
@@ -234,7 +243,7 @@ export class ContactApplyService extends BaseServiceV2 {
|
|
const source_id = get(data, 'source_id');
|
|
const source_id = get(data, 'source_id');
|
|
const builder = this.model.createQueryBuilder().where(`"apply_user" = :apply_user`, { apply_user });
|
|
const builder = this.model.createQueryBuilder().where(`"apply_user" = :apply_user`, { apply_user });
|
|
// if (!this.skipCheckList.includes(source)) builder.andWhere(`"target_user" = :target_user`, { target_user });
|
|
// if (!this.skipCheckList.includes(source)) builder.andWhere(`"target_user" = :target_user`, { target_user });
|
|
- if(this.skipCheckList.includes(source)) {
|
|
|
|
|
|
+ if (this.skipCheckList.includes(source)) {
|
|
builder.andWhere(`"source" =:source`, { source });
|
|
builder.andWhere(`"source" =:source`, { source });
|
|
builder.andWhere(`"source_id" =:source_id`, { source_id });
|
|
builder.andWhere(`"source_id" =:source_id`, { source_id });
|
|
}
|
|
}
|
|
@@ -261,6 +270,12 @@ export class ContactApplyService extends BaseServiceV2 {
|
|
const sourceData = get(data, 'sourceData');
|
|
const sourceData = get(data, 'sourceData');
|
|
if (get(sourceData, 'tel')) contacts.phone = get(sourceData, 'tel');
|
|
if (get(sourceData, 'tel')) contacts.phone = get(sourceData, 'tel');
|
|
if (get(sourceData, 'contacts')) contacts.person = get(sourceData, 'contacts');
|
|
if (get(sourceData, 'contacts')) contacts.person = get(sourceData, 'contacts');
|
|
|
|
+ } else if (source === 'sign') {
|
|
|
|
+ const sourceData = get(data, 'sourceData');
|
|
|
|
+ const person = get(sourceData, 'name');
|
|
|
|
+ const phone = get(sourceData, 'phone');
|
|
|
|
+ if (person) contacts.person = person;
|
|
|
|
+ if (phone) contacts.phone = phone;
|
|
} else if (source === 'incubator') {
|
|
} else if (source === 'incubator') {
|
|
const sourceData = get(data, 'sourceData');
|
|
const sourceData = get(data, 'sourceData');
|
|
const person = get(sourceData, 'person');
|
|
const person = get(sourceData, 'person');
|
|
@@ -321,7 +336,7 @@ export class ContactApplyService extends BaseServiceV2 {
|
|
str = '产业集群';
|
|
str = '产业集群';
|
|
break;
|
|
break;
|
|
case 'sign':
|
|
case 'sign':
|
|
- str = '活动路演'
|
|
|
|
|
|
+ str = '活动路演';
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|