上架库存调整记录;
This commit is contained in:
+84
-2
@@ -27,6 +27,8 @@ import com.mhd.wms.domain.inMaterialDetailSerialNumber.repository.po.InMaterialD
|
||||
import com.mhd.wms.domain.inMaterialDetailSerialNumber.repository.todo.InMaterialDetailSerialNumberDO;
|
||||
import com.mhd.wms.domain.inOrderAbnormal.repository.facade.IInOrderAbnormalService;
|
||||
import com.mhd.wms.domain.inOrderAbnormal.repository.todo.InOrderAbnormalBaseDO;
|
||||
import com.mhd.wms.domain.inventoryAdjustmentRecord.entity.InventoryAdjustmentRecord;
|
||||
import com.mhd.wms.domain.inventoryAdjustmentRecord.repository.mapper.InventoryAdjustmentRecordMapper;
|
||||
import com.mhd.wms.domain.inventoryStandingDetail.repository.facade.IInventoryStandingDetailService;
|
||||
import com.mhd.wms.domain.inventoryStandingDetail.repository.todo.InventoryStandingDetailDO;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.facade.IMaterialBaseInfoService;
|
||||
@@ -108,6 +110,8 @@ public class StockShelfOrderDomainService {
|
||||
private MaterialInventoryMapper materialInventoryMapper;
|
||||
@Autowired
|
||||
private IMaterialGoodsRuleService materialGoodsRuleService;
|
||||
@Autowired
|
||||
private InventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
|
||||
|
||||
/**
|
||||
* 分页查询上架单列表
|
||||
@@ -469,13 +473,91 @@ public class StockShelfOrderDomainService {
|
||||
materialInventory.setFreezeQuantity(BigDecimal.ZERO);
|
||||
|
||||
materialInventoryMapper.insert(materialInventory);
|
||||
|
||||
|
||||
//库存调整记录
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
||||
inventoryAdjustmentRecord.setAdjustType(0L);
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setMaterialCode(shelfMaterialDetail.getMaterialCode());
|
||||
inventoryAdjustmentRecord.setMaterialName(shelfMaterialDetail.getMaterialName());
|
||||
inventoryAdjustmentRecord.setBarCode(shelfMaterialDetail.getBarCode());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(shelfMaterialDetail.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setOrganizationId(stockReceiptOrderDO.getOrganizationId());
|
||||
inventoryAdjustmentRecord.setOrganizationName(stockReceiptOrderDO.getOrganizationName());
|
||||
inventoryAdjustmentRecord.setTopOrganizationId(stockReceiptOrderDO.getTopOrganizationId());
|
||||
inventoryAdjustmentRecord.setWarehouseCode(stockReceiptOrderDO.getWarehouseCode());
|
||||
inventoryAdjustmentRecord.setWarehouseName(stockReceiptOrderDO.getWarehouseName());
|
||||
inventoryAdjustmentRecord.setWarehouseId(stockReceiptOrderDO.getWarehouseId());
|
||||
inventoryAdjustmentRecord.setStorageCode(materialInventory.getStorageCode());
|
||||
inventoryAdjustmentRecord.setStorageName(materialInventory.getStorageName());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
inventoryAdjustmentRecord.setStorageLocationCode(materialInventory.getStorageLocationCode());
|
||||
inventoryAdjustmentRecord.setStorageLocationName(materialInventory.getStorageLocationName());
|
||||
inventoryAdjustmentRecord.setMaterialInventoryId(materialInventory.getMaterialInventoryId());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setShipperId(stockReceiptOrderDO.getShipperId());
|
||||
inventoryAdjustmentRecord.setShipperName(stockReceiptOrderDO.getShipperName());
|
||||
inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||
inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername());
|
||||
inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
||||
} else if (materialInventoryPOS.size() == 1) {
|
||||
MaterialInventory materialInventory = new MaterialInventory();
|
||||
MaterialInventoryPO materialInventoryPO = materialInventoryPOS.get(0);
|
||||
materialInventoryPO.setInventoryQuantity(materialInventoryPO.getInventoryQuantity().add(shelfMaterialDetail.getShelvesQuantity()));
|
||||
materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity().add(shelfMaterialDetail.getShelvesQuantity()));
|
||||
BigDecimal newInventoryQuantity = materialInventoryPO.getInventoryQuantity().add(shelfMaterialDetail.getShelvesQuantity());
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
BigDecimal newAllocationQuantity = materialInventoryPO.getAllocationQuantity().add(shelfMaterialDetail.getShelvesQuantity());
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||
BeanUtils.copyBeanProp(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
||||
inventoryAdjustmentRecord.setAdjustType(0L);
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setMaterialCode(shelfMaterialDetail.getMaterialCode());
|
||||
inventoryAdjustmentRecord.setMaterialName(shelfMaterialDetail.getMaterialName());
|
||||
inventoryAdjustmentRecord.setBarCode(shelfMaterialDetail.getBarCode());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(shelfMaterialDetail.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setOrganizationId(stockReceiptOrderDO.getOrganizationId());
|
||||
inventoryAdjustmentRecord.setOrganizationName(stockReceiptOrderDO.getOrganizationName());
|
||||
inventoryAdjustmentRecord.setTopOrganizationId(stockReceiptOrderDO.getTopOrganizationId());
|
||||
inventoryAdjustmentRecord.setWarehouseCode(stockReceiptOrderDO.getWarehouseCode());
|
||||
inventoryAdjustmentRecord.setWarehouseName(stockReceiptOrderDO.getWarehouseName());
|
||||
inventoryAdjustmentRecord.setWarehouseId(stockReceiptOrderDO.getWarehouseId());
|
||||
inventoryAdjustmentRecord.setStorageCode(materialInventory.getStorageCode());
|
||||
inventoryAdjustmentRecord.setStorageName(materialInventory.getStorageName());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
inventoryAdjustmentRecord.setStorageLocationCode(materialInventory.getStorageLocationCode());
|
||||
inventoryAdjustmentRecord.setStorageLocationName(materialInventory.getStorageLocationName());
|
||||
inventoryAdjustmentRecord.setMaterialInventoryId(materialInventory.getMaterialInventoryId());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setShipperId(stockReceiptOrderDO.getShipperId());
|
||||
inventoryAdjustmentRecord.setShipperName(stockReceiptOrderDO.getShipperName());
|
||||
inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||
inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername());
|
||||
inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity);
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity);
|
||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user