提交修改
This commit is contained in:
parent
3467c4547b
commit
fc135c0f8b
@ -11,7 +11,10 @@ import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1668425998119×tamp=1739289770603#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%8D%A1%E8%AF%81OCR&api=rest%2F2.0%2Focr%2Fv1%2Fb
|
||||
* https://console.bce.baidu.com/support/?_=1668425998119×tamp=1742560340214#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%8D%A1%E8%AF%81OCR&api=rest%2F2.0%2Focr%2Fv1%2Fbusiness_license&method=post
|
||||
*
|
||||
*
|
||||
*
|
||||
* 营业执照识别
|
||||
*/
|
||||
@Component
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.heyu.api.baidu.request.certificate;
|
||||
|
||||
|
||||
import com.heyu.api.request.BaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -11,7 +12,7 @@ import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class BBusinesslicenseVerificationDetailedRequest {
|
||||
public class BBusinesslicenseVerificationDetailedRequest extends BaseRequest {
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -264,15 +264,15 @@ public class BBusinesslicenseVerificationDetailedResp {
|
||||
@Data
|
||||
public static class WordsResultDTO {
|
||||
@JsonProperty("liquidation")
|
||||
private LiquidationDTO liquidation;
|
||||
private LiquidationDTO liquidation; // 公司清算信息
|
||||
@JsonProperty("penalties")
|
||||
private List<PenaltiesDTO> penalties;
|
||||
private List<PenaltiesDTO> penalties; // 行政处罚,每个数组可能包含多个object
|
||||
@JsonProperty("shixinitems")
|
||||
private List<?> shixinitems;
|
||||
private List<?> shixinitems; // 失信,每个数组可能包含多个object
|
||||
@JsonProperty("originalname")
|
||||
private List<?> originalname;
|
||||
private List<?> originalname; // 曾用名,每个数组可能包含多个object
|
||||
@JsonProperty("changes")
|
||||
private List<ChangesDTO> changes;
|
||||
private List<ChangesDTO> changes; // 企业变更
|
||||
@JsonProperty("industry")
|
||||
private IndustryDTO industry;
|
||||
@JsonProperty("branches")
|
||||
|
||||
@ -5,7 +5,10 @@ import com.aliyun.ocr20191230.models.RecognizeBusinessLicenseResponse;
|
||||
import com.aliyun.ocr20191230.models.RecognizeBusinessLicenseResponseBody;
|
||||
import com.heyu.api.alibaba.handle.common.text.ARecognizeBusinessLicenseHandle;
|
||||
import com.heyu.api.alibaba.request.common.text.ARecognizeBusinessLicenseRequest;
|
||||
import com.heyu.api.baidu.handle.certificate.BBusinessLicenseHandle;
|
||||
import com.heyu.api.baidu.request.certificate.BBusinessLicenseRequest;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.data.utils.MapUtils;
|
||||
import com.heyu.api.request.card.BusinessLicenseRecognizeRequest;
|
||||
import com.heyu.api.resp.card.BusinessLicenseRecognizeResp;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
@ -17,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/ocr/2019-12-30/RecognizeBusinessLicense?tab=DOC&lang=JAVA
|
||||
*营业执照识别
|
||||
@ -41,15 +46,43 @@ public class BusinessLicenseRecognizeController extends BaseController {
|
||||
private ARecognizeBusinessLicenseHandle arRecognizeBusinessLicenseHandle;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BBusinessLicenseHandle bBusinessLicenseHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(BusinessLicenseRecognizeRequest request) {
|
||||
BusinessLicenseRecognizeResp resp = new BusinessLicenseRecognizeResp();
|
||||
BBusinessLicenseRequest businessLicenseRequest = new BBusinessLicenseRequest();
|
||||
businessLicenseRequest.setImageUrl(request.getImageUrl());
|
||||
businessLicenseRequest.setImageBase64(request.getImageBase64());
|
||||
|
||||
ApiR<Map> bR = bBusinessLicenseHandle.handle(businessLicenseRequest);
|
||||
if (bR.isSuccess()) {
|
||||
Map<String, Object> data = bR.getData();
|
||||
resp.setCompanyType(MapUtils.getByExpr(data, "words_result.类型.words"));
|
||||
resp.setRegisterDate(MapUtils.getByExpr(data, "words_result.成立日期.words"));
|
||||
resp.setValidDateEnd(MapUtils.getByExpr(data, "words_result.有效期.words"));
|
||||
resp.setBusiness(MapUtils.getByExpr(data, "words_result.经营范围.words"));
|
||||
resp.setRegisterNumber(MapUtils.getByExpr(data, "words_result.社会信用代码.words"));
|
||||
resp.setCompanyAddress(MapUtils.getByExpr(data, "words_result.地址.words"));
|
||||
resp.setRegisterCapital(MapUtils.getByExpr(data, "words_result.注册资本.words"));
|
||||
resp.setCompanyName(MapUtils.getByExpr(data, "words_result.单位名称.words"));
|
||||
resp.setCompositionType(MapUtils.getByExpr(data, "words_result.组成形式.words"));
|
||||
resp.setCertificateNumber(MapUtils.getByExpr(data, "words_result.证件编号.words"));
|
||||
resp.setRealCapital(MapUtils.getByExpr(data, "words_result.实收资本.words"));
|
||||
resp.setValidDateStart(MapUtils.getByExpr(data, "words_result.有效期起始日期.words"));
|
||||
resp.setApprovalDate(MapUtils.getByExpr(data, "words_result.核准日期.words"));
|
||||
resp.setTaxRegisterCode(MapUtils.getByExpr(data, "words_result.税务登记号.words"));
|
||||
resp.setRegisterOrgan(MapUtils.getByExpr(data, "words_result.登记机关.words"));
|
||||
return R.ok().setData(resp);
|
||||
}
|
||||
|
||||
ARecognizeBusinessLicenseRequest arRecognizeBusinessLicenseRequest = new ARecognizeBusinessLicenseRequest();
|
||||
arRecognizeBusinessLicenseRequest.setImageBase64(request.getImageBase64());
|
||||
arRecognizeBusinessLicenseRequest.setImageUrl(request.getImageUrl());
|
||||
BusinessLicenseRecognizeResp resp = new BusinessLicenseRecognizeResp();
|
||||
|
||||
ApiR<RecognizeBusinessLicenseResponse> aR = arRecognizeBusinessLicenseHandle.handle(arRecognizeBusinessLicenseRequest);
|
||||
if (aR.isSuccess()) {
|
||||
RecognizeBusinessLicenseResponse response = aR.getData();
|
||||
@ -58,7 +91,7 @@ public class BusinessLicenseRecognizeController extends BaseController {
|
||||
RecognizeBusinessLicenseResponseBody.RecognizeBusinessLicenseResponseBodyData responseBodyData = responseBody.getData();
|
||||
resp.setCompanyType(responseBodyData.getType());
|
||||
resp.setRegisterDate(responseBodyData.getEstablishDate());
|
||||
resp.setValidDate(responseBodyData.getValidPeriod());
|
||||
resp.setValidDateEnd(responseBodyData.getValidPeriod());
|
||||
resp.setBusiness(responseBodyData.getBusiness());
|
||||
resp.setRegisterNumber(responseBodyData.getRegisterNumber());
|
||||
resp.setCompanyAddress(responseBodyData.getAddress());
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
package com.heyu.api.controller.certificate;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.certificate.BBusinesslicenseVerificationDetailedHandle;
|
||||
import com.heyu.api.baidu.request.certificate.BBusinesslicenseVerificationDetailedRequest;
|
||||
import com.heyu.api.baidu.response.certificate.BBusinesslicenseVerificationDetailedResp;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.request.certificate.BusinesslicenseVerificationDetailedReq;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/***
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1742562052573#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%8D%A1%E8%AF%81OCR&api=rest%2F2.0%2Focr%2Fv1%2Fbusinesslicense_verification_detailed&method=post
|
||||
*
|
||||
*
|
||||
*企业工商信息查询(高。。。
|
||||
*
|
||||
*
|
||||
* 传入企业名称、注册号、统一社会信用代码中的任意一种,具体返回企业全维度信息,包括工商基本信息、分支机构信息、企业变更信息、纳税信
|
||||
* 息、联系信息、企业高管信息、经营异常信息、动产抵押信息、曾用名信息、股东信息、行政处罚信息、行政许可信息、股权出资信息、失信信息、
|
||||
* 被执行信息等。
|
||||
*
|
||||
* 注:目前支持工商注册的企业认证,事业单位、律师事务所等信息暂不支持验证,发生工商变更或刚注册的企业信息,预计在企业公示的核准日期
|
||||
* T+3个工作日后可进行验证。
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/businesslicense")
|
||||
@NotIntercept
|
||||
public class BusinesslicenseVerificationDetailedController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BBusinesslicenseVerificationDetailedHandle bBusinesslicenseVerificationDetailedHandle;
|
||||
|
||||
@RequestMapping("/berification")
|
||||
@CacheResult
|
||||
public R recognize(BusinesslicenseVerificationDetailedReq request) {
|
||||
BBusinesslicenseVerificationDetailedRequest bBusinesslicenseVerificationDetailedRequest = new BBusinesslicenseVerificationDetailedRequest();
|
||||
bBusinesslicenseVerificationDetailedRequest.setVerifyNum(request.getVerifyNum());
|
||||
ApiR<BBusinesslicenseVerificationDetailedResp> bR = bBusinesslicenseVerificationDetailedHandle.handle(bBusinesslicenseVerificationDetailedRequest);
|
||||
if (bR.isSuccess()) {
|
||||
BBusinesslicenseVerificationDetailedResp bBusinesslicenseVerificationDetailedResp = bR.getData();
|
||||
return R.ok().setData(bBusinesslicenseVerificationDetailedResp.getWordsResult());
|
||||
}
|
||||
|
||||
return R.error(bR.getErrorMsg());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.heyu.api.request.certificate;
|
||||
|
||||
import com.heyu.api.data.dto.BaseReq;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusinesslicenseVerificationDetailedReq extends BaseReq {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询关键字段(企业名称、注册号、社会统一信用代码,可任意输入其中一种)
|
||||
*/
|
||||
private String verifyNum;
|
||||
|
||||
|
||||
}
|
||||
@ -38,7 +38,7 @@ public class BusinessLicenseRecognizeResp {
|
||||
* 示例值:
|
||||
* 29991231
|
||||
*/
|
||||
private String validDate;
|
||||
private String validDateEnd;
|
||||
|
||||
|
||||
/***
|
||||
@ -94,5 +94,44 @@ public class BusinessLicenseRecognizeResp {
|
||||
private String companyLegalPerson;
|
||||
|
||||
|
||||
/***
|
||||
* 组成形式
|
||||
*/
|
||||
private String compositionType;
|
||||
|
||||
/***
|
||||
* 证件编号
|
||||
*/
|
||||
private String certificateNumber;
|
||||
|
||||
/***
|
||||
* 实收资本
|
||||
*/
|
||||
private String realCapital;
|
||||
|
||||
/**
|
||||
* 有效期起始日期
|
||||
*/
|
||||
private String validDateStart;
|
||||
|
||||
|
||||
/**
|
||||
* 核准日期
|
||||
*/
|
||||
private String approvalDate ;
|
||||
|
||||
|
||||
/**
|
||||
* 税务登记号
|
||||
*/
|
||||
private String taxRegisterCode;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 登记机关
|
||||
*/
|
||||
private String registerOrgan;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
package com.heyu.api.resp.certificate;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusinesslicenseVerificationDetailedResp extends BaseResp {
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user