提交修改
This commit is contained in:
parent
f9cbbb6f06
commit
525e8dd14e
@ -16,7 +16,7 @@ public class ARecognizeVATInvoiceRequest extends ACommonTextRequest {
|
||||
* 枚举值:
|
||||
* jpg
|
||||
*/
|
||||
public String fileType;
|
||||
public String fileType = "jpg";
|
||||
|
||||
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/mobile/network/time")
|
||||
@NotIntercept
|
||||
public class MobileNetworkTimeVerificationController {
|
||||
public class MobileNetworkTimeVerificationController {
|
||||
|
||||
|
||||
public final static Map<String, String> checkResult = new HashMap<>();
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
package com.heyu.api.controller.certificate.tax;
|
||||
|
||||
|
||||
import com.aliyun.ocr20191230.models.RecognizeVATInvoiceResponse;
|
||||
import com.aliyun.ocr20191230.models.RecognizeVATInvoiceResponseBody;
|
||||
import com.heyu.api.alibaba.handle.common.text.ARecognizeVATInvoiceHandle;
|
||||
import com.heyu.api.alibaba.request.common.text.ARecognizeVATInvoiceRequest;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.controller.resp.tax.RecognizeVATInvoiceResp;
|
||||
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 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://next.api.aliyun.com/api/ocr/2019-12-30/RecognizeVATInvoice?tab=DEMO&lang=JAVA
|
||||
*
|
||||
*
|
||||
* 增值税发票识别 RecognizeVATInvoice
|
||||
*
|
||||
*
|
||||
* 功能描述
|
||||
* 增值税发票识别能力可以识别增值税发票(电子发票和纸质发票)关键字段内容,包括:校验码、复核人、开票人、发票代码、收款人等。
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/vat/invoice")
|
||||
@NotIntercept
|
||||
public class RecognizeVATInvoiceController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ARecognizeVATInvoiceHandle arRecognizeVATInvoiceHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(ARecognizeVATInvoiceRequest request) {
|
||||
|
||||
|
||||
RecognizeVATInvoiceResp resp = new RecognizeVATInvoiceResp();
|
||||
|
||||
ApiR<RecognizeVATInvoiceResponse> aR = arRecognizeVATInvoiceHandle.handle(request);
|
||||
if (aR.isSuccess() && isSuccessStatusCode(aR.getData().getStatusCode())) {
|
||||
RecognizeVATInvoiceResponse response = aR.getData();
|
||||
RecognizeVATInvoiceResponseBody responseBody = response.getBody();
|
||||
RecognizeVATInvoiceResponseBody.RecognizeVATInvoiceResponseBodyData responseBodyData = responseBody.getData();
|
||||
RecognizeVATInvoiceResponseBody.RecognizeVATInvoiceResponseBodyDataContent content = responseBodyData.getContent();
|
||||
|
||||
resp.setPayerAddress(content.getPayerAddress());
|
||||
resp.setPayeeRegisterNo(content.getPayeeRegisterNo());
|
||||
resp.setPayeeBankName(content.getPayeeBankName());
|
||||
resp.setInvoiceNo(content.getInvoiceNo());
|
||||
resp.setPayerRegisterNo(content.getPayerRegisterNo());
|
||||
resp.setChecker(content.getChecker());
|
||||
resp.setTaxAmount(content.getTaxAmount());
|
||||
resp.setInvoiceCode(content.getInvoiceCode());
|
||||
resp.setWithoutTaxAmount(content.getWithoutTaxAmount());
|
||||
resp.setInvoiceAmount(content.getInvoiceAmount());
|
||||
resp.setAntiFakeCode(content.getAntiFakeCode());
|
||||
resp.setPayerName(content.getPayerName());
|
||||
resp.setPayee(content.getPayee());
|
||||
resp.setSumAmount(content.getSumAmount());
|
||||
resp.setPayerBankName(content.getPayerBankName());
|
||||
resp.setClerk(content.getClerk());
|
||||
resp.setPayeeName(content.getPayeeName());
|
||||
resp.setPayeeAddress(content.getPayeeAddress());
|
||||
resp.setInvoiceCode(content.getInvoiceCode());
|
||||
resp.setItemName(content.getItemName());
|
||||
|
||||
return R.ok().setData(resp);
|
||||
}
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.heyu.api.controller.certificate.tax;
|
||||
|
||||
|
||||
import com.aliyun.ocr20191230.models.RecognizeVINCodeResponse;
|
||||
import com.aliyun.ocr20191230.models.RecognizeVINCodeResponseBody;
|
||||
import com.heyu.api.alibaba.handle.common.text.ARecognizeVINCodeHandle;
|
||||
import com.heyu.api.alibaba.request.common.text.ARecognizeVINCodeRequest;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.controller.request.tax.ARecognizeVATInvoiceReq;
|
||||
import com.heyu.api.controller.resp.tax.RecognizeVINCodeResp;
|
||||
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 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://next.api.aliyun.com/api/ocr/2019-12-30/RecognizeVINCode?tab=DEMO&lang=JAVA
|
||||
*
|
||||
*
|
||||
* VIN码识别
|
||||
*
|
||||
* RecognizeVINCode
|
||||
*功能描述
|
||||
*
|
||||
*
|
||||
*
|
||||
* VIN 码识别能力可以识别车辆 VIN 码,输出车辆 VIN 码数值。
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/vat/invoice")
|
||||
@NotIntercept
|
||||
public class RecognizeVINCodeController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ARecognizeVINCodeHandle arecognizeVINCodeHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(ARecognizeVATInvoiceReq request) {
|
||||
RecognizeVINCodeResp resp = new RecognizeVINCodeResp();
|
||||
|
||||
ARecognizeVINCodeRequest aRecognizeVINCodeRequest = new ARecognizeVINCodeRequest();
|
||||
aRecognizeVINCodeRequest.setImageUrl(request.getImageUrl());
|
||||
aRecognizeVINCodeRequest.setImageBase64(request.getImageBase64());
|
||||
|
||||
ApiR<RecognizeVINCodeResponse> aR = arecognizeVINCodeHandle.handle(aRecognizeVINCodeRequest);
|
||||
if (aR.isSuccess() && isSuccessStatusCode(aR.getData().getStatusCode())) {
|
||||
RecognizeVINCodeResponseBody responseBody = aR.getData().getBody();
|
||||
RecognizeVINCodeResponseBody.RecognizeVINCodeResponseBodyData responseBodyData = responseBody.getData();
|
||||
resp.setVinCode(responseBodyData.getVinCode());
|
||||
return R.ok().setData(resp);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.heyu.api.controller.request;
|
||||
|
||||
import com.heyu.api.data.dto.BaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public class CommonRequest extends BaseRequest {
|
||||
/**
|
||||
* 图片的url
|
||||
*/
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* base 64 编码
|
||||
*/
|
||||
private String imageBase64;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.heyu.api.controller.request.tax;
|
||||
|
||||
|
||||
import com.heyu.api.controller.request.CommonRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/ocr/2019-12-30/RecognizeVINCode?tab=DEMO&lang=JAVA
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class ARecognizeVATInvoiceReq extends CommonRequest {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,184 @@
|
||||
package com.heyu.api.controller.resp.tax;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
*
|
||||
* https://next.api.aliyun.com/api/ocr/2019-12-30/RecognizeVATInvoice?tab=DOC&lang=JAVA
|
||||
*
|
||||
*
|
||||
* 增值税发票识别 RecognizeVATInvoice
|
||||
*/
|
||||
@Data
|
||||
public class RecognizeVATInvoiceResp {
|
||||
|
||||
/***
|
||||
* 校验码。
|
||||
*
|
||||
* 示例值:
|
||||
* 02702870934284730434
|
||||
*/
|
||||
public String antiFakeCode;
|
||||
|
||||
/***
|
||||
* 复核人。
|
||||
*
|
||||
* 示例值:
|
||||
* 张三
|
||||
*/
|
||||
public String checker;
|
||||
|
||||
/***
|
||||
* 开票人。
|
||||
*
|
||||
* 示例值:
|
||||
* 张三
|
||||
*/
|
||||
public String clerk;
|
||||
|
||||
|
||||
/***
|
||||
* 价税合计(小写)。
|
||||
*
|
||||
* 示例值:
|
||||
* 200.00
|
||||
*/
|
||||
public String invoiceAmount;
|
||||
|
||||
|
||||
/***
|
||||
* 发票代码。
|
||||
*
|
||||
* 示例值:
|
||||
* 031001600311
|
||||
*/
|
||||
public String invoiceCode;
|
||||
|
||||
/***
|
||||
* 开票日期。
|
||||
*
|
||||
* 示例值:
|
||||
* 20190415
|
||||
*/
|
||||
public String invoiceDate;
|
||||
|
||||
/***
|
||||
* 发票号码。
|
||||
*
|
||||
* 示例值:
|
||||
* 03753869
|
||||
*/
|
||||
public String invoiceNo;
|
||||
|
||||
/**
|
||||
* <p>1</p>
|
||||
*/
|
||||
|
||||
public java.util.List<String> itemName;
|
||||
|
||||
/***
|
||||
* 收款人。
|
||||
*
|
||||
* 示例值:
|
||||
* 张三
|
||||
*/
|
||||
public String payee;
|
||||
|
||||
/***
|
||||
* 销售方地址、电话。
|
||||
*
|
||||
* 示例值:
|
||||
* 上海虹桥机场迎宾二路161号22342185
|
||||
*/
|
||||
public String payeeAddress;
|
||||
|
||||
/***
|
||||
* 销售方开户行及账号。
|
||||
*
|
||||
* 示例值:
|
||||
* 中国银行浙江省分行35845832****
|
||||
*/
|
||||
|
||||
public String payeeBankName;
|
||||
|
||||
|
||||
/***
|
||||
* 销售方名称。
|
||||
*
|
||||
* 示例值:
|
||||
* 上海机场(集团)有限公司
|
||||
*/
|
||||
public String payeeName;
|
||||
|
||||
|
||||
/***
|
||||
* 销售方纳税人识别号。
|
||||
*
|
||||
* 示例值:
|
||||
* 91420200000123403
|
||||
*/
|
||||
public String payeeRegisterNo;
|
||||
|
||||
|
||||
/***
|
||||
* 购买方地址、电话。
|
||||
*
|
||||
* 示例值:
|
||||
* 浙江省杭州市西湖区杭大路9号聚龙大厦西区15-18楼0571-87901580
|
||||
*/
|
||||
public String payerAddress;
|
||||
|
||||
/***
|
||||
* 购买方开户行及账号。
|
||||
*
|
||||
* 示例值:
|
||||
* 6221************1234
|
||||
*/
|
||||
public String payerBankName;
|
||||
|
||||
/***
|
||||
* 购买方名称。
|
||||
*
|
||||
* 示例值:
|
||||
* 三号技术有限责任公司
|
||||
*/
|
||||
public String payerName;
|
||||
|
||||
/***
|
||||
* 购买方纳税人识别号。
|
||||
*
|
||||
* 示例值:
|
||||
* 91420200000123403
|
||||
*/
|
||||
public String payerRegisterNo;
|
||||
|
||||
/***
|
||||
* 价税合计(大写)。
|
||||
*
|
||||
* 示例值:
|
||||
* 87
|
||||
*/
|
||||
public String sumAmount;
|
||||
|
||||
/***
|
||||
* 合计税额。
|
||||
*
|
||||
* 示例值:
|
||||
* 9.52
|
||||
*/
|
||||
public String taxAmount;
|
||||
|
||||
/***
|
||||
* 合计金额。
|
||||
*
|
||||
* 示例值:
|
||||
* 190.48
|
||||
*/
|
||||
public String withoutTaxAmount;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.heyu.api.controller.resp.tax;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseRequest;
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/ocr/2019-12-30/RecognizeVINCode?tab=DOC&lang=JAVA
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RecognizeVINCodeResp extends BaseResp {
|
||||
|
||||
|
||||
/***
|
||||
* 识别的车辆 VIN 码。
|
||||
*
|
||||
* 示例值:
|
||||
* LVBB2FAF777999888
|
||||
*/
|
||||
private String vinCode;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user