| | |
| | | } |
| | | util.ResponseFormat(c, code.Success, "删除成功") |
| | | } |
| | | |
| | | // ListOperation |
| | | // @Tags 产品 |
| | | // @Summary 产品历史出入库信息 |
| | | // @Produce application/json |
| | | // @Param object body request.QueryOperationList true "查询参数" |
| | | // @Success 200 {object} util.ResponseList{data=[]models.Operation} "成功" |
| | | // @Router /api-wms/v1/product/listOperaton [post] |
| | | func (slf ProductController) ListOperation(c *gin.Context) { |
| | | var params request.QueryOperationList |
| | | if err := c.BindJSON(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误:"+err.Error()) |
| | | return |
| | | } |
| | | if !params.PageInfo.Check() { |
| | | util.ResponseFormat(c, code.RequestParamError, "页码信息错误") |
| | | return |
| | | } |
| | | |
| | | search := models.NewOperationSearch().SetPage(params.Page, params.PageSize).SetPreload(true).SetOrder("created_at desc") |
| | | search.SetOrm(search.Orm.InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").Where("wms_operation_details.product_id=?", params.ProductId)) |
| | | |
| | | list, total, err := search.Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestError, "查找失败:"+err.Error()) |
| | | return |
| | | } |
| | | |
| | | util.ResponseFormatListWithPage(c, code.Success, list, int(total), params.Page, params.PageSize) |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/product/listOperaton": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "产品" |
| | | ], |
| | | "summary": "产品历史出入库信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.QueryOperationList" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Operation" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/product/updateProduct": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "description": "是否报废位置", |
| | | "type": "boolean" |
| | | }, |
| | | "jointName": { |
| | | "description": "拼接名称", |
| | | "type": "string" |
| | | }, |
| | | "name": { |
| | | "description": "位置名称", |
| | | "type": "string" |
| | |
| | | "weight": { |
| | | "description": "重量", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "models.Operation": { |
| | | "type": "object", |
| | | "properties": { |
| | | "comment": { |
| | | "type": "string" |
| | | }, |
| | | "companyID": { |
| | | "type": "integer" |
| | | }, |
| | | "companyName": { |
| | | "type": "string" |
| | | }, |
| | | "contacterID": { |
| | | "type": "integer" |
| | | }, |
| | | "contacterName": { |
| | | "type": "string" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "details": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.OperationDetails" |
| | | } |
| | | }, |
| | | "fromLocation": { |
| | | "description": "源位置", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/models.Location" |
| | | } |
| | | ] |
| | | }, |
| | | "fromLocationId": { |
| | | "description": "源位置id", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "number": { |
| | | "description": "单号", |
| | | "type": "string" |
| | | }, |
| | | "operationDate": { |
| | | "type": "string" |
| | | }, |
| | | "operationTypeId": { |
| | | "description": "作业类型id", |
| | | "type": "integer" |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "状态", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.OperationStatus" |
| | | } |
| | | ] |
| | | }, |
| | | "toLocation": { |
| | | "description": "目标位置", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/models.Location" |
| | | } |
| | | ] |
| | | }, |
| | | "toLocationId": { |
| | | "description": "目标位置id", |
| | | "type": "integer" |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.OperationDetails": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "operationId": { |
| | | "description": "操作id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "type": "string" |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.QueryOperationList": { |
| | | "type": "object", |
| | | "properties": { |
| | | "page": { |
| | | "description": "页码", |
| | | "type": "integer" |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateCompany": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | Description: "", |
| | | InfoInstanceName: "swagger", |
| | | SwaggerTemplate: docTemplate, |
| | | LeftDelim: "{{", |
| | | RightDelim: "}}", |
| | | } |
| | | |
| | | func init() { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/product/listOperaton": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "产品" |
| | | ], |
| | | "summary": "产品历史出入库信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.QueryOperationList" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Operation" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/product/updateProduct": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "description": "是否报废位置", |
| | | "type": "boolean" |
| | | }, |
| | | "jointName": { |
| | | "description": "拼接名称", |
| | | "type": "string" |
| | | }, |
| | | "name": { |
| | | "description": "位置名称", |
| | | "type": "string" |
| | |
| | | "weight": { |
| | | "description": "重量", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "models.Operation": { |
| | | "type": "object", |
| | | "properties": { |
| | | "comment": { |
| | | "type": "string" |
| | | }, |
| | | "companyID": { |
| | | "type": "integer" |
| | | }, |
| | | "companyName": { |
| | | "type": "string" |
| | | }, |
| | | "contacterID": { |
| | | "type": "integer" |
| | | }, |
| | | "contacterName": { |
| | | "type": "string" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "details": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.OperationDetails" |
| | | } |
| | | }, |
| | | "fromLocation": { |
| | | "description": "源位置", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/models.Location" |
| | | } |
| | | ] |
| | | }, |
| | | "fromLocationId": { |
| | | "description": "源位置id", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "number": { |
| | | "description": "单号", |
| | | "type": "string" |
| | | }, |
| | | "operationDate": { |
| | | "type": "string" |
| | | }, |
| | | "operationTypeId": { |
| | | "description": "作业类型id", |
| | | "type": "integer" |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "状态", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.OperationStatus" |
| | | } |
| | | ] |
| | | }, |
| | | "toLocation": { |
| | | "description": "目标位置", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/models.Location" |
| | | } |
| | | ] |
| | | }, |
| | | "toLocationId": { |
| | | "description": "目标位置id", |
| | | "type": "integer" |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.OperationDetails": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "operationId": { |
| | | "description": "操作id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "type": "string" |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.QueryOperationList": { |
| | | "type": "object", |
| | | "properties": { |
| | | "page": { |
| | | "description": "页码", |
| | | "type": "integer" |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateCompany": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | isScrapLocation: |
| | | description: 是否报废位置 |
| | | type: boolean |
| | | jointName: |
| | | description: 拼接名称 |
| | | type: string |
| | | name: |
| | | description: 位置名称 |
| | | type: string |
| | |
| | | weight: |
| | | description: 重量 |
| | | type: number |
| | | type: object |
| | | models.Operation: |
| | | properties: |
| | | comment: |
| | | type: string |
| | | companyID: |
| | | type: integer |
| | | companyName: |
| | | type: string |
| | | contacterID: |
| | | type: integer |
| | | contacterName: |
| | | type: string |
| | | createTime: |
| | | type: string |
| | | details: |
| | | items: |
| | | $ref: '#/definitions/models.OperationDetails' |
| | | type: array |
| | | fromLocation: |
| | | allOf: |
| | | - $ref: '#/definitions/models.Location' |
| | | description: 源位置 |
| | | fromLocationId: |
| | | description: 源位置id |
| | | type: integer |
| | | id: |
| | | type: integer |
| | | number: |
| | | description: 单号 |
| | | type: string |
| | | operationDate: |
| | | type: string |
| | | operationTypeId: |
| | | description: 作业类型id |
| | | type: integer |
| | | operationTypeName: |
| | | description: 作业类型名称 |
| | | type: string |
| | | sourceNumber: |
| | | description: 源单号 |
| | | type: string |
| | | status: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.OperationStatus' |
| | | description: 状态 |
| | | toLocation: |
| | | allOf: |
| | | - $ref: '#/definitions/models.Location' |
| | | description: 目标位置 |
| | | toLocationId: |
| | | description: 目标位置id |
| | | type: integer |
| | | updateTime: |
| | | type: string |
| | | type: object |
| | | models.OperationDetails: |
| | | properties: |
| | | amount: |
| | | description: 数量 |
| | | type: number |
| | | createTime: |
| | | type: string |
| | | id: |
| | | type: integer |
| | | operationId: |
| | | description: 操作id |
| | | type: integer |
| | | productId: |
| | | description: 产品id |
| | | type: string |
| | | productName: |
| | | description: 产品名称 |
| | | type: string |
| | | unit: |
| | | type: string |
| | | updateTime: |
| | | type: string |
| | | type: object |
| | | models.OperationType: |
| | | properties: |
| | |
| | | description: 产品名称 |
| | | type: string |
| | | unit: |
| | | type: string |
| | | type: object |
| | | request.QueryOperationList: |
| | | properties: |
| | | page: |
| | | description: 页码 |
| | | type: integer |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | productId: |
| | | type: string |
| | | type: object |
| | | request.UpdateCompany: |
| | |
| | | summary: 获取产品列表 |
| | | tags: |
| | | - 产品 |
| | | /api-wms/v1/product/listOperaton: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.QueryOperationList' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/models.Operation' |
| | | type: array |
| | | type: object |
| | | summary: 产品历史出入库信息 |
| | | tags: |
| | | - 产品 |
| | | /api-wms/v1/product/updateProduct: |
| | | post: |
| | | parameters: |
| | |
| | | PageInfo |
| | | KeyWord string `json:"keyWord"` |
| | | } |
| | | |
| | | type QueryOperationList struct { |
| | | PageInfo |
| | | ProductId string `json:"productId"` |
| | | } |
| | |
| | | productAPI.GET("getProductCategoryDetails/:id", productController.GetProductCategoryDetails) //获取产品类型详情 |
| | | productAPI.POST("updateProductCategory", productController.UpdateProductCategory) //修改产品类型 |
| | | productAPI.DELETE("deleteProductCategory/:id", productController.DeleteProductCategory) //删除产品类型 |
| | | |
| | | productAPI.POST("listOperaton", productController.ListOperation) //查看产品的历史出入库信息 |
| | | } |
| | | |
| | | return r |