chen 5 лет назад
Родитель
Сommit
053670d15c
2 измененных файлов с 16 добавлено и 5 удалено
  1. 5 5
      app/model/intelligentDocking.js
  2. 11 0
      app/service/companyidentify.js

+ 5 - 5
app/model/intelligentDocking.js

@@ -11,13 +11,13 @@ const info = new Schema({
 const IntelligentDockingSchema = {
   uid: { type: String, required: true, maxLength: 200 }, // 企业用户id
   // 对接需求
-  company_name: { type: String, required: false, maxLength: 200 }, // 企业名称
+  company_name: { type: String, required: true, maxLength: 200 }, // 企业名称
   code: { type: String, required: false, maxLength: 200 }, // 统一社会信用代码
-  person: { type: String, required: false, maxLength: 200 }, // 联系人
-  phone: { type: String, required: false, maxLength: 200 }, // 手机号
+  person: { type: String, required: true, maxLength: 200 }, // 联系人
+  phone: { type: String, required: true, maxLength: 200 }, // 手机号
   opening_bank: { type: String, required: false, maxLength: 200 }, // 首选开户行
-  orientation: { type: [ String ], required: false }, // 融资取向
-  money: { type: String, required: false, maxLength: 200 }, // 融资金额
+  orientation: { type: [ String ], required: true }, // 融资取向
+  money: { type: String, required: true, maxLength: 200 }, // 融资金额
   claims_min_term: { type: String, required: false, maxLength: 200 }, // 融资期限(小)
   claims_max_term: { type: String, required: false, maxLength: 200 }, // 融资期限(大)
   mongey_min_rate: { type: String, required: false, maxLength: 200 }, // 融资利率(小)

+ 11 - 0
app/service/companyidentify.js

@@ -17,6 +17,17 @@ class CompanyidentifyService extends CrudService {
     this.dmodel = this.ctx.model.Dictionary;
   }
 
+  // 重写创建方法
+  async create(data) {
+    const { uid, company_name, reg_num, type, address, business, capital, establish_date, valid_period, person, opening_bank } = data;
+    assert(company_name && reg_num && type && address && business && capital && establish_date && valid_period && person && opening_bank, '缺少部分信息项');
+
+    const res = await this.model.create(data);
+    // 给用户发送消息告知注册成功
+    this.ctx.service.viewnews.insertViewNews('认证成功', '恭喜您认证成功', res._id);
+    return res;
+  }
+
   // 修改企业认证信息表的状态
   async status({ id }, { status }) {
     // 根据id查询企业认证信息表的数据