自动化立体仓库 - WMS系统
1
ZY
2024-09-26 4df80cad47f22a930435835e7f7135bd60672cd8
src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
@@ -93,13 +93,15 @@
    }
    //退回
    @Transactional
    public void returned(List<PlaQty> plaQties, User user) {
        plaQties.forEach(plaQty -> {
            PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId());
            if(Cools.isEmpty(plaQtyOut.getReturned())){
            if(Cools.isEmpty(plaQtyOut.getReturned()) || plaQtyOut.getReturned() == 0){
                plaQtyOut.setReturned(plaQty.getOrderWeight());
            }else {
                plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned());
                throw new CoolException("该包物料已退回");
                //plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned());
            }
            plaQtyService.updateById(plaQtyOut);
@@ -110,6 +112,7 @@
            plaQtyReturned.setLocNo(plaQtyOut.getLocNo());
            plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo());
            plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date()));
            plaQtyReturned.setBrand(plaQty.getBrand());
            plaQtyReturned.setOrderWeight(plaQty.getOrderWeight());
            plaQtyReturned.setTransfer("退回入库");
            plaQtyReturned.setHandlerBy(user.getUsername());
@@ -127,7 +130,7 @@
            this.updateById(pla);
            SaasUtils.insertLog(0,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(),
                    null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop());
                    null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop(),null);
        });
    }