| | |
| | | } |
| | | } |
| | | }, |
| | | "/con/downloadContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "下载Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"下载成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/con/findContract": { |
| | | "get": { |
| | | "security": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/con/previewContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "预览Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"预览成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/con/updateContract": { |
| | | "put": { |
| | | "security": [ |
| | |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/downloadContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "下载Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"下载成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/previewContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "预览Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"预览成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/purchase/purchase": { |
| | | "put": { |
| | | "security": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/con/downloadContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "下载Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"下载成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/con/findContract": { |
| | | "get": { |
| | | "security": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/con/previewContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "预览Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"预览成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/con/updateContract": { |
| | | "put": { |
| | | "security": [ |
| | |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/downloadContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "下载Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"下载成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/previewContract": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Contract" |
| | | ], |
| | | "summary": "预览Contract", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "created_at", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "fileName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "supplierID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "updated_at", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"预览成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/purchase/purchase": { |
| | | "put": { |
| | | "security": [ |
| | |
| | | summary: 批量删除Contract |
| | | tags: |
| | | - Contract |
| | | /con/downloadContract: |
| | | get: |
| | | consumes: |
| | | - application/json |
| | | parameters: |
| | | - in: query |
| | | name: created_at |
| | | type: string |
| | | - in: query |
| | | name: fileName |
| | | type: string |
| | | - description: 主键ID |
| | | in: query |
| | | name: id |
| | | type: integer |
| | | - in: query |
| | | name: supplierID |
| | | type: integer |
| | | - in: query |
| | | name: updated_at |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: '{"success":true,"data":{},"msg":"下载成功"}' |
| | | schema: |
| | | type: string |
| | | security: |
| | | - ApiKeyAuth: [] |
| | | summary: 下载Contract |
| | | tags: |
| | | - Contract |
| | | /con/findContract: |
| | | get: |
| | | consumes: |
| | |
| | | summary: 分页获取Contract列表 |
| | | tags: |
| | | - Contract |
| | | /con/previewContract: |
| | | /con/updateContract: |
| | | put: |
| | | consumes: |
| | | - application/json |
| | | parameters: |
| | | - description: 更新Contract |
| | | in: body |
| | | name: data |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/test.Contract' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: '{"success":true,"data":{},"msg":"更新成功"}' |
| | | schema: |
| | | type: string |
| | | security: |
| | | - ApiKeyAuth: [] |
| | | summary: 更新Contract |
| | | tags: |
| | | - Contract |
| | | /downloadContract: |
| | | get: |
| | | consumes: |
| | | - application/json |
| | |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: '{"success":true,"data":{},"msg":"预览成功"}' |
| | | description: '{"success":true,"data":{},"msg":"下载成功"}' |
| | | schema: |
| | | type: string |
| | | security: |
| | | - ApiKeyAuth: [] |
| | | summary: 预览Contract |
| | | tags: |
| | | - Contract |
| | | /con/updateContract: |
| | | put: |
| | | consumes: |
| | | - application/json |
| | | parameters: |
| | | - description: 更新Contract |
| | | in: body |
| | | name: data |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/test.Contract' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: '{"success":true,"data":{},"msg":"更新成功"}' |
| | | schema: |
| | | type: string |
| | | security: |
| | | - ApiKeyAuth: [] |
| | | summary: 更新Contract |
| | | summary: 下载Contract |
| | | tags: |
| | | - Contract |
| | | /i/createIndustry: |
| | |
| | | summary: 更新Product |
| | | tags: |
| | | - Product |
| | | /previewContract: |
| | | get: |
| | | consumes: |
| | | - application/json |
| | | parameters: |
| | | - in: query |
| | | name: created_at |
| | | type: string |
| | | - in: query |
| | | name: fileName |
| | | type: string |
| | | - description: 主键ID |
| | | in: query |
| | | name: id |
| | | type: integer |
| | | - in: query |
| | | name: supplierID |
| | | type: integer |
| | | - in: query |
| | | name: updated_at |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: '{"success":true,"data":{},"msg":"预览成功"}' |
| | | schema: |
| | | type: string |
| | | security: |
| | | - ApiKeyAuth: [] |
| | | summary: 预览Contract |
| | | tags: |
| | | - Contract |
| | | /purchase/purchase: |
| | | post: |
| | | consumes: |
| | |
| | | if err != nil { |
| | | return purchaseList, total, err |
| | | } |
| | | } |
| | | |
| | | if info.SupplierId != 0 { |
| | | } else if info.SupplierId != 0 { |
| | | db = db.Where("supplier_id = ?", info.SupplierId) |
| | | } |
| | | err = db.Count(&total).Error |
| | | if err != nil { |
| | | if err != nil || total == 0 { |
| | | return purchaseList, total, err |
| | | } |
| | | if len(ids) != 0 { |
| | | db = global.GVA_DB.Model(&purchase.Purchase{}) |
| | | err = db.Where("id in (?)", ids).Preload("Supplier").Order("updated_at desc").Find(&purchaseList).Error |
| | | } else { |
| | | db = global.GVA_DB.Model(&purchase.Purchase{}) |
| | | //db = global.GVA_DB.Model(&purchase.Purchase{}) |
| | | err = db.Limit(limit).Offset(offset).Preload("Supplier").Order("updated_at desc").Find(&purchaseList).Error |
| | | } |
| | | |