From 4aa17acbb43449389f248732c77d9e9752e240a8 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 12 三月 2024 19:35:32 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/silk/silkServer

---
 models/raw_silk_rank_standard.go          |   16 +
 controllers/request/system_set.go         |   26 ++
 controllers/response/raw_silk_standard.go |    1 
 docs/swagger.yaml                         |  147 ++++++++++++
 docs/docs.go                              |  219 ++++++++++++++++++
 docs/swagger.json                         |  219 ++++++++++++++++++
 controllers/raw_silk_standard.go          |   61 +++++
 router/router.go                          |    3 
 8 files changed, 688 insertions(+), 4 deletions(-)

diff --git a/controllers/raw_silk_standard.go b/controllers/raw_silk_standard.go
index 823619c..7659034 100644
--- a/controllers/raw_silk_standard.go
+++ b/controllers/raw_silk_standard.go
@@ -2,11 +2,13 @@
 
 import (
 	"github.com/gin-gonic/gin"
+	"gorm.io/gorm"
 	"silkserver/controllers/request"
 	"silkserver/controllers/response"
 	"silkserver/extend/code"
 	"silkserver/extend/util"
 	"silkserver/models"
+	"silkserver/pkg/snowflake"
 	"strconv"
 )
 
@@ -108,6 +110,7 @@
 		var dr response.DynamicsRank
 		dr.RankName = standard.RankName
 		dr.RankValue = standard.RankValue
+		dr.RankProp = standard.RankProp
 		rankStandard, ok := m[standard.LineId]
 		if !ok {
 			rankStandard.LineId = standard.LineId
@@ -127,3 +130,61 @@
 	}
 	util.ResponseFormat(c, code.Success, data)
 }
+
+// SaveRankStandard
+//
+//	@Tags		绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯
+//	@Summary	淇濆瓨鐢熶笣瀹氱骇鏍囧噯
+//	@Produce	application/json
+//	@Param		object	body		request.SaveRankStandard	true	"鍙傛暟"
+//	@Success	200		{object}	util.Response		"鎴愬姛"
+//	@Router		/api-jl/v1/system/saveRankStandard [post]
+func (slf RawSilkStandardController) SaveRankStandard(c *gin.Context) {
+	var rankStandard request.SaveRankStandard
+	err := c.BindJSON(&rankStandard)
+	if err != nil {
+		util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屾暟鎹被鍨嬮敊璇�")
+		return
+	}
+	batch := make([]*models.RawSilkRankStandard, 0)
+	for _, standard := range rankStandard.RankStandard {
+		var rank models.RawSilkRankStandard
+		if standard.LineId == "" {
+			rank.LineId = snowflake.GenerateIdStr()
+		} else {
+			rank.LineId = standard.LineId
+		}
+		rank.CheckItem = standard.CheckItem
+		rank.StartFineness = standard.StartFineness
+		rank.EndFineness = standard.EndFineness
+		rank.RankA = standard.RankA
+		rank.RankB = standard.RankB
+		rank.RankC = standard.RankC
+		for _, dynamicsRank := range standard.DynamicsRanks {
+			rs := rank
+			rs.RankProp = dynamicsRank.RankProp
+			rs.RankName = dynamicsRank.RankName
+			rs.RankValue = dynamicsRank.RankValue
+			batch = append(batch, &rs)
+		}
+	}
+
+	err = models.WithTransaction(func(db *gorm.DB) error {
+		err = models.NewRawSilkRankStandardSearch().SetOrm(db).DeleteAll()
+		if err != nil {
+			return err
+		}
+		if len(batch) > 0 {
+			err = models.NewRawSilkRankStandardSearch().SetOrm(db).CreateBatch(batch)
+			if err != nil {
+				return err
+			}
+		}
+		return nil
+	})
+	if err != nil {
+		util.ResponseFormat(c, code.SaveFail, "淇濆瓨澶辫触")
+		return
+	}
+	util.ResponseFormat(c, code.Success, "淇濆瓨鎴愬姛")
+}
diff --git a/controllers/request/system_set.go b/controllers/request/system_set.go
index c87cd33..c7cb7d3 100644
--- a/controllers/request/system_set.go
+++ b/controllers/request/system_set.go
@@ -1,6 +1,9 @@
 package request
 
