fix(credit): 修复债务人公司ID匹配逻辑
- 将默认更新条件从 companyId 为空改为 companyId=0 - 修改查询条件从 isNull 改为等于 0 的判断 - 更新业务逻辑中对 needUpdate 的判断条件 docs(shop): 添加经销商推荐绑定接口文档 - 新增 SHOP_DEALER_REFEREE_BINDING.md 文档 - 定义 POST /api/shop/shop-dealer-referee 接口规则 - 说明邀请人有效性验证和防止自绑限制 - 描述首次绑定幂等性和溯源字段要求 - 提供数据库唯一索引建议和建表语句
This commit is contained in:
@@ -151,7 +151,7 @@ public class CreditJudgmentDebtorController extends BaseController {
|
||||
/**
|
||||
* 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName)
|
||||
*
|
||||
* <p>默认仅更新 companyId 为空的记录;如需覆盖更新,传 onlyNull=false。</p>
|
||||
* <p>默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。</p>
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:update')")
|
||||
@OperationLog
|
||||
@@ -170,7 +170,7 @@ public class CreditJudgmentDebtorController extends BaseController {
|
||||
.eq(currentTenantId != null, CreditJudgmentDebtor::getTenantId, currentTenantId)
|
||||
.isNotNull(CreditJudgmentDebtor::getName);
|
||||
if (Boolean.TRUE.equals(onlyNull)) {
|
||||
debtorQuery.isNull(CreditJudgmentDebtor::getCompanyId);
|
||||
debtorQuery.eq(CreditJudgmentDebtor::getCompanyId, 0);
|
||||
}
|
||||
if (limit != null && limit > 0) {
|
||||
debtorQuery.last("limit " + Math.min(limit, 200000));
|
||||
@@ -269,7 +269,7 @@ public class CreditJudgmentDebtorController extends BaseController {
|
||||
|
||||
boolean needUpdate = d.getCompanyId() == null || !companyId.equals(d.getCompanyId());
|
||||
if (Boolean.TRUE.equals(onlyNull)) {
|
||||
needUpdate = d.getCompanyId() == null;
|
||||
needUpdate = d.getCompanyId() != null && d.getCompanyId() == 0;
|
||||
}
|
||||
if (!needUpdate) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user