fix(asms): 同步新增问题修复

This commit is contained in:
yjz
2024-03-13 19:44:30 +08:00
parent e4a655934f
commit 0f8d66c975
@@ -541,14 +541,11 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
// 更新时间
lawsDomesticStandard.setUpdateTime(getSimpleDate2(lawsAsmsDomestic.getUpdateTimeString()));
LawsDomesticStandard domesticStandard = lawsDomesticStandardService.getById(lawsAsmsDomestic.getId());
int count = lawsDomesticStandardService.queryCountById(lawsAsmsDomestic.getId());
if (count > 0 && Objects.isNull(domesticStandard)){
if(Objects.isNull(domesticStandard)){
// 物理删除
lawsDomesticStandardService.delById(lawsAsmsDomestic.getId());
lawsDomesticStandardService.save(lawsDomesticStandard);
}else {
lawsDomesticStandardService.updateById(lawsDomesticStandard);
}
lawsDomesticStandardService.saveOrUpdate(lawsDomesticStandard);
// 同步es数据库
lawsHomeSearchService.updateEsData(LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD, lawsDomesticStandard.getId(), LawsHomeSearchCommon.LAWS_ES_ADD);
});