Commit f85805b1 authored by suhuiguang's avatar suhuiguang

fix(jg) :es操作

1.删除冗余刷新
parent af252cde
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.search.SearchRequest;
......@@ -11,7 +9,6 @@ import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.stereotype.Service;
import java.io.IOException;
......@@ -26,19 +23,8 @@ import static com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
@Slf4j
public class EquipmentCategoryService {
private final ESEquipmentCategory equipmentCategoryDao;
private final ElasticsearchOperations elasticsearchOperations;
private final RestHighLevelClient restHighLevelClient;
public ESEquipmentCategoryDto saveWithImmediateRefresh(ESEquipmentCategoryDto dto) {
ESEquipmentCategoryDto saved = equipmentCategoryDao.save(dto);
// 手动触发索引刷新
elasticsearchOperations.indexOps(ESEquipmentCategoryDto.class).refresh();
return saved;
}
public List<String> findSequenceNbrByIds(List<String> ids) {
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder()
.query(QueryBuilders.termsQuery("SEQUENCE_NBR.keyword", ids))
......
......@@ -278,8 +278,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
ESEquipmentCategory esEquipmentCategory;
@Autowired
EquipmentCategoryService equipmentCategoryService;
@Autowired
ICommonService commonService;
@Autowired
CommonMapper commonMapper;
......@@ -310,8 +308,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired
private IIdxBizJgOtherInfoService idxBizJgOtherInfoService;
@Autowired
private CodeUtil codeUtil;
@Autowired
private TzsServiceFeignClient tzsServiceFeignClient;
......@@ -336,8 +332,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
private JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
@Autowired
private SafetyProblemTracingMapper safetyProblemTracingMapper;
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Autowired
private TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper;
......@@ -4171,7 +4165,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
dto.setNEXT_INSPECT_DATE(DateUtil.parse(DateUtil.format(nextInspectDate, DatePattern.NORM_DATE_PATTERN)).getTime());
}
this.setWhetherSphericalTank(dto);
equipmentCategoryService.saveWithImmediateRefresh(dto);
esEquipmentCategory.save(dto);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment