fix(customer):修复重复认证时重复插入最终记录表的bug

This commit is contained in:
JIAN 2024-08-31 14:39:29 +08:00
parent fe18fade77
commit 8c387f3649

View File

@ -74,10 +74,17 @@ public class CertificationAuditServiceImpl extends ServiceImpl<CertificationAudi
.build());
// 更新最终信息表
workerCertificationMapper.insert(WorkerCertification.builder()
WorkerCertification agencyCertification = WorkerCertification.builder()
.id(userId)
.certificationStatus(CertificationStatusEnum.PROGRESSING.getStatus())
.build());
.build();
if (ChainWrappers.lambdaQueryChain(workerCertificationMapper)
.eq(WorkerCertification::getId, userId)
.count() == 0) {
workerCertificationMapper.insert(agencyCertification);
} else {
workerCertificationMapper.updateById(agencyCertification);
}
}
@Override
@ -104,10 +111,17 @@ public class CertificationAuditServiceImpl extends ServiceImpl<CertificationAudi
.build());
// 更新最终信息表
agencyCertificationMapper.insert(AgencyCertification.builder()
AgencyCertification agencyCertification = AgencyCertification.builder()
.id(userId)
.certificationStatus(CertificationStatusEnum.PROGRESSING.getStatus())
.build());
.build();
if (ChainWrappers.lambdaQueryChain(agencyCertificationMapper)
.eq(AgencyCertification::getId, userId)
.count() == 0) {
agencyCertificationMapper.insert(agencyCertification);
} else {
agencyCertificationMapper.updateById(agencyCertification);
}
}
@Override