zjj
2024-05-30 09284f08c7a901f684cf26ccb0e51a9204d9cd64
zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/MobileServiceImpl.java
@@ -103,7 +103,7 @@
                }
            }
            // 关联组托
        } else {
        }  else {
            Order order = orderService.selectByNo(param.getOrderNo(), hostId);
            if (order.getSettle() > 2) {
                throw new CoolException("单据编号已过期");
@@ -118,7 +118,7 @@
                    throw new CoolException(orderDetl.getMatnr() + "入库数量不合法");
                }
                // 修改订单明细数量
                if (!orderDetlService.increase(order.getId(), hostId, elem.getMatnr(), elem.getBatch(), elem.getAnfme())) {
                if (!orderDetlService.increaseWorkQtyByOrderNo(order.getOrderNo(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), hostId)) {
                    throw new CoolException("修改单据明细数量失败");
                }
@@ -237,7 +237,7 @@
    @Override
    @Transactional
    public R WarehouseIn(String locNo, String barcode,Long hostId) {
       //判断库位状态
        //判断库位状态
        LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, locNo).eq(LocMast::getHostId,hostId));
        if (Cools.isEmpty(locMast)){
            return R.error("该库位不存在");
@@ -266,11 +266,28 @@
            locDetl.setModiTime(now);
            locDetl.setAppeTime(now);
            locDetlService.save(locDetl);
            //是否属于订单数据
            if (!Cools.isEmpty(waitPakin.getOrderNo())){
                Order order = orderService.selectByNo(waitPakin.getOrderNo(), hostId);
                if (Cools.isEmpty(order)){
                    continue;
                }
                OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), waitPakin.getMatnr(), waitPakin.getBatch());
                if (Cools.isEmpty(orderDetl)){
                    continue;
                }
                // 修改订单明细完成数量
                if (!orderDetlService.increase(order.getId(), hostId, waitPakin.getMatnr(), waitPakin.getBatch(), waitPakin.getAnfme())) {
                    throw new CoolException("修改单据明细数量失败");
                }
            }
        }
        //修改库位状态
        locMast.setLocSts("F");
        locMast.setModiTime(now);
        locMastService.updateById(locMast);
        // 保存入库通知档历史档
        if (!waitPakinLogService.saveToHistory(barcode, hostId)) {
@@ -282,4 +299,26 @@
        }
        return R.ok("上架成功");
    }
    @Override
    public R WarehouseOut(CombParam combParam, Long hostId) {
        //判断库位状态
        LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, combParam.getLocno()).eq(LocMast::getHostId,hostId));
        if (Cools.isEmpty(locMast)){
            return R.error("该库位不存在");
        }
        if (!locMast.getLocSts().equals("F")){
            return R.error("该库位状态为:"+locMast.getLocSts()+",禁止出库");
        }
        //查询库存数据
        List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getZpallet, combParam.getBarcode()).eq(LocDetl::getLocNo, combParam.getLocno()).eq(LocDetl::getHostId, hostId));
        if (Cools.isEmpty(locDetls)){
            return R.error("未查询到库存数据");
        }
        for (LocDetl locDetl: locDetls){
        }
        return R.ok();
    }
}