|
@@ -99,12 +99,23 @@ public class EnterpriseHandler extends BaseNotifyHandler {
|
|
|
if (entity == null) {
|
|
if (entity == null) {
|
|
|
// 通知到达时本地尚未创建 → 先查预登记记录(applyInvite 创建的 PENDING 记录)
|
|
// 通知到达时本地尚未创建 → 先查预登记记录(applyInvite 创建的 PENDING 记录)
|
|
|
entity = enterpriseMapper.selectByOutBizNoIgnoreTenant(outBizNo);
|
|
entity = enterpriseMapper.selectByOutBizNoIgnoreTenant(outBizNo);
|
|
|
- entity.setEnterpriseId(enterpriseId);
|
|
|
|
|
- entity.setOutBizNo(outBizNo);
|
|
|
|
|
- entity.setAccountId(accountId);
|
|
|
|
|
- entity.setStatus(status);
|
|
|
|
|
- entity.setRemark(remark);
|
|
|
|
|
- enterpriseMapper.updateIgnoreTenant(entity);
|
|
|
|
|
|
|
+ if (entity == null) {
|
|
|
|
|
+ // PENDING 也不存在(历史数据),直接新建
|
|
|
|
|
+ entity = new EnterpriseEntity();
|
|
|
|
|
+ entity.setEnterpriseId(enterpriseId);
|
|
|
|
|
+ entity.setOutBizNo(outBizNo);
|
|
|
|
|
+ entity.setAccountId(accountId);
|
|
|
|
|
+ entity.setStatus(status);
|
|
|
|
|
+ entity.setRemark(remark);
|
|
|
|
|
+ enterpriseMapper.insert(entity);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ entity.setEnterpriseId(enterpriseId);
|
|
|
|
|
+ entity.setOutBizNo(outBizNo);
|
|
|
|
|
+ entity.setAccountId(accountId);
|
|
|
|
|
+ entity.setStatus(status);
|
|
|
|
|
+ entity.setRemark(remark);
|
|
|
|
|
+ enterpriseMapper.updateIgnoreTenant(entity);
|
|
|
|
|
+ }
|
|
|
log.info("通知创建企业记录: enterprise_id={}, status={}, providerId={}", enterpriseId, status, entity.getServiceProviderId());
|
|
log.info("通知创建企业记录: enterprise_id={}, status={}, providerId={}", enterpriseId, status, entity.getServiceProviderId());
|
|
|
} else {
|
|
} else {
|
|
|
// 已存在 → 更新状态
|
|
// 已存在 → 更新状态
|