1、优化生产数据增加房间柜体加工组信息;2、排单小板分页查询优化;

This commit is contained in:
gaoqr
2026-06-03 16:52:08 +08:00
parent d2168fd743
commit 16b1e8e326
9 changed files with 90 additions and 46 deletions
@@ -184,6 +184,8 @@ public class PlateDetailRespVO {
@Schema(description = "板类型,0 层板 1 立板 2 背板", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer type;
@Schema(description = "加工组ID")
private Long groupId;
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String processGroupName;
@@ -243,6 +243,11 @@ public class PlateDetailDO {
*/
private Integer type;
/**
* 加工组id
*/
private Long groupId;
/**
* 加工组名称
*/
@@ -444,5 +444,5 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
* @param planIds
* @return
*/
IPage<OrdersViewPlatesPageDO> selectPlanPlateInfoPage(@Param("page") IPage<OrdersViewPlatesPageDO> page, @Param("planIds") List<Long> planIds);
IPage<OrdersViewPlatesPageDO> selectPlanPlateInfoPage(@Param("page") IPage<OrdersViewPlatesPageDO> page, @Param("planIds") List<Long> planIds, @Param("orderIds") Set<Long> orderIds);
}
@@ -325,30 +325,30 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
AssertUtils.notEmpty(models, ORDER_PLATE_MODEL_DATE_ERROR);
// 查询订单对应的配件信息
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId());
// List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId());
// 查询订单对应的包裹信息
List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectOrderPackList(orderId,getUserOrganId());
if(CollUtil.isNotEmpty(printOrderPackReqVOS)) {
// 统计每个订单的包装数量
printOrderPackReqVOS
.stream()
.filter(f -> f
.getOrderId().equals(orderId))
.forEach(f -> f.setPackNum(printOrderPackReqVOS.stream().filter(e -> e.getOrderId().equals(orderId)).map(PrintOrderPackReqVO::getPackId).toList().size()));
}
// // 查询订单对应的包裹信息
// List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectOrderPackList(orderId,getUserOrganId());
//
//
// if(CollUtil.isNotEmpty(printOrderPackReqVOS)) {
// // 统计每个订单的包装数量
// printOrderPackReqVOS
// .stream()
// .filter(f -> f
// .getOrderId().equals(orderId))
// .forEach(f -> f.setPackNum(printOrderPackReqVOS.stream().filter(e -> e.getOrderId().equals(orderId)).map(PrintOrderPackReqVO::getPackId).toList().size()));
// }
return OrderSource.builder()
.orderList(Collections.singletonList(orderDO))
.goodsList(goodsDOS)
.plateList(BeanUtil.copyToList(plateDOS, PlateDetailRespVO.class))
.plateModels(models)
.orderPartsRespVOS(printOrderPartsRespVOS)
// .orderPartsRespVOS(printOrderPartsRespVOS)
.orderPartsRemarks(null)
.orderPackReqVOS(printOrderPackReqVOS)
// .orderPackReqVOS(printOrderPackReqVOS)
.build();
}
@@ -378,14 +378,12 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLAN_PLATE_ERROR);
List<PlateDetailDO> resultPlateList = mergeGroupAndComponentName(plateDetailRespVOS);
List<OrderDO> orderDOS = orderMapper.selectBatchIds(orderIds);
AssertUtils.notEmpty(orderDOS, ORDER_PLAN_ORDERS_EMPTY);
List<OrderModelDO> models =
resultPlateList.stream()
plateDetailRespVOS.stream()
.map(PlateDetailDO::getModelData)
.filter(StringUtils::isNotBlank)
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
@@ -394,10 +392,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
AssertUtils.notEmpty(models, ORDER_PLAN_PLATE_MODEL_DATE_ERROR);
List<RemainPlateDO> remainPlateDOS = remainPlateMapper.selectByPlanId(planId,getUserOrganId());
// List<RemainPlateDO> remainPlateDOS = remainPlateMapper.selectByPlanId(planId,getUserOrganId());
List<OptimizeRemainPlate> optimizeRemainPlates = BeanUtils.toBean(remainPlateDOS, OptimizeRemainPlate.class);
// List<OptimizeRemainPlate> optimizeRemainPlates = BeanUtils.toBean(remainPlateDOS, OptimizeRemainPlate.class);
// 查询混单实际请求大板信息
PlanActualGoodsModelDO planActualGoodsModelDO = null;
@@ -410,36 +408,36 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
}
// 查询订单对应的配件信息
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(orderIds, getUserOrganId());
// List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(orderIds, getUserOrganId());
// 查询订单对应的包裹信息
List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectPlanPackList(ids,getUserOrganId());
if(CollUtil.isNotEmpty(printOrderPackReqVOS)) {
for (Long orderId : orderIds) {
// 统计每个订单的包装数量
printOrderPackReqVOS
.stream()
.filter(f -> f.getOrderId().equals(orderId))
.forEach(f -> f.setPackNum(printOrderPackReqVOS.stream()
.filter(e -> e.getOrderId().equals(orderId))
.map(PrintOrderPackReqVO::getPackId).toList()
.size()));
}
}
// // 查询订单对应的包裹信息
// List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectPlanPackList(ids,getUserOrganId());
//
//
// if(CollUtil.isNotEmpty(printOrderPackReqVOS)) {
// for (Long orderId : orderIds) {
// // 统计每个订单的包装数量
// printOrderPackReqVOS
// .stream()
// .filter(f -> f.getOrderId().equals(orderId))
// .forEach(f -> f.setPackNum(printOrderPackReqVOS.stream()
// .filter(e -> e.getOrderId().equals(orderId))
// .map(PrintOrderPackReqVO::getPackId).toList()
// .size()));
// }
// }
return OrderSource.builder()
.orderList(orderDOS)
.plan(planDO)
.goodsList(goodsDOS)
.plateList(BeanUtil.copyToList(resultPlateList, PlateDetailRespVO.class))
.plateList(BeanUtil.copyToList(plateDetailRespVOS, PlateDetailRespVO.class))
.plateModels(models)
.planActualGoodsModelDO(planActualGoodsModelDO)
.optimizeRemainPlates(optimizeRemainPlates)
.orderPartsRespVOS(printOrderPartsRespVOS)
// .optimizeRemainPlates(optimizeRemainPlates)
// .orderPartsRespVOS(printOrderPartsRespVOS)
.orderPartsRemarks(null)
.orderPackReqVOS(printOrderPackReqVOS)
// .orderPackReqVOS(printOrderPackReqVOS)
.build();
}
@@ -249,6 +249,11 @@ public class OrderComponentServiceImpl implements OrderComponentService {
// 查询板件+板材信息
List<OrdersViewPlatesPageDO> ordersViewPlatesPageDOS = plateMapper.selectPlateGoodsByIds(orderIds, plateIdPageRecords, deleted);
if (CollUtil.isEmpty(plateIdPageRecords)) {
return new PageResult<>();
}
// 查询关联关系
List<OrderItemDO> orderItemRelation;
// 查询关联关系
if (!deleted) {
@@ -434,6 +439,9 @@ public class OrderComponentServiceImpl implements OrderComponentService {
List<Long> partsIds = partsPageRecords.stream().map(OrdersViewPartsPageDO::getId).toList();
if (CollUtil.isEmpty(partsIds)) {
return new PageResult<>();
}
// 查询关联关系
List<OrderItemDO> orderItemRelation;
if (!deleted) {
@@ -710,7 +710,7 @@ public class PlanServiceImpl implements PlanService {
// 分页查询排单板件
PageDTO<OrdersViewPlatesPageDO> page = new PageDTO<>(vo.getPageNo(), vo.getPageSize());
IPage<OrdersViewPlatesPageDO> ordersViewPlatesPageDOIPage = plateMapper.selectPlanPlateInfoPage(page, planIds);
IPage<OrdersViewPlatesPageDO> ordersViewPlatesPageDOIPage = plateMapper.selectPlanPlateInfoPage(page, planIds, orderIdSet);
long total = ordersViewPlatesPageDOIPage.getTotal();
if (total == 0) {
@@ -720,6 +720,9 @@ public class PlanServiceImpl implements PlanService {
List<OrdersViewPlatesPageDO> ordersViewPlatesPageDOIPageRecords = ordersViewPlatesPageDOIPage.getRecords();
List<Long> plateIds = ordersViewPlatesPageDOIPageRecords.stream().map(OrdersViewPlatesPageDO::getId).toList();
if (CollUtil.isEmpty(plateIds)) {
return new PageResult<>();
}
// 查询关联关系
List<OrderItemDO> orderItemRelation = orderItemMapper.selectList(new LambdaQueryWrapperX<OrderItemDO>()
.in(OrderItemDO::getOrderId, orderIdSet)
@@ -909,6 +909,9 @@ public class PlateServiceImpl implements PlateService {
// 查询板件+板材信息
List<OrdersViewPlatesPageDO> ordersViewPlatesPageDOS = plateMapper.selectPlateGoodsByIds(orderIds, plateIdPageRecords, deleted);
if (CollUtil.isEmpty(plateIdPageRecords)) {
return new PageResult<>();
}
List<OrderItemDO> orderItemRelation;
// 查询关联关系
if(!deleted) {
@@ -1077,6 +1080,9 @@ public class PlateServiceImpl implements PlateService {
List<Long> partsIds = partsPageRecords.stream().map(OrdersViewPartsPageDO::getId).toList();
if (CollUtil.isEmpty(partsIds)) {
return new PageResult<>();
}
// 查询关联关系
List<OrderItemDO> orderItemRelation;
if (!deleted) {
@@ -441,7 +441,13 @@
op.is_sculpt as isSculpt,
op.is_row_hole as hasHole,
op.remark as remark,
op.model_data as modelData
op.model_data as modelData,
oi.body_id as bodyId,
oi.room_id as roomId,
oi.group_id as groupId,
ob.name as bodyName,
ob.room_name as roomName,
og.name as processGroupName
FROM order_plate op
@@ -449,6 +455,9 @@
ON op.organ_id = ogs.organ_id
AND op.order_id = ogs.order_id
AND op.goods_id = ogs.id
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
left join order_body ob on ob.organ_id = op.organ_id and ob.order_id = op.order_id and ob.id = oi.body_id
left join order_group og on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = oi.group_id
WHERE op.organ_id = #{organId}
and op.order_id in
@@ -380,7 +380,7 @@
<select id="selectPlateListByGoodsIds"
resultMap="OrderSourcePlateDetialMap">
select
select distinct
ogs.goods_id as plateGoodsId,
ogs.goods_name as goodsName,
ogs.brand as brand,
@@ -406,10 +406,19 @@
op.open_door_type as openDoorType,
op.is_special_shaped as isSpecialShaped,
op.remark as remark,
op.model_data as modelData
op.model_data as modelData,
oi.body_id,
oi.room_id,
oi.group_id,
ob.name as bodyName,
ob.room_name,
og.name as processGroupName
from order_plate op
join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
left join order_body ob on ob.organ_id = op.organ_id and ob.order_id = op.order_id and ob.id = oi.body_id
left join order_group og on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = oi.group_id
where op.organ_id = #{organId}
and op.deleted = false
@@ -1623,6 +1632,10 @@
<foreach item="planId" collection="planIds" open="(" separator="," close=")">
#{planId}
</foreach>
AND p.order_id IN
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
#{orderId}
</foreach>
and p.deleted = false
</select>