diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java index 69c3610a4..d112aba43 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java @@ -746,6 +746,14 @@ public class StockShelfOrderDomainService { inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); + inventoryAdjustmentRecord.setNetWeight(BigDecimal.ZERO ); + inventoryAdjustmentRecord.setGrossWeight(BigDecimal.ZERO); + inventoryAdjustmentRecord.setVolume(BigDecimal.ZERO); + inventoryAdjustmentRecord.setArea(BigDecimal.ZERO); + inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight() == null ? BigDecimal.ZERO : materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight() == null ? BigDecimal.ZERO : materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume() == null ? BigDecimal.ZERO : materialInventory.getVolume()); + inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea() == null ? BigDecimal.ZERO : materialInventory.getArea()); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); } else if (materialInventoryPOS.size() == 1) { MaterialInventory materialInventory = new MaterialInventory(); @@ -835,6 +843,14 @@ public class StockShelfOrderDomainService { inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername()); inventoryAdjustmentRecord.setCreateTime(new Date()); + inventoryAdjustmentRecord.setNetWeight(BigDecimal.ZERO ); + inventoryAdjustmentRecord.setGrossWeight(BigDecimal.ZERO); + inventoryAdjustmentRecord.setVolume(BigDecimal.ZERO); + inventoryAdjustmentRecord.setArea(BigDecimal.ZERO); + inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight() == null ? BigDecimal.ZERO : materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight() == null ? BigDecimal.ZERO : materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume() == null ? BigDecimal.ZERO : materialInventory.getVolume()); + inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea() == null ? BigDecimal.ZERO : materialInventory.getArea()); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); } } @@ -1072,15 +1088,6 @@ public class StockShelfOrderDomainService { inventoryStandingDetailDO.setCreateBy(loginUser.getUserid()); inventoryStandingDetailDO.setCreateByName(loginUser.getUsername()); inventoryStandingDetailDO.setCreateTime(new Date()); - InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord(); - inventoryAdjustmentRecord.setNetWeight(BigDecimal.ZERO ); - inventoryAdjustmentRecord.setGrossWeight(BigDecimal.ZERO); - inventoryAdjustmentRecord.setVolume(BigDecimal.ZERO); - inventoryAdjustmentRecord.setArea(BigDecimal.ZERO); - inventoryAdjustmentRecord.setAdjustedNetWeight(shelfMaterialDetailPO.getTotalNetWeight() == null ? BigDecimal.ZERO : shelfMaterialDetailPO.getTotalNetWeight()); - inventoryAdjustmentRecord.setAdjustedGrossWeight(shelfMaterialDetailPO.getTotalGrossWeight() == null ? BigDecimal.ZERO : shelfMaterialDetailPO.getTotalGrossWeight()); - inventoryAdjustmentRecord.setAdjustedVolume(shelfMaterialDetailPO.getTotalVolume() == null ? BigDecimal.ZERO : shelfMaterialDetailPO.getTotalVolume()); - inventoryAdjustmentRecord.setAdjustedArea(shelfMaterialDetailPO.getTotalArea() == null ? BigDecimal.ZERO : shelfMaterialDetailPO.getTotalArea()); inventoryStandingDetailDOList.add(inventoryStandingDetailDO); } inventoryStandingDetailService.batchInsert(inventoryStandingDetailDOList);