feat: 金蝶黑名单查询支持number企业税号数组入参,客商提审按发票信息纳税人识别号过滤校验

This commit is contained in:
刘泉佳
2026-10-08 18:25:58 +08:00
parent a6af9a2ccd
commit 8f60bd5597
4 changed files with 33 additions and 10 deletions
@@ -1052,21 +1052,29 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
/** /**
* 国资委黑名单校验(A801-5):客商提审进入准入审批前实时查询金蝶黑名单, * 国资委黑名单校验(A801-5):客商提审进入准入审批前实时查询金蝶黑名单,
* 按统一社会信用代码精确匹配;命中禁止交易类(A)硬拦截, * 以客商发票信息中的纳税人识别号(number)作为查询条件按税号精确匹配;命中禁止交易类(A)硬拦截,
* 风险警示类(B)默认放行告警、可经 {@code thirdparty.bfi.blacklist.blockRiskWarning} 配置拦截, * 风险警示类(B)默认放行告警、可经 {@code thirdparty.bfi.blacklist.blockRiskWarning} 配置拦截,
* 其他类别放行告警;金蝶黑名单查询异常时向上抛出,阻断提审 * 其他类别放行告警;金蝶黑名单查询异常时向上抛出,阻断提审
* *
* @param customer 客商 * @param customer 客商
*/ */
private void validateBlacklist(CustomerArchiveVO customer) { private void validateBlacklist(CustomerArchiveVO customer) {
String creditCode = customer.getUnifiedCreditCode(); List<CustomerInvoiceInfoVO> invoices = customer.getInvoices();
if (Func.isEmpty(creditCode)) { if (Func.isEmpty(invoices)) {
return; return;
} }
List<BfiBlacklistVO> blacklist = bfiService.queryBlacklist("1"); List<String> taxNos = invoices.stream()
String code = creditCode.trim().toUpperCase(); .map(CustomerInvoiceInfoVO::getTaxNo)
.filter(Func::isNotEmpty)
.map(taxNo -> taxNo.trim().toUpperCase())
.distinct()
.toList();
if (Func.isEmpty(taxNos)) {
return;
}
List<BfiBlacklistVO> blacklist = bfiService.queryBlacklist("1", taxNos);
BfiBlacklistVO hit = blacklist.stream() BfiBlacklistVO hit = blacklist.stream()
.filter(item -> Func.isNotEmpty(item.getNumber()) && code.equals(item.getNumber().trim().toUpperCase())) .filter(item -> Func.isNotEmpty(item.getNumber()) && taxNos.contains(item.getNumber().trim().toUpperCase()))
.findFirst() .findFirst()
.orElse(null); .orElse(null);
if (hit == null) { if (hit == null) {
@@ -1079,8 +1087,8 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
throw new ServiceException(String.format("客商【%s】在国资委黑名单中(失信类别:%s,列入事由:%s),不允许提交准入审批", throw new ServiceException(String.format("客商【%s】在国资委黑名单中(失信类别:%s,列入事由:%s),不允许提交准入审批",
customer.getFullName(), category, hit.getAwrpTextareafield())); customer.getFullName(), category, hit.getAwrpTextareafield()));
} }
log.warn("客商命中金蝶黑名单风险警示类,放行,fullName={},unifiedCreditCode={},失信类别={},列入事由={}", log.warn("客商命中金蝶黑名单风险警示类,放行,fullName={},taxNos={},失信类别={},列入事由={}",
customer.getFullName(), creditCode, category, hit.getAwrpTextareafield()); customer.getFullName(), taxNos, category, hit.getAwrpTextareafield());
} }
private void validateUnique(CustomerArchiveVO customer) { private void validateUnique(CustomerArchiveVO customer) {
@@ -30,6 +30,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* 业财融合(BFI)A801-5 黑名单查询参数 * 业财融合(BFI)A801-5 黑名单查询参数
@@ -47,6 +48,15 @@ public class BfiBlacklistQueryDTO implements Serializable {
*/ */
private String enable; private String enable;
/**
* 企业税号,数组
*/
private List<String> number;
/**
* 企业名称,数组
*/
private List<String> name;
/** /**
* 【必填】页码,从1开始 * 【必填】页码,从1开始
*/ */
@@ -129,9 +129,10 @@ public interface IBfiService {
* A801-5 黑名单查询 * A801-5 黑名单查询
* *
* @param enable 使用状态[1:可用, 0:禁用] * @param enable 使用状态[1:可用, 0:禁用]
* @param number 企业税号数组,按税号过滤时传
* @return 黑名单列表 * @return 黑名单列表
*/ */
List<BfiBlacklistVO> queryBlacklist(String enable); List<BfiBlacklistVO> queryBlacklist(String enable, List<String> number);
/** /**
* A103-1 付款申请保存(根据星瀚应付下推付款申请) * A103-1 付款申请保存(根据星瀚应付下推付款申请)
@@ -31,6 +31,7 @@ import feign.Response;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.thirdparty.bfi.config.BfiProperties; import org.springblade.thirdparty.bfi.config.BfiProperties;
import org.springblade.thirdparty.bfi.constant.BfiConstant; import org.springblade.thirdparty.bfi.constant.BfiConstant;
@@ -222,12 +223,15 @@ public class BfiServiceImpl implements IBfiService {
} }
@Override @Override
public List<BfiBlacklistVO> queryBlacklist(String enable) { public List<BfiBlacklistVO> queryBlacklist(String enable, List<String> number) {
if (StringUtil.isBlank(enable)) { if (StringUtil.isBlank(enable)) {
throw new BfiException("查询BFI黑名单失败,使用状态不能为空"); throw new BfiException("查询BFI黑名单失败,使用状态不能为空");
} }
BfiBlacklistQueryDTO param = new BfiBlacklistQueryDTO(); BfiBlacklistQueryDTO param = new BfiBlacklistQueryDTO();
param.setEnable(enable); param.setEnable(enable);
if (Func.isNotEmpty(number)) {
param.setNumber(number);
}
String accessToken = getAccessToken(); String accessToken = getAccessToken();
return BfiUtil.queryAllPages(pageNo -> { return BfiUtil.queryAllPages(pageNo -> {
param.setPageNo(pageNo); param.setPageNo(pageNo);