创建批次时插入一条记录

This commit is contained in:
2025-10-05 18:28:16 +08:00
parent 9c35372720
commit 2aa0f09079
9 changed files with 145 additions and 26 deletions

View File

@@ -45,7 +45,9 @@ func (c *PigBatchController) CreatePigBatch(ctx *gin.Context) {
return
}
respDTO, err := c.service.CreatePigBatch(&req)
userID, err := controller.GetOperatorIDFromContext(ctx)
respDTO, err := c.service.CreatePigBatch(userID, &req)
if err != nil {
c.logger.Errorf("%s: 业务逻辑失败: %v", action, err)
controller.SendErrorWithAudit(ctx, controller.CodeInternalError, "创建猪批次失败", action, "业务逻辑失败", req)