-import "silkserver/constvar"
+import (
+	"github.com/shopspring/decimal"
+	"silkserver/constvar"
+)
 
 type GetDictList struct {
 	PageInfo
@@ -25,6 +28,27 @@
 	KeyWord string `json:"keyWord"`
 }
 
+type SaveRankStandard struct {
+	RankStandard []RankStandard `json:"rankStandard"`
+}
+
+type RankStandard struct {
+	LineId        string             `json:"lineId"`        //琛宨d
+	CheckItem     constvar.CheckItem `json:"checkItem"`     //妫�鏌ラ」鐩悕绉�
+	StartFineness decimal.Decimal    `json:"startFineness"` //寮�濮嬬氦搴�
+	EndFineness   decimal.Decimal    `json:"endFineness"`   //缁撴潫绾ゅ害
+	RankA         decimal.Decimal    `json:"rankA"`         //閲庣氦
+	RankB         decimal.Decimal    `json:"rankB"`         //澶ч噹
+	RankC         decimal.Decimal    `json:"rankC"`         //鐗归噹
+	DynamicsRanks []DynamicsRank     `json:"dynamicsRanks"`
+}
+
+type DynamicsRank struct {
+	RankProp  string          `json:"rankProp"`  //鍓嶇紑key
+	RankName  string          `json:"rankName"`  //绛夌骇鍚嶇О
+	RankValue decimal.Decimal `json:"rankValue"` //绛夌骇鍊�
+}
+
 // ---------------------------------------杞﹂棿---------------------------------
 type GetWorkshopManage struct {
 	PageInfo
diff --git a/controllers/response/raw_silk_standard.go b/controllers/response/raw_silk_standard.go
index b9bb7db..4c6890e 100644
--- a/controllers/response/raw_silk_standard.go
+++ b/controllers/response/raw_silk_standard.go
@@ -17,6 +17,7 @@
 }
 
 type DynamicsRank struct {
+	RankProp  string          `json:"rankProp"`  //鍓嶇紑key
 	RankName  string          `json:"rankName"`  //绛夌骇鍚嶇О
 	RankValue decimal.Decimal `json:"rankValue"` //绛夌骇鍊�
 }
diff --git a/docs/docs.go b/docs/docs.go
index 9dd3fd8..0b5baf6 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -423,6 +423,40 @@
                 }
             }
         },
+        "/api-jl/v1/system/getRankStandard": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯"
+                ],
+                "summary": "鑾峰彇鐢熶笣瀹氱骇鏍囧噯",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/util.ResponseList"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "type": "array",
+                                            "items": {
+                                                "$ref": "#/definitions/response.RankStandard"
+                                            }
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
         "/api-jl/v1/system/getWorkshopManageList": {
             "get": {
                 "produces": [
@@ -506,6 +540,36 @@
                 }
             }
         },
+        "/api-jl/v1/system/saveRankStandard": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯"
+                ],
+                "summary": "淇濆瓨鐢熶笣瀹氱骇鏍囧噯",
+                "parameters": [
+                    {
+                        "description": "鍙傛暟",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/request.SaveRankStandard"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/api-jl/v1/system/saveWorkshopManage": {
             "post": {
                 "produces": [
@@ -554,6 +618,30 @@
                 "LeftHalfCar",
                 "RightHalfCar",
                 "AllCar"
+            ]
+        },
+        "constvar.CheckItem": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3,
+                4,
+                5
+            ],
+            "x-enum-comments": {
+                "CheckItemCleanliness": "娓呮磥鍒�",
+                "CheckItemDeviation": "绾ゅ害鍋忓樊",
+                "CheckItemMaxDeviation": "鏈�澶у亸宸�",
+                "CheckItemPurity": "娲佸噣鍒�",
+                "CheckItemTwiceChange": "浜屾鍙樺寲"
+            },
+            "x-enum-varnames": [
+                "CheckItemDeviation",
+                "CheckItemTwiceChange",
+                "CheckItemCleanliness",
+                "CheckItemPurity",
+                "CheckItemMaxDeviation"
             ]
         },
         "constvar.DictType": {
@@ -871,6 +959,23 @@
                 }
             }
         },
