|
|
@ -1319,12 +1319,12 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
Map<String, LocationInformationEntity> mapList1 = plmLocations.stream() |
|
|
Map<String, LocationInformationEntity> mapList1 = plmLocations.stream() |
|
|
.collect(Collectors.toMap(LocationInformationEntity::getKey, Function.identity())); |
|
|
.collect(Collectors.toMap(LocationInformationEntity::getKey, Function.identity())); |
|
|
|
|
|
|
|
|
// 找出需要删除的对象(PLM有而IFS没有的) |
|
|
|
|
|
Set<String> keysToDelete = new HashSet<>(mapList1.keySet()); |
|
|
|
|
|
keysToDelete.removeAll(mapListAll.keySet()); |
|
|
|
|
|
List<LocationInformationEntity> toDelete = keysToDelete.stream() |
|
|
|
|
|
.map(mapList1::get) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// // 找出需要删除的对象(PLM有而IFS没有的) |
|
|
|
|
|
// Set<String> keysToDelete = new HashSet<>(mapList1.keySet()); |
|
|
|
|
|
// keysToDelete.removeAll(mapListAll.keySet()); |
|
|
|
|
|
// List<LocationInformationEntity> toDelete = keysToDelete.stream() |
|
|
|
|
|
// .map(mapList1::get) |
|
|
|
|
|
// .collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// 找出需要新增的对象(IFS有而PLM没有的) |
|
|
// 找出需要新增的对象(IFS有而PLM没有的) |
|
|
Set<String> keysToAdd = new HashSet<>(mapListAll.keySet()); |
|
|
Set<String> keysToAdd = new HashSet<>(mapListAll.keySet()); |
|
|
@ -1341,10 +1341,10 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// 删除 |
|
|
|
|
|
if (!toDelete.isEmpty()) { |
|
|
|
|
|
routingManagementMapper.syncDeleteLocation(toDelete); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// // 删除 |
|
|
|
|
|
// if (!toDelete.isEmpty()) { |
|
|
|
|
|
// routingManagementMapper.syncDeleteLocation(toDelete); |
|
|
|
|
|
// } |
|
|
// 新增 |
|
|
// 新增 |
|
|
if (!toAdd.isEmpty()) { |
|
|
if (!toAdd.isEmpty()) { |
|
|
// 分批插入 |
|
|
// 分批插入 |
|
|
@ -1388,12 +1388,12 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
Map<String, PersonnelLevel> mapList1 = plmLaborClasss.stream() |
|
|
Map<String, PersonnelLevel> mapList1 = plmLaborClasss.stream() |
|
|
.collect(Collectors.toMap(PersonnelLevel::getKey, Function.identity())); |
|
|
.collect(Collectors.toMap(PersonnelLevel::getKey, Function.identity())); |
|
|
|
|
|
|
|
|
// 找出需要删除的对象(PLM有而IFS没有的) |
|
|
|
|
|
Set<String> keysToDelete = new HashSet<>(mapList1.keySet()); |
|
|
|
|
|
keysToDelete.removeAll(mapListAll.keySet()); |
|
|
|
|
|
List<PersonnelLevel> toDelete = keysToDelete.stream() |
|
|
|
|
|
.map(mapList1::get) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// // 找出需要删除的对象(PLM有而IFS没有的) |
|
|
|
|
|
// Set<String> keysToDelete = new HashSet<>(mapList1.keySet()); |
|
|
|
|
|
// keysToDelete.removeAll(mapListAll.keySet()); |
|
|
|
|
|
// List<PersonnelLevel> toDelete = keysToDelete.stream() |
|
|
|
|
|
// .map(mapList1::get) |
|
|
|
|
|
// .collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// 找出需要新增的对象(IFS有而PLM没有的) |
|
|
// 找出需要新增的对象(IFS有而PLM没有的) |
|
|
Set<String> keysToAdd = new HashSet<>(mapListAll.keySet()); |
|
|
Set<String> keysToAdd = new HashSet<>(mapListAll.keySet()); |
|
|
@ -1410,10 +1410,10 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// 删除 |
|
|
|
|
|
if (!toDelete.isEmpty()) { |
|
|
|
|
|
routingManagementMapper.syncDeleteLaborClass(toDelete); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// // 删除 |
|
|
|
|
|
// if (!toDelete.isEmpty()) { |
|
|
|
|
|
// routingManagementMapper.syncDeleteLaborClass(toDelete); |
|
|
|
|
|
// } |
|
|
// 新增 |
|
|
// 新增 |
|
|
if (!toAdd.isEmpty()) { |
|
|
if (!toAdd.isEmpty()) { |
|
|
// 分批插入 |
|
|
// 分批插入 |
|
|
@ -1457,12 +1457,12 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
Map<String, WorkCenter> mapList1 = plmWorkCenters.stream() |
|
|
Map<String, WorkCenter> mapList1 = plmWorkCenters.stream() |
|
|
.collect(Collectors.toMap(WorkCenter::getKey, Function.identity())); |
|
|
.collect(Collectors.toMap(WorkCenter::getKey, Function.identity())); |
|
|
|
|
|
|
|
|
// 找出需要删除的对象(PLM有而IFS没有的) |
|
|
|
|
|
Set<String> keysToDelete = new HashSet<>(mapList1.keySet()); |
|
|
|
|
|
keysToDelete.removeAll(mapListAll.keySet()); |
|
|
|
|
|
List<WorkCenter> toDelete = keysToDelete.stream() |
|
|
|
|
|
.map(mapList1::get) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// // 找出需要删除的对象(PLM有而IFS没有的) |
|
|
|
|
|
// Set<String> keysToDelete = new HashSet<>(mapList1.keySet()); |
|
|
|
|
|
// keysToDelete.removeAll(mapListAll.keySet()); |
|
|
|
|
|
// List<WorkCenter> toDelete = keysToDelete.stream() |
|
|
|
|
|
// .map(mapList1::get) |
|
|
|
|
|
// .collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// 找出需要新增的对象(IFS有而PLM没有的) |
|
|
// 找出需要新增的对象(IFS有而PLM没有的) |
|
|
Set<String> keysToAdd = new HashSet<>(mapListAll.keySet()); |
|
|
Set<String> keysToAdd = new HashSet<>(mapListAll.keySet()); |
|
|
@ -1479,14 +1479,14 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
// 删除 |
|
|
|
|
|
if (!toDelete.isEmpty()) { |
|
|
|
|
|
routingManagementMapper.syncDeleteWorkCenter(toDelete); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// // 删除 |
|
|
|
|
|
// if (!toDelete.isEmpty()) { |
|
|
|
|
|
// routingManagementMapper.syncDeleteWorkCenter(toDelete); |
|
|
|
|
|
// } |
|
|
// 新增 |
|
|
// 新增 |
|
|
if (!toAdd.isEmpty()) { |
|
|
if (!toAdd.isEmpty()) { |
|
|
// 分批插入 |
|
|
// 分批插入 |
|
|
int batchSize = 200; // 假设每批200条记录 |
|
|
|
|
|
|
|
|
int batchSize = 100; // 假设每批100条记录 |
|
|
for (int i = 0; i < toAdd.size(); i += batchSize) { |
|
|
for (int i = 0; i < toAdd.size(); i += batchSize) { |
|
|
int end = Math.min(i + batchSize, toAdd.size()); |
|
|
int end = Math.min(i + batchSize, toAdd.size()); |
|
|
List<WorkCenter> subList = toAdd.subList(i, end); |
|
|
List<WorkCenter> subList = toAdd.subList(i, end); |
|
|
|