实现使用系统中所有可用的原料一键生成配方

This commit is contained in:
2025-11-26 20:44:41 +08:00
parent ba60ed541c
commit 34311889e8
12 changed files with 301 additions and 30 deletions

View File

@@ -3145,6 +3145,52 @@ const docTemplate = `{
}
}
},
"/api/v1/feed/recipes/generate-from-all-materials/{pig_type_id}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据指定的猪类型ID使用系统中所有可用的原料自动计算并创建一个成本最优的配方。",
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "使用系统中所有可用的原料一键生成配方",
"parameters": [
{
"type": "integer",
"description": "猪类型ID",
"name": "pig_type_id",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"description": "业务码为201代表创建成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.GenerateRecipeResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/feed/recipes/{id}": {
"get": {
"security": [
@@ -3669,7 +3715,6 @@ const docTemplate = `{
},
{
"enum": [
7,
-1,
0,
1,
@@ -3679,12 +3724,12 @@ const docTemplate = `{
5,
-1,
5,
6
6,
7
],
"type": "integer",
"format": "int32",
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -3694,7 +3739,8 @@ const docTemplate = `{
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel"
"InvalidLevel",
"_numLevels"
],
"name": "level",
"in": "query"
@@ -7439,6 +7485,23 @@ const docTemplate = `{
}
}
},
"dto.GenerateRecipeResponse": {
"type": "object",
"properties": {
"description": {
"description": "新生成的配方描述",
"type": "string"
},
"id": {
"description": "新生成的配方ID",
"type": "integer"
},
"name": {
"description": "新生成的配方名称",
"type": "string"
}
}
},
"dto.HistoricalAlarmDTO": {
"type": "object",
"properties": {
@@ -10523,7 +10586,6 @@ const docTemplate = `{
"type": "integer",
"format": "int32",
"enum": [
7,
-1,
0,
1,
@@ -10533,10 +10595,10 @@ const docTemplate = `{
5,
-1,
5,
6
6,
7
],
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -10546,7 +10608,8 @@ const docTemplate = `{
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel"
"InvalidLevel",
"_numLevels"
]
}
},

View File

@@ -3137,6 +3137,52 @@
}
}
},
"/api/v1/feed/recipes/generate-from-all-materials/{pig_type_id}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据指定的猪类型ID使用系统中所有可用的原料自动计算并创建一个成本最优的配方。",
"produces": [
"application/json"
],
"tags": [
"饲料管理-配方"
],
"summary": "使用系统中所有可用的原料一键生成配方",
"parameters": [
{
"type": "integer",
"description": "猪类型ID",
"name": "pig_type_id",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"description": "业务码为201代表创建成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.GenerateRecipeResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/feed/recipes/{id}": {
"get": {
"security": [
@@ -3661,7 +3707,6 @@
},
{
"enum": [
7,
-1,
0,
1,
@@ -3671,12 +3716,12 @@
5,
-1,
5,
6
6,
7
],
"type": "integer",
"format": "int32",
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -3686,7 +3731,8 @@
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel"
"InvalidLevel",
"_numLevels"
],
"name": "level",
"in": "query"
@@ -7431,6 +7477,23 @@
}
}
},
"dto.GenerateRecipeResponse": {
"type": "object",
"properties": {
"description": {
"description": "新生成的配方描述",
"type": "string"
},
"id": {
"description": "新生成的配方ID",
"type": "integer"
},
"name": {
"description": "新生成的配方名称",
"type": "string"
}
}
},
"dto.HistoricalAlarmDTO": {
"type": "object",
"properties": {
@@ -10515,7 +10578,6 @@
"type": "integer",
"format": "int32",
"enum": [
7,
-1,
0,
1,
@@ -10525,10 +10587,10 @@
5,
-1,
5,
6
6,
7
],
"x-enum-varnames": [
"_numLevels",
"DebugLevel",
"InfoLevel",
"WarnLevel",
@@ -10538,7 +10600,8 @@
"FatalLevel",
"_minLevel",
"_maxLevel",
"InvalidLevel"
"InvalidLevel",
"_numLevels"
]
}
},

View File

@@ -565,6 +565,18 @@ definitions:
thresholds:
type: number
type: object
dto.GenerateRecipeResponse:
properties:
description:
description: 新生成的配方描述
type: string
id:
description: 新生成的配方ID
type: integer
name:
description: 新生成的配方名称
type: string
type: object
dto.HistoricalAlarmDTO:
properties:
alarm_code:
@@ -2719,7 +2731,6 @@ definitions:
- PlanTypeFilterSystem
zapcore.Level:
enum:
- 7
- -1
- 0
- 1
@@ -2730,10 +2741,10 @@ definitions:
- -1
- 5
- 6
- 7
format: int32
type: integer
x-enum-varnames:
- _numLevels
- DebugLevel
- InfoLevel
- WarnLevel
@@ -2744,6 +2755,7 @@ definitions:
- _minLevel
- _maxLevel
- InvalidLevel
- _numLevels
info:
contact:
email: divano@example.com
@@ -4722,6 +4734,32 @@ paths:
summary: 更新配方
tags:
- 饲料管理-配方
/api/v1/feed/recipes/generate-from-all-materials/{pig_type_id}:
post:
description: 根据指定的猪类型ID使用系统中所有可用的原料自动计算并创建一个成本最优的配方。
parameters:
- description: 猪类型ID
in: path
name: pig_type_id
required: true
type: integer
produces:
- application/json
responses:
"201":
description: 业务码为201代表创建成功
schema:
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/dto.GenerateRecipeResponse'
type: object
security:
- BearerAuth: []
summary: 使用系统中所有可用的原料一键生成配方
tags:
- 饲料管理-配方
/api/v1/inventory/stock/adjust:
post:
consumes:
@@ -4947,7 +4985,6 @@ paths:
name: end_time
type: string
- enum:
- 7
- -1
- 0
- 1
@@ -4958,12 +4995,12 @@ paths:
- -1
- 5
- 6
- 7
format: int32
in: query
name: level
type: integer
x-enum-varnames:
- _numLevels
- DebugLevel
- InfoLevel
- WarnLevel
@@ -4974,6 +5011,7 @@ paths:
- _minLevel
- _maxLevel
- InvalidLevel
- _numLevels
- enum:
- 邮件
- 企业微信