| | |
| | | OneYield decimal.Decimal `json:"oneYield"` //台产 |
| | | Reelingdiscount string `json:"reelingdiscount"` //缫折 |
| | | } |
| | | |
| | | type ChangeYieldRegister struct { |
| | | CreateTime string `json:"createTime"` //创建时间 |
| | | MarketId uint `json:"marketId"` //庄口id |
| | | WorkshopId uint `json:"workshopId"` //车间id |
| | | GroupNumber int `json:"groupNumber"` //组别 |
| | | Spec string `json:"spec"` //规格 |
| | | } |
| | |
| | | for ; i <= manage.EndCarNumber; i++ { |
| | | car = append(car, i) |
| | | } |
| | | carNum = append(carNum, car) |
| | | if len(car) > 0 { |
| | | carNum = append(carNum, car) |
| | | } |
| | | } |
| | | util.ResponseFormat(c, code.Success, carNum) |
| | | } |
| | |
| | | // @Produce application/json |
| | | // @Param number path string true "number" |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-jl/v1/system/deleteYieldRegister/{number} [delete] |
| | | // @Router /api-jl/v1/fineness/deleteYieldRegister/{number} [delete] |
| | | func (slf YieldRegisterController) DeleteYieldRegister(c *gin.Context) { |
| | | number := c.Param("number") |
| | | if number == "" { |
| | |
| | | } |
| | | util.ResponseFormat(c, code.Success, "删除成功") |
| | | } |
| | | |
| | | // ChangeYieldRegister |
| | | // |
| | | // @Tags 生产管理/产量登记表 |
| | | // @Summary 切换产量登记表 |
| | | // @Produce application/json |
| | | // @Param object body request.ChangeYieldRegister true "参数" |
| | | // @Success 200 {object} util.Response{data=models.YieldRegister} "成功" |
| | | // @Router /api-jl/v1/fineness/changeYieldRegister [post] |
| | | func (slf YieldRegisterController) ChangeYieldRegister(c *gin.Context) { |
| | | var params request.ChangeYieldRegister |
| | | err := c.BindJSON(¶ms) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | first, err := models.NewYieldRegisterSearch().SetGroupNumber(params.GroupNumber).SetCreateTime(params.CreateTime). |
| | | SetMarketId(params.MarketId).SetWorkshopId(params.WorkshopId).SetSpec(params.Spec).SetPreload(true).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查询失败") |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, first) |
| | | } |
| | |
| | | "host": "{{.Host}}", |
| | | "basePath": "{{.BasePath}}", |
| | | "paths": { |
| | | "/api-jl/v1/fineness/changeYieldRegister": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产管理/产量登记表" |
| | | ], |
| | | "summary": "切换产量登记表", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.ChangeYieldRegister" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/models.YieldRegister" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/fineness/check": { |
| | | "get": { |
| | | "produces": [ |
| | |
| | | "type": "string", |
| | | "description": "字典信息", |
| | | "name": "id", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/fineness/deleteYieldRegister/{number}": { |
| | | "delete": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产管理/产量登记表" |
| | | ], |
| | | "summary": "删除产量登记表记录", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "number", |
| | | "name": "number", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | |
| | | "type": "string", |
| | | "description": "id", |
| | | "name": "id", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/system/deleteYieldRegister/{number}": { |
| | | "delete": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产管理/产量登记表" |
| | | ], |
| | | "summary": "删除产量登记表记录", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "number", |
| | | "name": "number", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.ChangeYieldRegister": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createTime": { |
| | | "description": "创建时间", |
| | | "type": "string" |
| | | }, |
| | | "groupNumber": { |
| | | "description": "组别", |
| | | "type": "integer" |
| | | }, |
| | | "marketId": { |
| | | "description": "庄口id", |
| | | "type": "integer" |
| | | }, |
| | | "spec": { |
| | | "description": "规格", |
| | | "type": "string" |
| | | }, |
| | | "workshopId": { |
| | | "description": "车间id", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.DynamicsRank": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "contact": {} |
| | | }, |
| | | "paths": { |
| | | "/api-jl/v1/fineness/changeYieldRegister": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产管理/产量登记表" |
| | | ], |
| | | "summary": "切换产量登记表", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.ChangeYieldRegister" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/models.YieldRegister" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/fineness/check": { |
| | | "get": { |
| | | "produces": [ |
| | |
| | | "type": "string", |
| | | "description": "字典信息", |
| | | "name": "id", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/fineness/deleteYieldRegister/{number}": { |
| | | "delete": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产管理/产量登记表" |
| | | ], |
| | | "summary": "删除产量登记表记录", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "number", |
| | | "name": "number", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | |
| | | "type": "string", |
| | | "description": "id", |
| | | "name": "id", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/system/deleteYieldRegister/{number}": { |
| | | "delete": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产管理/产量登记表" |
| | | ], |
| | | "summary": "删除产量登记表记录", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "number", |
| | | "name": "number", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.ChangeYieldRegister": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createTime": { |
| | | "description": "创建时间", |
| | | "type": "string" |
| | | }, |
| | | "groupNumber": { |
| | | "description": "组别", |
| | | "type": "integer" |
| | | }, |
| | | "marketId": { |
| | | "description": "庄口id", |
| | | "type": "integer" |
| | | }, |
| | | "spec": { |
| | | "description": "规格", |
| | | "type": "string" |
| | | }, |
| | | "workshopId": { |
| | | "description": "车间id", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.DynamicsRank": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | description: 车组 |
| | | type: integer |
| | | type: object |
| | | request.ChangeYieldRegister: |
| | | properties: |
| | | createTime: |
| | | description: 创建时间 |
| | | type: string |
| | | groupNumber: |
| | | description: 组别 |
| | | type: integer |
| | | marketId: |
| | | description: 庄口id |
| | | type: integer |
| | | spec: |
| | | description: 规格 |
| | | type: string |
| | | workshopId: |
| | | description: 车间id |
| | | type: integer |
| | | type: object |
| | | request.DynamicsRank: |
| | | properties: |
| | | rankName: |
| | |
| | | info: |
| | | contact: {} |
| | | paths: |
| | | /api-jl/v1/fineness/changeYieldRegister: |
| | | post: |
| | | parameters: |
| | | - description: 参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.ChangeYieldRegister' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/models.YieldRegister' |
| | | type: object |
| | | summary: 切换产量登记表 |
| | | tags: |
| | | - 生产管理/产量登记表 |
| | | /api-jl/v1/fineness/check: |
| | | get: |
| | | parameters: |
| | |
| | | summary: 纤度检验详情 |
| | | tags: |
| | | - 纤度检验 |
| | | /api-jl/v1/fineness/deleteYieldRegister/{number}: |
| | | delete: |
| | | parameters: |
| | | - description: number |
| | | in: path |
| | | name: number |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 删除产量登记表记录 |
| | | tags: |
| | | - 生产管理/产量登记表 |
| | | /api-jl/v1/fineness/getYieldRegisterInfo: |
| | | post: |
| | | parameters: |
| | |
| | | summary: 删除车间管理 |
| | | tags: |
| | | - 系统设置/车间管理 |
| | | /api-jl/v1/system/deleteYieldRegister/{number}: |
| | | delete: |
| | | parameters: |
| | | - description: number |
| | | in: path |
| | | name: number |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 删除产量登记表记录 |
| | | tags: |
| | | - 生产管理/产量登记表 |
| | | /api-jl/v1/system/dict: |
| | | get: |
| | | parameters: |
| | |
| | | |
| | | return nil |
| | | } |
| | | |
| | | func (slf *WorkshopManageSearch) Count() (int64, error) { |
| | | var ( |
| | | total int64 |
| | | db = slf.build() |
| | | ) |
| | | |
| | | if err := db.Count(&total).Error; err != nil { |
| | | return total, fmt.Errorf("find count err: %v", err) |
| | | } |
| | | return total, nil |
| | | } |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *YieldRegisterSearch) SetCreateTime(createTime string) *YieldRegisterSearch { |
| | | slf.CreateTime = createTime |
| | | return slf |
| | | } |
| | | |
| | | func (slf *YieldRegisterSearch) SetMarketId(marketId uint) *YieldRegisterSearch { |
| | | slf.MarketId = marketId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *YieldRegisterSearch) SetWorkshopId(workshopId uint) *YieldRegisterSearch { |
| | | slf.WorkshopId = workshopId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *YieldRegisterSearch) SetGroupNumber(groupNumber int) *YieldRegisterSearch { |
| | | slf.GroupNumber = groupNumber |
| | | return slf |
| | | } |
| | | |
| | | func (slf *YieldRegisterSearch) SetSpec(spec string) *YieldRegisterSearch { |
| | | slf.Spec = spec |
| | | return slf |
| | | } |
| | | |
| | | func (slf *YieldRegisterSearch) build() *gorm.DB { |
| | | db := slf.Orm.Table(slf.TableName()) |
| | | |
| | |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if slf.CreateTime != "" { |
| | | db = db.Where("create_time = ?", slf.CreateTime) |
| | | } |
| | | |
| | | if slf.WorkshopId > 0 { |
| | | db = db.Where("workshop_id = ?", slf.WorkshopId) |
| | | } |
| | | |
| | | if slf.MarketId > 0 { |
| | | db = db.Where("market_id = ?", slf.MarketId) |
| | | } |
| | | |
| | | if slf.GroupNumber > 0 { |
| | | db = db.Where("group_number = ?", slf.GroupNumber) |
| | | } |
| | | |
| | | if slf.Spec != "" { |
| | | db = db.Where("spec = ?", slf.Spec) |
| | | } |
| | | return db |
| | | } |
| | | |
| | |
| | | finenessApi.POST("getYieldRegisterList", yieldController.GetYieldRegisterList) // 获取产量登记表 |
| | | finenessApi.POST("getYieldRegisterInfo", yieldController.GetYieldRegisterInfo) // 获取产量登记表详情 |
| | | finenessApi.DELETE("deleteYieldRegister/:number", yieldController.DeleteYieldRegister) // 删除产量登记表记录 |
| | | finenessApi.POST("changeYieldRegister", yieldController.ChangeYieldRegister) // 切换产量登记表 |
| | | } |
| | | |
| | | return r |