ソースを参照

联系方式申请审核改为全依靠前端填写内容

lrf 7 ヶ月 前
コミット
7080f24996

+ 15 - 0
src/controller/users/contactApply.controller.ts

@@ -21,6 +21,21 @@ export class ContactApplyController {
   @Inject()
   esService: ESService;
 
+  /**
+   * 根据申请信息,找到联系人进行填充
+   * @param id 申请id
+   */
+  @Get('/contacts/:id')
+  async getContacts(@Param('id') id: number) {
+    const data = await await this.service.fetch({ id });
+    if (!data) throw new ServiceError(ErrorCode.DATA_NOT_FOUND); // 抛出异常,未找到要审核的数据
+    const source = get(data, 'source');
+    const source_id = get(data, 'source_id');
+    const otherData = await this.service.searchCompleteData(source, source_id);
+    const contacts = await this.service.getContactObject(otherData, source);
+    return contacts;
+  }
+
   @Post('/examine', { routerName: `审核${namePrefix}` })
   @ApiTags('信息审核')
   @ApiQuery({ name: 'examine' })

+ 2 - 2
src/service/users/contactApply.service.ts

@@ -71,8 +71,8 @@ export class ContactApplyService extends BaseServiceV2 {
     const sourceData = get(otherData, 'sourceData');
     const sourcePropValue = get(sourceData, 'name');
     let contacts = {};
-    if (source === 'sector') contacts = inputContacts;
-    else contacts = this.getContactObject(otherData, source);
+    // 所有的联系人及联系方式都使用前台传来的内容
+    contacts = inputContacts;
     let msgStr = `您通过 ${sourceStr}数据 ${sourcePropValue ? `- ${sourcePropValue}` : ''} 获取对方联系方式的申请已通过.`;
     // 拼接联系方式
     const person = get(contacts, 'person');