Merge branch 'master' of http://192.168.5.5:10010/r/silk/silkServer
| | |
| | | |
| | | 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" |
| | | ) |
| | | |
| | |
| | | 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 |
| | |
| | | } |
| | | 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, "参数解析失败,数据类型错误") |
| | | 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, "保存成功") |
| | | } |
| | |
| | | package request |
| | | |
| | | import "silkserver/constvar" |
| | | import ( |
| | | "github.com/shopspring/decimal" |
| | | "silkserver/constvar" |
| | | ) |
| | | |
| | | type GetDictList struct { |
| | | PageInfo |
| | |
| | | KeyWord string `json:"keyWord"` |
| | | } |
| | | |
| | | type SaveRankStandard struct { |
| | | RankStandard []RankStandard `json:"rankStandard"` |
| | | } |
| | | |
| | | type RankStandard struct { |
| | | LineId string `json:"lineId"` //行id |
| | | 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 |
| | |
| | | } |
| | | |
| | | type DynamicsRank struct { |
| | | RankProp string `json:"rankProp"` //前缀key |
| | | RankName string `json:"rankName"` //等级名称 |
| | | RankValue decimal.Decimal `json:"rankValue"` //等级值 |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | "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": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.DynamicsRank": { |
| | | "type": "object", |
| | | "properties": { |
| | | "rankName": { |
| | | "description": "等级名称", |
| | | "type": "string" |
| | | }, |
| | | "rankProp": { |
| | | "description": "前缀key", |
| | | "type": "string" |
| | | }, |
| | | "rankValue": { |
| | | "description": "等级值", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "request.FinenessItem": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "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": "行id", |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "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": "行id", |
| | | "type": "string" |
| | | }, |
| | | "rankA": { |
| | | "description": "野纤", |
| | | "type": "number" |
| | | }, |
| | | "rankB": { |
| | | "description": "大野", |
| | | "type": "number" |
| | | }, |
| | | "rankC": { |
| | | "description": "特野", |
| | | "type": "number" |
| | | }, |
| | | "startFineness": { |
| | | "description": "开始纤度", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "util.Response": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | "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": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.DynamicsRank": { |
| | | "type": "object", |
| | | "properties": { |
| | | "rankName": { |
| | | "description": "等级名称", |
| | | "type": "string" |
| | | }, |
| | | "rankProp": { |
| | | "description": "前缀key", |
| | | "type": "string" |
| | | }, |
| | | "rankValue": { |
| | | "description": "等级值", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "request.FinenessItem": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "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": "行id", |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "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": "行id", |
| | | "type": "string" |
| | | }, |
| | | "rankA": { |
| | | "description": "野纤", |
| | | "type": "number" |
| | | }, |
| | | "rankB": { |
| | | "description": "大野", |
| | | "type": "number" |
| | | }, |
| | | "rankC": { |
| | | "description": "特野", |
| | | "type": "number" |
| | | }, |
| | | "startFineness": { |
| | | "description": "开始纤度", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "util.Response": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | - 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 |
| | |
| | | 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: |
| | |
| | | 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: 行id |
| | | 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: |
| | |
| | | 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: 行id |
| | | type: string |
| | | rankA: |
| | | description: 野纤 |
| | | type: number |
| | | rankB: |
| | | description: 大野 |
| | | type: number |
| | | rankC: |
| | | description: 特野 |
| | | type: number |
| | | startFineness: |
| | | description: 开始纤度 |
| | | type: number |
| | | type: object |
| | | util.Response: |
| | | properties: |
| | |
| | | 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: |
| | |
| | | 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: |
| | |
| | | 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:等级值"` |
| | | } |
| | |
| | | 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) |
| | |
| | | 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 |
| | | } |
| | | |
| | |
| | | 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) //保存车间管理 |