出库不减o库存问题修改;

This commit is contained in:
王奎兴
2026-05-29 14:20:03 +08:00
parent 7c000fda35
commit ba6b38d8c6
4 changed files with 23 additions and 4 deletions
@@ -126,16 +126,25 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMat
Long materialBaseInfoId = materialInventoryOmsParamDO.getMaterialBaseInfoId();
Long warehouseId = materialInventoryOmsParamDO.getWarehouseId();
LambdaQueryWrapper<ReservationMaterialInventory> param = new LambdaQueryWrapper<ReservationMaterialInventory>()
.eq(ReservationMaterialInventory::getInOrderNumber, inOrderNumber)
// .eq(ReservationMaterialInventory::getInOrderNumber, inOrderNumber)
//.eq(ReservationMaterialInventory::getLotNumber, lotNumber)
//.eq(ReservationMaterialInventory::getBatchNumber, batchNumber)
.eq(ReservationMaterialInventory::getMaterialBaseInfoId, materialBaseInfoId)
.eq(ReservationMaterialInventory::getWarehouseId, warehouseId);
if(inOrderNumber != null && !inOrderNumber.isEmpty()) {
param.eq(ReservationMaterialInventory::getInOrderNumber, inOrderNumber);
} else {
param.isNull(ReservationMaterialInventory::getInOrderNumber);
}
if(lotNumber != null && !lotNumber.isEmpty()) {
// param.eq(ReservationMaterialInventory::getLotNumber, lotNumber);
param.eq(ReservationMaterialInventory::getLotNumber, lotNumber);
} else {
param.isNull(ReservationMaterialInventory::getLotNumber);
}
if (batchNumber != null && !batchNumber.isEmpty()) {
// param.eq(ReservationMaterialInventory::getBatchNumber, batchNumber);
param.eq(ReservationMaterialInventory::getBatchNumber, batchNumber);
} else {
param.isNull(ReservationMaterialInventory::getBatchNumber);
}
List<ReservationMaterialInventory> reservationMaterialInventories = materialInventoryMapper.selectList(param);
if (reservationMaterialInventories != null && reservationMaterialInventories.size() > 0) {
@@ -215,6 +215,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
reservationStockOutOrderDO.setSalesmanId(loginUser.getUserPo().getUserId().toString());
reservationStockOutOrderDO.setSalesmanName(loginUser.getUserPo().getUserName());
reservationStockOutOrderDO.setCreateTime(new Date());
reservationStockOutOrderDO.setDocumentDate(new Date());
reservationStockOutOrderDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationStockOutOrderDO.setCreateByName(loginUser.getUserPo().getUserName());
reservationStockOutOrderDO.setDelFlag(1);
@@ -347,6 +348,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
reservationStockInOrderDO.setDelFlag(1);
reservationStockInOrderDO.setDocumentCreator(loginUser.getUserPo().getUserId().toString());
reservationStockInOrderDO.setDocumentCreatorName(loginUser.getUserPo().getUserName());
reservationStockInOrderDO.setDocumentDate(new Date());
reservationStockInOrderDO.setOrderTypeCode("pu_tong_ru_ku");
reservationStockInOrderDO.setOrderTypeName("普通入库");
reservationStockInOrderDO.setIssueStatus(0);
@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.ext_attr_1, b.ext_attr_2, b.ext_attr_3, b.ext_attr_4,
b.production_date, b.expiry_date, b.inventory_date,
b.batch_ref_no, b.sheet_ref_no, b.box_pallet_no,a.ADJUST_ACTION,a.RELATE_NO,
a.in_order_number,a.lot_number,b.batch_number
b.in_order_number,b.lot_number,b.batch_number
from reservation_inventory_adjustment_record a left join reservation_material_inventory b on a.material_inventory_id = b.material_inventory_id
where a.del_flag = 1
</sql>
@@ -401,6 +401,14 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
//保存物料明细信息
outMaterialDetailList.forEach(outMaterialDetail -> {
outMaterialDetail.setIsAllocated("1");
Long materialInventoryId = outMaterialDetail.getMaterialInventoryId();
if (materialInventoryId != null) {
MaterialInventory materialInventory = materialInventoryMapper.selectById(materialInventoryId);
outMaterialDetail.setBatchNumber(materialInventory.getBatchNumber());
outMaterialDetail.setExpiryDate(materialInventory.getExpiryDate());
outMaterialDetail.setProductionDate(materialInventory.getProductionDate());
outMaterialDetail.setLotNo(materialInventory.getLotNumber());
}
});
saveOrUpdateBatch(outMaterialDetailList);