mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
cad拆单 加工组和部件关联关系分离
This commit is contained in:
+20
-41
@@ -1574,28 +1574,6 @@ public class WebCadOrderImportAsyncFactory {
|
|||||||
|
|
||||||
orderGroupMap.put(groupMapKey, orderGroupDO);
|
orderGroupMap.put(groupMapKey, orderGroupDO);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(partComponentIds)) {
|
|
||||||
for (Long partComponentId : partComponentIds) {
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
|
||||||
.builder()
|
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
|
||||||
.orderId(orderId)
|
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
|
||||||
.roomId(roomId)
|
|
||||||
.bodyId(bodyId)
|
|
||||||
.groupId(orderGroupDO.getId())
|
|
||||||
.partsId(part.getImesPartsId())
|
|
||||||
.packageId(0L)
|
|
||||||
.plateId(0L)
|
|
||||||
.num(part.getNum())
|
|
||||||
.compId(partComponentId)
|
|
||||||
.cadViewId(cadViewId)
|
|
||||||
.organId(organId)
|
|
||||||
.build();
|
|
||||||
orderItemDOS.add(orderItemDO);
|
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
.builder()
|
.builder()
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
@@ -1614,7 +1592,6 @@ public class WebCadOrderImportAsyncFactory {
|
|||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
.builder()
|
.builder()
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
@@ -1626,11 +1603,31 @@ public class WebCadOrderImportAsyncFactory {
|
|||||||
.packageId(0L)
|
.packageId(0L)
|
||||||
.plateId(0L)
|
.plateId(0L)
|
||||||
.num(partNum)
|
.num(partNum)
|
||||||
|
.groupId(0L) // 用于统计加工组下配件的总数
|
||||||
.organId(organId)
|
.organId(organId)
|
||||||
.build();
|
.build();
|
||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
} else {
|
} else {
|
||||||
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
|
.builder()
|
||||||
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
|
.orderId(orderId)
|
||||||
|
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
||||||
|
.roomId(roomId)
|
||||||
|
.bodyId(bodyId)
|
||||||
|
.partsId(part.getImesPartsId())
|
||||||
|
.packageId(0L)
|
||||||
|
.plateId(0L)
|
||||||
|
.num(part.getNum())
|
||||||
|
.cadViewId(cadViewId)
|
||||||
|
.organId(organId)
|
||||||
|
.build();
|
||||||
|
orderItemDOS.add(orderItemDO);
|
||||||
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建部件的关联关系
|
||||||
if (CollUtil.isNotEmpty(partComponentIds)) {
|
if (CollUtil.isNotEmpty(partComponentIds)) {
|
||||||
for (Long partComponentId : partComponentIds) {
|
for (Long partComponentId : partComponentIds) {
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
@@ -1651,24 +1648,6 @@ public class WebCadOrderImportAsyncFactory {
|
|||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
|
||||||
.builder()
|
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
|
||||||
.orderId(orderId)
|
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
|
||||||
.roomId(roomId)
|
|
||||||
.bodyId(bodyId)
|
|
||||||
.partsId(part.getImesPartsId())
|
|
||||||
.packageId(0L)
|
|
||||||
.plateId(0L)
|
|
||||||
.num(part.getNum())
|
|
||||||
.cadViewId(cadViewId)
|
|
||||||
.organId(organId)
|
|
||||||
.build();
|
|
||||||
orderItemDOS.add(orderItemDO);
|
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+23
-44
@@ -1761,33 +1761,11 @@ public class WebCadOrderImportFactory {
|
|||||||
orderGroupMap.put(groupMapKey, orderGroupDO);
|
orderGroupMap.put(groupMapKey, orderGroupDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(partComponentIds)) {
|
|
||||||
for (Long partComponentId : partComponentIds) {
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
.builder()
|
.builder()
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
.orderId(orderId)
|
.orderId(orderId)
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
.type(OrderItemTypeEnum.PARTS_ITEM.getStatus())
|
||||||
.roomId(roomId)
|
|
||||||
.bodyId(bodyId)
|
|
||||||
.groupId(orderGroupDO.getId())
|
|
||||||
.partsId(part.getImesPartsId())
|
|
||||||
.packageId(0L)
|
|
||||||
.plateId(0L)
|
|
||||||
.num(part.getNum())
|
|
||||||
.compId(partComponentId)
|
|
||||||
.cadViewId(cadViewId)
|
|
||||||
.organId(organId)
|
|
||||||
.build();
|
|
||||||
orderItemDOS.add(orderItemDO);
|
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
|
||||||
.builder()
|
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
|
||||||
.orderId(orderId)
|
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
|
||||||
.roomId(roomId)
|
.roomId(roomId)
|
||||||
.bodyId(bodyId)
|
.bodyId(bodyId)
|
||||||
.groupId(orderGroupDO.getId())
|
.groupId(orderGroupDO.getId())
|
||||||
@@ -1801,30 +1779,49 @@ public class WebCadOrderImportFactory {
|
|||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
.builder()
|
.builder()
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
.orderId(orderId)
|
.orderId(orderId)
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
.type(OrderItemTypeEnum.PARTS_ITEM.getStatus())
|
||||||
.roomId(roomId)
|
.roomId(roomId)
|
||||||
.bodyId(bodyId)
|
.bodyId(bodyId)
|
||||||
.partsId(part.getImesPartsId())
|
.partsId(part.getImesPartsId())
|
||||||
.packageId(0L)
|
.packageId(0L)
|
||||||
.plateId(0L)
|
.plateId(0L)
|
||||||
.num(partNum)
|
.num(partNum)
|
||||||
|
.groupId(0L) // 用于统计加工组下配件的总数
|
||||||
.organId(organId)
|
.organId(organId)
|
||||||
.build();
|
.build();
|
||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
} else {
|
} else {
|
||||||
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
|
.builder()
|
||||||
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
|
.orderId(orderId)
|
||||||
|
.type(OrderItemTypeEnum.PARTS_ITEM.getStatus())
|
||||||
|
.roomId(roomId)
|
||||||
|
.bodyId(bodyId)
|
||||||
|
.partsId(part.getImesPartsId())
|
||||||
|
.packageId(0L)
|
||||||
|
.plateId(0L)
|
||||||
|
.num(part.getNum())
|
||||||
|
.cadViewId(cadViewId)
|
||||||
|
.organId(organId)
|
||||||
|
.build();
|
||||||
|
orderItemDOS.add(orderItemDO);
|
||||||
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建部件的关联关系
|
||||||
if(CollUtil.isNotEmpty(partComponentIds)) {
|
if(CollUtil.isNotEmpty(partComponentIds)) {
|
||||||
for (Long partComponentId : partComponentIds) {
|
for (Long partComponentId : partComponentIds) {
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
.builder()
|
.builder()
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
.id((Long) snowFlakeGenerator.nextId(null))
|
||||||
.orderId(orderId)
|
.orderId(orderId)
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
.type(OrderItemTypeEnum.PARTS_ITEM.getStatus())
|
||||||
.roomId(roomId)
|
.roomId(roomId)
|
||||||
.bodyId(bodyId)
|
.bodyId(bodyId)
|
||||||
.partsId(part.getImesPartsId())
|
.partsId(part.getImesPartsId())
|
||||||
@@ -1838,24 +1835,6 @@ public class WebCadOrderImportFactory {
|
|||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
|
||||||
.builder()
|
|
||||||
.id((Long) snowFlakeGenerator.nextId(null))
|
|
||||||
.orderId(orderId)
|
|
||||||
.type(OrderItemTypeEnum.PLATE_ITEM.getStatus())
|
|
||||||
.roomId(roomId)
|
|
||||||
.bodyId(bodyId)
|
|
||||||
.partsId(part.getImesPartsId())
|
|
||||||
.packageId(0L)
|
|
||||||
.plateId(0L)
|
|
||||||
.num(part.getNum())
|
|
||||||
.cadViewId(cadViewId)
|
|
||||||
.organId(organId)
|
|
||||||
.build();
|
|
||||||
orderItemDOS.add(orderItemDO);
|
|
||||||
orderItemBatchInsertWithinThreshold(orderItemDOS, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user