Commit e8b66cc2 authored by tianbo's avatar tianbo

修改一码通es初始化接口-添加字段

parent 4441e203
......@@ -63,11 +63,7 @@ public class SuperviseInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"IMPORTANT_PLACES\"")
private String importantPlaces;
/**
* 是否同步到es中
*/
@TableField(value ="\"IS_NOT_ES\"")
private Integer isNotEs;
......
......@@ -178,5 +178,9 @@ public class UseInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"COUNTY_NAME\"")
private String countyName;
/**
* 是否同步到es中
*/
@TableField(value ="\"IS_NOT_ES\"")
private Integer isNotEs;
}
......@@ -16,8 +16,8 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategoryData;
import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum;
......@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryDataMapper;
import com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.tzs.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.boot.module.tzs.api.mapper.SupervisoryCodeInfoMapper;
import com.yeejoin.amos.boot.module.tzs.api.mapper.UseInfoMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.tzs.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.tzs.biz.utils.JsonUtils;
......@@ -94,6 +95,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private SuperviseInfoMapper superviseInfoMapper;
@Autowired
private UseInfoMapper useInfoMapper;
@Autowired
private SuperviseInfoService superviseInfoService;
@Autowired
......@@ -796,9 +800,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override
public void checkEsData(String id) {
Map<String, Object> map = categoryOtherInfoMapper.selectDataById(id);
SuperviseInfo superviseInfo = new SuperviseInfo();
superviseInfo.setIsNotEs(1);
superviseInfoMapper.update(superviseInfo, new QueryWrapper<SuperviseInfo>().eq("RECORD", id));
UseInfo useInfo = new UseInfo();
useInfo.setIsNotEs(1);
useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD", id));
ESEquipmentCategoryDto dto = JSON.parseObject(JSONObject.toJSONString(map), ESEquipmentCategoryDto.class);
Optional<ESEquipmentCategoryDto> data = esEquipmentCategory.findById(id);
if (!ObjectUtils.isEmpty(data)) {
......@@ -810,6 +814,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
public List<EquipmentCategoryData> createEquipmentCategoryData() {
equipmentCategoryDataService.remove(new QueryWrapper<>());
return getCategoryData(null);
......@@ -987,9 +993,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
ESEquipmentCategoryDto save = esEquipmentCategory.save(dto);
if (!ObjectUtils.isEmpty(save)) {
//同步到es后修改
SuperviseInfo superviseInfo = new SuperviseInfo();
superviseInfo.setIsNotEs(1);
superviseInfoMapper.update(superviseInfo, new QueryWrapper<SuperviseInfo>().eq("RECORD", map.get("SEQUENCE_NBR").toString()));
UseInfo useInfo = new UseInfo();
useInfo.setIsNotEs(1);
useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD",
map.get("SEQUENCE_NBR").toString()));
}
return save;
}
......
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