liujiandao
2023-11-23 780416dd70d9c863ddf8121b5c017db7a0801956
供应商修改
4个文件已修改
566 ■■■■ 已修改文件
docs/docs.go 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/purchase/purchase.go 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go
@@ -135,61 +135,6 @@
                }
            }
        },
        "/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": [
@@ -328,61 +273,6 @@
                }
            }
        },
        "/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": [
@@ -414,6 +304,61 @@
                "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"
                        }
@@ -1500,6 +1445,61 @@
                }
            }
        },
        "/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": [
docs/swagger.json
@@ -126,61 +126,6 @@
                }
            }
        },
        "/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": [
@@ -319,61 +264,6 @@
                }
            }
        },
        "/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": [
@@ -405,6 +295,61 @@
                "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"
                        }
@@ -1491,6 +1436,61 @@
                }
            }
        },
        "/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": [
docs/swagger.yaml
@@ -984,39 +984,6 @@
      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:
@@ -1101,7 +1068,30 @@
      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
@@ -1126,35 +1116,12 @@
      - 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:
@@ -1812,6 +1779,39 @@
      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:
service/purchase/purchase.go
@@ -140,20 +140,18 @@
        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
    }