自动化立体仓库 - WMS系统
skyouc
5 小时以前 97e70fa264df2d3d0ed004137a8c55d9035b10f9
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -21,6 +21,7 @@
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -544,7 +545,7 @@
        if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
            throw new CoolException(BaseRes.PARAM);
        }
        if (param.getCombMats().size() > 1) {
        if (param.getCombMats().size() < 1) {
            throw new CoolException("请提取一个商品,或者刷新重新组托!");
        }
        // 判断是否有相同条码的数据
@@ -555,9 +556,6 @@
        if (param.getBarcode().length() != 8) {
            throw new CoolException("条码长度不是8位===>>" + param.getBarcode());
        }
        if (param.getCombMats().size() > 1) {
            throw new CoolException("不允许混料===>>" + param.getBarcode());
        }
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
@@ -593,7 +591,7 @@
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
                BeanUtils.copyProperties(mat, waitPakin);
                waitPakin.setBatch(detlDto.getBatch());
                waitPakin.setZpallet(param.getBarcode());   // 托盘码
                waitPakin.setIoStatus("N");     // 入出状态
@@ -617,18 +615,20 @@
            // 生成入库通知档
            List<DetlDto> detlDtos = new ArrayList<>();
            param.getCombMats().forEach(elem -> {
                // 订单明细数量校验
//                OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch());
                OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
                        elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3());
                if (elem.getAnfme() > orderDetl.getEnableQty()) {
                    throw new CoolException(orderDetl.getMatnr() + "入库数量不合法");
//                OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
//                        elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3());
                OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                        .eq("order_id", order.getId())
                        .eq("matnr", elem.getMatnr()));
                if (Objects.isNull(detls)) {
                    throw new CoolException("数据错误:单据明细不存在!!");
                }
                // 修改订单作业数量
//                if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) {
//                    throw new CoolException("修改单据作业数量失败");
//                }
                if (elem.getAnfme() > detls.getEnableQty()) {
                    throw new CoolException(detls.getMatnr() + "入库数量不合法");
                }
                OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
                        elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
@@ -647,7 +647,8 @@
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
                BeanUtils.copyProperties(mat, waitPakin);
//                waitPakin.sync(mat);
                waitPakin.setOrderNo(order.getOrderNo());   // 单据编号
                waitPakin.setBatch(detlDto.getBatch());     // 序列码
                waitPakin.setZpallet(param.getBarcode());   // 托盘码
@@ -945,7 +946,7 @@
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
                BeanUtils.copyProperties(mat, waitPakin);
                waitPakin.setOrderNo(orderNo);
                waitPakin.setBatch(detlDto.getBatch());
                waitPakin.setZpallet(param.getBarcode());   // 托盘码