+        "request.DynamicsRank": {
+            "type": "object",
+            "properties": {
+                "rankName": {
+                    "description": "绛夌骇鍚嶇О",
+                    "type": "string"
+                },
+                "rankProp": {
+                    "description": "鍓嶇紑key",
+                    "type": "string"
+                },
+                "rankValue": {
+                    "description": "绛夌骇鍊�",
+                    "type": "number"
+                }
+            }
+        },
         "request.FinenessItem": {
             "type": "object",
             "properties": {
@@ -889,6 +994,60 @@
                 "sum": {
                     "description": "鍚堣",
                     "type": "number"
+                }
+            }
+        },
+        "request.RankStandard": {
+            "type": "object",
+            "properties": {
+                "checkItem": {
+                    "description": "妫�鏌ラ」鐩悕绉�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.CheckItem"
+                        }
+                    ]
+                },
+                "dynamicsRanks": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/request.DynamicsRank"
+                    }
+                },
+                "endFineness": {
+                    "description": "缁撴潫绾ゅ害",
+                    "type": "number"
+                },
+                "lineId": {
+                    "description": "琛宨d",
+                    "type": "string"
+                },
+                "rankA": {
+                    "description": "閲庣氦",
+                    "type": "number"
+                },
+                "rankB": {
+                    "description": "澶ч噹",
+                    "type": "number"
+                },
+                "rankC": {
+                    "description": "鐗归噹",
+                    "type": "number"
+                },
+                "startFineness": {
+                    "description": "寮�濮嬬氦搴�",
+                    "type": "number"
+                }
+            }
+        },
+        "request.SaveRankStandard": {
+            "type": "object",
+            "properties": {
+                "rankStandard": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/request.RankStandard"
+                    }
                 }
             }
         },
@@ -920,6 +1079,66 @@
                 }
             }
         },
+        "response.DynamicsRank": {
+            "type": "object",
+            "properties": {
+                "rankName": {
+                    "description": "绛夌骇鍚嶇О",
+                    "type": "string"
+                },
+                "rankProp": {
+                    "description": "鍓嶇紑key",
+                    "type": "string"
+                },
+                "rankValue": {
+                    "description": "绛夌骇鍊�",
+                    "type": "number"
+                }
+            }
+        },
+        "response.RankStandard": {
+            "type": "object",
+            "properties": {
+                "checkItem": {
+                    "description": "妫�鏌ラ」鐩悕绉�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.CheckItem"
+                        }
+                    ]
+                },
+                "dynamicsRanks": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/response.DynamicsRank"
+                    }
+                },
+                "endFineness": {
+                    "description": "缁撴潫绾ゅ害",
+                    "type": "number"
+                },
+                "lineId": {
+                    "description": "琛宨d",
+                    "type": "string"
+                },
+                "rankA": {
+                    "description": "閲庣氦",
+                    "type": "number"
+                },
+                "rankB": {
+                    "description": "澶ч噹",
+                    "type": "number"
+                },
+                "rankC": {
+                    "description": "鐗归噹",
+                    "type": "number"
+                },
+                "startFineness": {
+                    "description": "寮�濮嬬氦搴�",
+                    "type": "number"
+                }
+            }
+        },
         "util.Response": {
             "type": "object",
             "properties": {
diff --git a/docs/swagger.json b/docs/swagger.json
index 51c491c..57c171c 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -411,6 +411,40 @@
                 }
             }
         },
+        "/api-jl/v1/system/getRankStandard": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯"
+                ],
+                "summary": "鑾峰彇鐢熶笣瀹氱骇鏍囧噯",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/util.ResponseList"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "type": "array",
+                                            "items": {
+                                                "$ref": "#/definitions/response.RankStandard"
+                                            }
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
         "/api-jl/v1/system/getWorkshopManageList": {
             "get": {
                 "produces": [
@@ -494,6 +528,36 @@
                 }
             }
         },
