买卖猪要调整猪栏存量

This commit is contained in:
2025-10-06 16:19:48 +08:00
parent 648a790cec
commit 3b109d1547
5 changed files with 153 additions and 38 deletions

View File

@@ -51,9 +51,9 @@ type PigBatchService interface {
GetCurrentPigQuantity(batchID uint) (int, error)
// SellPigs 处理卖猪的业务逻辑。
SellPigs(batchID uint, quantity int, unitPrice float64, tatalPrice float64, traderName string, tradeDate time.Time, remarks string, operatorID uint) error
SellPigs(batchID uint, penID uint, quantity int, unitPrice float64, tatalPrice float64, traderName string, tradeDate time.Time, remarks string, operatorID uint) error
// BuyPigs 处理买猪的业务逻辑。
BuyPigs(batchID uint, quantity int, unitPrice float64, tatalPrice float64, traderName string, tradeDate time.Time, remarks string, operatorID uint) error
BuyPigs(batchID uint, penID uint, quantity int, unitPrice float64, tatalPrice float64, traderName string, tradeDate time.Time, remarks string, operatorID uint) error
UpdatePigBatchQuantity(operatorID uint, batchID uint, changeType models.LogChangeType, changeAmount int, changeReason string, happenedAt time.Time) error
}