| | |
| | | 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 { |
| | |
| | | } |
| | | } |
| | | } |
| | | 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 |
| | | } |
| | | } |
| | |
| | | } |
| | | }, |
| | | "/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" |
| | | ], |
| | |
| | | "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": { |
| | |
| | | "description": "位置名称", |
| | | "type": "string" |
| | | }, |
| | | "nextCount": { |
| | | "description": "下次盘点", |
| | | "type": "string" |
| | | }, |
| | | "notes": { |
| | | "description": "外部备注", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级id", |
| | | "type": "string" |
| | | }, |
| | | "recentlyCount": { |
| | | "description": "最近盘点", |
| | | "type": "string" |
| | | }, |
| | | "replenishLocation": { |
| | |
| | | "description": "默认源位置id", |
| | | "type": "integer" |
| | | }, |
| | | "earlyOperations": { |
| | | "description": "预填写作业详情", |
| | | "type": "boolean" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "prefix": { |
| | | "description": "前缀", |
| | | "type": "string" |
| | | }, |
| | | "printLabel": { |
| | |
| | | "description": "作业类型id", |
| | | "type": "integer" |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | |
| | | "description": "操作id", |
| | | "type": "integer" |
| | | }, |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "quantity": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "unit": { |
| | | "type": "string" |
| | |
| | | "description": "作业类型id", |
| | | "type": "integer" |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | |
| | | } |
| | | }, |
| | | "/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" |
| | | ], |
| | |
| | | "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": { |
| | |
| | | "description": "位置名称", |
| | | "type": "string" |
| | | }, |
| | | "nextCount": { |
| | | "description": "下次盘点", |
| | | "type": "string" |
| | | }, |
| | | "notes": { |
| | | "description": "外部备注", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级id", |
| | | "type": "string" |
| | | }, |
| | | "recentlyCount": { |
| | | "description": "最近盘点", |
| | | "type": "string" |
| | | }, |
| | | "replenishLocation": { |
| | |
| | | "description": "默认源位置id", |
| | | "type": "integer" |
| | | }, |
| | | "earlyOperations": { |
| | | "description": "预填写作业详情", |
| | | "type": "boolean" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "prefix": { |
| | | "description": "前缀", |
| | | "type": "string" |
| | | }, |
| | | "printLabel": { |
| | |
| | | "description": "作业类型id", |
| | | "type": "integer" |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | |
| | | "description": "操作id", |
| | | "type": "integer" |
| | | }, |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "quantity": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "unit": { |
| | | "type": "string" |
| | |
| | | "description": "作业类型id", |
| | | "type": "integer" |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | |
| | | name: |
| | | description: 位置名称 |
| | | type: string |
| | | nextCount: |
| | | description: 下次盘点 |
| | | type: string |
| | | notes: |
| | | description: 外部备注 |
| | | type: string |
| | | parentId: |
| | | description: 上级id |
| | | type: string |
| | | recentlyCount: |
| | | description: 最近盘点 |
| | | type: string |
| | | replenishLocation: |
| | | description: 是否补充位置 |
| | |
| | | defaultLocationSrcId: |
| | | description: 默认源位置id |
| | | type: integer |
| | | earlyOperations: |
| | | description: 预填写作业详情 |
| | | type: boolean |
| | | id: |
| | | type: integer |
| | | name: |
| | | description: 仓库名称 |
| | | type: string |
| | | prefix: |
| | | description: 前缀 |
| | | type: string |
| | | printLabel: |
| | | description: 是否打印标签 |
| | |
| | | operationTypeId: |
| | | description: 作业类型id |
| | | type: integer |
| | | operationTypeName: |
| | | description: 作业类型名称 |
| | | type: string |
| | | sourceNumber: |
| | | description: 源单号 |
| | | type: string |
| | |
| | | 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 |
| | |
| | | operationTypeId: |
| | | description: 作业类型id |
| | | type: integer |
| | | operationTypeName: |
| | | description: 作业类型名称 |
| | | type: string |
| | | sourceNumber: |
| | | description: 源单号 |
| | | type: string |
| | |
| | | summary: 删除入库/出库信息 |
| | | tags: |
| | | - 入库/出库 |
| | | put: |
| | | /api-wms/v1/operation/update: |
| | | post: |
| | | parameters: |
| | | - description: 入库信息 |
| | | in: body |
| | |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.UpdateOperation' |
| | | - description: 入库信息id |
| | | in: path |
| | | name: id |
| | | required: true |
| | | type: integer |
| | | produces: |
| | | - application/json |
| | | responses: |