feat: 收款信息开户行匹配金蝶行名行号带出联行号并保存前校验
- 新增 A905-3 行名行号查询能力(BfiBankQueryDTO/BfiBankVO/IBfiClient.bebankQuery/IBfiService.queryBank) - 客商档案新增 query-bank 按行名精确匹配(失焦回显联行号)与 query-bank-by-number 按行号校验(保存前拦截,异常上抛便于区分查不到与校验失败) - 清理 BfiServiceImpl 内置发票查询 mock,统一走 BfiClientMock 桩文件
This commit is contained in:
+21
@@ -38,6 +38,7 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBankVO;
|
||||
import org.springblade.transport.support.TransportBusinessSupport;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
@@ -208,6 +209,26 @@ public class CustomerArchiveController extends BladeController {
|
||||
return R.data(customerArchiveService.querySupplierCode(creditCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 金蝶开户行查询(A905-3,收款信息填写开户行失焦精确匹配联行号用)
|
||||
*/
|
||||
@GetMapping("/query-bank")
|
||||
@ApiOperationSupport(order = 12)
|
||||
@Operation(summary = "金蝶开户行查询", description = "A905-3 按行名精确匹配金蝶行名行号档案,返回行名与联行号,查不到返回空")
|
||||
public R<BfiBankVO> queryBank(@Parameter(description = "开户行名称", required = true) @RequestParam String bankName) {
|
||||
return R.data(customerArchiveService.queryKingdeeBank(bankName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 金蝶联行号校验(A905-3,收款信息保存前校验联行号真实存在用)
|
||||
*/
|
||||
@GetMapping("/query-bank-by-number")
|
||||
@ApiOperationSupport(order = 12)
|
||||
@Operation(summary = "金蝶联行号校验", description = "A905-3 按行号精确匹配金蝶行名行号档案,查不到返回空,接口异常返回错误")
|
||||
public R<BfiBankVO> queryBankByNumber(@Parameter(description = "联行号", required = true) @RequestParam String cnapsCode) {
|
||||
return R.data(customerArchiveService.queryKingdeeBankByNumber(cnapsCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 评分明细模板
|
||||
*/
|
||||
|
||||
+17
@@ -25,6 +25,7 @@ package org.springblade.transport.service;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBankVO;
|
||||
import org.springblade.transport.excel.CustomerArchiveExcel;
|
||||
import org.springblade.transport.pojo.entity.CustomerArchive;
|
||||
import org.springblade.transport.pojo.vo.CustomerArchiveVO;
|
||||
@@ -204,6 +205,22 @@ public interface ICustomerArchiveService extends BaseService<CustomerArchive> {
|
||||
*/
|
||||
String querySupplierCode(String unifiedCreditCode);
|
||||
|
||||
/**
|
||||
* A905-3 按行名精确匹配金蝶行名行号档案(收款信息填写开户行后失焦回显联行号用),查不到返回 null
|
||||
*
|
||||
* @param bankName 开户行名称(行名全称)
|
||||
* @return 匹配到的行名行号档案,含联行号
|
||||
*/
|
||||
BfiBankVO queryKingdeeBank(String bankName);
|
||||
|
||||
/**
|
||||
* A905-3 按行号精确匹配金蝶行名行号档案(收款信息保存前校验联行号真实存在用),查不到返回 null,接口异常上抛由全局异常处理返回
|
||||
*
|
||||
* @param cnapsCode 联行号(行号)
|
||||
* @return 匹配到的行名行号档案
|
||||
*/
|
||||
BfiBankVO queryKingdeeBankByNumber(String cnapsCode);
|
||||
|
||||
/**
|
||||
* 推送失败状态落库(独立事务):推送主事务已回滚,失败状态与原因单独落库供页面展示与手动重推
|
||||
*
|
||||
|
||||
+63
@@ -46,8 +46,10 @@ import org.springblade.system.cache.UserCache;
|
||||
import org.springblade.transport.constant.HcsSyncConstant;
|
||||
import org.springblade.transport.excel.CustomerArchiveExcel;
|
||||
import org.springblade.thirdparty.bfi.constant.BfiConstant;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBankQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiCustomerQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiSupplierQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBankVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultErrorVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultItemVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultVO;
|
||||
@@ -672,6 +674,67 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
return this.queryKingdeeSupplierNumber(unifiedCreditCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* A905-3 按行名查询金蝶行名行号档案:收款信息填写开户行失焦时实时精确匹配取联行号,
|
||||
* 接口异常返回 null 不阻断录入,由前端提示未查询到
|
||||
*/
|
||||
@Override
|
||||
public BfiBankVO queryKingdeeBank(String bankName) {
|
||||
if (Func.isEmpty(bankName)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
BfiBankQueryDTO param = new BfiBankQueryDTO();
|
||||
param.setPageNo(1);
|
||||
param.setPageSize(10);
|
||||
param.setStatus(BfiConstant.BILL_STATUS_AUDITED);
|
||||
param.setEnable(BfiConstant.ENABLE_ENABLED);
|
||||
param.setName(List.of(bankName.trim()));
|
||||
BfiPageVO<BfiBankVO> page = bfiService.queryBank(param);
|
||||
List<BfiBankVO> rows = page == null ? null : page.getRows();
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 金蝶侧按行名过滤若为模糊匹配,本地再按全称精确比对取第一条
|
||||
String trimmedName = bankName.trim();
|
||||
return rows.stream()
|
||||
.filter(bank -> trimmedName.equals(bank.getName()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
} catch (Exception exception) {
|
||||
log.warn("A905-3行名行号查询失败,bankName={}", bankName, exception);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A905-3 按行号查询金蝶行名行号档案:收款信息保存前校验联行号真实存在,查不到返回 null 由前端拦截保存;
|
||||
* 与 {@link #queryKingdeeBank(String)} 不同,接口异常不上抛吞掉而是直接抛出,便于前端区分「查不到」与「校验失败」
|
||||
*/
|
||||
@Override
|
||||
public BfiBankVO queryKingdeeBankByNumber(String cnapsCode) {
|
||||
if (Func.isEmpty(cnapsCode)) {
|
||||
return null;
|
||||
}
|
||||
BfiBankQueryDTO param = new BfiBankQueryDTO();
|
||||
param.setPageNo(1);
|
||||
param.setPageSize(10);
|
||||
param.setStatus(BfiConstant.BILL_STATUS_AUDITED);
|
||||
param.setEnable(BfiConstant.ENABLE_ENABLED);
|
||||
param.setNumber(List.of(cnapsCode.trim()));
|
||||
BfiPageVO<BfiBankVO> page = bfiService.queryBank(param);
|
||||
List<BfiBankVO> rows = page == null ? null : page.getRows();
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 金蝶侧按行号过滤若为模糊匹配,本地再按编码精确比对取第一条
|
||||
String trimmedCode = cnapsCode.trim();
|
||||
return rows.stream()
|
||||
.filter(bank -> trimmedCode.equals(bank.getNumber()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金蝶已存在档案时,客商编号(customer_code)采纳金蝶客商编码,后续业务接口沿用客商编号即拿到金蝶编码;
|
||||
* 金蝶编码为空或与当前编号一致时无需处理;同租户下已被其他客商占用时跳过回填,避免违反 uk_customer_archive_code 唯一约束
|
||||
|
||||
+13
@@ -30,6 +30,7 @@ import org.springblade.thirdparty.bfi.config.BfiFeignClientConfig;
|
||||
import org.springblade.thirdparty.bfi.constant.BfiConstant;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillSaveBodyDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiArBillSaveBodyDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBankQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBillLockDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBlacklistQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiClaimPushBodyDTO;
|
||||
@@ -50,6 +51,7 @@ import org.springblade.thirdparty.bfi.pojo.dto.BfiWithdrawTokenDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiApBillVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiArBillVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiAttachmentUploadVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBankVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillLockResultVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBlacklistVO;
|
||||
@@ -101,6 +103,7 @@ public interface IBfiClient {
|
||||
String CUSTOMER_QUERY_URL = "${thirdParty.bfi.customerQueryUrl:/ierp/kapi/v2/awrp/basedata/bd_customer/query}";
|
||||
String CUSTOMER_SAVE_URL = "${thirdParty.bfi.customerSaveUrl:/ierp/kapi/v2/awrp/basedata/bd_customer/save}";
|
||||
String SUPPLIER_QUERY_URL = "${thirdParty.bfi.supplierQueryUrl:/ierp/kapi/v2/awrp/basedata/bd_supplier/query}";
|
||||
String BEBANK_QUERY_URL = "${thirdParty.bfi.bebankQueryUrl:/ierp/kapi/v2/awrp/basedata/bd_bebank/query}";
|
||||
String AP_BILL_SAVE_URL = "${thirdParty.bfi.apBillSaveUrl:/ierp/kapi/v2/awrp/ap/ap/ap_finapbill/save}";
|
||||
String AP_BILL_QUERY_URL = "${thirdParty.bfi.apBillQueryUrl:/ierp/kapi/v2/awrp/ap/ap_finapbill/query}";
|
||||
String AR_BILL_SAVE_URL = "${thirdParty.bfi.arBillSaveUrl:/ierp/kapi/v2/awrp/ar/ar/ar_finarbill/save}";
|
||||
@@ -295,6 +298,16 @@ public interface IBfiClient {
|
||||
@RequestParam(value = "modifytimeS", required = false) String modifytimeS,
|
||||
@RequestParam(value = "modifytimeE", required = false) String modifytimeE);
|
||||
|
||||
/**
|
||||
* A905-3 行名行号查询
|
||||
*
|
||||
* @param accessToken 访问令牌,通过 getToken 获取
|
||||
* @param param 查询参数
|
||||
* @return 行名行号分页数据
|
||||
*/
|
||||
@GetMapping(BEBANK_QUERY_URL)
|
||||
BfiResultVO<BfiPageVO<BfiBankVO>> bebankQuery(@RequestHeader(BfiConstant.HEADER_ACCESS_TOKEN) String accessToken, @SpringQueryMap BfiBankQueryDTO param);
|
||||
|
||||
/**
|
||||
* A102-2 财务应付单保存
|
||||
*
|
||||
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.thirdparty.bfi.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业财融合(BFI)A905-3 行名行号查询参数
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class BfiBankQueryDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 【必填】页码,从1开始
|
||||
*/
|
||||
private Integer pageNo;
|
||||
/**
|
||||
* 【必填】页数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
/**
|
||||
* 数据状态[A:暂存, B:已提交, C:已审核]
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 使用状态[0:禁用, 1:可用]
|
||||
*/
|
||||
private String enable;
|
||||
/**
|
||||
* 名称(行名)
|
||||
*/
|
||||
private List<String> name;
|
||||
/**
|
||||
* 编码(行号)
|
||||
*/
|
||||
private List<String> number;
|
||||
/**
|
||||
* 修改时间-开始,格式:yyyy-MM-dd HH:mm:ss,限定时间范围不可超过6个月
|
||||
*/
|
||||
private String modifytimeS;
|
||||
/**
|
||||
* 修改时间-结束,格式:yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String modifytimeE;
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.thirdparty.bfi.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 业财融合(BFI)A905-3 行名行号查询返回结果
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
public class BfiBankVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 编码(行号)
|
||||
*/
|
||||
private String number;
|
||||
/**
|
||||
* 名称(行名)
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 数据状态[A:暂存, B:已提交, C:已审核]
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 使用状态[0:禁用, 1:可用]
|
||||
*/
|
||||
private String enable;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createtime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String modifytime;
|
||||
/**
|
||||
* 主数据内码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long masterid;
|
||||
/**
|
||||
* 联行号
|
||||
*/
|
||||
@JsonAlias("union_number")
|
||||
private String unionNumber;
|
||||
/**
|
||||
* Swift Code
|
||||
*/
|
||||
@JsonAlias("swift_code")
|
||||
private String swiftCode;
|
||||
/**
|
||||
* 银行类别名称
|
||||
*/
|
||||
private String bankcatename;
|
||||
/**
|
||||
* 省份(银企)
|
||||
*/
|
||||
private String provincetxt;
|
||||
/**
|
||||
* 城市(银企)
|
||||
*/
|
||||
private String citytxt;
|
||||
/**
|
||||
* 分行代码
|
||||
*/
|
||||
private String branchcode;
|
||||
/**
|
||||
* 疑似过期[Y:是, N:否]
|
||||
*/
|
||||
private String isoverdue;
|
||||
}
|
||||
+10
@@ -30,6 +30,7 @@ import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillSaveDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiArBillQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiArBillSaveDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBankQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBillLockDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiClaimAnnounceQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiClaimPushDTO;
|
||||
@@ -52,6 +53,7 @@ import org.springblade.thirdparty.bfi.pojo.dto.BfiSupplierQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiApBillVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiArBillVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiAttachmentUploadVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBankVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBlacklistVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiClaimAnnounceVO;
|
||||
@@ -193,6 +195,14 @@ public interface IBfiService {
|
||||
*/
|
||||
BfiPageVO<BfiSupplierVO> querySupplier(BfiSupplierQueryDTO param);
|
||||
|
||||
/**
|
||||
* A905-3 行名行号查询
|
||||
*
|
||||
* @param param 查询参数,页码从1开始,修改时间范围不可超过6个月
|
||||
* @return 行名行号分页数据
|
||||
*/
|
||||
BfiPageVO<BfiBankVO> queryBank(BfiBankQueryDTO param);
|
||||
|
||||
/**
|
||||
* A102-2 财务应付单保存
|
||||
*
|
||||
|
||||
+13
-22
@@ -43,6 +43,7 @@ import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillSaveDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiArBillQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiArBillSaveBodyDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiArBillSaveDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBankQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBillLockDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiBlacklistQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiClaimAnnounceQueryDTO;
|
||||
@@ -79,6 +80,7 @@ import org.springblade.thirdparty.bfi.pojo.dto.BfiWithdrawTokenDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiApBillVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiArBillVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiAttachmentUploadVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBankVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillLockResultVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultItemVO;
|
||||
import org.springblade.thirdparty.bfi.pojo.vo.BfiBillSaveResultVO;
|
||||
@@ -346,6 +348,16 @@ public class BfiServiceImpl implements IBfiService {
|
||||
return result.getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BfiPageVO<BfiBankVO> queryBank(BfiBankQueryDTO param) {
|
||||
if (param == null || param.getPageNo() == null || param.getPageSize() == null) {
|
||||
throw new BfiException("查询BFI行名行号失败,分页参数不能为空");
|
||||
}
|
||||
String accessToken = getAccessToken();
|
||||
BfiResultVO<BfiPageVO<BfiBankVO>> result = commonCall("行名行号查询", () -> client.bebankQuery(accessToken, param));
|
||||
return result.getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BfiBillSaveResultVO saveApBill(BfiApBillSaveDTO param) {
|
||||
if (param == null || StringUtil.isBlank(param.getAwrpSrcSys()) || StringUtil.isBlank(param.getAwrpSrcCode())) {
|
||||
@@ -474,10 +486,7 @@ public class BfiServiceImpl implements IBfiService {
|
||||
if (param == null || StringUtil.isBlank(param.getSerialNo()) || StringUtil.isBlank(param.getSellerTaxpayerId())) {
|
||||
throw new BfiException("查询BFI开票申请发票失败,单据编号与销方税号不能为空");
|
||||
}
|
||||
if (properties.isMockEnabled()) {
|
||||
log.info("【MOCK】查询BFI开票申请发票,serialNo={}", param.getSerialNo());
|
||||
return mockQueryInvoiceApplyInvoice();
|
||||
}
|
||||
// mock 模式由 BfiClientMock 读取桩文件 invoiceApplyOpenApi.json(有桩用桩、无桩透传真实接口),此处不再内置固定响应
|
||||
// data 原文需序列化为 JSON 后 Base64 编码
|
||||
String data = Base64.getEncoder().encodeToString(JSONUtil.toJsonStr(param).getBytes(StandardCharsets.UTF_8));
|
||||
BfiInvoiceApplyOpenApiBodyDTO body = new BfiInvoiceApplyOpenApiBodyDTO();
|
||||
@@ -767,22 +776,4 @@ public class BfiServiceImpl implements IBfiService {
|
||||
long expireMillis = tokenVO.getExpiresIn() - BfiConstant.TOKEN_EXPIRE_BUFFER_MILLIS;
|
||||
bladeRedis.getValueOps().setIfAbsent(BfiConstant.BFI_TOKEN_CACHE_KEY, tokenVO.getAccessToken(), Duration.ofMillis(expireMillis));
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock 开票申请发票查询(开发调试用)
|
||||
*
|
||||
* @return mock 发票查询结果
|
||||
*/
|
||||
private BfiOpenApiResultVO<List<BfiInvoiceApplyOpenApiBillVO>> mockQueryInvoiceApplyIn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xNzA1NTAwMDFfMDAwMSIsInNrbSI6IiIsInNwZWNpYWxSZWRGbGFnIjowLCJzcGxpdE9yTWVyZ2VGbGFnIjoiMCIsInRheEZsYWciOiIxIiwidGVybWluYWxObyI6IiIsInRvdGFsQW1vdW50IjozNjIyLjY0LCJ0b3RhbFRheEFtb3VudCI6MjE3LjM2fV0sImJpbGxObyI6IktQU1EtSkNaWC0yMDI2MDMtMDAwNTgwIn1d";
|
||||
BfiOpenApiResultVO<List<BfiInvoiceApplyOpenApiBillVO>> result = new BfiOpenApiResultVO<>();
|
||||
result.setErrorCode("0");
|
||||
result.setSuccess(true);
|
||||
String decodedJson = new String(Base64.getDecoder().decode(mockData), StandardCharsets.UTF_8);
|
||||
JSONObject decodedObj = JSONUtil.parseObj(decodedJson);
|
||||
result.setErrorCode(decodedObj.getStr("errorCode"));
|
||||
result.setSuccess(decodedObj.getBool("success"));
|
||||
result.setData(decodedObj.getBeanList("data", BfiInvoiceApplyOpenApiBillVO.class));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user