| | |
| | | if(list.isEmpty()){ |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | List<String> typeIds = list.stream().map(TErpGoods::getTypeId).collect(Collectors.toList()); |
| | | if(!typeIds.isEmpty()){ |
| | | List<TErpGoodsType> typeList = erpGoodsTypeMapper.selectBatchIds(typeIds); |
| | |
| | | } |
| | | tErpGoodsWarehouseLastVO.setAllNum(tErpGoodsWarehouseVOS.stream().mapToInt(TErpGoodsWarehouseVO::getNowNum).sum()); |
| | | tErpGoodsWarehouseLastVO.setAllTotalPrice(tErpGoodsWarehouseVOS.stream().mapToDouble(TErpGoodsWarehouseVO::getUnitAmount).sum()); |
| | | tErpGoodsWarehouseLastVO.setAllTotalPrice(BigDecimal.valueOf(tErpGoodsWarehouseLastVO.getAllTotalPrice()).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | tErpGoodsWarehouseLastVO.setList(tErpGoodsWarehouseVOS); |
| | | tErpGoodsWarehouseLastVO.setWarningInventory(goods.getWarningInventory()); |
| | | tErpGoodsWarehouseLastVOS.add(tErpGoodsWarehouseLastVO); |
| | |
| | | tErpSupplierWarehousing.setGoodsId(dto.getGoodsId()); |
| | | TErpGoods goods = erpGoodsMapper.selectById(dto.getGoodsId()); |
| | | tErpSupplierWarehousing.setGoodsName(goods.getGoodsName()); |
| | | tErpSupplierWarehousing.setGoodsCount(tErpSupplierWarehousing.getGoodsCount()); |
| | | tErpSupplierWarehousing.setUnitAmount(tErpSupplierWarehousing.getUnitAmount()); |
| | | tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousing.getTotalPrice()); |
| | | erpSupplierWarehousingMapper.insert(tErpSupplierWarehousing); |
| | | tErpSupplierWarehousing.setGoodsCount(dto.getWarehousingNum()); |
| | | tErpSupplierWarehousing.setUnitAmount(dto.getPrice()); |
| | | tErpSupplierWarehousing.setTotalPrice(dto.getTotalPrice()); |
| | | List<WarehousingGoodsNextDto> warehousingGoodsNextDtos = dto.getWarehousingGoodsNextDtos(); |
| | | int sum = warehousingGoodsNextDtos.stream().mapToInt(WarehousingGoodsNextDto::getWarehousingNum).sum(); |
| | | tErpSupplierWarehousing.setGoodsCount( sum); |
| | | erpSupplierWarehousingMapper.insert(tErpSupplierWarehousing); |
| | | |
| | | for (WarehousingGoodsNextDto warehousingGoodsNextDto : warehousingGoodsNextDtos) { |
| | | TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = new TErpSupplierWarehousingBatch(); |
| | | tErpSupplierWarehousingBatch.setWarehousingId(tErpSupplierWarehousing.getId()); |
| | |
| | | throw new ServiceException("批次号:"+tErpSupplierWarehousingBatch.getBatchNumber()+"库存不足"); |
| | | } |
| | | TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(tErpSupplierWarehousingBatch.getWarehousingId()); |
| | | TErpGoods goods = erpGoodsMapper.selectById(tErpSupplierWarehousing.getGoodsId()); |
| | | BigDecimal multiply = goods.getSalesAmount().multiply(BigDecimal.valueOf(outboundGoodsNextDto.getNum())); |
| | | // TErpGoods goods = erpGoodsMapper.selectById(tErpSupplierWarehousing.getGoodsId()); |
| | | BigDecimal multiply = tErpSupplierWarehousing.getUnitAmount().multiply(BigDecimal.valueOf(outboundGoodsNextDto.getNum())); |
| | | |
| | | TErpSupplierOutboundGoods tErpSupplierOutboundGoods1 = new TErpSupplierOutboundGoods(); |
| | | tErpSupplierOutboundGoods1.setWarehousingId(dto.getWarehouseId()); |
| | | tErpSupplierOutboundGoods1.setWarehousingId(tErpSupplierWarehousing.getId()); |
| | | tErpSupplierOutboundGoods1.setWarehousingBatchId(outboundGoodsNextDto.getBatchId()); |
| | | tErpSupplierOutboundGoods1.setOutboundCount(outboundGoodsNextDto.getNum()); |
| | | tErpSupplierOutboundGoods1.setTotalPrice(multiply); |