mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增webcad生产单导入:cad拆单数据补充异形、造型、排孔的数据判断赋值
This commit is contained in:
+44
-16
@@ -436,12 +436,26 @@ public class WebCadOrderImportFactory {
|
|||||||
// 基于房间名分组
|
// 基于房间名分组
|
||||||
Map<String, List<WebCadDataBlockReqVO>> roomCollect = blockList.stream()
|
Map<String, List<WebCadDataBlockReqVO>> roomCollect = blockList.stream()
|
||||||
.collect(Collectors.groupingBy(WebCadDataBlockReqVO::getRoomName, Collectors.toList()));
|
.collect(Collectors.groupingBy(WebCadDataBlockReqVO::getRoomName, Collectors.toList()));
|
||||||
roomCollect.forEach((roomName, listRoom) -> {
|
for (Map.Entry<String, List<WebCadDataBlockReqVO>> roomEntry : roomCollect.entrySet()) {
|
||||||
|
String roomName = roomEntry.getKey();
|
||||||
|
List<WebCadDataBlockReqVO> listRoom = roomEntry.getValue();
|
||||||
|
|
||||||
Long roomId = (Long) snowFlakeGenerator.nextId(null);
|
Long roomId = (Long) snowFlakeGenerator.nextId(null);
|
||||||
|
// 检查当前单子中是否已有房间,是则使用相同房间id
|
||||||
|
List<OrderBodyDO> existRoomNameBodys = orderBodyMapper.selectList(new LambdaUpdateWrapper<OrderBodyDO>()
|
||||||
|
.eq(OrderBodyDO::getOrderId, orderId)
|
||||||
|
.eq(OrderBodyDO::getRoomName, roomName)
|
||||||
|
.eq(OrderBodyDO::getOrganId, organId));
|
||||||
|
if (CollUtil.isNotEmpty(existRoomNameBodys)) {
|
||||||
|
roomId = existRoomNameBodys.get(0).getRoomId();
|
||||||
|
}
|
||||||
// 基于柜体名分组
|
// 基于柜体名分组
|
||||||
Map<String, List<WebCadDataBlockReqVO>> bodyCollect = listRoom.stream()
|
Map<String, List<WebCadDataBlockReqVO>> bodyCollect = listRoom.stream()
|
||||||
.collect(Collectors.groupingBy(WebCadDataBlockReqVO::getCabinetName, Collectors.toList()));
|
.collect(Collectors.groupingBy(WebCadDataBlockReqVO::getCabinetName, Collectors.toList()));
|
||||||
bodyCollect.forEach((bodyName, listBody) -> {
|
for (Map.Entry<String, List<WebCadDataBlockReqVO>> bodyEntry : bodyCollect.entrySet()) {
|
||||||
|
String bodyName = bodyEntry.getKey();
|
||||||
|
List<WebCadDataBlockReqVO> listBody = bodyEntry.getValue();
|
||||||
|
|
||||||
String roomBodyKey = roomName + bodyName;
|
String roomBodyKey = roomName + bodyName;
|
||||||
WebCadDataDoubleRoomTreeReqVO.ChildrenDTO cadBody = roomBodyMap.get(roomBodyKey);
|
WebCadDataDoubleRoomTreeReqVO.ChildrenDTO cadBody = roomBodyMap.get(roomBodyKey);
|
||||||
|
|
||||||
@@ -470,8 +484,8 @@ public class WebCadOrderImportFactory {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
}
|
||||||
// 所有自定义板编号生成完成后更新配置到生产单
|
// 所有自定义板编号生成完成后更新配置到生产单
|
||||||
customPlateNoGenerateService.updateCustomPlateNoGenerateConfig(plateNoGenerateConfigVO, orderDO);
|
customPlateNoGenerateService.updateCustomPlateNoGenerateConfig(plateNoGenerateConfigVO, orderDO);
|
||||||
// 批量插入板件
|
// 批量插入板件
|
||||||
@@ -517,9 +531,16 @@ public class WebCadOrderImportFactory {
|
|||||||
* @param block
|
* @param block
|
||||||
*/
|
*/
|
||||||
private void createPlate(OrderBodyDO orderBodyDO, WebCadDataBlockReqVO block) {
|
private void createPlate(OrderBodyDO orderBodyDO, WebCadDataBlockReqVO block) {
|
||||||
|
WebCadDataBlockReqVO.InfoDTO blockInfo = block.getInfo();
|
||||||
|
// 是否矩形,不是矩形那就是异形
|
||||||
|
Boolean unRegular = !blockInfo.getIsRect();
|
||||||
|
// 是否造型
|
||||||
|
boolean isModel = (block.getFrontModelCount() + block.getBackModelCount()) > 0;
|
||||||
|
// 是否排孔
|
||||||
|
boolean isRawHole = (block.getFrontHoleCount() + block.getBackHoleCount()) > 0;
|
||||||
|
|
||||||
orderBodyDO.setPlateNum(orderBodyDO.getPlateNum() + 1);
|
orderBodyDO.setPlateNum(orderBodyDO.getPlateNum() + 1);
|
||||||
orderBodyDO.setUnregularNum(orderBodyDO.getUnregularNum() + BooleanUtil.toInt(block.getIsSpecialShape()));
|
orderBodyDO.setUnregularNum(orderBodyDO.getUnregularNum() + BooleanUtil.toInt(unRegular));
|
||||||
Boolean isSpecialShape = block.getIsSpecialShape();
|
|
||||||
|
|
||||||
// 柜体长宽深
|
// 柜体长宽深
|
||||||
orderBodyDO.setWidth(block.getCabinetWidth());
|
orderBodyDO.setWidth(block.getCabinetWidth());
|
||||||
@@ -530,8 +551,6 @@ public class WebCadOrderImportFactory {
|
|||||||
long plateNo = idWorker.nextId();
|
long plateNo = idWorker.nextId();
|
||||||
long obtainingTime = idWorker.obtainingTime();
|
long obtainingTime = idWorker.obtainingTime();
|
||||||
|
|
||||||
WebCadDataBlockReqVO.InfoDTO blockInfo = block.getInfo();
|
|
||||||
|
|
||||||
|
|
||||||
String splitHeight = blockInfo.getSpliteHeight();
|
String splitHeight = blockInfo.getSpliteHeight();
|
||||||
String spliteWidth = blockInfo.getSpliteWidth();
|
String spliteWidth = blockInfo.getSpliteWidth();
|
||||||
@@ -554,8 +573,9 @@ public class WebCadOrderImportFactory {
|
|||||||
.holeFace(block.getHoleFace())
|
.holeFace(block.getHoleFace())
|
||||||
.isDoor(block.getIsDoor())
|
.isDoor(block.getIsDoor())
|
||||||
.openDoorType(block.getOpenDoorType())
|
.openDoorType(block.getOpenDoorType())
|
||||||
.isSculpt(false)
|
.isSpecialShaped(unRegular)
|
||||||
.isSpecialShaped(isSpecialShape)
|
.isSculpt(isModel)
|
||||||
|
.isRowHole(isRawHole)
|
||||||
.customPlateNoBuilder(new StringBuilder())
|
.customPlateNoBuilder(new StringBuilder())
|
||||||
.holeArrange(block.getHoleArrange())
|
.holeArrange(block.getHoleArrange())
|
||||||
.unregularPointCount(block.getUnregularPointCount())
|
.unregularPointCount(block.getUnregularPointCount())
|
||||||
@@ -568,7 +588,6 @@ public class WebCadOrderImportFactory {
|
|||||||
.offsetY(BigDecimal.valueOf(block.getOffsetY()))
|
.offsetY(BigDecimal.valueOf(block.getOffsetY()))
|
||||||
.isArcAcross(block.getIsArcBase())
|
.isArcAcross(block.getIsArcBase())
|
||||||
.moduleTypeId(0L)
|
.moduleTypeId(0L)
|
||||||
.isRowHole(false)
|
|
||||||
.isOptimized(false)
|
.isOptimized(false)
|
||||||
.isCutted(0)
|
.isCutted(0)
|
||||||
.isCancel(false)
|
.isCancel(false)
|
||||||
@@ -616,7 +635,7 @@ public class WebCadOrderImportFactory {
|
|||||||
orderModelsBatchInsertWithinThreshold(false);
|
orderModelsBatchInsertWithinThreshold(false);
|
||||||
|
|
||||||
// 遍历加工组信息,生成对应的加工组和item
|
// 遍历加工组信息,生成对应的加工组和item
|
||||||
analyzeBlockProcessGroup(orderBodyDO, block, plateId);
|
analyzeBlockProcessGroup(orderBodyDO, block, blockInfo, plateId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -664,10 +683,11 @@ public class WebCadOrderImportFactory {
|
|||||||
* @param block
|
* @param block
|
||||||
* @param plateId
|
* @param plateId
|
||||||
*/
|
*/
|
||||||
private void analyzeBlockProcessGroup(OrderBodyDO orderBodyDO, WebCadDataBlockReqVO block, Long plateId) {
|
private void analyzeBlockProcessGroup(OrderBodyDO orderBodyDO, WebCadDataBlockReqVO block, WebCadDataBlockReqVO.InfoDTO infoDTO, Long plateId) {
|
||||||
Long bodyId = orderBodyDO.getId();
|
Long bodyId = orderBodyDO.getId();
|
||||||
Long roomId = orderBodyDO.getRoomId();
|
Long roomId = orderBodyDO.getRoomId();
|
||||||
Boolean isSpecialShape = block.getIsSpecialShape();
|
// 是否矩形,不是矩形那就是异形
|
||||||
|
Boolean unRegular = !infoDTO.getIsRect();
|
||||||
|
|
||||||
List<WebCadDataBlockReqVO.GroupInfo> groupInfos = block.getGroupInfos();
|
List<WebCadDataBlockReqVO.GroupInfo> groupInfos = block.getGroupInfos();
|
||||||
if (CollUtil.isNotEmpty(groupInfos)) {
|
if (CollUtil.isNotEmpty(groupInfos)) {
|
||||||
@@ -691,7 +711,7 @@ public class WebCadOrderImportFactory {
|
|||||||
.depth(groupInfo.getDepth())
|
.depth(groupInfo.getDepth())
|
||||||
.multiNum(0)
|
.multiNum(0)
|
||||||
.plateNum(1)
|
.plateNum(1)
|
||||||
.unregularNum(BooleanUtil.toInt(isSpecialShape))
|
.unregularNum(BooleanUtil.toInt(unRegular))
|
||||||
.filename("无")
|
.filename("无")
|
||||||
.remark("无")
|
.remark("无")
|
||||||
.deleted(false)
|
.deleted(false)
|
||||||
@@ -705,7 +725,7 @@ public class WebCadOrderImportFactory {
|
|||||||
orderGroupDOS.add(orderGroupDO);
|
orderGroupDOS.add(orderGroupDO);
|
||||||
} else {
|
} else {
|
||||||
orderGroupDO.setPlateNum(orderGroupDO.getPlateNum() + 1);
|
orderGroupDO.setPlateNum(orderGroupDO.getPlateNum() + 1);
|
||||||
orderGroupDO.setUnregularNum(orderGroupDO.getUnregularNum() + BooleanUtil.toInt(isSpecialShape));
|
orderGroupDO.setUnregularNum(orderGroupDO.getUnregularNum() + BooleanUtil.toInt(unRegular));
|
||||||
}
|
}
|
||||||
|
|
||||||
OrderItemDO orderItemDO = OrderItemDO
|
OrderItemDO orderItemDO = OrderItemDO
|
||||||
@@ -770,6 +790,14 @@ public class WebCadOrderImportFactory {
|
|||||||
.collect(Collectors.groupingBy(WebCadDataPartsReqVO.BlockObjectListDTO::getRoomName, Collectors.toList()));
|
.collect(Collectors.groupingBy(WebCadDataPartsReqVO.BlockObjectListDTO::getRoomName, Collectors.toList()));
|
||||||
roomCollect.forEach((roomName, listRoom) -> {
|
roomCollect.forEach((roomName, listRoom) -> {
|
||||||
Long roomId = (Long) snowFlakeGenerator.nextId(null);
|
Long roomId = (Long) snowFlakeGenerator.nextId(null);
|
||||||
|
// 检查当前单子中是否已有房间,是则使用相同房间id
|
||||||
|
List<OrderBodyDO> existRoomNameBodys = orderBodyMapper.selectList(new LambdaUpdateWrapper<OrderBodyDO>()
|
||||||
|
.eq(OrderBodyDO::getOrderId, orderId)
|
||||||
|
.eq(OrderBodyDO::getRoomName, roomName)
|
||||||
|
.eq(OrderBodyDO::getOrganId, organId));
|
||||||
|
if (CollUtil.isNotEmpty(existRoomNameBodys)) {
|
||||||
|
roomId = existRoomNameBodys.get(0).getRoomId();
|
||||||
|
}
|
||||||
|
|
||||||
// 基于柜体名分组
|
// 基于柜体名分组
|
||||||
Map<String, List<WebCadDataPartsReqVO.BlockObjectListDTO>> bodyCollect = listRoom.stream()
|
Map<String, List<WebCadDataPartsReqVO.BlockObjectListDTO>> bodyCollect = listRoom.stream()
|
||||||
|
|||||||
Reference in New Issue
Block a user