Jelajahi Sumber

对接关注

chen 4 tahun lalu
induk
melakukan
aa0051d477

+ 3 - 3
app/controller/.companyidentify.js

@@ -9,12 +9,12 @@ module.exports = {
       '!business',
       '!capital',
       '!establish_date',
-      '!valid_period',
+      'valid_period',
       '!person',
       '!opening_bank',
       'status',
       // '!code',
-      // 'business_license',
+      'business_license',
       // 'establish_date',
       // 'due_date',
       // 'type',
@@ -61,7 +61,7 @@ module.exports = {
       'opening_bank',
       'status',
       // 'uid',
-      // 'business_license',
+      'business_license',
       // 'company_name',
       // 'establish_date',
       // 'due_date',

+ 2 - 2
app/model/companyidentify.js

@@ -13,12 +13,12 @@ const CompanyidentifySchema = {
   business: { type: String, required: true, maxLength: 200 }, // 经营范围                   必填
   capital: { type: String, required: true, maxLength: 200 }, // 注册资本                    必填
   establish_date: { type: String, required: true, maxLength: 200 }, // 成立日期             必填
-  valid_period: { type: String, required: true, maxLength: 200 }, //    公司营业期限终止日期      "长期"表示为"29991231"
+  valid_period: { type: String, required: false, maxLength: 200 }, //    公司营业期限终止日期      "长期"表示为"29991231"
   person: { type: String, required: true, maxLength: 200 }, //      法定代表人      必填
   opening_bank: { type: String, required: true, maxLength: 200 }, //      开户行      必填
   status: { type: String, required: false, maxLength: 200, default: '1' }, // 认证状态,0-认证中,1-认证通过,2-认证失败  改为默认认证通过
 
-  // business_license: { type: String, required: false, maxLength: 200 }, // 营业执照图片
+  business_license: { type: String }, // 营业执照图片 -- 存base64码
   // establish_date: { type: String, required: false, maxLength: 200 }, // 成立日期
   // due_date: { type: String, required: false, maxLength: 200 }, // 营业到期日期
   // type: { type: String, required: false, maxLength: 200 }, // 企业类型

+ 1 - 1
app/model/companyup.js

@@ -14,7 +14,7 @@ const CompanyupSchema = {
   business: { type: String, required: true, maxLength: 200 }, // 经营范围                   必填
   capital: { type: String, required: true, maxLength: 200 }, // 注册资本                    必填
   establish_date: { type: String, required: true, maxLength: 200 }, // 成立日期             必填
-  valid_period: { type: String, required: true, maxLength: 200 }, //    公司营业期限终止日期      "长期"表示为"29991231"
+  valid_period: { type: String, required: false, maxLength: 200 }, //    公司营业期限终止日期      "长期"表示为"29991231"
   person: { type: String, required: true, maxLength: 200 }, //      法定代表人      必填
 
 

+ 3 - 3
app/service/companyidentify.js

@@ -19,8 +19,8 @@ class CompanyidentifyService extends CrudService {
 
   // 重写创建方法
   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 { uid, company_name, business_license, reg_num, type, address, business, capital, establish_date, person, opening_bank } = data;
+    assert(company_name && business_license && reg_num && type && address && business && capital && establish_date && person && opening_bank, '缺少部分信息项');
 
     const res = await this.model.create(data);
     // 给用户发送消息告知注册成功
@@ -36,7 +36,7 @@ class CompanyidentifyService extends CrudService {
     if (status === '1') {
       // 将企业认证信息表中的部分字段提取出来,创建用户对应的企业信息表
       // const newdata = _.pick(companyidentify, [ 'uid', 'company_name', 'introduction', 'registered_addr', 'business_addr', 'profession_one', 'profession_two', 'profession_three', 'profession_four' ]);
-      const newdata = _.pick(companyidentify, [ 'uid', 'company_name', 'reg_num', 'type', 'address', 'business', 'capital', 'establish_date', 'valid_period', 'person' ]);
+      const newdata = _.pick(companyidentify, [ 'uid', 'company_name', 'reg_num', 'type', 'address', 'business', 'capital', 'establish_date', 'person' ]);
       // 将企业用户表中的权限改为1(认证)
       const companyuser = await this.umodel.findById(companyidentify.uid);
       companyuser.roles = '1';