Commit f85805b1 authored by suhuiguang's avatar suhuiguang

fix(jg) :es操作

1.删除冗余刷新
parent af252cde
package com.yeejoin.amos.boot.module.common.biz.service.impl; 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.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
...@@ -11,7 +9,6 @@ import org.elasticsearch.client.RestHighLevelClient; ...@@ -11,7 +9,6 @@ import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.IOException; import java.io.IOException;
...@@ -26,19 +23,8 @@ import static com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant ...@@ -26,19 +23,8 @@ import static com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
@Slf4j @Slf4j
public class EquipmentCategoryService { public class EquipmentCategoryService {
private final ESEquipmentCategory equipmentCategoryDao;
private final ElasticsearchOperations elasticsearchOperations;
private final RestHighLevelClient restHighLevelClient; 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) { public List<String> findSequenceNbrByIds(List<String> ids) {
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder() SearchSourceBuilder sourceBuilder = new SearchSourceBuilder()
.query(QueryBuilders.termsQuery("SEQUENCE_NBR.keyword", ids)) .query(QueryBuilders.termsQuery("SEQUENCE_NBR.keyword", ids))
......
...@@ -278,8 +278,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -278,8 +278,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired @Autowired
ESEquipmentCategory esEquipmentCategory; ESEquipmentCategory esEquipmentCategory;
@Autowired @Autowired
EquipmentCategoryService equipmentCategoryService;
@Autowired
ICommonService commonService; ICommonService commonService;
@Autowired @Autowired
CommonMapper commonMapper; CommonMapper commonMapper;
...@@ -310,8 +308,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -310,8 +308,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired @Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService; private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired @Autowired
private IIdxBizJgOtherInfoService idxBizJgOtherInfoService;
@Autowired
private CodeUtil codeUtil; private CodeUtil codeUtil;
@Autowired @Autowired
private TzsServiceFeignClient tzsServiceFeignClient; private TzsServiceFeignClient tzsServiceFeignClient;
...@@ -336,8 +332,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -336,8 +332,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired @Autowired
private JgRegistrationHistoryServiceImpl jgRegistrationHistoryService; private JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
@Autowired @Autowired
private SafetyProblemTracingMapper safetyProblemTracingMapper;
@Autowired
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@Autowired @Autowired
private TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper; private TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper;
...@@ -4171,7 +4165,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4171,7 +4165,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
dto.setNEXT_INSPECT_DATE(DateUtil.parse(DateUtil.format(nextInspectDate, DatePattern.NORM_DATE_PATTERN)).getTime()); dto.setNEXT_INSPECT_DATE(DateUtil.parse(DateUtil.format(nextInspectDate, DatePattern.NORM_DATE_PATTERN)).getTime());
} }
this.setWhetherSphericalTank(dto); 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