From 84c22e342cfae6e2e49257620231980b9d81fa39 Mon Sep 17 00:00:00 2001 From: huang <1724659546@qq.com> Date: Mon, 6 Oct 2025 21:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=97=85=E7=8C=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/domain/pig/pig_batch.go | 10 +++++++ .../domain/pig/pig_batch_service_pig_sick.go | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 internal/domain/pig/pig_batch_service_pig_sick.go diff --git a/internal/domain/pig/pig_batch.go b/internal/domain/pig/pig_batch.go index 4576d7e..7d14efd 100644 --- a/internal/domain/pig/pig_batch.go +++ b/internal/domain/pig/pig_batch.go @@ -67,6 +67,16 @@ type PigBatchService interface { // ---调栏子服务 --- TransferPigsAcrossBatches(sourceBatchID uint, destBatchID uint, fromPenID uint, toPenID uint, quantity uint, operatorID uint, remarks string) error TransferPigsWithinBatch(batchID uint, fromPenID uint, toPenID uint, quantity uint, operatorID uint, remarks string) error + + // --- 病猪管理相关方法 --- + // RecordSickPigs 记录新增病猪事件。 + RecordSickPigs(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, diagnosis string, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error + // RecordSickPigRecovery 记录病猪康复事件。 + RecordSickPigRecovery(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error + // RecordSickPigDeath 记录病猪死亡事件。 + RecordSickPigDeath(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error + // RecordSickPigCull 记录病猪淘汰事件。 + RecordSickPigCull(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error } // pigBatchService 是 PigBatchService 接口的具体实现。 diff --git a/internal/domain/pig/pig_batch_service_pig_sick.go b/internal/domain/pig/pig_batch_service_pig_sick.go new file mode 100644 index 0000000..f088a06 --- /dev/null +++ b/internal/domain/pig/pig_batch_service_pig_sick.go @@ -0,0 +1,27 @@ +package pig + +import ( + "time" + + "git.huangwc.com/pig/pig-farm-controller/internal/infra/models" +) + +// RecordSickPigs 记录新增病猪事件。 +func (s *pigBatchService) RecordSickPigs(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, diagnosis string, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error { + panic("implement me") +} + +// RecordSickPigRecovery 记录病猪康复事件。 +func (s *pigBatchService) RecordSickPigRecovery(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error { + panic("implement me") +} + +// RecordSickPigDeath 记录病猪死亡事件。 +func (s *pigBatchService) RecordSickPigDeath(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error { + panic("implement me") +} + +// RecordSickPigCull 记录病猪淘汰事件。 +func (s *pigBatchService) RecordSickPigCull(operatorID uint, batchID uint, penID uint, pigIDs string, quantity int, treatmentLocation models.PigBatchSickPigTreatmentLocation, happenedAt time.Time, remarks string) error { + panic("implement me") +}