skyouc
2025-07-07 2a24c69b830d9dc97a8673f5f69418e9f95f3e1b
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java
@@ -4,6 +4,7 @@
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.entity.enums.OrderSettleType;
import com.zy.asrs.wms.asrs.entity.enums.OrderType;
import com.zy.asrs.wms.asrs.mapper.WaitPakinMapper;
import com.zy.asrs.wms.asrs.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -59,7 +60,7 @@
        }
        //可用数量
        Double count = orderDetl.getAnfme() - orderDetl.getQty() - orderDetl.getWorkQty() - orderDetl.getWaitQty();
        Double count = Math.round((orderDetl.getAnfme() - orderDetl.getWorkQty() - orderDetl.getQty()) * 1000) / 1000.0;
        if (waitPakin.getAnfme() > count) {
            throw new CoolException("组托数量超过剩余可用数量");
        }
@@ -88,6 +89,12 @@
            throw new CoolException("订单不存在");
        }
        //如果是平库入库单,修改订单明细执行数量
        if (order.getOrderType() == OrderType.PK_IN_ORDER.id) {
            orderDetl.setWorkQty(waitPakin.getAnfme());
            orderDetlService.updateById(orderDetl);
        }
        //更新订单状态
        if (order.getOrderSettle().equals(OrderSettleType.INIT.val())) {
            order.setOrderSettle(OrderSettleType.WAIT.val());