+        "/api-jl/v1/system/saveRankStandard": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯"
+                ],
+                "summary": "淇濆瓨鐢熶笣瀹氱骇鏍囧噯",
+                "parameters": [
+                    {
+                        "description": "鍙傛暟",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/request.SaveRankStandard"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/api-jl/v1/system/saveWorkshopManage": {
             "post": {
                 "produces": [
@@ -542,6 +606,30 @@
                 "LeftHalfCar",
                 "RightHalfCar",
                 "AllCar"
+            ]
+        },
+        "constvar.CheckItem": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3,
+                4,
+                5
+            ],
+            "x-enum-comments": {
+                "CheckItemCleanliness": "娓呮磥鍒�",
+                "CheckItemDeviation": "绾ゅ害鍋忓樊",
+                "CheckItemMaxDeviation": "鏈�澶у亸宸�",
+                "CheckItemPurity": "娲佸噣鍒�",
+                "CheckItemTwiceChange": "浜屾鍙樺寲"
+            },
+            "x-enum-varnames": [
+                "CheckItemDeviation",
+                "CheckItemTwiceChange",
+                "CheckItemCleanliness",
+                "CheckItemPurity",
+                "CheckItemMaxDeviation"
             ]
         },
         "constvar.DictType": {
@@ -859,6 +947,23 @@
                 }
             }
         },
+        "request.DynamicsRank": {
+            "type": "object",
+            "properties": {
+                "rankName": {
+                    "description": "绛夌骇鍚嶇О",
+                    "type": "string"
+                },
+                "rankProp": {
+                    "description": "鍓嶇紑key",
+                    "type": "string"
+                },
+                "rankValue": {
+                    "description": "绛夌骇鍊�",
+                    "type": "number"
+                }
+            }
+        },
         "request.FinenessItem": {
             "type": "object",
             "properties": {
@@ -877,6 +982,60 @@
                 "sum": {
                     "description": "鍚堣",
                     "type": "number"
+                }
+            }
+        },
+        "request.RankStandard": {
+            "type": "object",
+            "properties": {
+                "checkItem": {
+                    "description": "妫�鏌ラ」鐩悕绉�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.CheckItem"
+                        }
+                    ]
+                },
+                "dynamicsRanks": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/request.DynamicsRank"
+                    }
+                },
+                "endFineness": {
+                    "description": "缁撴潫绾ゅ害",
+                    "type": "number"
+                },
+                "lineId": {
+                    "description": "琛宨d",
+                    "type": "string"
+                },
+                "rankA": {
+                    "description": "閲庣氦",
+                    "type": "number"
+                },
+                "rankB": {
+                    "description": "澶ч噹",
+                    "type": "number"
+                },
+                "rankC": {
+                    "description": "鐗归噹",
+                    "type": "number"
+                },
+                "startFineness": {
+                    "description": "寮�濮嬬氦搴�",
+                    "type": "number"
+                }
+            }
+        },
+        "request.SaveRankStandard": {
+            "type": "object",
+            "properties": {
+                "rankStandard": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/request.RankStandard"
+                    }
                 }
             }
         },
@@ -908,6 +1067,66 @@
                 }
             }
         },
