ERP:增加 ERP 可出库订单列表

This commit is contained in:
YunaiV 2024-02-11 10:33:37 +08:00
parent 6f57987208
commit 09e4763c79
2 changed files with 9 additions and 0 deletions

View File

@ -71,4 +71,7 @@ public class ErpSaleOrderPageReqVO extends PageParam {
@Schema(description = "退货状态", example = "2")
private Integer returnStatus;
@Schema(description = "是否可出库", example = "true")
private Boolean outEnable;
}

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order.ErpSaleOrderPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpSaleOrderDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpSaleOrderItemDO;
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.ibatis.annotations.Mapper;
@ -45,6 +46,11 @@ public interface ErpSaleOrderMapper extends BaseMapperX<ErpSaleOrderDO> {
} else if (Objects.equals(reqVO.getReturnStatus(), ErpSaleOrderPageReqVO.RETURN_STATUS_ALL)) {
query.apply("t.return_count = t.total_count");
}
// 可出库
if (Boolean.TRUE.equals(reqVO.getOutEnable())) {
query.eq(ErpSaleOrderDO::getStatus, ErpAuditStatus.APPROVE.getStatus())
.apply("t.in_count < t.total_count");
}
if (reqVO.getProductId() != null) {
query.leftJoin(ErpSaleOrderItemDO.class, ErpSaleOrderItemDO::getOrderId, ErpSaleOrderDO::getId)
.eq(reqVO.getProductId() != null, ErpSaleOrderItemDO::getProductId, reqVO.getProductId())