|
@@ -101,10 +101,12 @@ export class ContactApplyController {
|
|
/**组织数据,填充联系方式申请表:将被申请方的id填充 */
|
|
/**组织数据,填充联系方式申请表:将被申请方的id填充 */
|
|
const userData = get(otherData, 'userData');
|
|
const userData = get(otherData, 'userData');
|
|
// 如果是在跳过检查列表中的申请,则不需要target_user.直接由管理员审核
|
|
// 如果是在跳过检查列表中的申请,则不需要target_user.直接由管理员审核
|
|
|
|
+ // 09-20修改: 没有target_user也允许,由管理员去填写内容
|
|
if (!skipCheckList.includes(source)) {
|
|
if (!skipCheckList.includes(source)) {
|
|
- if (!userData) throw new ServiceError(ErrorCode.CONTACTAPPLY_TARGET_USER_NOT_FOUND);
|
|
|
|
- const target_user = get(userData, 'id');
|
|
|
|
- data['target_user'] = target_user;
|
|
|
|
|
|
+ if (userData) {
|
|
|
|
+ const target_user = get(userData, 'id');
|
|
|
|
+ data['target_user'] = target_user;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 检查是否有未审核的申请
|
|
// 检查是否有未审核的申请
|
|
await this.service.checkHasApply(data);
|
|
await this.service.checkHasApply(data);
|
|
@@ -115,8 +117,9 @@ export class ContactApplyController {
|
|
// 没有keyword,无法计算匹配度,不用继续往下了.
|
|
// 没有keyword,无法计算匹配度,不用继续往下了.
|
|
if (!keyword) throw new ServiceError(ErrorCode.CONTACTAPPLY_NO_KEYWORD); //抛出异常: 无关键词,无法进行匹配计算
|
|
if (!keyword) throw new ServiceError(ErrorCode.CONTACTAPPLY_NO_KEYWORD); //抛出异常: 无关键词,无法进行匹配计算
|
|
// 查询匹配度
|
|
// 查询匹配度
|
|
- const result = await this.esService.getCS(keyword, source);
|
|
|
|
|
|
+ const result = await this.esService.getCS(keyword, source, source_id);
|
|
if (!result) throw new ServiceError(ErrorCode.CONTACTAPPLY_MATCHING_NOT_ENOUGH); // 抛出异常,无匹配度到4星,无法进行预约
|
|
if (!result) throw new ServiceError(ErrorCode.CONTACTAPPLY_MATCHING_NOT_ENOUGH); // 抛出异常,无匹配度到4星,无法进行预约
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
/**创建申请数据 */
|
|
/**创建申请数据 */
|
|
const dbData = await this.service.create(data);
|
|
const dbData = await this.service.create(data);
|