This commit is contained in:
mkm 2023-09-09 11:07:41 +08:00
commit fe040f1575
7 changed files with 54 additions and 21 deletions

View File

@ -30,6 +30,7 @@ use app\common\logic\contract\ContractLogic;
use app\common\model\contract\Contract; use app\common\model\contract\Contract;
use app\common\model\task_scheduling\TaskScheduling; use app\common\model\task_scheduling\TaskScheduling;
use app\common\model\user\User; use app\common\model\user\User;
use think\facade\Log;
/** /**
* Company控制器 * Company控制器
@ -200,6 +201,7 @@ class CompanyController extends BaseAdminController
'id' => $company['id'], 'id' => $company['id'],
]; ];
$res = app(JunziqianController::class)->EnterpriseCertification($data); $res = app(JunziqianController::class)->EnterpriseCertification($data);
Log::info(['企业认证同步结果',$res]);
if ($res->success == true) { if ($res->success == true) {
$email = $res->data; $email = $res->data;
// 企业人脸上传 // 企业人脸上传
@ -209,7 +211,7 @@ class CompanyController extends BaseAdminController
// return $this->fail($faceCreateRe); // return $this->fail($faceCreateRe);
// } // }
// 修改法人邮箱 // 修改法人邮箱
Db::name('company')->where('id', $params['id'])->update(['master_email' => $email]); Db::name('company')->where('id', $params['id'])->update(['master_email' => $email, 'face_create_status'=>1]);
// 加入缓存中is_callback用于判断是否获取到异步通知 // 加入缓存中is_callback用于判断是否获取到异步通知
RedisLogic::getInstance()->set('authentication_company_id_'.$company['id'], json_encode(['company_id'=>$company['id'],'is_callback'=>0, 'timing'=>time()])); RedisLogic::getInstance()->set('authentication_company_id_'.$company['id'], json_encode(['company_id'=>$company['id'],'is_callback'=>0, 'timing'=>time()]));
// return $this->success('认证成功',[],1, 1); // return $this->success('认证成功',[],1, 1);
@ -239,7 +241,7 @@ class CompanyController extends BaseAdminController
]; ];
$res = app(JunziqianController::class)->organizationReapply($data); $res = app(JunziqianController::class)->organizationReapply($data);
if ($res->success == true) { if ($res->success == true) {
Db::name('company')->where('id', $params['id'])->update(['master_email' => $res->data]); Db::name('company')->where('id', $params['id'])->update(['master_email' => $res->data, 'face_create_status'=>1]); //todo 上人脸采集功能时
return $this->success('系统认证中,请稍后刷新页面查看', ['email' => $res->data], 1, 1); return $this->success('系统认证中,请稍后刷新页面查看', ['email' => $res->data], 1, 1);
} else { } else {
return $this->fail($res->msg); return $this->fail($res->msg);

View File

@ -90,9 +90,13 @@ class ContractLists extends BaseAdminDataLists implements ListsSearchInterface
}else{ }else{
$item->party_b_name=Db::name('user')->where('id',$item->party_b)->value('nickname'); $item->party_b_name=Db::name('user')->where('id',$item->party_b)->value('nickname');
} }
$area_manager_name=Db::name('admin')->where('id',$item->party_a_info->area_manager)->value('name'); if(!empty($item->party_a_info)){
if($area_manager_name){ $area_manager_name=Db::name('admin')->where('id',$item->party_a_info->area_manager)->value('name');
$item->area_manager_name=$area_manager_name; if($area_manager_name){
$item->area_manager_name=$area_manager_name;
}else{
$item->area_manager_name='暂无片区经理';
}
}else{ }else{
$item->area_manager_name='暂无片区经理'; $item->area_manager_name='暂无片区经理';
} }

View File

@ -35,7 +35,7 @@ class CompanyValidate extends BaseValidate
'company_name' => 'require|unique:Company', 'company_name' => 'require|unique:Company',
'organization_code' => 'require', 'organization_code' => 'require',
'master_name' => 'require', 'master_name' => 'require',
'id_card' => 'require', // 'id_card' => 'require',
'master_position' => 'require', 'master_position' => 'require',
'master_phone' => 'require', 'master_phone' => 'require',
'master_email' => 'require', 'master_email' => 'require',
@ -53,7 +53,7 @@ class CompanyValidate extends BaseValidate
'company_name' => '公司名称', 'company_name' => '公司名称',
'organization_code' => '组织机构代码', 'organization_code' => '组织机构代码',
'master_name' => '主联系人姓名', 'master_name' => '主联系人姓名',
'id_card' => '主联系人身份证', // 'id_card' => '主联系人身份证',
'master_position' => '主联系人职务', 'master_position' => '主联系人职务',
'master_phone' => '主联系人手机', 'master_phone' => '主联系人手机',
'master_email' => '主联系人邮箱', 'master_email' => '主联系人邮箱',
@ -70,7 +70,7 @@ class CompanyValidate extends BaseValidate
*/ */
public function sceneAdd() public function sceneAdd()
{ {
return $this->only(['company_name','organization_code','master_name','id_card','master_position','master_phone']); return $this->only(['company_name','organization_code','master_name','master_position','master_phone']);
} }
@ -82,7 +82,7 @@ class CompanyValidate extends BaseValidate
*/ */
public function sceneEdit() public function sceneEdit()
{ {
return $this->only(['id','company_name','organization_code','master_name','id_card','master_position','master_phone']); return $this->only(['id','company_name','organization_code','master_name','master_position','master_phone']);
} }

