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