xuhy
2 天以前 72aaf45389cd09c206ee1b90f0c7f5bf59782930
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
@@ -166,9 +166,9 @@
                tErpGoodsWarehouseVO.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber());
                tErpGoodsWarehouseVO.setProductionDate(tErpSupplierWarehousingBatch.getProductionDate());
                tErpGoodsWarehouseVO.setExpiryDate(tErpSupplierWarehousingBatch.getExpiryDate());
                TErpSupplierOutboundGoods tErpSupplierOutboundGoods1 = tErpSupplierOutboundGoods.stream().filter(t -> t.getWarehousingBatchId().equals(tErpSupplierWarehousingBatch.getId())).findFirst().orElse(null);
                if(tErpSupplierOutboundGoods1!=null){
                    tErpGoodsWarehouseVO.setNowNum(tErpSupplierWarehousingBatch.getWarehousingNumber()-tErpSupplierOutboundGoods1.getOutboundCount());
                List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods1 = tErpSupplierOutboundGoods.stream().filter(t -> t.getWarehousingBatchId().equals(tErpSupplierWarehousingBatch.getId())).collect(Collectors.toList());
                if(!tErpSupplierOutboundGoods1.isEmpty()){
                    tErpGoodsWarehouseVO.setNowNum(tErpSupplierWarehousingBatch.getWarehousingNumber()-tErpSupplierOutboundGoods1.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum());
                }else {
                    tErpGoodsWarehouseVO.setNowNum(tErpSupplierWarehousingBatch.getWarehousingNumber());
                }
@@ -278,7 +278,7 @@
            TErpSupplierWarehousing tErpSupplierWarehousing = new TErpSupplierWarehousing();
            // 当前年月日时分秒
            // 查询上一个入库单
            TErpSupplierWarehousing last = erpSupplierWarehousingMapper.selectOne(new LambdaQueryWrapper<TErpSupplierWarehousing>().orderByDesc(TErpSupplierWarehousing::getCreateTime).last("LIMIT 1"));
            TErpSupplierWarehousing last = erpSupplierWarehousingMapper.selectOne(new LambdaQueryWrapper<TErpSupplierWarehousing>().orderByDesc(TErpSupplierWarehousing::getCreateTime).orderByDesc(TErpSupplierWarehousing::getWarehouseNo).last("LIMIT 1"));
            if(last==null){
                tErpSupplierWarehousing.setWarehouseNo("G"+DateUtils.dateTimeNow()+"00001");
            }else {