+        "response.DynamicsRank": {
+            "type": "object",
+            "properties": {
+                "rankName": {
+                    "description": "绛夌骇鍚嶇О",
+                    "type": "string"
+                },
+                "rankProp": {
+                    "description": "鍓嶇紑key",
+                    "type": "string"
+                },
+                "rankValue": {
+                    "description": "绛夌骇鍊�",
+                    "type": "number"
+                }
+            }
+        },
+        "response.RankStandard": {
+            "type": "object",
+            "properties": {
+                "checkItem": {
+                    "description": "妫�鏌ラ」鐩悕绉�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.CheckItem"
+                        }
+                    ]
+                },
+                "dynamicsRanks": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/response.DynamicsRank"
+                    }
+                },
+                "endFineness": {
+                    "description": "缁撴潫绾ゅ害",
+                    "type": "number"
+                },
+                "lineId": {
+                    "description": "琛宨d",
+                    "type": "string"
+                },
+                "rankA": {
+                    "description": "閲庣氦",
+                    "type": "number"
+                },
+                "rankB": {
+                    "description": "澶ч噹",
+                    "type": "number"
+                },
+                "rankC": {
+                    "description": "鐗归噹",
+                    "type": "number"
+                },
+                "startFineness": {
+                    "description": "寮�濮嬬氦搴�",
+                    "type": "number"
+                }
+            }
+        },
         "util.Response": {
             "type": "object",
             "properties": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 2370fa4..732df48 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -13,6 +13,26 @@
     - LeftHalfCar
     - RightHalfCar
     - AllCar
+  constvar.CheckItem:
+    enum:
+    - 1
+    - 2
+    - 3
+    - 4
+    - 5
+    type: integer
+    x-enum-comments:
+      CheckItemCleanliness: 娓呮磥鍒�
+      CheckItemDeviation: 绾ゅ害鍋忓樊
+      CheckItemMaxDeviation: 鏈�澶у亸宸�
+      CheckItemPurity: 娲佸噣鍒�
+      CheckItemTwiceChange: 浜屾鍙樺寲
+    x-enum-varnames:
+    - CheckItemDeviation
+    - CheckItemTwiceChange
+    - CheckItemCleanliness
+    - CheckItemPurity
+    - CheckItemMaxDeviation
   constvar.DictType:
     enum:
     - 0
@@ -231,6 +251,18 @@
         description: 杞︾粍
         type: string
     type: object
+  request.DynamicsRank:
+    properties:
+      rankName:
+        description: 绛夌骇鍚嶇О
+        type: string
+      rankProp:
+        description: 鍓嶇紑key
+        type: string
+      rankValue:
+        description: 绛夌骇鍊�
+        type: number
+    type: object
   request.FinenessItem:
     properties:
       fineness:
@@ -245,6 +277,42 @@
       sum:
         description: 鍚堣
         type: number
+    type: object
+  request.RankStandard:
+    properties:
+      checkItem:
+        allOf:
+        - $ref: '#/definitions/constvar.CheckItem'
+        description: 妫�鏌ラ」鐩悕绉�
+      dynamicsRanks:
+        items:
+          $ref: '#/definitions/request.DynamicsRank'
+        type: array
+      endFineness:
+        description: 缁撴潫绾ゅ害
+        type: number
+      lineId:
+        description: 琛宨d
+        type: string
+      rankA:
+        description: 閲庣氦
+        type: number
+      rankB:
+        description: 澶ч噹
+        type: number
+      rankC:
+        description: 鐗归噹
+        type: number
+      startFineness:
+        description: 寮�濮嬬氦搴�
+        type: number
+    type: object
+  request.SaveRankStandard:
+    properties:
+      rankStandard:
+        items:
+          $ref: '#/definitions/request.RankStandard'
+        type: array
     type: object
   request.UpdateDict:
     properties:
@@ -263,6 +331,47 @@
       remark:
         description: 澶囨敞
         type: string
+    type: object
+  response.DynamicsRank:
+    properties:
+      rankName:
+        description: 绛夌骇鍚嶇О
+        type: string
+      rankProp:
+        description: 鍓嶇紑key
+        type: string
+      rankValue:
+        description: 绛夌骇鍊�
+        type: number
+    type: object
+  response.RankStandard:
+    properties:
+      checkItem:
+        allOf:
+        - $ref: '#/definitions/constvar.CheckItem'
+        description: 妫�鏌ラ」鐩悕绉�
+      dynamicsRanks:
+        items:
+          $ref: '#/definitions/response.DynamicsRank'
+        type: array
+      endFineness:
+        description: 缁撴潫绾ゅ害
+        type: number
+      lineId:
+        description: 琛宨d
+        type: string
+      rankA:
+        description: 閲庣氦
+        type: number
+      rankB:
+        description: 澶ч噹
+        type: number
+      rankC:
+        description: 鐗归噹
+        type: number
+      startFineness:
+        description: 寮�濮嬬氦搴�
+        type: number
     type: object
   util.Response:
     properties:
@@ -542,6 +651,25 @@
       summary: 鑾峰彇鐢熶笣瀹氫环鏍囧噯
       tags:
       - 绯荤粺璁剧疆/鐢熶笣瀹氫环鏍囧噯
+  /api-jl/v1/system/getRankStandard:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 鎴愬姛
+          schema:
+            allOf:
+            - $ref: '#/definitions/util.ResponseList'
+            - properties:
+                data:
+                  items:
+                    $ref: '#/definitions/response.RankStandard'
+                  type: array
+              type: object
+      summary: 鑾峰彇鐢熶笣瀹氱骇鏍囧噯
+      tags:
+      - 绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯
   /api-jl/v1/system/getWorkshopManageList:
     get:
       parameters:
@@ -592,6 +720,25 @@
       summary: 淇濆瓨鐢熶笣瀹氫环鏍囧噯
       tags:
       - 绯荤粺璁剧疆/鐢熶笣瀹氫环鏍囧噯
+  /api-jl/v1/system/saveRankStandard:
+    post:
+      parameters:
+      - description: 鍙傛暟
+        in: body
+        name: object
+        required: true
+        schema:
+          $ref: '#/definitions/request.SaveRankStandard'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 鎴愬姛
+          schema:
+            $ref: '#/definitions/util.Response'
+      summary: 淇濆瓨鐢熶笣瀹氱骇鏍囧噯
+      tags:
+      - 绯荤粺璁剧疆/鐢熶笣瀹氱骇鏍囧噯
   /api-jl/v1/system/saveWorkshopManage:
     post:
       parameters:
diff --git a/models/raw_silk_rank_standard.go b/models/raw_silk_rank_standard.go
index fdc2770..4ecf2e3 100644
--- a/models/raw_silk_rank_standard.go
+++ b/models/raw_silk_rank_standard.go
@@ -19,6 +19,7 @@
 		RankA         decimal.Decimal    `json:"rankA" gorm:"type:decimal(20,4);comment:閲庣氦"`
 		RankB         decimal.Decimal    `json:"rankB" gorm:"type:decimal(20,4);comment:澶ч噹"`
 		RankC         decimal.Decimal    `json:"rankC" gorm:"type:decimal(20,4);comment:鐗归噹"`
+		RankProp      string             `json:"rankProp" gorm:"type:varchar(255);comment:鍓嶇紑key"`
 		RankName      string             `json:"rankName" gorm:"type:varchar(255);comment:绛夌骇鍚嶇О"`
 		RankValue     decimal.Decimal    `json:"rankValue" gorm:"type:decimal(20,4);comment:绛夌骇鍊�"`
 	}