View File

@ -32,7 +32,7 @@ use think\response\Json;
*/ */
class IndexController extends BaseApiController class IndexController extends BaseApiController
{ {
public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl', 'notifyProperty', 'notifyAuthentication', 'notifyVehicleContractUpdate', 'systemCarRent', 'selfCarRent', 'cancelRent']; public array $notNeedLogin = ['test','index', 'config', 'policy', 'decorate', 'notifyUrl', 'notifyProperty', 'notifyAuthentication', 'notifyVehicleContractUpdate', 'systemCarRent', 'selfCarRent', 'cancelRent'];
/** /**
* @notes 首页数据 * @notes 首页数据
@ -49,6 +49,11 @@ class IndexController extends BaseApiController
return $this->data($result); return $this->data($result);
} }
public function test() {
$res = app(JunziqianController::class)->downloadVehicleContractEvidence('APL1699006920226521088','泸县供投里海农业科技有限公司','91510521MAC477XA13');
dump($res);
}
/** /**
* @notes 全局配置 * @notes 全局配置
@ -335,7 +340,7 @@ class IndexController extends BaseApiController
//获取租赁车辆信息 //获取租赁车辆信息
$vehicleRentInfo = VehicleRent::where('car_id', $vehicle['id'])->find(); $vehicleRentInfo = VehicleRent::where('car_id', $vehicle['id'])->find();
//更新原始合同类型 //更新原始合同类型
VehicleContract::where('id', $vehicleRentInfo['contract_id'])->update(['type' => 2]); VehicleContract::where('id', $vehicleRentInfo['contract_id'])->update(['status' => 6]);
VehicleRent::where('car_id', $vehicle['id'])->update([ VehicleRent::where('car_id', $vehicle['id'])->update([
'status' => 3, 'status' => 3,
]); ]);

View File

@ -77,8 +77,9 @@ class JunziqianController extends BaseApiController
$request->organizationRegNo = $data['organization_code']; $request->organizationRegNo = $data['organization_code'];
$request->organizationRegImg = $data['business_license']; //new CURLFile('D:/tmp/test.png',null,"test.png"); $request->organizationRegImg = $data['business_license']; //new CURLFile('D:/tmp/test.png',null,"test.png");
$request->legalName = $data["master_name"]; //法人 $request->legalName = $data["master_name"]; //法人
$request->legalIdentityCard = $data["master_id_card"]; // 法人身份证 签约时人脸识别需要 // $request->legalIdentityCard = $data["master_id_card"]; // 法人身份证 签约时人脸识别需要
$request->legalMobile = $data["master_phone"]; // 法人手机号 预留 签约时短信验证需要 // $request->legalMobile = $data["master_phone"]; // 法人手机号 预留 签约时短信验证需要
if (isset($data['master_email'])) { if (isset($data['master_email'])) {
$request->emailOrMobile = $data['master_email']; //邮箱 $request->emailOrMobile = $data['master_email']; //邮箱
} }
@ -101,8 +102,8 @@ class JunziqianController extends BaseApiController
$request->organizationRegNo = $data['organization_code']; $request->organizationRegNo = $data['organization_code'];
$request->organizationRegImg = $data['business_license']; //new CURLFile('D:/tmp/test.png',null,"test.png"); $request->organizationRegImg = $data['business_license']; //new CURLFile('D:/tmp/test.png',null,"test.png");
$request->legalName = $data["master_name"]; //法人 $request->legalName = $data["master_name"]; //法人
$request->legalIdentityCard = $data["master_id_card"]; // 法人身份证 签约时人脸识别需要 // $request->legalIdentityCard = $data["master_id_card"]; // 法人身份证 签约时人脸识别需要
$request->legalMobile = $data["master_phone"]; // 法人手机号 预留 短信验证需要 // $request->legalMobile = $data["master_phone"]; // 法人手机号 预留 短信验证需要
$request->emailOrMobile = $data['master_email']; //邮箱 $request->emailOrMobile = $data['master_email']; //邮箱
//发起创建企业请求 //发起创建企业请求
$response = $requestUtils->doPost("/v2/user/organizationReapply", $request); $response = $requestUtils->doPost("/v2/user/organizationReapply", $request);
@ -147,7 +148,7 @@ class JunziqianController extends BaseApiController
$request = new ApplySignReq(); $request = new ApplySignReq();
$request->contractName = $data['name']; $request->contractName = $data['name'];
$request->signatories = $data['signatories']; //签约方 $request->signatories = $data['signatories']; //签约方
$request->faceThreshold = 79; // 人脸识别阀值:默认等级(1-100之间整数),建议范围(60-79) // $request->faceThreshold = 79; // 人脸识别阀值:默认等级(1-100之间整数),建议范围(60-79)
$request->serverCa = 1; //是否需要服务端云证书 $request->serverCa = 1; //是否需要服务端云证书
$request->fileType = 1; //合同上传方式 url $request->fileType = 1; //合同上传方式 url
$request->url = $data['url']; $request->url = $data['url'];
@ -168,13 +169,13 @@ class JunziqianController extends BaseApiController
$request-> email = $data['master_email']; $request-> email = $data['master_email'];
$request-> enterpriseName = $data['company_name']; $request-> enterpriseName = $data['company_name'];
$request-> identityNo = $data['organization_code']; $request-> identityNo = $data['organization_code'];
$request-> facePerType = 0; // $request-> facePerType = 0;
$request-> legalPersonName = $data['master_name']; $request-> legalPersonName = $data['master_name'];
$request-> legalIdentityCard = $data['master_id_card'];//法人证件号 $request-> legalIdentityCard = $data['master_id_card'];//法人证件号
$request-> legalMobile = $data['master_phone']; $request-> legalMobile = $data['master_phone'];
$request-> faceAgantIdenName = $data['master_name']; $request-> faceAgantIdenName = $data['master_name'];
$request-> faceAgantIdenCard = $data['master_id_card']; $request-> faceAgantIdenCard = $data['master_id_card'];
$request-> backUrl = env('url.url_prefix').'/api/Hetong/notifyOrganizationFaceCreate'; // 做完人脸识别后指定跳转到供销系统mobile首页 $request-> backUrl = env('url.url_prefix').'/api/Hetong/notifyOrganizationFaceCreate';
$response = $requestUtils->doPost("/v2/user/organizationFaceCreate",$request); $response = $requestUtils->doPost("/v2/user/organizationFaceCreate",$request);
return $response; return $response;
} }
@ -216,6 +217,27 @@ class JunziqianController extends BaseApiController
} }
} }
public function downloadVehicleContractEvidence($applyNo,$companyName,$companyCode) {
//构建请求工具
$requestUtils=new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
//初始化合同参数
$request=array(
"applyNo" => $applyNo,
"fullName" => $companyName, //签约人名称(合同发起接口中传入的签署人姓名)
"identityCard" => $companyCode, //统一社会信用代码
"identityType" => 12, //证件类型 1身份证, 2护照, 3台胞证, 4港澳居民来往内地通行证, 11营业执照, 12统一社会信用代码, 20子账号, 99其他
"evidenceType" => 0 //证据类型,0图片,1视频,2人脸证据
);
$response = $requestUtils->doPost("/v2/sign/evidenceLinkFile",$request);
if ($response->success) {
$resData = (array)$response->data;
$this->getDownload($resData['link'], root_path() . 'public/uploads/vehicle_contract/' . $applyNo . '.png');
return env('project.website_domain').'/uploads/vehicle_contract/' . $applyNo . '.png';
} else {
return false;
}
}
public function SigningLink($data) public function SigningLink($data)
{ {
//构建请求工具 //构建请求工具

View File

@ -237,7 +237,7 @@ class VehicleController extends BaseApiController
return $this->fail('当前镇街公司未签约'); return $this->fail('当前镇街公司未签约');
} }
//判断是否申请过 //判断是否申请过
$vehicleContract = VehicleContract::where('company_b_id',$this->userInfo['company_id'])->where('type','<>',2)->where('status','<>',4)->find(); $vehicleContract = VehicleContract::where('company_b_id',$this->userInfo['company_id'])->where('type','<>',2)->whereNotIn('status','4,5,6')->find();
if(!empty($vehicleContract)){ if(!empty($vehicleContract)){
return $this->fail('请勿重复申请'); return $this->fail('请勿重复申请');
} }

View File

@ -261,8 +261,8 @@ class ContractLogic extends BaseLogic
$data = [ $data = [
'name' => $name . '的合同', 'name' => $name . '的合同',
'signatories' => [ 'signatories' => [
['fullName' => $name, 'identityType' => 12, 'identityCard' => $result['organization_code'], 'email' => $result['master_email'], 'noNeedVerify' => 1, 'authLevel'=>[11],'signLevel' => 1], ['fullName' => $name, 'identityType' => 12, 'identityCard' => $result['organization_code'], 'email' => $result['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1], // 'authLevel'=>[11], 签约时验证人脸识别
['fullName' => $result['contract']['party_a_info']['company_name'], 'identityType' => 12, 'identityCard' => $result['contract']['party_a_info']['organization_code'], 'email' => $result['contract']['party_a_info']['master_email'], 'noNeedVerify' => 1, 'authLevel'=>[11],'signLevel' => 1] ['fullName' => $result['contract']['party_a_info']['company_name'], 'identityType' => 12, 'identityCard' => $result['contract']['party_a_info']['organization_code'], 'email' => $result['contract']['party_a_info']['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1]
], ],
'url' => $result['contract']['file'], 'url' => $result['contract']['file'],
]; ];