|
@@ -98,26 +98,12 @@ public class EnterpriseHandler extends BaseNotifyHandler {
|
|
|
|
|
|
|
|
if (entity == null) {
|
|
if (entity == null) {
|
|
|
// 通知到达时本地尚未创建 → 先查预登记记录(applyInvite 创建的 PENDING 记录)
|
|
// 通知到达时本地尚未创建 → 先查预登记记录(applyInvite 创建的 PENDING 记录)
|
|
|
- EnterpriseEntity pending = null;
|
|
|
|
|
- if (StrUtil.isNotBlank(outBizNo)) {
|
|
|
|
|
- pending = enterpriseMapper.selectByOutBizNoIgnoreTenant(outBizNo);
|
|
|
|
|
- }
|
|
|
|
|
- entity = new EnterpriseEntity();
|
|
|
|
|
|
|
+ entity = enterpriseMapper.selectByOutBizNoIgnoreTenant(outBizNo);
|
|
|
entity.setEnterpriseId(enterpriseId);
|
|
entity.setEnterpriseId(enterpriseId);
|
|
|
entity.setOutBizNo(outBizNo);
|
|
entity.setOutBizNo(outBizNo);
|
|
|
entity.setAccountId(accountId);
|
|
entity.setAccountId(accountId);
|
|
|
entity.setStatus(status);
|
|
entity.setStatus(status);
|
|
|
entity.setRemark(remark);
|
|
entity.setRemark(remark);
|
|
|
- // 从 PENDING 记录取 tenantId(applyInvite 创建时已写入正确值)
|
|
|
|
|
- if (pending != null && pending.getTenantId() != null) {
|
|
|
|
|
- entity.setTenantId(pending.getTenantId());
|
|
|
|
|
- }
|
|
|
|
|
- if (pending != null) {
|
|
|
|
|
- entity.setServiceProviderId(pending.getServiceProviderId());
|
|
|
|
|
- entity.setScopeLabel(pending.getScopeLabel());
|
|
|
|
|
- entity.setName(pending.getName());
|
|
|
|
|
- enterpriseMapper.deleteById(pending);
|
|
|
|
|
- }
|
|
|
|
|
enterpriseMapper.insert(entity);
|
|
enterpriseMapper.insert(entity);
|
|
|
log.info("通知创建企业记录: enterprise_id={}, status={}, providerId={}", enterpriseId, status, entity.getServiceProviderId());
|
|
log.info("通知创建企业记录: enterprise_id={}, status={}, providerId={}", enterpriseId, status, entity.getServiceProviderId());
|
|
|
} else {
|
|
} else {
|
|
@@ -126,7 +112,7 @@ public class EnterpriseHandler extends BaseNotifyHandler {
|
|
|
if (StrUtil.isNotBlank(outBizNo)) entity.setOutBizNo(outBizNo);
|
|
if (StrUtil.isNotBlank(outBizNo)) entity.setOutBizNo(outBizNo);
|
|
|
if (StrUtil.isNotBlank(accountId)) entity.setAccountId(accountId);
|
|
if (StrUtil.isNotBlank(accountId)) entity.setAccountId(accountId);
|
|
|
if (StrUtil.isNotBlank(remark)) entity.setRemark(remark);
|
|
if (StrUtil.isNotBlank(remark)) entity.setRemark(remark);
|
|
|
- enterpriseMapper.updateById(entity);
|
|
|
|
|
|
|
+ enterpriseMapper.updateIgnoreTenant(entity);
|
|
|
log.info("通知更新企业状态: enterprise_id={}, status={}", enterpriseId, status);
|
|
log.info("通知更新企业状态: enterprise_id={}, status={}", enterpriseId, status);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -139,7 +125,7 @@ public class EnterpriseHandler extends BaseNotifyHandler {
|
|
|
if (info.get("account_id") != null) entity.setAccountId((String) info.get("account_id"));
|
|
if (info.get("account_id") != null) entity.setAccountId((String) info.get("account_id"));
|
|
|
if (info.get("enterprise_name") != null) entity.setName((String) info.get("enterprise_name"));
|
|
if (info.get("enterprise_name") != null) entity.setName((String) info.get("enterprise_name"));
|
|
|
if (info.get("enterprise_alias") != null) entity.setShortName((String) info.get("enterprise_alias"));
|
|
if (info.get("enterprise_alias") != null) entity.setShortName((String) info.get("enterprise_alias"));
|
|
|
- enterpriseMapper.updateById(entity);
|
|
|
|
|
|
|
+ enterpriseMapper.updateIgnoreTenant(entity);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.warn("同步企业详情失败(不影响主流程): enterprise_id={}, error={}", enterpriseId, e.getMessage());
|
|
log.warn("同步企业详情失败(不影响主流程): enterprise_id={}, error={}", enterpriseId, e.getMessage());
|