修正数据错误

This commit is contained in:
2025-11-27 16:27:49 +08:00
parent e2da441a6d
commit b8e0301175
2 changed files with 83 additions and 83 deletions

View File

@@ -180,7 +180,7 @@ func (r *recipeGenerateManagerImpl) GenerateRecipe(ctx context.Context, pigType
}
maxAdditionConstraints = append(maxAdditionConstraints, maxAdditionConstraintInfo{
materialColIndex: materialColIndex,
limit: float64(mat.MaxAdditionRatio),
limit: float64(mat.MaxAdditionRatio) / 100.0,
})
}
}
@@ -318,7 +318,7 @@ func (r *recipeGenerateManagerImpl) GenerateRecipe(ctx context.Context, pigType
recipe.RecipeIngredients = append(recipe.RecipeIngredients, models.RecipeIngredient{
RawMaterialID: materialIDs[i],
// 比例: float64 -> float32
Percentage: float32(proportion),
Percentage: float32(proportion * 100.0),
})
}