自动化立体仓库 - WMS系统
#
zjj
2024-12-09 423a96e72578bae358dec7485477ea9e1c566fae
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -74,6 +74,8 @@
    private ManLocDetlService manLocDetlService;
    @Autowired
    private ManLocDetlMapper manLocDetlMapper;
    @Resource
    private InventoryCheckOrderDetlService inventoryCheckOrderDetlService;
    @Resource
    private BasDevpMapper basDevpMapper;
@@ -262,11 +264,15 @@
        if(param.getCombMats().size()>1){
            throw new CoolException("请提取一个商品,或者刷新重新组托!");
        }
        // 判断是否有相同条码的数据
        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
                eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
            throw new CoolException(param.getBarcode() + "数据正在进行入库");
        }
        param.getCombMats().forEach(elem -> {
            // 判断是否有相同条码的数据
            if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
                    eq("zpallet", param.getBarcode())
                    .eq("io_status", "N")
                    .eq("matnr",elem.getMatnr()).eq("batch",elem.getBatch())) > 0) {
                throw new CoolException(param.getBarcode() + "已有相同数据");
            }
        });
        if(param.getBarcode().length()!=9){
            throw new CoolException("条码长度不是9位===>>" + param.getBarcode());
@@ -274,9 +280,9 @@
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode()));
        if (countLoc > 0 || countWrk > 0 || countwait > 0) {
            throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode());
//        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode()));
        if (countLoc > 0 || countWrk > 0) {
            throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode());
        }
        Date now = new Date();
@@ -287,6 +293,15 @@
            // 生成入库通知档
            List<DetlDto> detlDtos = new ArrayList<>();
            param.getCombMats().forEach(elem -> {
                // 判断是否有相同条码的数据
                if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
                        eq("zpallet", param.getBarcode())
                        .eq("io_status", "N")
                        .eq("matnr",elem.getMatnr()).eq("batch",elem.getBatch())) > 0) {
                    throw new CoolException(param.getBarcode() + "已有相同数据");
                }
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme());
                if (DetlDto.has(detlDtos, detlDto)) {
                    DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch());
@@ -372,7 +387,8 @@
                waitPakin.setAppeTime(now);
                waitPakin.setModiUser(userId);
                waitPakin.setModiTime(now);
                waitPakin.setManu(detlDto.getMark());
                waitPakin.setManu(detlDto.getMark()); //标记
                waitPakin.setOrigin(order.getItemName());//仓库
                if (!waitPakinService.insert(waitPakin)) {
                    throw new CoolException("保存入库通知档失败");
                }
@@ -816,6 +832,13 @@
    public void leftoversOut(Map<String, Object> map,Long userId) {
        String barcode = map.get("barcode").toString();
        String barcode2 = map.get("barcode2").toString();
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",barcode2));
        int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",barcode2).ne("io_type",200));
        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",barcode2));
        if (countLoc > 0 || countWrk > 0 || countwait > 0) {
            throw new CoolException("该条码已被使用===>>" + barcode2);
        }
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode).eq("io_type", 103));
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException("未查询到拣料任务");
@@ -869,6 +892,34 @@
    }
    @Override
    public void pdaAdjust(pdaAdjustParam param, Long userId) {
        if (Cools.isEmpty(param)){
            throw new CoolException("盘点列表参数为空");
        }
        for (InventoryCheckOrderDetl orderDetl: param.getParam()){
            InventoryCheckOrderDetl inventoryCheckOrderDetl = inventoryCheckOrderDetlService.selectOne(new EntityWrapper<InventoryCheckOrderDetl>()
                    .eq("order_no", orderDetl.getOrderNo())
                    .eq("matnr", orderDetl.getMatnr())
                    .eq("batch", orderDetl.getBatch()));
            if (Cools.isEmpty(inventoryCheckOrderDetl)){
                throw new CoolException("未查询到盘点信息");
            }
            if (!inventoryCheckOrderDetl.getStatus().equals("1")){
                throw new CoolException("该任务已盘点");
            }
            inventoryCheckOrderDetl.setCheckAnfme(orderDetl.getCheckAnfme());
            inventoryCheckOrderDetl.setStatus("2");
            if (!inventoryCheckOrderDetlService.updateById(inventoryCheckOrderDetl)){
                throw new CoolException("保存盘点信息失败!");
            }
        }
    }
    @Override
    @Transactional
    public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl,
                         Double curOutQty, Integer ioType, Long userId, Date now) {