add:企业人脸校验上传

This commit is contained in:
chenbo 2023-09-04 17:48:08 +08:00
parent e41413c6ab
commit db7a68d449
5 changed files with 74 additions and 0 deletions

View File

@ -203,6 +203,8 @@ class CompanyController extends BaseAdminController
} else {
return $this->fail($res->msg);
}
} else {
return $this->fail("公司不存在");
}
}
//重新认证
@ -229,6 +231,47 @@ class CompanyController extends BaseAdminController
}
}
// 企业人脸校验上传
public function organizationFaceCreate()
{
$params = (new CompanyValidate())->goCheck('detail');
$company = Db::name('company')->where('id', $params['id'])->find();
// 公司数据合法性校验
$this->companyCheck($company);
$data = [
'company_name' => $company['company_name'],
'organization_code' => $company['organization_code'],
'master_name' => $company['master_name'],
'master_id_card' => $company['master_id_card'],
'master_email' => $company['master_email'],
'master_phone' => $company['master_phone'],
'id' => $company['id'],
];
$res = app(JunziqianController::class)->organizationFaceCreate($data);
if ($res->success == true && !empty($res->data)) {
return $this->success('成功',["faceCreateUrl"=>$res->data],1, 1);
} else {
return $this->fail($res->msg);
}
}
private function companyCheck($company) {
if (empty($company)) {
return $this->fail("公司不存在");
}
if (empty($company['master_face'])) {
return $this->fail("未上传主联系人头像信息,无法上传企业人脸");
}
if(empty($company['master_id_card'])) {
return $this->fail("主联系人证件号为空,无法上传企业人脸");
}
if(empty($company['master_email'])) {
return $this->fail("主联系人邮箱为空,无法上传企业人脸");
}
}
public function userList()
{
$existUsers = Company::where('status', '<>', -1)->column('admin_id');

View File

@ -385,4 +385,13 @@ class IndexController extends BaseApiController
return json(['success' => false, 'msg' => '失败,没有参数']);
}
/**
* 企业人脸校验上传回调
*/
public function notifyOrganizationFaceCreate()
{
$parmas = Request()->param();
Log::debug('认证回调:'.$parmas);
}
}

View File

@ -153,6 +153,25 @@ class JunziqianController extends BaseApiController
return $response;
}
// 企业人脸校验上传
public function OrganizationFaceCreate($data) {
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
$request=new OrganizationCreateReq();
$request-> orderNo = uniqid();
$request-> email = $data['master_email'];
$request-> enterpriseName = $data['company_name'];
$request-> identityNo = $data['organization_code'];
$request-> legalPersonName = $data['master_name'];
$request-> legalIdentityCard = $data['master_id_card'];//法人证件号
$request-> legalMobile = $data['master_phone'];
$request-> facePerType = 1;
$request-> faceAgantIdenName = $data['master_name'];
$request-> faceAgantIdenCard = $data['master_id_card'];
$request-> backUrl = env('url.url_prefix').'/notifyOrganizationFaceCreate?id='.$data['id'];
$response = $requestUtils->doPost("/v2/user/organizationFaceCreate",$request);
return $response;
}
public function VehicleRentSigning($data, $id, $notify)
{
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
@ -163,6 +182,7 @@ class JunziqianController extends BaseApiController
$request->fileType = 1; //合同上传方式 url
$request->url = $data['url'];
$request->notifyUrl = $notify.'?id='.$id;
$request->needQifengSign = 1;
//发起PING请求
// halt($request);

View File

@ -66,6 +66,7 @@ class CompanyLogic extends BaseLogic
'address' => $params['address'],
'company_type' => $params['company_type'],
'master_name' => $params['master_name'],
'master_id_card' => $params['id_card'], // 主联系人证件号
'master_position' => $params['master_position'],
'master_phone' => $params['master_phone'],
'master_email' => $params['master_email'],

View File

@ -36,4 +36,5 @@ Route::rule('crontab', function () {
Route::post('/notify_url', IndexController::class . '@notifyUrl');
Route::post('/notifyAuthentication',IndexController::class . '@notifyAuthentication');
Route::post('/notifyOrganizationFaceCreate',IndexController::class . '@notifyOrganizationFaceCreate'); // 企业人脸上传校验回调接口
Route::get('/api/junziqian/download_file',JunziqianController::class . '@download_file');