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

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

parent 87bde01b
......@@ -2186,15 +2186,6 @@ public class DataHandlerServiceImpl {
List<Long> manageSeqs = manageList.stream()
.map(JgUseRegistrationManage::getSequenceNbr)
.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);
for (List<Long> part : managePartitions) {
......@@ -2203,30 +2194,37 @@ public class DataHandlerServiceImpl {
.in(JgUseRegistrationManage::getSequenceNbr, part)
.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);
esEquipmentBatch.forEach(x -> {
x.setUSE_PLACE("陕西省/西安市");
x.setUSE_PLACE_CODE("610000#610100");
x.setIS_DO_BUSINESS(Boolean.TRUE);
});
esEquipmentDao.saveAll(esEquipmentBatch);
// 批量查询 & 更新设备分类数据
Iterable<ESEquipmentCategoryDto> equipmentCategoryBatch = esEquipmentCategory.findAllById(part);
equipmentCategoryBatch.forEach(x -> {
x.setIS_DO_BUSINESS(Boolean.TRUE);
x.setUSE_PLACE("陕西省/西安市");
x.setUSE_PLACE_CODE("610000#610100");
});
esEquipmentCategory.saveAll(equipmentCategoryBatch);
}
// 批量查询 & 更新设备数据
Iterable<ESEquipmentInfo> esEquipmentBatch = esEquipmentDao.findAllById(recordList);
esEquipmentBatch.forEach(x -> {
x.setUSE_PLACE("陕西省/西安市");
x.setUSE_PLACE_CODE("610000#610100");
x.setIS_DO_BUSINESS(Boolean.TRUE);
});
esEquipmentDao.saveAll(esEquipmentBatch);
return String.format("刷新证管理表数据:%s 条;对应设备ES数据:%s 条。", manageList.size(), recordList.size());
// 批量查询 & 更新设备分类数据
Iterable<ESEquipmentCategoryDto> equipmentCategoryBatch = esEquipmentCategory.findAllById(recordList);
equipmentCategoryBatch.forEach(x -> {
x.setIS_DO_BUSINESS(Boolean.TRUE);
x.setUSE_PLACE("陕西省/西安市");
x.setUSE_PLACE_CODE("610000#610100");
});
esEquipmentCategory.saveAll(equipmentCategoryBatch);
}
return String.format("刷新证管理表数据:%s 条;对应设备ES数据:%s 条。", manageList.size(), useRegistrantionCodeList.size());
}
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