|
|
|
@ -1341,7 +1341,6 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
* 同步库位到PLM |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void syncLocationToPLM(LocationInformationVo data) { |
|
|
|
// 查出最大的 rowVersion |
|
|
|
String rowVersion = routingManagementMapper.getMaxLocationRowVersion(); |
|
|
|
@ -1384,12 +1383,12 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 找出需要更新的对象(ifsRowVersion不同) |
|
|
|
Set<String> commonKeys = new HashSet<>(mapListAll.keySet()); |
|
|
|
commonKeys.retainAll(mapList1.keySet()); |
|
|
|
List<LocationInformationEntity> toUpdate = commonKeys.stream() |
|
|
|
.filter(key -> !mapListAll.get(key).getIfsRowVersion().equals(mapList1.get(key).getIfsRowVersion())) |
|
|
|
.map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
|
.collect(Collectors.toList()); |
|
|
|
// Set<String> commonKeys = new HashSet<>(mapListAll.keySet()); |
|
|
|
// commonKeys.retainAll(mapList1.keySet()); |
|
|
|
// List<LocationInformationEntity> toUpdate = commonKeys.stream() |
|
|
|
// .filter(key -> !mapListAll.get(key).getIfsRowVersion().equals(mapList1.get(key).getIfsRowVersion())) |
|
|
|
// .map(key -> mapListAll.get(key)) // 选择listAll中的版本进行更新 |
|
|
|
// .collect(Collectors.toList()); |
|
|
|
|
|
|
|
// // 删除 |
|
|
|
// if (!toDelete.isEmpty()) { |
|
|
|
@ -1405,23 +1404,22 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
routingManagementMapper.syncSaveLocation(subList); |
|
|
|
} |
|
|
|
} |
|
|
|
// 修改 |
|
|
|
if (!toUpdate.isEmpty()) { |
|
|
|
// 分批修改 |
|
|
|
int batchSize = 100; // 假设每批100条记录 |
|
|
|
for (int i = 0; i < toUpdate.size(); i += batchSize) { |
|
|
|
int end = Math.min(i + batchSize, toUpdate.size()); |
|
|
|
List<LocationInformationEntity> subList = toUpdate.subList(i, end); |
|
|
|
routingManagementMapper.syncUpdateLocation(subList); |
|
|
|
} |
|
|
|
} |
|
|
|
// // 修改 |
|
|
|
// if (!toUpdate.isEmpty()) { |
|
|
|
// // 分批修改 |
|
|
|
// int batchSize = 100; // 假设每批100条记录 |
|
|
|
// for (int i = 0; i < toUpdate.size(); i += batchSize) { |
|
|
|
// int end = Math.min(i + batchSize, toUpdate.size()); |
|
|
|
// List<LocationInformationEntity> subList = toUpdate.subList(i, end); |
|
|
|
// routingManagementMapper.syncUpdateLocation(subList); |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 同步人员等级到PLM |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void syncLaborClassToPLM(PersonnelLevelVo data) { |
|
|
|
// 查出最大的 rowVersion |
|
|
|
String rowVersion = routingManagementMapper.getMaxLaborClassRowVersion(); |
|
|
|
@ -1501,7 +1499,6 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
* 同步加工中心到PLM |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void syncWorkCenterToPLM(WorkCenterVo data) { |
|
|
|
// 查出最大的 rowVersion |
|
|
|
String rowVersion = routingManagementMapper.getMaxWorkCenterRowVersion(); |
|
|
|
@ -1584,7 +1581,6 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
* 同步加工中心成本到PLM |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void syncWorkCenterCostToPLM(WorkCenterCostVo data) { |
|
|
|
// 查出最大的 rowVersion |
|
|
|
String rowVersion = routingManagementMapper.getMaxWorkCenterCostRowVersion(); |
|
|
|
|