提交修改
This commit is contained in:
parent
41fb0960fc
commit
d815cfad4d
@ -1,13 +1,14 @@
|
||||
package com.heyu.api.baidu.handle.certificate;
|
||||
|
||||
|
||||
import com.heyu.api.data.annotation.CustomPath;
|
||||
import com.heyu.api.baidu.BaiduBaseHandle;
|
||||
import com.heyu.api.baidu.request.certificate.BFoodBusinessLicenseRequest;
|
||||
import com.heyu.api.data.annotation.CustomPath;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740323343124#/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%2Ffood_business_license&method=post
|
||||
* <p>
|
||||
@ -17,7 +18,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@Slf4j
|
||||
@CustomPath("foodBusinessLicense")
|
||||
public class BFoodBusinessLicenseHandle extends BaiduBaseHandle<BFoodBusinessLicenseRequest, JSONObject> {
|
||||
public class BFoodBusinessLicenseHandle extends BaiduBaseHandle<BFoodBusinessLicenseRequest, Map> {
|
||||
|
||||
@Override
|
||||
public String getUri() {
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
package com.heyu.api.controller.certificate;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.certificate.BFoodBusinessLicenseHandle;
|
||||
import com.heyu.api.baidu.request.certificate.BFoodBusinessLicenseRequest;
|
||||
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.MapUtils;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.certificate.FoodBusinessLicenseResp;
|
||||
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;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740323343124#/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%2Ffood_business_license&method=post
|
||||
* <p>
|
||||
* <p>
|
||||
* 食品经营许可证识别
|
||||
*
|
||||
*接口描述
|
||||
* 支持对食品经营许可证进行结构化识别,包括经营者名称、社会信用代码、法定代表人、住所、经营场所、主体业态、经营项目、有效期至、许可证编号、
|
||||
* 日常监督管理机构、日常监督管理人员、发证机关、签发人、签发日期,全部 14 个字段。
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/foodBusinessLicense")
|
||||
@NotIntercept
|
||||
public class FoodBusinessLicenseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BFoodBusinessLicenseHandle bFoodBusinessLicenseHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(BFoodBusinessLicenseRequest request) {
|
||||
FoodBusinessLicenseResp resp = new FoodBusinessLicenseResp();
|
||||
ApiR<Map> bR = bFoodBusinessLicenseHandle.handle(request);
|
||||
if (bR.isSuccess()) {
|
||||
Map<String, Object> data = bR.getData();
|
||||
|
||||
resp.setBusinessName(MapUtils.getByExpr(data, "words_result.经营者名称.word"));
|
||||
resp.setBusinessSite(MapUtils.getByExpr(data, "words_result.经营场所.word"));
|
||||
resp.setDaySupervisionUnit(MapUtils.getByExpr(data, "words_result.日常监督管理机构.word"));
|
||||
resp.setDaySupervisionPerson(MapUtils.getByExpr(data, "words_result.日常监督管理人员.word"));
|
||||
resp.setIssuanceDate(MapUtils.getByExpr(data, "words_result.签发日期.word"));
|
||||
resp.setBusinessProject(MapUtils.getByExpr(data, "words_result.经营项目.word"));
|
||||
resp.setValidDateEnd(MapUtils.getByExpr(data, "words_result.有效期至.word"));
|
||||
resp.setLicenseNumber(MapUtils.getByExpr(data, "words_result.许可证编号.word"));
|
||||
resp.setLegalPerson(MapUtils.getByExpr(data, "words_result.法定代表人.word"));
|
||||
resp.setSocialCreditCode(MapUtils.getByExpr(data, "words_result.社会信用代码.word"));
|
||||
resp.setAddress(MapUtils.getByExpr(data, "words_result.住所.word"));
|
||||
resp.setIssuingAuthority(MapUtils.getByExpr(data, "words_result.发证机关.word"));
|
||||
resp.setMainBusiness(MapUtils.getByExpr(data, "words_result.主体业态.word"));
|
||||
resp.setIssuingPerson(MapUtils.getByExpr(data, "words_result.签发人.word"));
|
||||
return R.ok().setData(resp);
|
||||
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.heyu.api.resp.certificate;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FoodBusinessLicenseResp extends BaseResp {
|
||||
|
||||
|
||||
/***
|
||||
* 经营者名称
|
||||
*/
|
||||
private String businessName;
|
||||
|
||||
|
||||
/***
|
||||
* 经营场所
|
||||
*/
|
||||
private String businessSite;
|
||||
|
||||
|
||||
/***
|
||||
* 日常监督管理机构
|
||||
*/
|
||||
private String daySupervisionUnit;
|
||||
|
||||
|
||||
/***
|
||||
* 日常监督管理人员
|
||||
*/
|
||||
private String daySupervisionPerson;
|
||||
|
||||
/***
|
||||
* 签发日期
|
||||
*/
|
||||
private String issuanceDate;
|
||||
|
||||
|
||||
/***
|
||||
* 经营项目
|
||||
*/
|
||||
private String businessProject;
|
||||
|
||||
|
||||
/***
|
||||
* 有效期至
|
||||
*/
|
||||
private String validDateEnd;
|
||||
|
||||
/***
|
||||
* 许可证编号
|
||||
*/
|
||||
private String licenseNumber;
|
||||
|
||||
/***
|
||||
* 法定代表人
|
||||
*/
|
||||
private String legalPerson;
|
||||
|
||||
|
||||
/***
|
||||
* 社会信用代码
|
||||
*/
|
||||
private String socialCreditCode;
|
||||
|
||||
/**
|
||||
* 住所
|
||||
*/
|
||||
private String address;
|
||||
|
||||
|
||||
/***
|
||||
* 发证机关
|
||||
*/
|
||||
private String issuingAuthority;
|
||||
|
||||
|
||||
/***
|
||||
* 主体业态
|
||||
*/
|
||||
private String mainBusiness;
|
||||
|
||||
|
||||
/**
|
||||
* 签发人
|
||||
*/
|
||||
private String issuingPerson;
|
||||
|
||||
}
|
||||
@ -4,5 +4,6 @@ public class Test1 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("11111111");
|
||||
System.out.println("22222222");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user