瀏覽代碼

增加查询发票信息接口

zou.yingbin 4 年之前
父節點
當前提交
c09135f6d8
共有 6 個文件被更改,包括 327 次插入3 次删除
  1. 17 0
      controllers/wrTrade2/qryWrTrade.go
  2. 97 1
      docs/docs.go
  3. 97 1
      docs/swagger.json
  4. 66 1
      docs/swagger.yaml
  5. 49 0
      models/wrTrade2.go
  6. 1 0
      routers/router.go

+ 17 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -618,3 +618,20 @@ func QueryWrPerformanceStepType(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryWrUserReceiptInfo
+// @Summary 查询发票信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int false "用户id"
+// @Param receipttype query int false "发票类型 - 1:个人 2:企业"
+// @Success 200 {array} models.WrUserReceiptInfo
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryWrUserReceiptInfo [get]
+// @Tags 仓单贸易v2
+func QueryWrUserReceiptInfo(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrUserReceiptInfo{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 97 - 1
docs/docs.go

@@ -4881,7 +4881,7 @@ var doc = `{
                         "ApiKeyAuth": []
                     }
                 ],
-                "description": "原型页面:\n1.商品信息-\u003e商品参数修改流水-\u003e 增值税税率 | 折算系数 | 成本权重\n2.风管审核-\u003e套保比例审核 | 折算系数审核 | 增值税税率审核 | 成本权重审核",
+                "description": "原型页面:\n1.商品信息-\u003e商品参数修改流水-\u003e 增值税税率 | 折算系数 | 成本权重; 流水页面查申请状态为“审核通过”的记录\n2.风管审核-\u003e套保比例审核 | 折算系数审核 | 增值税税率审核 | 成本权重审核",
                 "produces": [
                     "application/json"
                 ],
@@ -13679,6 +13679,53 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryWrUserReceiptInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询发票信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "发票类型 - 1:个人 2:企业",
+                        "name": "receipttype",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrUserReceiptInfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/ZJ/GetBankTip": {
             "get": {
                 "produces": [
@@ -36071,6 +36118,55 @@ var doc = `{
                 }
             }
         },
+        "models.WrUserReceiptInfo": {
+            "type": "object",
+            "properties": {
+                "address": {
+                    "description": "地址[发票类型:企业]",
+                    "type": "string"
+                },
+                "autoid": {
+                    "description": "AutoID",
+                    "type": "integer"
+                },
+                "contactinfo": {
+                    "description": "联系方式",
+                    "type": "string"
+                },
+                "idnum": {
+                    "description": "身份证号码[发票类型:个人]",
+                    "type": "string"
+                },
+                "isdefault": {
+                    "description": "是否默认地址 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "receiptaccount": {
+                    "description": "发票帐号[发票类型:企业]",
+                    "type": "string"
+                },
+                "receiptbank": {
+                    "description": "发票开户行[发票类型:企业]",
+                    "type": "string"
+                },
+                "receipttype": {
+                    "description": "发票类型 - 1:个人 2:企业",
+                    "type": "integer"
+                },
+                "taxpayerid": {
+                    "description": "纳税人识别号",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "户名(个人姓名或企业名称)",
+                    "type": "string"
+                }
+            }
+        },
         "models.XHBRAND": {
             "type": "object",
             "properties": {

+ 97 - 1
docs/swagger.json

@@ -4865,7 +4865,7 @@
                         "ApiKeyAuth": []
                     }
                 ],
-                "description": "原型页面:\n1.商品信息-\u003e商品参数修改流水-\u003e 增值税税率 | 折算系数 | 成本权重\n2.风管审核-\u003e套保比例审核 | 折算系数审核 | 增值税税率审核 | 成本权重审核",
+                "description": "原型页面:\n1.商品信息-\u003e商品参数修改流水-\u003e 增值税税率 | 折算系数 | 成本权重; 流水页面查申请状态为“审核通过”的记录\n2.风管审核-\u003e套保比例审核 | 折算系数审核 | 增值税税率审核 | 成本权重审核",
                 "produces": [
                     "application/json"
                 ],
@@ -13663,6 +13663,53 @@
                 }
             }
         },
+        "/WrTrade2/QueryWrUserReceiptInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询发票信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "发票类型 - 1:个人 2:企业",
+                        "name": "receipttype",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrUserReceiptInfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/ZJ/GetBankTip": {
             "get": {
                 "produces": [
@@ -36055,6 +36102,55 @@
                 }
             }
         },
