From db7a68d449653790fe405488b4c81586c9f5ac8a Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Mon, 4 Sep 2023 17:48:08 +0800 Subject: [PATCH] =?UTF-8?q?add:=E4=BC=81=E4=B8=9A=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/CompanyController.php | 43 +++++++++++++++++++ app/api/controller/IndexController.php | 9 ++++ app/api/controller/JunziqianController.php | 20 +++++++++ app/common/logic/CompanyLogic.php | 1 + route/app.php | 1 + 5 files changed, 74 insertions(+) diff --git a/app/adminapi/controller/CompanyController.php b/app/adminapi/controller/CompanyController.php index 7920b1d11..893a6d95f 100644 --- a/app/adminapi/controller/CompanyController.php +++ b/app/adminapi/controller/CompanyController.php @@ -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'); diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index d2ed0138d..c3c80dbfb 100755 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -385,4 +385,13 @@ class IndexController extends BaseApiController return json(['success' => false, 'msg' => '失败,没有参数']); } + + /** + * 企业人脸校验上传回调 + */ + public function notifyOrganizationFaceCreate() + { + $parmas = Request()->param(); + Log::debug('认证回调:'.$parmas); + } } diff --git a/app/api/controller/JunziqianController.php b/app/api/controller/JunziqianController.php index 8d056227b..5fe96daeb 100644 --- a/app/api/controller/JunziqianController.php +++ b/app/api/controller/JunziqianController.php @@ -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); diff --git a/app/common/logic/CompanyLogic.php b/app/common/logic/CompanyLogic.php index cbced01fd..8339af017 100644 --- a/app/common/logic/CompanyLogic.php +++ b/app/common/logic/CompanyLogic.php @@ -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'], diff --git a/route/app.php b/route/app.php index dab0d9540..e74188d82 100755 --- a/route/app.php +++ b/route/app.php @@ -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'); \ No newline at end of file