jiangshuai
2023-09-21 7539ba3aa1ce089442433dd98c86794bee62198f
1.出入库一部分代码
4个文件已修改
237 ■■■■■ 已修改文件
controllers/operation.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -294,7 +294,7 @@
            return err
        }
        if operationType.BaseOperationType == constvar.BaseOperationTypeIncoming {
            if err := models.NewMaterialSearch().Orm.Exec("update material INNER JOIN wms_operation_details on wms_operation_details.product_id=material.id INNER JOIN wms_operation on wms_operation.id=wms_operation_details.operation_id set material.amount=material.amount + wms_operation_details.quantity where wms_operation.id=?", id).Error; err != nil {
            if err := models.NewMaterialSearch().Orm.Exec("update material INNER JOIN wms_operation_details on wms_operation_details.product_id=material.id INNER JOIN wms_operation on wms_operation.id=wms_operation_details.operation_id set material.amount=material.amount + wms_operation_details.amount where wms_operation.id=?", id).Error; err != nil {
                return err
            }
        } else if operationType.BaseOperationType == constvar.BaseOperationTypeOutgoing {
@@ -321,7 +321,7 @@
                    }
                }
            }
            if err := models.NewMaterialSearch().Orm.Exec("update material INNER JOIN wms_operation_details on wms_operation_details.product_id=material.id INNER JOIN wms_operation on wms_operation.id=wms_operation_details.operation_id set material.amount=material.amount - wms_operation_details.quantity where wms_operation.id=?", id).Error; err != nil {
            if err := models.NewMaterialSearch().Orm.Exec("update material INNER JOIN wms_operation_details on wms_operation_details.product_id=material.id INNER JOIN wms_operation on wms_operation.id=wms_operation_details.operation_id set material.amount=material.amount - wms_operation_details.amount where wms_operation.id=?", id).Error; err != nil {
                return err
            }
        }
docs/docs.go
@@ -565,7 +565,35 @@
            }
        },
        "/api-wms/v1/operation/operation/{id}": {
            "put": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "入库/出库"
                ],
                "summary": "删除入库/出库信息",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/operation/update": {
            "post": {
                "produces": [
                    "application/json"
                ],
@@ -582,39 +610,6 @@
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOperation"
                        }
                    },
                    {
                        "type": "integer",
                        "description": "入库信息id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "入库/出库"
                ],
                "summary": "删除入库/出库信息",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
@@ -1618,8 +1613,20 @@
                    "description": "位置名称",
                    "type": "string"
                },
                "nextCount": {
                    "description": "下次盘点",
                    "type": "string"
                },
                "notes": {
                    "description": "外部备注",
                    "type": "string"
                },
                "parentId": {
                    "description": "上级id",
                    "type": "string"
                },
                "recentlyCount": {
                    "description": "最近盘点",
                    "type": "string"
                },
                "replenishLocation": {
@@ -1893,11 +1900,19 @@
                    "description": "默认源位置id",
                    "type": "integer"
                },
                "earlyOperations": {
                    "description": "预填写作业详情",
                    "type": "boolean"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "prefix": {
                    "description": "前缀",
                    "type": "string"
                },
                "printLabel": {
@@ -2150,6 +2165,10 @@
                    "description": "作业类型id",
                    "type": "integer"
                },
                "operationTypeName": {
                    "description": "作业类型名称",
                    "type": "string"
                },
                "sourceNumber": {
                    "description": "源单号",
                    "type": "string"
@@ -2316,6 +2335,10 @@
                    "description": "操作id",
                    "type": "integer"
                },
                "amount": {
                    "description": "数量",
                    "type": "number"
                },
                "productId": {
                    "description": "产品id",
                    "type": "string"
@@ -2323,10 +2346,6 @@
                "productName": {
                    "description": "产品名称",
                    "type": "string"
                },
                "quantity": {
                    "description": "数量",
                    "type": "number"
                },
                "unit": {
                    "type": "string"
@@ -2417,6 +2436,10 @@
                    "description": "作业类型id",
                    "type": "integer"
                },
                "operationTypeName": {
                    "description": "作业类型名称",
                    "type": "string"
                },
                "sourceNumber": {
                    "description": "源单号",
                    "type": "string"
docs/swagger.json
@@ -553,7 +553,35 @@
            }
        },
        "/api-wms/v1/operation/operation/{id}": {
            "put": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "入库/出库"
                ],
                "summary": "删除入库/出库信息",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/operation/update": {
            "post": {
                "produces": [
                    "application/json"
                ],
@@ -570,39 +598,6 @@
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOperation"
                        }
                    },
                    {
                        "type": "integer",
                        "description": "入库信息id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "入库/出库"
                ],
                "summary": "删除入库/出库信息",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
