浏览代码

1.查待付款单据接口修改查询参数
2.查客户协议与状态接口修改查询参数

zou.yingbin 4 年之前
父节点
当前提交
b8ca349cdc
共有 7 个文件被更改,包括 29 次插入24 次删除
  1. 3 3
      controllers/qhj/qryQhj.go
  2. 1 1
      controllers/qhj/qryQhjAgreement.go
  3. 5 5
      docs/docs.go
  4. 5 5
      docs/swagger.json
  5. 6 7
      docs/swagger.yaml
  6. 4 1
      models/qhj.go
  7. 5 2
      models/qhjAgreement.go

+ 3 - 3
controllers/qhj/qryQhj.go

@@ -374,7 +374,7 @@ func QueryAccountInOutApply(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param accountid query int true "资金账号id"
 // @Param tradeid query int false "成交单号"
-// @Param payflag query int false "付款标识 - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止"
+// @Param payflag query string false "付款标识(可多个,逗号隔开) - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止"
 // @Success 200 {array} models.QhjPayOrder
 // @Failure 500 {object} app.Response
 // @Router /Qhj/QueryPayOrder [get]
@@ -384,10 +384,10 @@ func QueryPayOrder(c *gin.Context) {
 	req := struct {
 		ACCOUNTID int64  `form:"accountid" binding:"required"` // 用户id
 		TRADEID   string `form:"tradeid"`                      // 成交单号
-		PAYFLAG   int32  `form:"payflag"`                      // 付款标识
+		PAYFLAG   string `form:"payflag"`                      // 付款标识
 	}{}
 	a.DoBindReq(&req)
-	m := models.QhjPayOrder{BUYACCOUNTID: req.ACCOUNTID, TRADEID: req.TRADEID, PAYFLAG: req.PAYFLAG}
+	m := models.QhjPayOrder{BUYACCOUNTID: req.ACCOUNTID, TRADEID: req.TRADEID, FilterPayFlag: req.PAYFLAG}
 	a.DoGetDataI(&m)
 }
 

+ 1 - 1
controllers/qhj/qryQhjAgreement.go

@@ -125,7 +125,7 @@ func QueryQhjCustomerSignLog(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param userid query int false "客户ID"
 // @Param configid query int false "配置id(SEQ_QHJ_NODEAGREEMENTCONFIG)"
-// @Param nodetype query int false "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出"
+// @Param nodetype query string false "环节类型(可多个,逗号隔开) - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出"
 // @Param goodsid query int false "商品ID [默认为0, NodeType>=3 的为商品值]"
 // @Param agreementid query int false "协议ID"
 // @Param agreementtype query int false "协议类型 - 1:注册 2:登录 3:交易"

+ 5 - 5
docs/docs.go

@@ -7502,8 +7502,8 @@ var doc = `{
                         "in": "query"
                     },
                     {
-                        "type": "integer",
-                        "description": "付款标识 - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止",
+                        "type": "string",
+                        "description": "付款标识(可多个,逗号隔开) - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止",
                         "name": "payflag",
                         "in": "query"
                     }
@@ -8985,8 +8985,8 @@ var doc = `{
                         "in": "query"
                     },
                     {
-                        "type": "integer",
-                        "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                        "type": "string",
+                        "description": "环节类型(可多个,逗号隔开) - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
                         "name": "nodetype",
                         "in": "query"
                     },
@@ -24233,7 +24233,7 @@ var doc = `{
                     "type": "string"
                 },
                 "status": {
-                    "description": "开户状态(网上开户表wskh_userinfo) - 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过 ; 账户状态(正式表useraccount) - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)",
+                    "description": "开户状态(网上开户表wskh_userinfo) 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过 ; 账户状态(正式表useraccount) 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)",
                     "type": "integer"
                 },
                 "statusdesc": {

+ 5 - 5
docs/swagger.json

@@ -7486,8 +7486,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "integer",
-                        "description": "付款标识 - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止",
+                        "type": "string",
+                        "description": "付款标识(可多个,逗号隔开) - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止",
                         "name": "payflag",
                         "in": "query"
                     }
@@ -8969,8 +8969,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "integer",
-                        "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                        "type": "string",
+                        "description": "环节类型(可多个,逗号隔开) - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
                         "name": "nodetype",
                         "in": "query"
                     },
@@ -24217,7 +24217,7 @@
                     "type": "string"
                 },
                 "status": {
-                    "description": "开户状态(网上开户表wskh_userinfo) - 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过 ; 账户状态(正式表useraccount) - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)",
+                    "description": "开户状态(网上开户表wskh_userinfo) 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过 ; 账户状态(正式表useraccount) 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)",
                     "type": "integer"
                 },
                 "statusdesc": {

+ 6 - 7
docs/swagger.yaml

@@ -10341,9 +10341,8 @@ definitions:
         description: 备注
         type: string
       status:
-        description: '开户状态(网上开户表wskh_userinfo) - 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝
-          6:测评不通过 ; 账户状态(正式表useraccount) - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销)
-          7:注销(删除)'
+        description: '开户状态(网上开户表wskh_userinfo) 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过
+          ; 账户状态(正式表useraccount) 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)'
         type: integer
       statusdesc:
         description: 账户状态中文描述
@@ -19257,10 +19256,10 @@ paths:
         in: query
         name: tradeid
         type: integer
-      - description: 付款标识 - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止
+      - description: 付款标识(可多个,逗号隔开) - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止
         in: query
         name: payflag
-        type: integer
+        type: string
       produces:
       - application/json
       responses:
@@ -20195,10 +20194,10 @@ paths:
         in: query
         name: configid
         type: integer
-      - description: 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
+      - description: 环节类型(可多个,逗号隔开) - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
         in: query
         name: nodetype
-        type: integer
+        type: string
       - description: 商品ID [默认为0, NodeType>=3 的为商品值]
         in: query
         name: goodsid

+ 4 - 1
models/qhj.go

@@ -1674,6 +1674,8 @@ type QhjPayOrder struct {
 	QTYDECIMALPLACE int     `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"` // 成交量小数位
 	ADVANCERATIO    float64 `json:"advanceratio"  xorm:"ADVANCERATIO"`         // 首付比率
 	ENUMDICNAME     string  `json:"enumdicname"`                               // 单位名称
+
+	FilterPayFlag string `json:"-"` // 付款标识筛选
 }
 
 func (r *QhjPayOrder) calc() {
@@ -1713,7 +1715,8 @@ func (r *QhjPayOrder) buildSql() string {
 		" WHERE 1 = 1"
 	sqlId.AndEx("t.BUYACCOUNTID", r.BUYACCOUNTID, r.BUYACCOUNTID > 0)
 	sqlId.AndEx("t.TRADEID", r.TRADEID, len(r.TRADEID) > 0)
-	sqlId.AndEx("t.PAYFLAG", r.PAYFLAG, r.PAYFLAG > 0)
+	//sqlId.AndEx("t.PAYFLAG", r.PAYFLAG, r.PAYFLAG > 0)
+	sqlId.JoinEx(r.FilterPayFlag != "", fmt.Sprintf(" and t.PAYFLAG in(%v)", r.FilterPayFlag))
 	return sqlId.String()
 }
 

+ 5 - 2
models/qhjAgreement.go

@@ -7,6 +7,7 @@
 package models
 
 import (
+	"fmt"
 	"mtp2_if/db"
 	"mtp2_if/utils"
 )
@@ -300,7 +301,7 @@ func (r *QhjCustomerSignLog) GetDataEx() (interface{}, error) {
 type QhjUserNodeCfgAndStatus struct {
 	AGREEMENTTYPE    int32  `json:"agreementtype"  xorm:"AGREEMENTTYPE" form:"agreementtype"`          // 协议类型 - 1:注册 2:登录 3:交易
 	AGREEMENTVERSION int32  `json:"agreementversion"  xorm:"AGREEMENTVERSION" form:"agreementversion"` // 协议版本号
-	NODETYPE         int32  `json:"nodetype"  xorm:"NODETYPE" form:"nodetype"`                         // 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
+	NODETYPE         int32  `json:"nodetype"  xorm:"NODETYPE"`                                         // 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
 	CONFIGID         int64  `json:"configid"  xorm:"CONFIGID" form:"configid"`                         // 配置(SEQ_QHJ_NODEAGREEMENTCONFIG)
 	AGREEMENTID      int64  `json:"agreementid"  xorm:"AGREEMENTID" form:"agreementid"`                // 协议ID
 	CREATETIME       string `json:"createtime"  xorm:"CREATETIME" form:"createtime"`                   // 创建时间
@@ -311,6 +312,8 @@ type QhjUserNodeCfgAndStatus struct {
 	USERID           int64  `json:"userid"  xorm:"USERID" form:"userid"`                               // 客户ID
 	SIGNTIMESTAMP    string `json:"signtimestamp"  xorm:"SIGNTIMESTAMP" form:"signtimestamp"`          // 签约状态时间戳(最近一次)
 	TRADEDATE        string `json:"tradedate"  xorm:"TRADEDATE" form:"tradedate"`                      // 签约交易日(yyyyMMdd)
+
+	FilterNodeType string `json:"-" form:"nodetype"` // 环节类型筛选条件
 }
 
 func (r *QhjUserNodeCfgAndStatus) calc() {
@@ -344,11 +347,11 @@ func (r *QhjUserNodeCfgAndStatus) buildSql() string {
 		" WHERE 1 = 1"
 	sqlId.FormatParam(r.USERID)
 	sqlId.AndEx("t.configid", r.CONFIGID, r.CONFIGID > 0)
-	sqlId.AndEx("t.nodetype", r.NODETYPE, r.NODETYPE > 0)
 	sqlId.AndEx("t.goodsid", r.GOODSID, r.GOODSID > 0)
 	sqlId.AndEx("t.agreementid", r.AGREEMENTID, r.AGREEMENTID > 0)
 	sqlId.AndEx("t.agreementtype", r.AGREEMENTTYPE, r.AGREEMENTTYPE > 0)
 	sqlId.AndEx("t.agreementversion", r.AGREEMENTVERSION, r.AGREEMENTVERSION > 0)
+	sqlId.JoinEx(r.FilterNodeType != "", fmt.Sprintf(" and t.nodetype in(%v)", r.FilterNodeType))
 	sqlId.AndLike("c.agreementno", r.AGREEMENTNO)
 	sqlId.AndLike("c.agreementname", r.AGREEMENTNAME)
 	return sqlId.String()