Browse Source

2024-08-16 ifs接口更新2

master
fengyuan_yang 1 year ago
parent
commit
8061baad9d
  1. 2
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  2. 62
      src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java
  3. 1
      src/main/resources/mapper/part/MasterPartInformationMapper.xml
  4. 8
      src/main/resources/mapper/part/RoutingManagementMapper.xml

2
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -1982,7 +1982,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
bomIfsManufStructCostDistrib.setAlternativeNo(bomManufStructCostDistribVo.getAlternativeNo());
bomIfsManufStructCostDistrib.setByProdLineItemNo(bomManufStructCostDistribVo.getByProdLineItemNo().toString());
bomIfsManufStructCostDistrib.setComponentLineItemNo(bomManufStructCostDistribVo.getComponentLineItemNo().toString());
bomIfsManufStructCostDistrib.setItemCostDistribution(bomManufStructCostDistribVo.getItemCostDistribution().toString());
bomIfsManufStructCostDistrib.setItemCostDistribution(bomManufStructCostDistribVo.getItemCostDistribution() == null ? "" : bomManufStructCostDistribVo.getItemCostDistribution().toString());
bomIfsManufStructCostDistrib.setComponentPartNo(bomManufStructCostDistribVo.getComponentPartNo());
bomIfsManufStructCostDistrib.setByProductPartNo(bomManufStructCostDistribVo.getByProdPartNo());
bomIfsManufStructCostDistribs.add(bomIfsManufStructCostDistrib);

62
src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java

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

1
src/main/resources/mapper/part/MasterPartInformationMapper.xml

@ -57,6 +57,7 @@
sub_lot_rule = #{subLotRule},
component_lot_rule = #{componentLotRule},
code_no = #{codeNo},
um_id = #{umId},
update_date = getDate(),
update_by = #{updateBy}
WHERE part_no = #{partNo}

8
src/main/resources/mapper/part/RoutingManagementMapper.xml

@ -1227,7 +1227,7 @@
um_id, active, remark, pro_line_no, can_create_new_roll_flag, need_setup_flag, ifs_row_version)
VALUES
<foreach item="item" collection="list" separator=",">
(#{item.site}, #{item.workCenterNo}, #{item.workCenterDesc}, #{item.workCenterTypeDB}, #{item.workCenterType}, #{item.averageCapacity}, #{item.efficiency}, #{item.utilization}, #{item.capacityTypeDB}, #{item.capacityType},
(#{item.site}, #{item.workCenterNo}, #{item.workCenterDesc}, #{item.workCenterTypeDB}, #{item.workCenterType}, #{item.averageCapacity,jdbcType=DECIMAL}, #{item.efficiency,jdbcType=DECIMAL}, #{item.utilization,jdbcType=DECIMAL}, #{item.capacityTypeDB}, #{item.capacityType},
#{item.umId}, #{item.active}, #{item.remark}, #{item.proLineNo}, #{item.canCreateNewRollFlag}, #{item.needSetupFlag}, #{item.ifsRowVersion})
</foreach>
</insert>
@ -1239,9 +1239,9 @@
work_center_desc = #{item.workCenterDesc},
work_center_type_db = #{item.workCenterTypeDB},
work_center_type = #{item.workCenterType},
average_capacity = #{item.averageCapacity},
efficiency = #{item.efficiency},
utilization = #{item.utilization},
average_capacity = #{item.averageCapacity,jdbcType=DECIMAL},
efficiency = #{item.efficiency,jdbcType=DECIMAL},
utilization = #{item.utilization,jdbcType=DECIMAL},
capacity_type_db = #{item.capacityTypeDB},
capacity_type = #{item.capacityType},
um_id = #{item.umId},

Loading…
Cancel
Save