@@ -1606,8 +1601,20 @@
                    "description": "位置名称",
                    "type": "string"
                },
                "nextCount": {
                    "description": "下次盘点",
                    "type": "string"
                },
                "notes": {
                    "description": "外部备注",
                    "type": "string"
                },
                "parentId": {
                    "description": "上级id",
                    "type": "string"
                },
                "recentlyCount": {
                    "description": "最近盘点",
                    "type": "string"
                },
                "replenishLocation": {
@@ -1881,11 +1888,19 @@
                    "description": "默认源位置id",
                    "type": "integer"
                },
                "earlyOperations": {
                    "description": "预填写作业详情",
                    "type": "boolean"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "prefix": {
                    "description": "前缀",
                    "type": "string"
                },
                "printLabel": {
@@ -2138,6 +2153,10 @@
                    "description": "作业类型id",
                    "type": "integer"
                },
                "operationTypeName": {
                    "description": "作业类型名称",
                    "type": "string"
                },
                "sourceNumber": {
                    "description": "源单号",
                    "type": "string"
@@ -2304,6 +2323,10 @@
                    "description": "操作id",
                    "type": "integer"
                },
                "amount": {
                    "description": "数量",
                    "type": "number"
                },
                "productId": {
                    "description": "产品id",
                    "type": "string"
@@ -2311,10 +2334,6 @@
                "productName": {
                    "description": "产品名称",
                    "type": "string"
                },
                "quantity": {
                    "description": "数量",
                    "type": "number"
                },
                "unit": {
                    "type": "string"
@@ -2405,6 +2424,10 @@
                    "description": "作业类型id",
                    "type": "integer"
                },
                "operationTypeName": {
                    "description": "作业类型名称",
                    "type": "string"
                },
                "sourceNumber": {
                    "description": "源单号",
                    "type": "string"
docs/swagger.yaml
@@ -244,8 +244,17 @@
      name:
        description: 位置名称
        type: string
      nextCount:
        description: 下次盘点
        type: string
      notes:
        description: 外部备注
        type: string
      parentId:
        description: 上级id
        type: string
      recentlyCount:
        description: 最近盘点
        type: string
      replenishLocation:
        description: 是否补充位置
@@ -442,10 +451,16 @@
      defaultLocationSrcId:
        description: 默认源位置id
        type: integer
      earlyOperations:
        description: 预填写作业详情
        type: boolean
      id:
        type: integer
      name:
        description: 仓库名称
        type: string
      prefix:
        description: 前缀
        type: string
      printLabel:
        description: 是否打印标签
@@ -618,6 +633,9 @@
      operationTypeId:
        description: 作业类型id
        type: integer
      operationTypeName:
        description: 作业类型名称
        type: string
      sourceNumber:
        description: 源单号
        type: string
@@ -731,15 +749,15 @@
      OperationId:
        description: 操作id
        type: integer
      amount:
        description: 数量
        type: number
      productId:
        description: 产品id
        type: string
      productName:
        description: 产品名称
        type: string
      quantity:
        description: 数量
        type: number
      unit:
        type: string
    type: object
@@ -803,6 +821,9 @@
      operationTypeId:
        description: 作业类型id
        type: integer
      operationTypeName:
        description: 作业类型名称
        type: string
      sourceNumber:
        description: 源单号
        type: string
@@ -1244,7 +1265,8 @@
      summary: 删除入库/出库信息
      tags:
      - 入库/出库
    put:
  /api-wms/v1/operation/update:
    post:
      parameters:
      - description: 入库信息
        in: body
@@ -1252,11 +1274,6 @@
        required: true
        schema:
          $ref: '#/definitions/request.UpdateOperation'
      - description: 入库信息id
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses: