移位管理调整前后净重...
This commit is contained in:
+59
-9
@@ -396,10 +396,38 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
|
||||
inventoryAdjustmentRecord.setVolume(materialInventory1.getVolume() == null ? BigDecimal.ZERO : materialInventory1.getVolume());
|
||||
inventoryAdjustmentRecord.setArea(materialInventory1.getArea() == null ? BigDecimal.ZERO : materialInventory1.getArea());
|
||||
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(shiftMaterialDetailDO.getNetWeight() == null ? BigDecimal.ZERO : shiftMaterialDetailDO.getNetWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(shiftMaterialDetailDO.getGrossWeight() == null ? BigDecimal.ZERO : shiftMaterialDetailDO.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(shiftMaterialDetailDO.getVolume() == null ? BigDecimal.ZERO : shiftMaterialDetailDO.getVolume());
|
||||
inventoryAdjustmentRecord.setAdjustedArea(shiftMaterialDetailDO.getArea() == null ? BigDecimal.ZERO : shiftMaterialDetailDO.getArea());
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(
|
||||
materialInventory1.getNetWeight() != null ?
|
||||
materialInventory1.getNetWeight().subtract(shiftMaterialDetailDO.getNetWeight() != null ?
|
||||
shiftMaterialDetailDO.getNetWeight() : BigDecimal.ZERO) :
|
||||
BigDecimal.ZERO
|
||||
);
|
||||
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(
|
||||
materialInventory1.getGrossWeight() != null ?
|
||||
materialInventory1.getGrossWeight().subtract(shiftMaterialDetailDO.getGrossWeight() != null ?
|
||||
shiftMaterialDetailDO.getGrossWeight() : BigDecimal.ZERO) :
|
||||
BigDecimal.ZERO
|
||||
);
|
||||
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(
|
||||
materialInventory1.getVolume() != null ?
|
||||
materialInventory1.getVolume().subtract(shiftMaterialDetailDO.getVolume() != null ?
|
||||
shiftMaterialDetailDO.getVolume() : BigDecimal.ZERO) :
|
||||
BigDecimal.ZERO
|
||||
);
|
||||
|
||||
inventoryAdjustmentRecord.setAdjustedArea(
|
||||
materialInventory1.getArea() != null ?
|
||||
materialInventory1.getArea().subtract(shiftMaterialDetailDO.getArea() != null ?
|
||||
shiftMaterialDetailDO.getArea() : BigDecimal.ZERO) :
|
||||
BigDecimal.ZERO
|
||||
);
|
||||
// inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory1.getNetWeight().subtract(shiftMaterialDetailDO.getNetWeight()));
|
||||
// inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory1.getGrossWeight().subtract(shiftMaterialDetailDO.getGrossWeight()));
|
||||
// inventoryAdjustmentRecord.setAdjustedVolume(materialInventory1.getVolume().subtract(shiftMaterialDetailDO.getVolume()));
|
||||
// inventoryAdjustmentRecord.setAdjustedArea(materialInventory1.getArea().subtract(shiftMaterialDetailDO.getArea()));
|
||||
|
||||
|
||||
inventoryAdjustmentRecord.setAdjustAction("移位管理");
|
||||
inventoryAdjustmentRecord.setRelateNo(shiftMaterialDetailDO.getShiftNumber());
|
||||
@@ -437,13 +465,35 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
|
||||
inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(shiftMaterialDetailDO.getShiftQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationAfterQuantity();
|
||||
// inventoryAdjustmentRecord.setAllocationBeforeQuantity();
|
||||
// inventoryAdjustmentRecord.setFreezeBeforeQuantity();
|
||||
// inventoryAdjustmentRecord.setFreezeAfterQuantity();
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity() == null ? BigDecimal.ZERO : materialInventory1.getAllocationQuantity());
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory1.getAllocationQuantity() == null ? BigDecimal.ZERO : materialInventory1.getAllocationQuantity());
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory1.getFreezeQuantity() == null ? BigDecimal.ZERO : materialInventory1.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory1.getFreezeQuantity() == null ? BigDecimal.ZERO : materialInventory1.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(shiftMaterialDetailDO.getInventoryQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(shiftMaterialDetailDO.getInventoryQuantity().subtract(shiftMaterialDetailDO.getShiftQuantity()));
|
||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);//移位前物料记录
|
||||
InventoryAdjustmentRecord inventoryAdjustmentRecord2 = new InventoryAdjustmentRecord();
|
||||
BeanUtils.copyProperties(inventoryAdjustmentRecord, inventoryAdjustmentRecord2);
|
||||
inventoryAdjustmentRecord2.setNetWeight(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord2.setGrossWeight(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord2.setVolume(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord2.setArea(BigDecimal.ZERO);
|
||||
|
||||
inventoryAdjustmentRecord2.setAdjustedNetWeight(shiftMaterialDetailDO.getNetWeight());
|
||||
inventoryAdjustmentRecord2.setAdjustedGrossWeight(shiftMaterialDetailDO.getGrossWeight());
|
||||
inventoryAdjustmentRecord2.setAdjustedVolume(shiftMaterialDetailDO.getVolume());
|
||||
inventoryAdjustmentRecord2.setAdjustedArea(shiftMaterialDetailDO.getArea());
|
||||
inventoryAdjustmentRecord.setWarehouseCode(shiftMaterialDetailDO.getNewWarehouseCode());
|
||||
inventoryAdjustmentRecord.setWarehouseName(shiftMaterialDetailDO.getNewWarehouseName());
|
||||
inventoryAdjustmentRecord.setWarehouseId(shiftMaterialDetailDO.getNewWarehouseId());
|
||||
inventoryAdjustmentRecord.setStorageCode(shiftMaterialDetailDO.getNewStorageCode());
|
||||
inventoryAdjustmentRecord.setStorageName(shiftMaterialDetailDO.getNewStorageName());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(shiftMaterialDetailDO.getNewStorageLocationId());
|
||||
inventoryAdjustmentRecord.setStorageLocationCode(shiftMaterialDetailDO.getNewStorageLocationCode());
|
||||
inventoryAdjustmentRecord.setStorageLocationName(shiftMaterialDetailDO.getNewStorageLocationName());
|
||||
inventoryAdjustmentRecord.setStorageSectionId(shiftMaterialDetailDO.getNewStorageSectionId());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(shiftMaterialDetailDO.getNewStorageLocationId());
|
||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord2);//移位后物料记录
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user