xuhy
4 天以前 433bc1e314ecfd483379ca0e2e74e7c815d3261f
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
@@ -570,6 +570,28 @@
                String warehousingId1 = tErpSupplierWarehousingBatch1.getWarehousingId();
                TErpSupplierWarehousing tErpSupplierWarehousing2 = erpSupplierWarehousingMapper.selectById(warehousingId1);
                if(inventoryGoodsDto.getDamagedCount()!=null && inventoryGoodsDto.getDamagedCount()>0){
                    TErpSupplierOutbound tErpSupplierOutbound = new TErpSupplierOutbound();
                    tErpSupplierOutbound.setWarehouseId(dto.getWarehouseId());
                    tErpSupplierOutbound.setSupplierId(supplierClinicId);
                    tErpSupplierOutbound.setOutboundType(1);
                    tErpSupplierOutbound.setOutboundNumber("G" + s);
                    int count = inventoryGoodsDto.getDamagedCount();
                    tErpSupplierOutbound.setTotalMoney(tErpSupplierWarehousing1.getUnitAmount().multiply(new BigDecimal(count)));
                    tErpSupplierOutbound.setGoodsId(tErpSupplierWarehousing2.getGoodsId());
                    erpSupplierOutboundMapper.insert(tErpSupplierOutbound);
                    TErpSupplierOutboundGoods tErpSupplierOutboundGoods = new TErpSupplierOutboundGoods();
                    tErpSupplierOutboundGoods.setOutboundId(tErpSupplierOutbound.getId());
                    tErpSupplierOutboundGoods.setWarehousingId(tErpSupplierWarehousing1.getId());
                    tErpSupplierOutboundGoods.setWarehousingBatchId(tErpSupplierWarehousingBatch.getId());
                    tErpSupplierOutboundGoods.setOutboundCount(count);
                    tErpSupplierOutboundGoods.setTotalPrice(tErpSupplierWarehousing1.getUnitAmount().multiply(new BigDecimal(count)));
                    erpSupplierOutboundGoodsMapper.insert(tErpSupplierOutboundGoods);
                }
                TErpSupplierOutbound tErpSupplierOutbound = new TErpSupplierOutbound();
                tErpSupplierOutbound.setWarehouseId(dto.getWarehouseId());
                tErpSupplierOutbound.setSupplierId(supplierClinicId);
@@ -638,6 +660,8 @@
            TErpClinicWarehousing tErpSupplierWarehousing1 = erpClinicWarehousingMapper.selectById(warehousingId);
            TErpGoods erpGoods = this.getById(tErpSupplierWarehousingBatch.getGoodsId());
            // 盘点是盘亏盘盈   赢
            if (inventoryGoodsDto.getNum() < inventoryGoodsDto.getInventoryCount()) {
                // 添加入库信息
@@ -683,6 +707,26 @@
            } else {
                if(inventoryGoodsDto.getDamagedCount()!=null && inventoryGoodsDto.getDamagedCount()>0){
                    TErpClinicOutbound tErpSupplierOutbound = new TErpClinicOutbound();
//                tErpSupplierOutbound.setWarehouseId(dto.getWarehouseId());
//                tErpSupplierOutbound.setSupplierId(supplierClinicId);
                    tErpSupplierOutbound.setOutboundType(1);
                    tErpSupplierOutbound.setOutboundNumber("G" + s);
                    int count = inventoryGoodsDto.getDamagedCount();
                    tErpSupplierOutbound.setTotalMoney(erpGoods.getSalesAmount().multiply(new BigDecimal(count)));
                    tErpSupplierOutbound.setInventoryId(tErpSupplierInventory.getId());
                    erpClinicOutboundMapper.insert(tErpSupplierOutbound);
                    TErpClinicOutboundGoods tErpSupplierOutboundGoods = new TErpClinicOutboundGoods();
                    tErpSupplierOutboundGoods.setOutboundId(tErpSupplierOutbound.getId());
                    tErpSupplierOutboundGoods.setWarehousingId(tErpSupplierWarehousing1.getId());
                    tErpSupplierOutboundGoods.setWarehousingBatchId(tErpSupplierWarehousingBatch.getId());
                    tErpSupplierOutboundGoods.setOutboundCount(count);
                    tErpSupplierOutboundGoods.setTotalPrice(erpGoods.getSalesAmount().multiply(new BigDecimal(count)));
                    erpClinicOutboundGoodsMapper.insert(tErpSupplierOutboundGoods);
                }
                TErpClinicOutbound tErpSupplierOutbound = new TErpClinicOutbound();
//                tErpSupplierOutbound.setWarehouseId(dto.getWarehouseId());
//                tErpSupplierOutbound.setSupplierId(supplierClinicId);