From 5a3744ad92188d4aa638e6e3ef66f47f1beca25f Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Tue, 25 Mar 2025 20:26:49 +0800 Subject: [PATCH] jruqwhnt --- ...irTransportVatInvoiceVerificationResp.java | 16 + .../BCommonVatInvoiceVerificationResp.java | 253 ++++++++++++++++ .../BTrainVatInvoiceVerificationResp.java | 15 + .../BUsedCarVatInvoiceVerificationResp.java | 16 + .../BVatInvoiceVerificationResp.java | 3 +- .../BVehicleVatInvoiceVerificationResp.java | 15 + ...ommonVatInvoiceVerificationController.java | 284 ++++++++++++++++++ ...ransportVatInvoiceVerificationRequest.java | 59 ++++ .../CommonVatInvoiceVerificationRequest.java | 67 +++++ .../TrainVatInvoiceVerificationRequest.java | 55 ++++ .../UsedCarVatInvoiceVerificationRequest.java | 54 ++++ .../VehicleVatInvoiceVerificationRequest.java | 53 ++++ ...irTransportVatInvoiceVerificationResp.java | 17 ++ .../CommonVatInvoiceVerificationResp.java | 99 ++++++ .../TrainVatInvoiceVerificationResp.java | 17 ++ .../UsedCarVatInvoiceVerificationResp.java | 17 ++ .../VehicleVatInvoiceVerificationResp.java | 16 + 17 files changed, 1055 insertions(+), 1 deletion(-) create mode 100644 api-third/src/main/java/com/heyu/api/baidu/response/financial/BAirTransportVatInvoiceVerificationResp.java create mode 100644 api-third/src/main/java/com/heyu/api/baidu/response/financial/BCommonVatInvoiceVerificationResp.java create mode 100644 api-third/src/main/java/com/heyu/api/baidu/response/financial/BTrainVatInvoiceVerificationResp.java create mode 100644 api-third/src/main/java/com/heyu/api/baidu/response/financial/BUsedCarVatInvoiceVerificationResp.java create mode 100644 api-third/src/main/java/com/heyu/api/baidu/response/financial/BVehicleVatInvoiceVerificationResp.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/controller/financial/CommonVatInvoiceVerificationController.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/request/financial/AirTransportVatInvoiceVerificationRequest.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/request/financial/CommonVatInvoiceVerificationRequest.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/request/financial/TrainVatInvoiceVerificationRequest.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/request/financial/UsedCarVatInvoiceVerificationRequest.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/request/financial/VehicleVatInvoiceVerificationRequest.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/resp/financial/AirTransportVatInvoiceVerificationResp.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/resp/financial/CommonVatInvoiceVerificationResp.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/resp/financial/TrainVatInvoiceVerificationResp.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/resp/financial/UsedCarVatInvoiceVerificationResp.java create mode 100644 api-web/api-interface/src/main/java/com/heyu/api/resp/financial/VehicleVatInvoiceVerificationResp.java diff --git a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BAirTransportVatInvoiceVerificationResp.java b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BAirTransportVatInvoiceVerificationResp.java new file mode 100644 index 0000000..5809cc2 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BAirTransportVatInvoiceVerificationResp.java @@ -0,0 +1,16 @@ +package com.heyu.api.baidu.response.financial; + + +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class BAirTransportVatInvoiceVerificationResp extends BVatInvoiceVerificationResp { + + +} diff --git a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BCommonVatInvoiceVerificationResp.java b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BCommonVatInvoiceVerificationResp.java new file mode 100644 index 0000000..e38d577 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BCommonVatInvoiceVerificationResp.java @@ -0,0 +1,253 @@ +package com.heyu.api.baidu.response.financial; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@NoArgsConstructor +@Data +public class BCommonVatInvoiceVerificationResp extends BVatInvoiceVerificationResp { + + + @JsonProperty("words_result") + private WordsResultDTO wordsResult; + + @NoArgsConstructor + @Data + public static class WordsResultDTO { + @JsonProperty("log_id") + private Long logId; + @JsonProperty("words_result_num") + private Integer wordsResultNum; + @JsonProperty("VerifyFrequency") + private String verifyFrequency; + @JsonProperty("VerifyMessage") + private String verifyMessage; + @JsonProperty("InvalidSign") + private String invalidSign; + @JsonProperty("InvoiceType") + private String invoiceType; + @JsonProperty("MachineCode") + private String machineCode; + @JsonProperty("CheckCode") + private String checkCode; + @JsonProperty("InvoiceCode") + private String invoiceCode; + @JsonProperty("InvoiceDate") + private String invoiceDate; + @JsonProperty("VerifyResult") + private String verifyResult; + @JsonProperty("InvoiceNum") + private String invoiceNum; + @JsonProperty("TaxControlNum") + private String taxControlNum; + @JsonProperty("CommodityEndDate") + private List commodityEndDate; + @JsonProperty("VehicleTonnage") + private String vehicleTonnage; + @JsonProperty("CommodityVehicleType") + private List commodityVehicleType; + @JsonProperty("CommodityStartDate") + private List commodityStartDate; + @JsonProperty("SellerAddress") + private String sellerAddress; + @JsonProperty("CommodityPrice") + private List commodityPrice; + @JsonProperty("TransportCargoInformation") + private String transportCargoInformation; + @JsonProperty("NoteDrawer") + private String noteDrawer; + @JsonProperty("CommodityNum") + private List commodityNum; + @JsonProperty("SellerRegisterNum") + private String sellerRegisterNum; + @JsonProperty("SellerBank") + private String sellerBank; + @JsonProperty("Remarks") + private String remarks; + @JsonProperty("TotalTax") + private String totalTax; + @JsonProperty("CommodityTaxRate") + private List commodityTaxRate; + @JsonProperty("CommodityExpenseItem") + private List commodityExpenseItem; + @JsonProperty("ZeroTaxRateIndicator") + private String zeroTaxRateIndicator; + @JsonProperty("Carrier") + private String carrier; + @JsonProperty("SenderCode") + private String senderCode; + @JsonProperty("PurchaserRegisterNum") + private String purchaserRegisterNum; + @JsonProperty("ReceiverCode") + private String receiverCode; + @JsonProperty("AmountInFiguers") + private String amountInFiguers; + @JsonProperty("PurchaserBank") + private String purchaserBank; + @JsonProperty("Checker") + private String checker; + @JsonProperty("TollSign") + private String tollSign; + @JsonProperty("VehicleTypeNum") + private String vehicleTypeNum; + @JsonProperty("DepartureViaArrival") + private String departureViaArrival; + @JsonProperty("Receiver") + private String receiver; + @JsonProperty("Recipient") + private String recipient; + @JsonProperty("TotalAmount") + private String totalAmount; + @JsonProperty("CommodityAmount") + private List commodityAmount; + @JsonProperty("PurchaserName") + private String purchaserName; + @JsonProperty("CommodityType") + private List commodityType; + @JsonProperty("Sender") + private String sender; + @JsonProperty("PurchaserAddress") + private String purchaserAddress; + @JsonProperty("CommodityTax") + private List commodityTax; + @JsonProperty("CarrierCode") + private String carrierCode; + @JsonProperty("CommodityPlateNum") + private List commodityPlateNum; + @JsonProperty("CommodityUnit") + private List commodityUnit; + @JsonProperty("Payee") + private String payee; + @JsonProperty("RecipientCode") + private String recipientCode; + @JsonProperty("CommodityName") + private List commodityName; + @JsonProperty("SellerName") + private String sellerName; + + @NoArgsConstructor + @Data + public static class CommodityEndDateDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityVehicleTypeDTO { + @JsonProperty("row") + private String row; + } + + @NoArgsConstructor + @Data + public static class CommodityStartDateDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityPriceDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityNumDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityTaxRateDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityExpenseItemDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityAmountDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityTypeDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityTaxDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityPlateNumDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityUnitDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + + @NoArgsConstructor + @Data + public static class CommodityNameDTO { + @JsonProperty("row") + private String row; + @JsonProperty("word") + private String word; + } + } +} diff --git a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BTrainVatInvoiceVerificationResp.java b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BTrainVatInvoiceVerificationResp.java new file mode 100644 index 0000000..a62c38f --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BTrainVatInvoiceVerificationResp.java @@ -0,0 +1,15 @@ +package com.heyu.api.baidu.response.financial; + + +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class BTrainVatInvoiceVerificationResp extends BVatInvoiceVerificationResp { + +} diff --git a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BUsedCarVatInvoiceVerificationResp.java b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BUsedCarVatInvoiceVerificationResp.java new file mode 100644 index 0000000..68a6f8b --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BUsedCarVatInvoiceVerificationResp.java @@ -0,0 +1,16 @@ +package com.heyu.api.baidu.response.financial; + + +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class BUsedCarVatInvoiceVerificationResp extends BVatInvoiceVerificationResp { + + +} diff --git a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVatInvoiceVerificationResp.java b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVatInvoiceVerificationResp.java index 8f2c129..419d36c 100644 --- a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVatInvoiceVerificationResp.java +++ b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVatInvoiceVerificationResp.java @@ -1,6 +1,7 @@ package com.heyu.api.baidu.response.financial; +import com.heyu.api.data.dto.BaseResp; import lombok.Data; /** @@ -11,5 +12,5 @@ import lombok.Data; * */ @Data -public class BVatInvoiceVerificationResp { +public class BVatInvoiceVerificationResp extends BaseResp { } diff --git a/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVehicleVatInvoiceVerificationResp.java b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVehicleVatInvoiceVerificationResp.java new file mode 100644 index 0000000..3c05a05 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/baidu/response/financial/BVehicleVatInvoiceVerificationResp.java @@ -0,0 +1,15 @@ +package com.heyu.api.baidu.response.financial; + + +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class BVehicleVatInvoiceVerificationResp extends BVatInvoiceVerificationResp { + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/financial/CommonVatInvoiceVerificationController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/financial/CommonVatInvoiceVerificationController.java new file mode 100644 index 0000000..bc4303d --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/financial/CommonVatInvoiceVerificationController.java @@ -0,0 +1,284 @@ +package com.heyu.api.controller.financial; + + +import com.heyu.api.baidu.handle.financial.BVatInvoiceVerificationHandle; +import com.heyu.api.baidu.request.financial.BVatInvoiceVerificationRequest; +import com.heyu.api.baidu.response.financial.BCommonVatInvoiceVerificationResp; +import com.heyu.api.baidu.response.financial.BVatInvoiceVerificationResp; +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.financial.CommonVatInvoiceVerificationRequest; +import com.heyu.api.resp.financial.CommonVatInvoiceVerificationResp; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + + +/*** + *https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + * + * + * 增值税发票验真 + * + * + * + * 支持 14 种增值税发票的信息核验,包括增值税专票、电子专票、普票、电子普票、卷票、区块链发票(深圳地区)、全电发票(新版全国统一电子发票,专票/普票)、通行费增值税电子普通发票、货物运输业增值税专用发票、 + * 机动车销售发票、二手车销售发票、航空运输电子客票行程单(电子发票)、铁路电子客票(电子发票)等,支持返回票面的全部信息。同时可直接与同平台的发票识别能力对接,完成发票识别的同时进行自动化验真。 + * + * + * 视频教程请参见 智能财务票据识别+增值税发票验真使用教程 + * + * + */ +@Slf4j +@RestController +@RequestMapping("/common/vat/Invoice") +@NotIntercept +public class CommonVatInvoiceVerificationController extends BaseController { + + + @Autowired + private BVatInvoiceVerificationHandle bVatInvoiceVerificationHandle; + + + @RequestMapping("/verification") + @CacheResult + public R verification(CommonVatInvoiceVerificationRequest req) { + + BVatInvoiceVerificationRequest bVatInvoiceVerificationRequest = new BVatInvoiceVerificationRequest(); + bVatInvoiceVerificationRequest.setInvoiceCode(req.getInvoiceCode()); + bVatInvoiceVerificationRequest.setInvoiceNum(req.getInvoiceNum()); + bVatInvoiceVerificationRequest.setInvoiceDate(req.getInvoiceDate()); + bVatInvoiceVerificationRequest.setInvoiceType(req.getInvoiceType()); + bVatInvoiceVerificationRequest.setCheckCode(req.getCheckCode()); + bVatInvoiceVerificationRequest.setTotalAmount(req.getTotalAmount()); + + + CommonVatInvoiceVerificationResp resp = new CommonVatInvoiceVerificationResp(); + + + ApiR bR = bVatInvoiceVerificationHandle.handle(bVatInvoiceVerificationRequest, BCommonVatInvoiceVerificationResp.class); + if (bR.isSuccess()) { + BCommonVatInvoiceVerificationResp bCommonVatInvoiceVerificationResp = (BCommonVatInvoiceVerificationResp) bR.getData(); + BCommonVatInvoiceVerificationResp.WordsResultDTO wordsResultDTO = bCommonVatInvoiceVerificationResp.getWordsResult(); + + String verifyFrequency = wordsResultDTO.getVerifyFrequency(); // 查验次数。为历史查验次数 + String verifyMessage = wordsResultDTO.getVerifyMessage(); //查验结果信息。查验成功且发票为真返回“查验成功发票一致“,查验失败返回对应错误原因,详见末尾表格 + String invalidSign= wordsResultDTO.getInvalidSign(); // 是否作废(冲红)。Y:已作废;H:已冲红;N:未作废 + String invoiceType = wordsResultDTO.getInvoiceType(); //发票种类。即增值税专用发票、增值税电子专用发票、增值税普通发票、增值税普通发票(电子)、增值税普通发票(卷式)、通行费增值税电子普通发票、区块链电子发票、全电发票(专用发票)、全电发票(普通发票)、机动车销售发票、二手车销售发票、货物运输业增值税专用发票、航空运输电子客票行程单(电子发票)、铁路电子客票(电子发票) + String machineCode = wordsResultDTO.getMachineCode(); //机器编号 + String checkCode = wordsResultDTO.getCheckCode(); //校验码 + String invoiceCode = wordsResultDTO.getInvoiceCode(); //发票代码 + String invoiceDate = wordsResultDTO.getInvoiceDate(); // 开票日期 + String verifyResult = wordsResultDTO.getVerifyResult(); //查验结果。查验成功返回“0001”,查验失败返回对应查验结果错误码,详见末尾表格 + String invoiceNum = wordsResultDTO.getInvoiceNum(); //发票号码 + String taxControlNum = wordsResultDTO.getTaxControlNum(); //税控盘号。货运专票返回信息,其他类型发票可忽略 + resp.setVerifyFrequency(verifyFrequency); + resp.setVerifyMessage(verifyMessage); + resp.setInvalidSign(invalidSign); + resp.setInvoiceType(invoiceType); + resp.setMachineCode(machineCode); + resp.setCheckCode(checkCode); + resp.setInvoiceCode(invoiceCode); + resp.setInvoiceDate(invoiceDate); + resp.setVerifyResult(verifyResult); + resp.setInvoiceNum(invoiceNum); + resp.setTaxControlNum(taxControlNum); + + List commodityEndDate = new ArrayList<>(); // 通行日期止。通行费增值税电子普通发票返回信息,其他类型发票可忽略wordsResultDTO + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityEndDate())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityEndDateDTO commodityEndDateDTO : wordsResultDTO.getCommodityEndDate()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityEndDateDTO.getRow()); + commodityDTO.setWord(commodityEndDateDTO.getWord()); + commodityEndDate.add(commodityDTO); + } + } + resp.setCommodityEndDate(commodityEndDate); + + resp.setVehicleTonnage(wordsResultDTO.getVehicleTonnage()); //车船吨位。货运专票返回信息,其他类型发票可忽略 + List commodityVehicleType = new ArrayList<>(); //类型。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityVehicleType())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityVehicleTypeDTO commodityVehicleTypeDTO : wordsResultDTO.getCommodityVehicleType()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityVehicleTypeDTO.getRow()); + commodityVehicleType.add(commodityDTO); + } + } + resp.setCommodityVehicleType(commodityVehicleType); + + List commodityStartDate = new ArrayList<>(); //通行日期起。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityStartDate())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityStartDateDTO commodityStartDateDTO : wordsResultDTO.getCommodityStartDate()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityStartDateDTO.getRow()); + commodityDTO.setWord(commodityStartDateDTO.getWord()); + commodityStartDate.add(commodityDTO); + commodityStartDate.add(commodityDTO); + } + } + resp.setCommodityStartDate(commodityStartDate); + + resp.setSellerAddress(wordsResultDTO.getSellerAddress()); // 销售方地址及电话 + + List commodityPrice = new ArrayList<>(); //单价 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityPrice())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityPriceDTO commodityPriceDTO : wordsResultDTO.getCommodityPrice()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityPriceDTO.getRow()); + commodityDTO.setWord(commodityPriceDTO.getWord()); + commodityPrice.add(commodityDTO); + commodityPrice.add(commodityDTO); + } + } + resp.setCommodityPrice(commodityPrice); + + resp.setTransportCargoInformation(wordsResultDTO.getTransportCargoInformation()); //运输货物信息。货运专票返回信息,其他类型发票可忽略 + resp.setNoteDrawer(wordsResultDTO.getNoteDrawer()); //开票人(因税局不返回此字段,故字段为空,暂做保留使用) + resp.setSellerRegisterNum(wordsResultDTO.getSellerRegisterNum()); //销售方纳税人识别号 + resp.setSellerBank(wordsResultDTO.getSellerBank()); //销售方开户行及账号 + resp.setRemarks(wordsResultDTO.getRemarks()); // 备注 + resp.setTotalTax(wordsResultDTO.getTotalTax()); //合计税额 + resp.setZeroTaxRateIndicator(wordsResultDTO.getZeroTaxRateIndicator()); //零税率标识。空:非零税率,1:税率栏位显示“免税”,2:税率栏位显示“不征税”,3:零税率。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + resp.setCarrier(wordsResultDTO.getCarrier()); //承运人名称。货运专票返回信息,其他类型发票可忽略 + resp.setSenderCode(wordsResultDTO.getSenderCode()); // 发货人识别号。货运专票返回信息,其他类型发票可忽略 + resp.setPurchaserRegisterNum(wordsResultDTO.getPurchaserRegisterNum()); // 购方纳税人识别号 + resp.setReceiverCode(wordsResultDTO.getReceiverCode()); //收货人识别号。货运专票返回信息,其他类型发票可忽略 + resp.setAmountInFiguers(wordsResultDTO.getAmountInFiguers()); //价税合计(小写) + resp.setPurchaserBank(wordsResultDTO.getPurchaserBank()); // 购方开户行及账号 + resp.setChecker(wordsResultDTO.getChecker()); //复核(因税局不返回此字段,故字段为空,暂做保留使用) + resp.setTollSign(wordsResultDTO.getTollSign()); //通行费标志。Y-可抵扣通行费,N-不可抵扣通行费。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + resp.setVehicleTypeNum(wordsResultDTO.getVehicleTypeNum()); + resp.setDepartureViaArrival(wordsResultDTO.getDepartureViaArrival()); // 起运地、经由、到达地。货运专票返回信息,其他类型发票可忽略 + resp.setReceiver(wordsResultDTO.getReceiver()); // 收货人名称。货运专票返回信息,其他类型发票可忽略 + resp.setRecipient(wordsResultDTO.getRecipient()); // 受票方名称。货运专票返回信息,其他类型发票可忽略 + resp.setTotalAmount(wordsResultDTO.getTotalAmount()); // 合计金额 + resp.setPurchaserName(wordsResultDTO.getPurchaserName()); //购方名称 + resp.setSender(wordsResultDTO.getSender()); // 发货人名称。货运专票返回信息,其他类型发票可忽略 + resp.setPurchaserAddress(wordsResultDTO.getPurchaserAddress()); // 买方单位/个人住址 + resp.setCarrierCode(wordsResultDTO.getCarrierCode()); //承运人识别号。货运专票返回信息,其他类型发票可忽略 + resp.setPayee(wordsResultDTO.getPayee()); //收款人(因税局不返回此字段,故字段为空,暂做保留使用) + resp.setRecipientCode(wordsResultDTO.getRecipientCode()); //受票方识别号。货运专票返回信息,其他类型发票可忽略 + resp.setSellerName(wordsResultDTO.getSellerName()); //销售方名称 + + + + + List commodityTaxRate = new ArrayList<>(); //税率 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityTaxRate())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityTaxRateDTO commodityTaxRateDTO : wordsResultDTO.getCommodityTaxRate()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityTaxRateDTO.getRow()); + commodityDTO.setWord(commodityTaxRateDTO.getWord()); + commodityTaxRate.add(commodityDTO); + } + } + resp.setCommodityTaxRate(commodityTaxRate); + + List commodityExpenseItem = new ArrayList<>(); //费用项目。货运专票返回信息,其他类型发票可忽略 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityExpenseItem())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityExpenseItemDTO commodityExpenseItemDTO : wordsResultDTO.getCommodityExpenseItem()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityExpenseItemDTO.getRow()); + commodityDTO.setWord(commodityExpenseItemDTO.getWord()); + commodityExpenseItem.add(commodityDTO); + } + } + resp.setCommodityExpenseItem(commodityExpenseItem); + + List commodityNum = new ArrayList<>(); //数量 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityNum())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityNumDTO commodityNumDTO : wordsResultDTO.getCommodityNum()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityNumDTO.getRow()); + commodityDTO.setWord(commodityNumDTO.getWord()); + commodityNum.add(commodityDTO); + } + } + resp.setCommodityNum(commodityNum); + + List commodityAmount= new ArrayList<>(); //金额 + + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityAmount())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityAmountDTO commodityAmountDTO : wordsResultDTO.getCommodityAmount()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityAmountDTO.getRow()); + commodityDTO.setWord(commodityAmountDTO.getWord()); + commodityAmount.add(commodityDTO); + } + } + resp.setCommodityAmount(commodityAmount); + + List commodityType = new ArrayList<>(); //规格型号 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityType())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityTypeDTO commodityTypeDTO : wordsResultDTO.getCommodityType()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityTypeDTO.getRow()); + commodityDTO.setWord(commodityTypeDTO.getWord()); + commodityType.add(commodityDTO); + } + } + resp.setCommodityType(commodityType); + + List commodityTax = new ArrayList<>(); //税额 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityTax())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityTaxDTO tax : wordsResultDTO.getCommodityTax()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(tax.getRow()); + commodityDTO.setWord(tax.getWord()); + commodityTax.add(commodityDTO); + } + } + resp.setCommodityTax(commodityTax); + + List commodityPlateNum= new ArrayList<>(); //车牌号。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityPlateNum())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityPlateNumDTO commodityPlateNumDTO : wordsResultDTO.getCommodityPlateNum()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityPlateNumDTO.getRow()); + commodityDTO.setWord(commodityPlateNumDTO.getWord()); + commodityPlateNum.add(commodityDTO); + } + } + resp.setCommodityPlateNum(commodityPlateNum); + + List commodityUnit = new ArrayList<>(); // 单位 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityUnit())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityUnitDTO commodityUnitDTO : wordsResultDTO.getCommodityUnit()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityUnitDTO.getRow()); + commodityDTO.setWord(commodityUnitDTO.getWord()); + commodityUnit.add(commodityDTO); + + } + } + resp.setCommodityUnit(commodityUnit); + + List commodityName = new ArrayList<>(); // 货物名称/项目名称 + if(CollectionUtils.isNotEmpty(wordsResultDTO.getCommodityName())){ + for (BCommonVatInvoiceVerificationResp.WordsResultDTO.CommodityNameDTO commodityNameDTO : wordsResultDTO.getCommodityName()) { + CommonVatInvoiceVerificationResp.CommodityDTO commodityDTO = new CommonVatInvoiceVerificationResp.CommodityDTO(); + commodityDTO.setRow(commodityNameDTO.getRow()); + commodityDTO.setWord(commodityNameDTO.getWord()); + commodityName.add(commodityDTO); + + + } + } + resp.setCommodityName(commodityName); + } + + + return R.ok(); + } + + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/request/financial/AirTransportVatInvoiceVerificationRequest.java b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/AirTransportVatInvoiceVerificationRequest.java new file mode 100644 index 0000000..57e122c --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/AirTransportVatInvoiceVerificationRequest.java @@ -0,0 +1,59 @@ +package com.heyu.api.request.financial; + + +import com.heyu.api.baidu.request.BBaseRequest; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class AirTransportVatInvoiceVerificationRequest extends BBaseRequest { + + /** + * 发票代码。 + * 全电发票(专用发票)、全电发票(普通发票)此参数可为空,其他类型发票均不可为空 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNum; + + /** + * 开票日期。格式YYYYMMDD,例:20210101 + */ + private String invoiceDate; + + + /** + + * 航空运输电子客票行程单(电子发票):elec_flight_itinerary_invoice + * 发票种类 + * + * + * + * + */ + private String invoiceType; + + /** + * 校验码。填写发票校验码后6位。 + * 增值税电子专票、普票、电子普票、卷票、区块链电子发票、通行费增值税电子普通发票此参数必填; + * 其他类型发票此参数可为空 + */ + private String checkCode; + + + /** + * 发票金额。 + * 增值税专票、电子专票、区块链电子发票、机动车销售发票、货运专票填写不含税金额; + * 二手车销售发票填写车价合计; + * 全电发票(专用发票)、全电发票(普通发票)填写价税合计金额,其他类型发票可为空 + */ + private String totalAmount; +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/request/financial/CommonVatInvoiceVerificationRequest.java b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/CommonVatInvoiceVerificationRequest.java new file mode 100644 index 0000000..d68d900 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/CommonVatInvoiceVerificationRequest.java @@ -0,0 +1,67 @@ +package com.heyu.api.request.financial; + + +import com.heyu.api.baidu.request.BBaseRequest; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class CommonVatInvoiceVerificationRequest extends BBaseRequest { + + /** + * 发票代码。 + * 全电发票(专用发票)、全电发票(普通发票)此参数可为空,其他类型发票均不可为空 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNum; + + /** + * 开票日期。格式YYYYMMDD,例:20210101 + */ + private String invoiceDate; + + + /** + * 增值税专用发票:special_vat_invoice + * 增值税电子专用发票:elec_special_vat_invoice + * 增值税普通发票:normal_invoice + * 增值税普通发票(电子):elec_normal_invoice + * 增值税普通发票(卷式):roll_normal_invoice + * 通行费增值税电子普通发票:toll_elec_normal_invoice + * 区块链电子发票(目前仅支持深圳地区):blockchain_invoice + * 全电发票(专用发票):elec_invoice_special + * 全电发票(普通发票):elec_invoice_normal + * 货运运输业增值税专用发票:special_freight_transport_invoice + * 发票种类 + * + * + * + * 增值税专票、电子专票、普票、电子普通发票、卷票、通行费增值税电子普通发票、货物运输业增值税专用发票返回信息 + */ + private String invoiceType; + + /** + * 校验码。填写发票校验码后6位。 + * 增值税电子专票、普票、电子普票、卷票、区块链电子发票、通行费增值税电子普通发票此参数必填; + * 其他类型发票此参数可为空 + */ + private String checkCode; + + + /** + * 发票金额。 + * 增值税专票、电子专票、区块链电子发票、机动车销售发票、货运专票填写不含税金额; + * 二手车销售发票填写车价合计; + * 全电发票(专用发票)、全电发票(普通发票)填写价税合计金额,其他类型发票可为空 + */ + private String totalAmount; +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/request/financial/TrainVatInvoiceVerificationRequest.java b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/TrainVatInvoiceVerificationRequest.java new file mode 100644 index 0000000..c213dbf --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/TrainVatInvoiceVerificationRequest.java @@ -0,0 +1,55 @@ +package com.heyu.api.request.financial; + + +import com.heyu.api.baidu.request.BBaseRequest; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class TrainVatInvoiceVerificationRequest extends BBaseRequest { + + /** + * 发票代码。 + * 全电发票(专用发票)、全电发票(普通发票)此参数可为空,其他类型发票均不可为空 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNum; + + /** + * 开票日期。格式YYYYMMDD,例:20210101 + */ + private String invoiceDate; + + + /** + 铁路电子客票(电子发票): elec_train_ticket_invoice + * + * 增值税专票、电子专票、普票、电子普通发票、卷票、通行费增值税电子普通发票、货物运输业增值税专用发票返回信息 + */ + private String invoiceType; + + /** + * 校验码。填写发票校验码后6位。 + * 增值税电子专票、普票、电子普票、卷票、区块链电子发票、通行费增值税电子普通发票此参数必填; + * 其他类型发票此参数可为空 + */ + private String checkCode; + + + /** + * 发票金额。 + * 增值税专票、电子专票、区块链电子发票、机动车销售发票、货运专票填写不含税金额; + * 二手车销售发票填写车价合计; + * 全电发票(专用发票)、全电发票(普通发票)填写价税合计金额,其他类型发票可为空 + */ + private String totalAmount; +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/request/financial/UsedCarVatInvoiceVerificationRequest.java b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/UsedCarVatInvoiceVerificationRequest.java new file mode 100644 index 0000000..f4b0d57 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/UsedCarVatInvoiceVerificationRequest.java @@ -0,0 +1,54 @@ +package com.heyu.api.request.financial; + + +import com.heyu.api.baidu.request.BBaseRequest; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class UsedCarVatInvoiceVerificationRequest extends BBaseRequest { + + /** + * 发票代码。 + * 全电发票(专用发票)、全电发票(普通发票)此参数可为空,其他类型发票均不可为空 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNum; + + /** + * 开票日期。格式YYYYMMDD,例:20210101 + */ + private String invoiceDate; + + + /** + + * 二手车销售发票:used_vehicle_invoice + */ + private String invoiceType; + + /** + * 校验码。填写发票校验码后6位。 + * 增值税电子专票、普票、电子普票、卷票、区块链电子发票、通行费增值税电子普通发票此参数必填; + * 其他类型发票此参数可为空 + */ + private String checkCode; + + + /** + * 发票金额。 + * 增值税专票、电子专票、区块链电子发票、机动车销售发票、货运专票填写不含税金额; + * 二手车销售发票填写车价合计; + * 全电发票(专用发票)、全电发票(普通发票)填写价税合计金额,其他类型发票可为空 + */ + private String totalAmount; +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/request/financial/VehicleVatInvoiceVerificationRequest.java b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/VehicleVatInvoiceVerificationRequest.java new file mode 100644 index 0000000..afcb6a9 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/request/financial/VehicleVatInvoiceVerificationRequest.java @@ -0,0 +1,53 @@ +package com.heyu.api.request.financial; + + +import com.heyu.api.baidu.request.BBaseRequest; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class VehicleVatInvoiceVerificationRequest extends BBaseRequest { + + /** + * 发票代码。 + * 全电发票(专用发票)、全电发票(普通发票)此参数可为空,其他类型发票均不可为空 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNum; + + /** + * 开票日期。格式YYYYMMDD,例:20210101 + */ + private String invoiceDate; + + + /** + * 二手车销售发票:used_vehicle_invoice + */ + private String invoiceType; + + /** + * 校验码。填写发票校验码后6位。 + * 增值税电子专票、普票、电子普票、卷票、区块链电子发票、通行费增值税电子普通发票此参数必填; + * 其他类型发票此参数可为空 + */ + private String checkCode; + + + /** + * 发票金额。 + * 增值税专票、电子专票、区块链电子发票、机动车销售发票、货运专票填写不含税金额; + * 二手车销售发票填写车价合计; + * 全电发票(专用发票)、全电发票(普通发票)填写价税合计金额,其他类型发票可为空 + */ + private String totalAmount; +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/AirTransportVatInvoiceVerificationResp.java b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/AirTransportVatInvoiceVerificationResp.java new file mode 100644 index 0000000..9bbbc48 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/AirTransportVatInvoiceVerificationResp.java @@ -0,0 +1,17 @@ +package com.heyu.api.resp.financial; + + +import com.heyu.api.data.dto.BaseResp; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class AirTransportVatInvoiceVerificationResp extends BaseResp { + + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/CommonVatInvoiceVerificationResp.java b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/CommonVatInvoiceVerificationResp.java new file mode 100644 index 0000000..b747898 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/CommonVatInvoiceVerificationResp.java @@ -0,0 +1,99 @@ +package com.heyu.api.resp.financial; + + +import com.heyu.api.data.dto.BaseResp; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class CommonVatInvoiceVerificationResp extends BaseResp { + + + private String verifyFrequency; // 查验次数。为历史查验次数 + private String verifyMessage; //查验结果信息。查验成功且发票为真返回“查验成功发票一致“,查验失败返回对应错误原因,详见末尾表格 + private String invalidSign; // 是否作废(冲红)。Y:已作废;H:已冲红;N:未作废 + private String invoiceType; //发票种类。即增值税专用发票、增值税电子专用发票、增值税普通发票、增值税普通发票(电子)、增值税普通发票(卷式)、通行费增值税电子普通发票、区块链电子发票、全电发票(专用发票)、全电发票(普通发票)、机动车销售发票、二手车销售发票、货物运输业增值税专用发票、航空运输电子客票行程单(电子发票)、铁路电子客票(电子发票) + private String machineCode; //机器编号 + private String checkCode; //校验码 + private String invoiceCode; //发票代码 + private String invoiceDate; // 开票日期 + /*** + * 9999 查验失败 查验失败,业务出现异常,请提交工单咨询 + * 0002 超过该张票当天查验次数 此发票今日查询次数已达上限(5次),请次日查询 + * 0005 请求不合法 发票信息有误,请核对后再查询 + * 0006 发票信息不一致 发票信息有误,请核对后再查询 + * 0009 发票不存在 所查发票不存在 + * 1004 已超过最大查验量 已超过最大查验量,请提交工单咨询 + * 1005 查询发票不规范 信息有误,请核对后再查询 + * 1006 查验异常 发票信息有误,请核对后再查询 + * 1008 字段不能为空 发票请求参数不能为空 + * 1009 参数长度不正确 参数长度不符合规范,确认参数,再次查验 + * 1014 日期当天的不能查验 日期当天的不能查验,请隔天再查 + * 1015 超过5年的不能查验 超过5年的不能查验 + * 1020 没有查验权限 没有查验权限,请提交工单咨询 + * 1021 网络超时 税局维护升级,暂时无法查验,请提交工单咨询 + */ + private String verifyResult; //查验结果。查验成功返回“0001”,查验失败返回对应查验结果错误码,详见末尾表格 + private String invoiceNum; //发票号码 + + private String taxControlNum; //税控盘号。货运专票返回信息,其他类型发票可忽略 + private List commodityEndDate; // 通行日期止。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + private String vehicleTonnage; //车船吨位。货运专票返回信息,其他类型发票可忽略 + private List commodityVehicleType; //类型。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + private List commodityStartDate; //通行日期起。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + private String sellerAddress; // 销售方地址及电话 + private List commodityPrice; //单价 + private String transportCargoInformation; //运输货物信息。货运专票返回信息,其他类型发票可忽略 + private String noteDrawer; //开票人(因税局不返回此字段,故字段为空,暂做保留使用) + private List commodityNum; //数量 + private String sellerRegisterNum; //销售方纳税人识别号 + private String sellerBank; //销售方开户行及账号 + private String remarks; // 备注 + private String totalTax; //合计税额 + private List commodityTaxRate; //税率 + private List commodityExpenseItem; //费用项目。货运专票返回信息,其他类型发票可忽略 + private String zeroTaxRateIndicator; //零税率标识。空:非零税率,1:税率栏位显示“免税”,2:税率栏位显示“不征税”,3:零税率。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + private String carrier; //承运人名称。货运专票返回信息,其他类型发票可忽略 + private String senderCode; // 发货人识别号。货运专票返回信息,其他类型发票可忽略 + private String purchaserRegisterNum; // 购方纳税人识别号 + private String receiverCode; //收货人识别号。货运专票返回信息,其他类型发票可忽略 + private String amountInFiguers; //价税合计(小写) + private String purchaserBank; // 购方开户行及账号 + private String checker; //复核(因税局不返回此字段,故字段为空,暂做保留使用) + private String tollSign; //通行费标志。Y-可抵扣通行费,N-不可抵扣通行费。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + private String vehicleTypeNum; + private String departureViaArrival; // 起运地、经由、到达地。货运专票返回信息,其他类型发票可忽略 + private String receiver; // 收货人名称。货运专票返回信息,其他类型发票可忽略 + private String recipient; // 受票方名称。货运专票返回信息,其他类型发票可忽略 + private String totalAmount; // 合计金额 + private List commodityAmount; //金额 + private String purchaserName; //购方名称 + private List commodityType; //规格型号 + private String sender; // 发货人名称。货运专票返回信息,其他类型发票可忽略 + private String purchaserAddress; // 买方单位/个人住址 + private List commodityTax; //税额 + private String carrierCode; //承运人识别号。货运专票返回信息,其他类型发票可忽略 + private List commodityPlateNum; //车牌号。通行费增值税电子普通发票返回信息,其他类型发票可忽略 + private List commodityUnit; // 单位 + private String payee; //收款人(因税局不返回此字段,故字段为空,暂做保留使用) + private String recipientCode; //受票方识别号。货运专票返回信息,其他类型发票可忽略 + private List commodityName; // 货物名称/项目名称 + private String sellerName; //销售方名称 + + @NoArgsConstructor + @Data + public static class CommodityDTO { + private String row; //行号 + private String word; // 内容 + } + + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/TrainVatInvoiceVerificationResp.java b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/TrainVatInvoiceVerificationResp.java new file mode 100644 index 0000000..d78566f --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/TrainVatInvoiceVerificationResp.java @@ -0,0 +1,17 @@ +package com.heyu.api.resp.financial; + + +import com.heyu.api.data.dto.BaseResp; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class TrainVatInvoiceVerificationResp extends BaseResp { + + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/UsedCarVatInvoiceVerificationResp.java b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/UsedCarVatInvoiceVerificationResp.java new file mode 100644 index 0000000..39a3e58 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/UsedCarVatInvoiceVerificationResp.java @@ -0,0 +1,17 @@ +package com.heyu.api.resp.financial; + + +import com.heyu.api.data.dto.BaseResp; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class UsedCarVatInvoiceVerificationResp extends BaseResp { + + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/VehicleVatInvoiceVerificationResp.java b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/VehicleVatInvoiceVerificationResp.java new file mode 100644 index 0000000..0251c3b --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/resp/financial/VehicleVatInvoiceVerificationResp.java @@ -0,0 +1,16 @@ +package com.heyu.api.resp.financial; + + +import com.heyu.api.data.dto.BaseResp; +import lombok.Data; + +/** + * https://console.bce.baidu.com/support/?_=1740494347073×tamp=1740500368284#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Fvat_invoice_verification&method=post + *

+ * 增值税发票验真 + */ + +@Data +public class VehicleVatInvoiceVerificationResp extends BaseResp { + +}