Kaynağa Gözat

1.增加查客户签约节点和状态接口

zou.yingbin 4 yıl önce
ebeveyn
işleme
50b97fb2b4

+ 24 - 0
controllers/qhj/qryQhjAgreement.go

@@ -118,3 +118,27 @@ func QueryQhjCustomerSignLog(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryUserNodeCfgAndStatus
+// @Summary 查询用户协议节点配置和状态
+// @Produce json
+// @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 goodsid query int false "商品ID [默认为0, NodeType>=3 的为商品值]"
+// @Param agreementid query int false "协议ID"
+// @Param agreementtype query int false "协议类型 - 1:注册 2:登录 3:交易"
+// @Param agreementversion query int false "协议版本号"
+// @Param agreementno query string false "协议编号(模糊匹配)"
+// @Param agreementname query string false "协议名称(模糊匹配)"
+// @Success 200 {array} models.QhjUserNodeCfgAndStatus
+// @Failure 500 {object} app.Response
+// @Router /QhjSys/QueryUserNodeCfgAndStatus [get]
+// @Tags 大连千海金(协议和签约信息)
+func QueryUserNodeCfgAndStatus(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjUserNodeCfgAndStatus{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 150 - 0
docs/docs.go

@@ -8957,6 +8957,95 @@ var doc = `{
                 }
             }
         },
+        "/QhjSys/QueryUserNodeCfgAndStatus": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询用户协议节点配置和状态",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "客户ID",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "配置id(SEQ_QHJ_NODEAGREEMENTCONFIG)",
+                        "name": "configid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                        "name": "nodetype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                        "name": "goodsid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议ID",
+                        "name": "agreementid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议类型 - 1:注册 2:登录 3:交易",
+                        "name": "agreementtype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议版本号",
+                        "name": "agreementversion",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "协议编号(模糊匹配)",
+                        "name": "agreementno",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "协议名称(模糊匹配)",
+                        "name": "agreementname",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjUserNodeCfgAndStatus"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Quote/QueryHistoryDatas": {
             "get": {
                 "security": [
@@ -24472,6 +24561,10 @@ var doc = `{
         "models.QhjNodeAgreementConfig": {
             "type": "object",
             "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
                 "agreementid": {
                     "description": "协议ID",
                     "type": "integer"
@@ -25407,6 +25500,63 @@ var doc = `{
                 }
             }
         },
+        "models.QhjUserNodeCfgAndStatus": {
+            "type": "object",
+            "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
+                "agreementid": {
+                    "description": "协议ID",
+                    "type": "integer"
+                },
+                "agreementname": {
+                    "description": "协议名称",
+                    "type": "string"
+                },
+                "agreementno": {
+                    "description": "协议编号",
+                    "type": "string"
+                },
+                "agreementtype": {
+                    "description": "协议类型 - 1:注册 2:登录 3:交易",
+                    "type": "integer"
+                },
+                "agreementversion": {
+                    "description": "协议版本号",
+                    "type": "integer"
+                },
+                "configid": {
+                    "description": "配置(SEQ_QHJ_NODEAGREEMENTCONFIG)",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                    "type": "integer"
+                },
+                "nodetype": {
+                    "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                    "type": "integer"
+                },
+                "signtimestamp": {
+                    "description": "签约状态时间戳(最近一次)",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "签约交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "客户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Qhjgoodsex": {
             "type": "object",
             "properties": {

+ 150 - 0
docs/swagger.json

@@ -8941,6 +8941,95 @@
                 }
             }
         },
+        "/QhjSys/QueryUserNodeCfgAndStatus": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询用户协议节点配置和状态",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "客户ID",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "配置id(SEQ_QHJ_NODEAGREEMENTCONFIG)",
+                        "name": "configid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                        "name": "nodetype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                        "name": "goodsid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议ID",
+                        "name": "agreementid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议类型 - 1:注册 2:登录 3:交易",
+                        "name": "agreementtype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议版本号",
+                        "name": "agreementversion",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "协议编号(模糊匹配)",
+                        "name": "agreementno",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "协议名称(模糊匹配)",
+                        "name": "agreementname",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjUserNodeCfgAndStatus"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Quote/QueryHistoryDatas": {
             "get": {
                 "security": [
@@ -24456,6 +24545,10 @@
         "models.QhjNodeAgreementConfig": {
             "type": "object",
             "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
                 "agreementid": {
                     "description": "协议ID",
                     "type": "integer"
@@ -25391,6 +25484,63 @@
                 }
             }
         },
+        "models.QhjUserNodeCfgAndStatus": {
+            "type": "object",
+            "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
+                "agreementid": {
+                    "description": "协议ID",
+                    "type": "integer"
+                },
+                "agreementname": {
+                    "description": "协议名称",
+                    "type": "string"
+                },
+                "agreementno": {
+                    "description": "协议编号",
+                    "type": "string"
+                },
+                "agreementtype": {
+                    "description": "协议类型 - 1:注册 2:登录 3:交易",
+                    "type": "integer"
+                },
+                "agreementversion": {
+                    "description": "协议版本号",
+                    "type": "integer"
+                },
+                "configid": {
+                    "description": "配置(SEQ_QHJ_NODEAGREEMENTCONFIG)",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                    "type": "integer"
+                },
+                "nodetype": {
+                    "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                    "type": "integer"
+                },
+                "signtimestamp": {
+                    "description": "签约状态时间戳(最近一次)",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "签约交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "客户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Qhjgoodsex": {
             "type": "object",
             "properties": {

+ 102 - 0
docs/swagger.yaml

@@ -10585,6 +10585,9 @@ definitions:
     type: object
   models.QhjNodeAgreementConfig:
     properties:
+      agreementcontent:
+        description: 协议内容
+        type: string
       agreementid:
         description: 协议ID
         type: integer
@@ -11280,6 +11283,48 @@ definitions:
         description: 用户名称
         type: string
     type: object
+  models.QhjUserNodeCfgAndStatus:
+    properties:
+      agreementcontent:
+        description: 协议内容
+        type: string
+      agreementid:
+        description: 协议ID
+        type: integer
+      agreementname:
+        description: 协议名称
+        type: string
+      agreementno:
+        description: 协议编号
+        type: string
+      agreementtype:
+        description: 协议类型 - 1:注册 2:登录 3:交易
+        type: integer
+      agreementversion:
+        description: 协议版本号
+        type: integer
+      configid:
+        description: 配置(SEQ_QHJ_NODEAGREEMENTCONFIG)
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      goodsid:
+        description: 商品ID [默认为0, NodeType>=3 的为商品值]
+        type: integer
+      nodetype:
+        description: 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
+        type: integer
+      signtimestamp:
+        description: 签约状态时间戳(最近一次)
+        type: string
+      tradedate:
+        description: 签约交易日(yyyyMMdd)
+        type: string
+      userid:
+        description: 客户ID
+        type: integer
+    type: object
   models.Qhjgoodsex:
     properties:
       canfinance:
@@ -20017,6 +20062,63 @@ paths:
       summary: 查询客户协议签约流水
       tags:
       - 大连千海金(协议和签约信息)
+  /QhjSys/QueryUserNodeCfgAndStatus:
+    get:
+      parameters:
+      - description: 客户ID
+        in: query
+        name: userid
+        type: integer
+      - description: 配置id(SEQ_QHJ_NODEAGREEMENTCONFIG)
+        in: query
+        name: configid
+        type: integer
+      - description: 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
+        in: query
+        name: nodetype
+        type: integer
+      - description: 商品ID [默认为0, NodeType>=3 的为商品值]
+        in: query
+        name: goodsid
+        type: integer
+      - description: 协议ID
+        in: query
+        name: agreementid
+        type: integer
+      - description: 协议类型 - 1:注册 2:登录 3:交易
+        in: query
+        name: agreementtype
+        type: integer
+      - description: 协议版本号
+        in: query
+        name: agreementversion
+        type: integer
+      - description: 协议编号(模糊匹配)
+        in: query
+        name: agreementno
+        type: string
+      - description: 协议名称(模糊匹配)
+        in: query
+        name: agreementname
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjUserNodeCfgAndStatus'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询用户协议节点配置和状态
+      tags:
+      - 大连千海金(协议和签约信息)
   /Quote/QueryHistoryDatas:
     get:
       parameters:

+ 79 - 32
models/qhjAgreement.go

@@ -55,13 +55,8 @@ func (r *QhjAgreementConfig) buildSql() string {
 	sqlId.AndEx("t.agreementtype", r.AGREEMENTTYPE, r.AGREEMENTTYPE > 0)
 	sqlId.AndEx("t.agreementfrequency", r.AGREEMENTFREQUENCY, r.AGREEMENTFREQUENCY > 0)
 	sqlId.AndEx("t.isvalid", r.ISVALID, r.ISVALID > 0)
-	if r.AGREEMENTNO != "" {
-		sqlId.JoinFormat(" and t.agreementno like '%%%v%%'", r.AGREEMENTNO)
-	}
-	if r.AGREEMENTNAME != "" {
-		sqlId.JoinFormat(" and t.agreementname like '%%%v%%'", r.AGREEMENTNAME)
-	}
-
+	sqlId.AndLike("t.agreementno", r.AGREEMENTNO)
+	sqlId.AndLike("t.agreementname", r.AGREEMENTNAME)
 	return sqlId.String()
 }
 
@@ -112,13 +107,8 @@ func (r *QhjAgreementChangeLog) buildSql() string {
 	sqlId.AndEx("t.agreementid", r.AGREEMENTID, r.AGREEMENTID > 0)
 	sqlId.AndEx("t.agreementversion", r.AGREEMENTVERSION, r.AGREEMENTVERSION > 0)
 	sqlId.AndEx("t.agreementtype", r.AGREEMENTTYPE, r.AGREEMENTTYPE > 0)
-
-	if r.AGREEMENTNO != "" {
-		sqlId.JoinFormat(" and t.agreementno like '%%%v%%'", r.AGREEMENTNO)
-	}
-	if r.AGREEMENTNAME != "" {
-		sqlId.JoinFormat(" and t.agreementname like '%%%v%%'", r.AGREEMENTNAME)
-	}
+	sqlId.AndLike("t.agreementno", r.AGREEMENTNO)
+	sqlId.AndLike("t.agreementname", r.AGREEMENTNAME)
 
 	return sqlId.String()
 }
@@ -144,6 +134,7 @@ type QhjNodeAgreementConfig struct {
 	GOODSID          int32  `json:"goodsid"  xorm:"GOODSID" form:"goodsid"`                            // 商品ID [默认为0, NodeType>=3 的为商品值]
 	AGREEMENTNO      string `json:"agreementno"  xorm:"AGREEMENTNO" form:"agreementno"`                // 协议编号
 	AGREEMENTNAME    string `json:"agreementname"  xorm:"AGREEMENTNAME" form:"agreementname"`          // 协议名称
+	AGREEMENTCONTENT string `json:"agreementcontent"  xorm:"AGREEMENTCONTENT" form:"agreementcontent"` // 协议内容
 }
 
 func (r *QhjNodeAgreementConfig) calc() {
@@ -170,12 +161,8 @@ func (r *QhjNodeAgreementConfig) buildSql() string {
 	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)
-	if r.AGREEMENTNO != "" {
-		sqlId.JoinFormat(" and c.agreementno like '%%%v%%'", r.AGREEMENTNO)
-	}
-	if r.AGREEMENTNAME != "" {
-		sqlId.JoinFormat(" and c.agreementname like '%%%v%%'", r.AGREEMENTNAME)
-	}
+	sqlId.AndLike("c.agreementno", r.AGREEMENTNO)
+	sqlId.AndLike("c.agreementname", r.AGREEMENTNAME)
 	return sqlId.String()
 }
 
@@ -227,9 +214,7 @@ func (r *QhjCustomerSignStatus) buildSql() string {
 	sqlId.AndEx("t.nodetype", r.NODETYPE, r.NODETYPE > 0)
 	sqlId.AndEx("t.goodsid", r.GOODSID, r.GOODSID > 0)
 	sqlId.AndEx("t.tradedate", r.TRADEDATE, r.TRADEDATE != "")
-	if r.USERNAME != "" {
-		sqlId.JoinFormat(" and u.accountname like '%%%v%%'", r.USERNAME)
-	}
+	sqlId.AndLike("u.accountname", r.USERNAME)
 	return sqlId.String()
 }
 
@@ -295,15 +280,9 @@ func (r *QhjCustomerSignLog) buildSql() string {
 	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)
-	if r.USERNAME != "" {
-		sqlId.JoinFormat(" and u.accountname like '%%%v%%'", r.USERNAME)
-	}
-	if r.AGREEMENTNO != "" {
-		sqlId.JoinFormat(" and c.agreementno like '%%%v%%'", r.AGREEMENTNO)
-	}
-	if r.AGREEMENTNAME != "" {
-		sqlId.JoinFormat(" and c.agreementname like '%%%v%%'", r.AGREEMENTNAME)
-	}
+	sqlId.AndLike("u.accountname", r.USERNAME)
+	sqlId.AndLike("c.agreementno", r.AGREEMENTNO)
+	sqlId.AndLike("c.agreementname", r.AGREEMENTNAME)
 	return sqlId.String()
 }
 
@@ -316,3 +295,71 @@ func (r *QhjCustomerSignLog) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// QhjUserNodeCfgAndStatus 客户签约节点和状态
+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:卖出
+	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"`                   // 创建时间
+	GOODSID          int32  `json:"goodsid"  xorm:"GOODSID" form:"goodsid"`                            // 商品ID [默认为0, NodeType>=3 的为商品值]
+	AGREEMENTNO      string `json:"agreementno"  xorm:"AGREEMENTNO" form:"agreementno"`                // 协议编号
+	AGREEMENTNAME    string `json:"agreementname"  xorm:"AGREEMENTNAME" form:"agreementname"`          // 协议名称
+	AGREEMENTCONTENT string `json:"agreementcontent"  xorm:"AGREEMENTCONTENT" form:"agreementcontent"` // 协议内容
+	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)
+}
+
+func (r *QhjUserNodeCfgAndStatus) calc() {
+
+}
+
+func (r *QhjUserNodeCfgAndStatus) buildSql() string {
+	var sqlId utils.SQLVal = "with k as" +
+		" (select *" +
+		"    from (select row_number() over(partition by userid, nodetype order by tradedate desc) cnt," +
+		"                 r.*" +
+		"            from QHJ_CustomerSignStatus r)" +
+		"   where cnt = 1)" +
+		"SELECT t.CONFIGID," +
+		"       t.NODETYPE," +
+		"       t.GOODSID," +
+		"       t.AGREEMENTID," +
+		"       t.AGREEMENTTYPE," +
+		"       t.AGREEMENTVERSION," +
+		"       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       c.agreementno," +
+		"       c.agreementname," +
+		"       to_char(c.agreementcontent) agreementcontent," +
+		"       k.userid," +
+		"       k.tradedate," +
+		"       k.signtimestamp" +
+		"  FROM QHJ_NODEAGREEMENTCONFIG t" +
+		"  LEFT JOIN QHJ_AGREEMENTCONFIG c" +
+		"    on t.agreementid = c.agreementid" +
+		"  LEFT JOIN k on k.nodetype=t.nodetype and k.userid=%v" +
+		" 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.AndLike("c.agreementno", r.AGREEMENTNO)
+	sqlId.AndLike("c.agreementname", r.AGREEMENTNAME)
+	return sqlId.String()
+}
+
+// GetDataEx 获取客户签约节点和状态
+func (r *QhjUserNodeCfgAndStatus) GetDataEx() (interface{}, error) {
+	sData := make([]QhjUserNodeCfgAndStatus, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -498,6 +498,7 @@ func InitRouter() *gin.Engine {
 		qhjAgreementR.GET("QueryNodeAgreementConfig", qhj.QueryNodeAgreementConfig)
 		qhjAgreementR.GET("QueryCustomerSignStatus", qhj.QueryCustomerSignStatus)
 		qhjAgreementR.GET("QueryQhjCustomerSignLog", qhj.QueryQhjCustomerSignLog)
+		qhjAgreementR.GET("QueryUserNodeCfgAndStatus", qhj.QueryUserNodeCfgAndStatus)
 	}
 
 	return r

+ 7 - 0
utils/sqlUtils.go

@@ -83,3 +83,10 @@ func (r *SQLVal) JoinEx(bJoin bool, condition string) {
 func (r *SQLVal) JoinFormat(strFmt string, param ...interface{}) {
 	*r += SQLVal(fmt.Sprintf(strFmt, param...))
 }
+
+// AndLike 模糊匹配, 参数 val 为空时不进行匹配
+func (r *SQLVal) AndLike(fieldName string, val string) {
+	if len(val) > 0 {
+		*r += SQLVal(fmt.Sprintf(" and %v like '%%%v%%'", fieldName, val))
+	}
+}