| | |
| | | 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()); |
| | | } |
| | |
| | | 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 { |