package cn.iocoder.yudao.module.mes.service.wm.stockreserve;
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stockreserve.MesWmStockReserveDO;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
/**
|
* MES 库存占用 Service 接口
|
*/
|
public interface MesWmStockReserveService {
|
|
/**
|
* 创建库存占用
|
*
|
* @param materialStockId 库存记录ID
|
* @param bizType 业务类型
|
* @param bizId 业务单据ID
|
* @param bizCode 业务单号
|
* @param bizLineId 业务单据行ID
|
* @param itemId 物料ID
|
* @param quantity 占用数量
|
*/
|
void createReserve(Long materialStockId, Integer bizType, Long bizId, String bizCode, Long bizLineId, Long itemId, BigDecimal quantity);
|
|
/**
|
* 批量创建库存占用
|
*
|
* @param reserves 占用信息列表
|
*/
|
void createReserveBatch(List<ReserveInfo> reserves);
|
|
/**
|
* 释放库存占用(取消单据时)
|
*
|
* @param bizType 业务类型
|
* @param bizId 业务单据ID
|
*/
|
void releaseReserve(Integer bizType, Long bizId);
|
|
/**
|
* 确认占用转出库(执行出库时)
|
* 更新占用记录状态为已出库,并扣减库存占用量字段
|
*
|
* @param bizType 业务类型
|
* @param bizId 业务单据ID
|
*/
|
void confirmReserveToOutbound(Integer bizType, Long bizId);
|
|
/**
|
* 查询指定业务单据的占用记录
|
*
|
* @param bizType 业务类型
|
* @param bizId 业务单据ID
|
* @return 占用记录列表
|
*/
|
List<MesWmStockReserveDO> getReserveListByBiz(Integer bizType, Long bizId);
|
|
/**
|
* 查询指定物料的占用数量汇总
|
*
|
* @param itemId 物料ID
|
* @param warehouseId 仓库ID(可选)
|
* @return 占用数量
|
*/
|
BigDecimal sumReservedQuantity(Long itemId, Long warehouseId);
|
|
/**
|
* 占用信息
|
*/
|
record ReserveInfo(Long materialStockId, Integer bizType, Long bizId, String bizCode, Long bizLineId, Long itemId, BigDecimal quantity) {}
|
|
}
|