@@ -68,6 +69,17 @@
 	return nil
 }
 
+// CreateBatch 鎵归噺鎻掑叆
+func (slf *RawSilkRankStandardSearch) CreateBatch(records []*RawSilkRankStandard) error {
+	var db = slf.build()
+
+	if err := db.Create(&records).Error; err != nil {
+		return fmt.Errorf("create batch err: %v, records: %+v", err, records)
+	}
+
+	return nil
+}
+
 func (slf *RawSilkRankStandardSearch) FindNotTotal() ([]*RawSilkRankStandard, error) {
 	var (
 		records = make([]*RawSilkRankStandard, 0)
@@ -91,10 +103,10 @@
 	return nil
 }
 
-func (slf *RawSilkRankStandardSearch) Delete() error {
+func (slf *RawSilkRankStandardSearch) DeleteAll() error {
 	var db = slf.build()
 
-	if err := db.Unscoped().Delete(&RawSilkRankStandard{}).Error; err != nil {
+	if err := db.Where("1=1").Delete(&RawSilkRankStandard{}).Error; err != nil {
 		return err
 	}
 
diff --git a/router/router.go b/router/router.go
index 3201fc2..8e8214f 100644
--- a/router/router.go
+++ b/router/router.go
@@ -39,7 +39,8 @@
 		systemApi.POST("savePriceStandard", rawSilkController.SavePriceStandard)           //淇濆瓨鐢熶笣瀹氫环鏍囧噯
 		systemApi.DELETE("deletePriceStandard/:id", rawSilkController.DeletePriceStandard) //鍒犻櫎鐢熶笣瀹氫环鏍囧噯
 		//鐢熶笣瀹氫环
-		systemApi.GET("getRankStandard", rawSilkController.GetRankStandard)
+		systemApi.GET("getRankStandard", rawSilkController.GetRankStandard)    //鑾峰彇鐢熶笣瀹氱骇鏍囧噯
+		systemApi.POST("saveRankStandard", rawSilkController.SaveRankStandard) //淇濆瓨鐢熶笣瀹氱骇鏍囧噯
 		//杞﹂棿绠$悊
 		systemApi.GET("getWorkshopManageList", workshopController.GetWorkshopManageList)      //鑾峰彇杞﹂棿绠$悊鍒楄〃
 		systemApi.POST("saveWorkshopManage", workshopController.SaveWorkshopManage)           //淇濆瓨杞﹂棿绠$悊

--
Gitblit v1.8.0