Commit e8b66cc2 authored by tianbo's avatar tianbo

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

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