Commit 0a2226b5 authored by 刘林's avatar 刘林

fix(jg):西安电梯做业务修改

parent 87bde01b
...@@ -2186,15 +2186,6 @@ public class DataHandlerServiceImpl { ...@@ -2186,15 +2186,6 @@ public class DataHandlerServiceImpl {
List<Long> manageSeqs = manageList.stream() List<Long> manageSeqs = manageList.stream()
.map(JgUseRegistrationManage::getSequenceNbr) .map(JgUseRegistrationManage::getSequenceNbr)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<String> useRegistrantionCodeList = manageList.stream()
.map(JgUseRegistrationManage::getUseRegistrationCode)
.collect(Collectors.toList());
List<String> recordList = registerInfoService.lambdaQuery()
.in(IdxBizJgRegisterInfo::getUseOrgCode, useRegistrantionCodeList)
.list()
.stream()
.map(IdxBizJgRegisterInfo::getRecord)
.collect(Collectors.toList());
List<List<Long>> managePartitions = Lists.partition(manageSeqs, BATCH_SIZE); List<List<Long>> managePartitions = Lists.partition(manageSeqs, BATCH_SIZE);
for (List<Long> part : managePartitions) { for (List<Long> part : managePartitions) {
...@@ -2203,12 +2194,20 @@ public class DataHandlerServiceImpl { ...@@ -2203,12 +2194,20 @@ public class DataHandlerServiceImpl {
.in(JgUseRegistrationManage::getSequenceNbr, part) .in(JgUseRegistrationManage::getSequenceNbr, part)
.update(); .update();
} }
List<String> useRegistrantionCodeList = manageList.stream()
.map(JgUseRegistrationManage::getUseRegistrationCode)
.collect(Collectors.toList());
List<List<String>> useRegistrationCodes = Lists.partition(useRegistrantionCodeList, BATCH_SIZE);
for (List<String> useRegistrations : useRegistrationCodes) {
List<String> recordList = registerInfoService.lambdaQuery()
.in(IdxBizJgRegisterInfo::getUseOrgCode, useRegistrations)
.list()
.stream()
.map(IdxBizJgRegisterInfo::getRecord)
.collect(Collectors.toList());
// ------------------- 更新数据 --- 设备数据 -------------------
List<List<String>> recordPartitions = Lists.partition(recordList, BATCH_SIZE);
for (List<String> part : recordPartitions) {
// 批量查询 & 更新设备数据 // 批量查询 & 更新设备数据
Iterable<ESEquipmentInfo> esEquipmentBatch = esEquipmentDao.findAllById(part); Iterable<ESEquipmentInfo> esEquipmentBatch = esEquipmentDao.findAllById(recordList);
esEquipmentBatch.forEach(x -> { esEquipmentBatch.forEach(x -> {
x.setUSE_PLACE("陕西省/西安市"); x.setUSE_PLACE("陕西省/西安市");
x.setUSE_PLACE_CODE("610000#610100"); x.setUSE_PLACE_CODE("610000#610100");
...@@ -2217,7 +2216,7 @@ public class DataHandlerServiceImpl { ...@@ -2217,7 +2216,7 @@ public class DataHandlerServiceImpl {
esEquipmentDao.saveAll(esEquipmentBatch); esEquipmentDao.saveAll(esEquipmentBatch);
// 批量查询 & 更新设备分类数据 // 批量查询 & 更新设备分类数据
Iterable<ESEquipmentCategoryDto> equipmentCategoryBatch = esEquipmentCategory.findAllById(part); Iterable<ESEquipmentCategoryDto> equipmentCategoryBatch = esEquipmentCategory.findAllById(recordList);
equipmentCategoryBatch.forEach(x -> { equipmentCategoryBatch.forEach(x -> {
x.setIS_DO_BUSINESS(Boolean.TRUE); x.setIS_DO_BUSINESS(Boolean.TRUE);
x.setUSE_PLACE("陕西省/西安市"); x.setUSE_PLACE("陕西省/西安市");
...@@ -2225,8 +2224,7 @@ public class DataHandlerServiceImpl { ...@@ -2225,8 +2224,7 @@ public class DataHandlerServiceImpl {
}); });
esEquipmentCategory.saveAll(equipmentCategoryBatch); esEquipmentCategory.saveAll(equipmentCategoryBatch);
} }
return String.format("刷新证管理表数据:%s 条;对应设备ES数据:%s 条。", manageList.size(), useRegistrantionCodeList.size());
return String.format("刷新证管理表数据:%s 条;对应设备ES数据:%s 条。", manageList.size(), recordList.size());
} }
public String refreshXianData2ES(boolean isUpdate) throws IOException { public String refreshXianData2ES(boolean isUpdate) throws IOException {
......
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