1、装配设置接入加工状态筛选;2、group_id=0过滤异常修复;

This commit is contained in:
gaoqr
2026-06-01 14:11:50 +08:00
parent 205db8ed9c
commit 493699c6cb
5 changed files with 71 additions and 3 deletions
@@ -1,5 +1,7 @@
package com.cf.imes.module.executor.controller.admin.order.vo.order;
import com.cf.imes.framework.common.validation.InEnum;
import com.cf.imes.module.executor.enums.ordercomponent.OrderComponentProcessStatusEnum;
import com.cf.imes.module.executor.validation.order.OrderStatusValid;
import lombok.*;
@@ -100,4 +102,8 @@ public class OrderPageReqVO extends PageParam {
@Schema(description = "排序字段", example = "id")
private String field;
@Schema(description = "加工状态")
@InEnum(OrderComponentProcessStatusEnum.class)
private Integer processStatus;
}
@@ -424,7 +424,11 @@ public class OrderComponentServiceImpl implements OrderComponentService {
.in(OrderItemDO::getOrderId, pageReqVO.getOrderIds())
.inIfPresent(OrderItemDO::getCompId, queryComponentIds)
.in(OrderItemDO::getPartsId, partsIds)
.ne(OrderItemDO::getGroupId, 0L)
.and(wrapper ->
wrapper.ne(OrderItemDO::getGroupId, 0L)
.or()
.isNull(OrderItemDO::getGroupId)
)
.select(OrderItemDO::getPartsId, OrderItemDO::getCadViewId, OrderItemDO::getGroupId, OrderItemDO::getCompId, OrderItemDO::getNum)
);
@@ -1032,7 +1032,11 @@ public class PlateServiceImpl implements PlateService {
.eq(OrderItemDO::getOrderId, pageReqVO.getOrderId())
.inIfPresent(OrderItemDO::getBodyId, bodyIds)
.inIfPresent(OrderItemDO::getGroupId, groupIds)
.ne(OrderItemDO::getGroupId, 0L)
.and(wrapper ->
wrapper.ne(OrderItemDO::getGroupId, 0L)
.or()
.isNull(OrderItemDO::getGroupId)
)
.in(OrderItemDO::getPartsId, partsIds)
.select(OrderItemDO::getPartsId, OrderItemDO::getBodyId, OrderItemDO::getCadViewId, OrderItemDO::getGroupId, OrderItemDO::getCompId, OrderItemDO::getNum)
);
@@ -127,6 +127,60 @@
AND t.create_time BETWEEN #{reqVO.createTime[0]} AND #{reqVO.createTime[1]}
</if>
<!-- 部件装配状态过滤(单选):加在子订单的过滤条件中 -->
<if test="reqVO.processStatus != null">
<choose>
<!-- 0. 不加工 -->
<when test="reqVO.processStatus == 0">
AND EXISTS (
SELECT 1
FROM order_component oc
WHERE oc.order_id = t.id
AND oc.deleted = 0
AND oc.pid = 0
AND oc.extra_process_status = 0
)
</when>
<!-- 1. 未加工 -->
<when test="reqVO.processStatus == 1">
AND EXISTS (
SELECT 1
FROM order_component oc
WHERE oc.order_id = t.id
AND oc.deleted = 0
AND oc.pid = 0
AND oc.process_status = 1
AND oc.extra_process_status IS NULL
)
</when>
<!-- 2. 已加工 -->
<when test="reqVO.processStatus == 2">
AND EXISTS (
SELECT 1
FROM order_component oc
WHERE oc.order_id = t.id
AND oc.deleted = 0
AND oc.pid = 0
AND oc.process_status = 2
)
</when>
<!-- 3. 部分加工 -->
<when test="reqVO.processStatus == 3">
AND EXISTS (
SELECT 1
FROM order_component oc
WHERE oc.order_id = t.id
AND oc.deleted = 0
AND oc.pid = 0
AND oc.extra_process_status = 3
)
</when>
</choose>
</if>
AND t.deleted = #{reqVO.deleted}
) tmp
@@ -454,7 +454,7 @@
oi.parts_id != 0
AND oi.package_id = 0
AND oi.source_id = 0
AND oi.group_id != 0
AND (oi.group_id != 0 oi.group_id is null)
AND op.deleted = false
AND op.type != '封边条'
AND oi.order_id IN