|
@@ -3,7 +3,7 @@
|
|
|
|
|
|
namespace app\user\controller;
|
|
|
|
|
|
-use app\user\model\Headquarters;
|
|
|
+use app\user\model\CompanyType;use app\user\model\Headquarters;
|
|
|
use app\user\model\SupplierContact;
|
|
|
use think\App;
|
|
|
use think\facade\Validate;
|
|
@@ -56,7 +56,7 @@ class Supplier extends Base{
|
|
|
'registertime|成立日期' => 'requireIf:supplier_img,""|max:255',
|
|
|
'scope|经营范围' => 'requireIf:supplier_img,""|max:3000',
|
|
|
'type|申请类型' => 'require|number|in:0,1',
|
|
|
- 'nature|公司类型' => 'require|number|in:1,2,3,4,5,6,7,8,9',
|
|
|
+ 'nature|公司类型' => 'requireIf:supplier_img,""|number|in:1,2,3,4,5,6,7,8,9',
|
|
|
'legaler|法人' => 'requireIf:supplier_img,""|max:255',
|
|
|
'addr|公司详细地址' => 'requireIf:supplier_img,""|max:255',
|
|
|
'prove_img|资质证明' => 'url',
|
|
@@ -70,8 +70,7 @@ class Supplier extends Base{
|
|
|
]);
|
|
|
if(!$valid->check($param))return error($valid->getError());
|
|
|
if ($param['license_img']!=''){
|
|
|
- $param['license_img'] = $param['license_img'];
|
|
|
- $result = $this->GetBusinessInfoByParam($param['license_img']);
|
|
|
+ $Busines = $this->GetBusinessInfoByParam($param['license_img']);
|
|
|
/**
|
|
|
* Array of attributes to getter functions (for serialization of requests)
|
|
|
* registrationNumber - 老版本营业执照对应注册号。 - 新三证合一版本营业执照对应社会保障号。
|
|
@@ -88,21 +87,23 @@ class Supplier extends Base{
|
|
|
* confidence 相关字段的置信度信息,置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。 置信度由算法给出,不直接等价于对应字段的准确率。
|
|
|
* @var string[]
|
|
|
*/
|
|
|
- if($result['code']==200){
|
|
|
+
|
|
|
+ if($Busines['isResult']){
|
|
|
+ $result = $Busines['data'];
|
|
|
$param['ocr_status'] = 1;
|
|
|
if ($param['name'] != $result['name']) {
|
|
|
$param['remark'] = '企业名称与营业执照不匹配';
|
|
|
}
|
|
|
- if ($param['registercode'] !=$result['registrationNumber']&& $param['registercode']!= '') {
|
|
|
+ if ($param['registercode'] !=$result['registration_number']&& $param['registercode']!= '') {
|
|
|
$param['remark'] .= '企业纳税识别号与营业执照不匹配';
|
|
|
}
|
|
|
$param['addr']=$result['address']??"";
|
|
|
- $param['legaler']=$result['legalRepresentative']??"";
|
|
|
- $param['registercode']=$result['registrationNumber']??"";
|
|
|
- $param['registertime']=$result['foundDate']??"";
|
|
|
- $param['scope']=$result['businessScope']??"";
|
|
|
- $param['nature']=$result['type']??"";
|
|
|
- $param['capital'] = $result['registeredCapital']??"";
|
|
|
+ $param['legaler']=$result['legal_representative']??"";
|
|
|
+ $param['registercode']=$result['registration_number']??"";
|
|
|
+ $param['registertime']=$result['found_date']??"";
|
|
|
+ $param['scope']=$result['business_scope']??"";
|
|
|
+ $param['nature']= CompanyType::checkType($result['type']);
|
|
|
+ $param['capital'] = $result['registered_capital']??"";
|
|
|
|
|
|
}else{
|
|
|
$param['remark'] = '营业执照识别失败';
|
|
@@ -243,22 +244,24 @@ class Supplier extends Base{
|
|
|
|
|
|
if($param['license_img']!='' && $info->license_img!=$param['license_img']){
|
|
|
$info->license_img=$param['license_img'];
|
|
|
- $result = $this->GetBusinessInfoByParam($param['license_img']);
|
|
|
- if($result['code']=='200'){
|
|
|
+ $business = $this->GetBusinessInfoByParam($param['license_img']);
|
|
|
+
|
|
|
+ if($business['isResult']){
|
|
|
$info->ocr_status = 1;
|
|
|
+ $result = $business['data'];
|
|
|
if ($param['name'] != $result['name']) {
|
|
|
$info->remark = "企业名称与营业执照不匹配";
|
|
|
}
|
|
|
- if ($param['registercode'] !=$result['registrationNumber']&& $param['registercode']!= '') {
|
|
|
+ if ($param['registercode'] !=$result['registration_number']&& $param['registercode']!= '') {
|
|
|
$info->remark .= '企业纳税识别号与营业执照不匹配';
|
|
|
}
|
|
|
$param['addr']=$result['address']??'';
|
|
|
- $param['legaler']=$result['legalRepresentative']??'';
|
|
|
- $param['registercode']=$result['registrationNumber']??'';
|
|
|
- $param['registertime']=$result['foundDate']??'';
|
|
|
- $param['scope']=$result['businessScope']??'';
|
|
|
- $param['nature']=$result['type']??'';
|
|
|
- $param['capital'] = $result['registeredCapital']??'';
|
|
|
+ $param['legaler']=$result['legal_representative']??'';
|
|
|
+ $param['registercode']=$result['registration_number']??'';
|
|
|
+ $param['registertime']=$result['found_date']??'';
|
|
|
+ $param['scope']=$result['business_scope']??'';
|
|
|
+ $param['nature']=CompanyType::checkType($result['type']);
|
|
|
+ $param['capital'] = $result['registered_capital']??'';
|
|
|
|
|
|
}else{
|
|
|
$info->remark = '营业执照识别失败';
|