+        "models.WrUserReceiptInfo": {
+            "type": "object",
+            "properties": {
+                "address": {
+                    "description": "地址[发票类型:企业]",
+                    "type": "string"
+                },
+                "autoid": {
+                    "description": "AutoID",
+                    "type": "integer"
+                },
+                "contactinfo": {
+                    "description": "联系方式",
+                    "type": "string"
+                },
+                "idnum": {
+                    "description": "身份证号码[发票类型:个人]",
+                    "type": "string"
+                },
+                "isdefault": {
+                    "description": "是否默认地址 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "receiptaccount": {
+                    "description": "发票帐号[发票类型:企业]",
+                    "type": "string"
+                },
+                "receiptbank": {
+                    "description": "发票开户行[发票类型:企业]",
+                    "type": "string"
+                },
+                "receipttype": {
+                    "description": "发票类型 - 1:个人 2:企业",
+                    "type": "integer"
+                },
+                "taxpayerid": {
+                    "description": "纳税人识别号",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "户名(个人姓名或企业名称)",
+                    "type": "string"
+                }
+            }
+        },
         "models.XHBRAND": {
             "type": "object",
             "properties": {

+ 66 - 1
docs/swagger.yaml

@@ -16567,6 +16567,42 @@ definitions:
         description: 用户id
         type: integer
     type: object
+  models.WrUserReceiptInfo:
+    properties:
+      address:
+        description: 地址[发票类型:企业]
+        type: string
+      autoid:
+        description: AutoID
+        type: integer
+      contactinfo:
+        description: 联系方式
+        type: string
+      idnum:
+        description: 身份证号码[发票类型:个人]
+        type: string
+      isdefault:
+        description: 是否默认地址 - 0:否 1:是
+        type: integer
+      receiptaccount:
+        description: 发票帐号[发票类型:企业]
+        type: string
+      receiptbank:
+        description: 发票开户行[发票类型:企业]
+        type: string
+      receipttype:
+        description: 发票类型 - 1:个人 2:企业
+        type: integer
+      taxpayerid:
+        description: 纳税人识别号
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+      username:
+        description: 户名(个人姓名或企业名称)
+        type: string
+    type: object
   models.XHBRAND:
     properties:
       brandid:
@@ -21717,7 +21753,7 @@ paths:
     get:
       description: |-
         原型页面:
-        1.商品信息->商品参数修改流水-> 增值税税率 | 折算系数 | 成本权重
+        1.商品信息->商品参数修改流水-> 增值税税率 | 折算系数 | 成本权重; 流水页面查申请状态为“审核通过”的记录
         2.风管审核->套保比例审核 | 折算系数审核 | 增值税税率审核 | 成本权重审核
       parameters:
       - description: 用户ID
@@ -27274,6 +27310,35 @@ paths:
       summary: 查询我的朋友
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryWrUserReceiptInfo:
+    get:
+      parameters:
+      - description: 用户id
+        in: query
+        name: userid
+        type: integer
+      - description: 发票类型 - 1:个人 2:企业
+        in: query
+        name: receipttype
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrUserReceiptInfo'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询发票信息
+      tags:
+      - 仓单贸易v2
   /ZJ/GetBankTip:
     get:
       produces:

+ 49 - 0
models/wrTrade2.go

@@ -3540,3 +3540,52 @@ func (r *WrPerformanceStepType) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// WrUserReceiptInfo 发票信息
+type WrUserReceiptInfo struct {
+	AUTOID         int64  `json:"autoid"  xorm:"AUTOID" form:"autoid"`                // AutoID
+	USERID         int64  `json:"userid"  xorm:"USERID" form:"userid"`                // 用户ID
+	RECEIPTTYPE    int32  `json:"receipttype"  xorm:"RECEIPTTYPE" form:"receipttype"` // 发票类型 - 1:个人 2:企业
+	USERNAME       string `json:"username"  xorm:"USERNAME"`                          // 户名(个人姓名或企业名称)
+	TAXPAYERID     string `json:"taxpayerid"  xorm:"TAXPAYERID" form:"taxpayerid"`    // 纳税人识别号
+	CONTACTINFO    string `json:"contactinfo"  xorm:"CONTACTINFO"`                    // 联系方式
+	RECEIPTBANK    string `json:"receiptbank"  xorm:"RECEIPTBANK"`                    // 发票开户行[发票类型:企业]
+	RECEIPTACCOUNT string `json:"receiptaccount"  xorm:"RECEIPTACCOUNT"`              // 发票帐号[发票类型:企业]
+	ADDRESS        string `json:"address"  xorm:"ADDRESS"`                            // 地址[发票类型:企业]
+	IDNUM          string `json:"idnum"  xorm:"IDNUM"`                                // 身份证号码[发票类型:个人]
+	ISDEFAULT      int32  `json:"isdefault"  xorm:"'ISDEFAULT'"`                      // 是否默认地址 - 0:否 1:是
+}
+
+func (r *WrUserReceiptInfo) calc() {
+
+}
+
+func (r *WrUserReceiptInfo) buildSql() string {
+	var sqlId utils.SQLVal = `
+SELECT t.AUTOID,
+       t.USERID,
+       t.RECEIPTTYPE,
+       t.USERNAME,
+       t.TAXPAYERID,
+       t.CONTACTINFO,
+       t.RECEIPTBANK,
+       t.RECEIPTACCOUNT,
+       t.ADDRESS,
+       t.IDNUM
+  FROM USERRECEIPTINFO t
+ WHERE 1 = 1
+`
+	sqlId.AndEx("t.USERID", r.USERID, r.USERID > 0)
+	sqlId.AndEx("t.USERID", r.RECEIPTTYPE, r.RECEIPTTYPE > 0)
+	return sqlId.String()
+}
+
+// GetDataEx 获取发票信息
+func (r *WrUserReceiptInfo) GetDataEx() (interface{}, error) {
+	sData := make([]WrUserReceiptInfo, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -572,6 +572,7 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryPermancePlanTmp", wrTrade2.QueryPermancePlanTmp)
 		wrTrade2R.GET("QueryWrTradeBargainApply", wrTrade2.QueryWrTradeBargainApply)
 		wrTrade2R.GET("QueryWrPerformanceStepType", wrTrade2.QueryWrPerformanceStepType)
+		wrTrade2R.GET("QueryWrUserReceiptInfo", wrTrade2.QueryWrUserReceiptInfo)
 	}
 
 	// **************************天津麦顿*************************