Pārlūkot izejas kodu

1.查交易扩展商加 增加个人/企业是否可见字段
2.查成交明细增加成交价字段
3.增加查询客户协议相关接口

zou.yingbin 4 gadi atpakaļ
vecāks
revīzija
dbfcf65e53
8 mainītis faili ar 2156 papildinājumiem un 12 dzēšanām
  1. 120 0
      controllers/qhj/qryQhjAgreement.go
  2. 632 0
      docs/docs.go
  3. 632 0
      docs/swagger.json
  4. 428 0
      docs/swagger.yaml
  5. 15 11
      models/qhj.go
  6. 318 0
      models/qhjAgreement.go
  7. 1 1
      models/qhjPCWeb.go
  8. 10 0
      routers/router.go

+ 120 - 0
controllers/qhj/qryQhjAgreement.go

@@ -0,0 +1,120 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/6/30 9:29
+* @Modify  : 2021/6/30 9:29
+ */
+
+package qhj
+
+import (
+	"github.com/gin-gonic/gin"
+	"mtp2_if/global/app"
+	"mtp2_if/models"
+)
+
+// QueryAgreementConfig
+// @Summary 查询协议配置
+// @Produce json
+// @Security ApiKeyAuth
+// @Param agreementid query int false "协议ID"
+// @Param agreementversion query int false "协议版本号"
+// @Param agreementtype query int false "协议类型 - 1:注册 2:登录 3:交易"
+// @Param isvalid query int false "是否有效 - 0:无效 1:有效"
+// @Param agreementno query string false "协议编号(模糊匹配)"
+// @Param agreementname query string false "协议名称(模糊匹配)"
+// @Success 200 {array} models.QhjAgreementConfig
+// @Failure 500 {object} app.Response
+// @Router /QhjSys/QueryAgreementConfig [get]
+// @Tags 大连千海金(协议和签约信息)
+func QueryAgreementConfig(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjAgreementConfig{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QueryAgreementChangeLog
+// @Summary 查询协议配置变更流水
+// @Produce json
+// @Security ApiKeyAuth
+// @Param agreementid query int false "协议ID"
+// @Param agreementversion query int false "协议版本号"
+// @Param agreementtype query int false "协议类型 - 1:注册 2:登录 3:交易"
+// @Param agreementno query string false "协议编号(模糊匹配)"
+// @Param agreementname query string false "协议名称(模糊匹配)"
+// @Success 200 {array} models.QhjAgreementChangeLog
+// @Failure 500 {object} app.Response
+// @Router /QhjSys/QueryAgreementChangeLog [get]
+// @Tags 大连千海金(协议和签约信息)
+func QueryAgreementChangeLog(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjAgreementChangeLog{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QueryNodeAgreementConfig
+// @Summary 查询协议节点配置
+// @Produce json
+// @Security ApiKeyAuth
+// @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.QhjNodeAgreementConfig
+// @Failure 500 {object} app.Response
+// @Router /QhjSys/QueryNodeAgreementConfig [get]
+// @Tags 大连千海金(协议和签约信息)
+func QueryNodeAgreementConfig(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjNodeAgreementConfig{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QueryCustomerSignStatus
+// @Summary 查询客户协议签约状态
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int false "客户ID"
+// @Param nodetype query int false "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易"
+// @Param goodsid query int false "商品ID [默认为0, NodeType>=3 的为商品值]"
+// @Param tradedate query string false "创建交易日(yyyyMMdd)"
+// @Param username query string false "用户名称(模糊匹配)"
+// @Success 200 {array} models.QhjCustomerSignStatus
+// @Failure 500 {object} app.Response
+// @Router /QhjSys/QueryCustomerSignStatus [get]
+// @Tags 大连千海金(协议和签约信息)
+func QueryCustomerSignStatus(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjCustomerSignStatus{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QueryQhjCustomerSignLog
+// @Summary 查询客户协议签约流水
+// @Produce json
+// @Security ApiKeyAuth
+// @Param logid query int false "流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)"
+// @Param userid query int false "客户ID"
+// @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 username query string false "用户名称(模糊匹配)"
+// @Param agreementno query string false "协议编号(模糊匹配)"
+// @Param agreementname query string false "协议名称(模糊匹配)"
+// @Success 200 {array} models.QhjCustomerSignLog
+// @Failure 500 {object} app.Response
+// @Router /QhjSys/QueryQhjCustomerSignLog [get]
+// @Tags 大连千海金(协议和签约信息)
+func QueryQhjCustomerSignLog(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjCustomerSignLog{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 632 - 0
docs/docs.go

@@ -8549,6 +8549,373 @@ var doc = `{
                 }
             }
         },
+        "/QhjSys/QueryAgreementChangeLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询协议配置变更流水",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "协议ID",
+                        "name": "agreementid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议版本号",
+                        "name": "agreementversion",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议类型 - 1:注册 2:登录 3:交易",
+                        "name": "agreementtype",
+                        "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.QhjAgreementChangeLog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryAgreementConfig": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询协议配置",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "协议ID",
+                        "name": "agreementid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议版本号",
+                        "name": "agreementversion",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议类型 - 1:注册 2:登录 3:交易",
+                        "name": "agreementtype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否有效 - 0:无效 1:有效",
+                        "name": "isvalid",
+                        "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.QhjAgreementConfig"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryCustomerSignStatus": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询客户协议签约状态",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "客户ID",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易",
+                        "name": "nodetype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                        "name": "goodsid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "创建交易日(yyyyMMdd)",
+                        "name": "tradedate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "用户名称(模糊匹配)",
+                        "name": "username",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjCustomerSignStatus"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryNodeAgreementConfig": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询协议节点配置",
+                "parameters": [
+                    {
+                        "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.QhjNodeAgreementConfig"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryQhjCustomerSignLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询客户协议签约流水",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)",
+                        "name": "logid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "客户ID",
+                        "name": "userid",
+                        "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": "string",
+                        "description": "用户名称(模糊匹配)",
+                        "name": "username",
+                        "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.QhjCustomerSignLog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Quote/QueryHistoryDatas": {
             "get": {
                 "security": [
@@ -22493,6 +22860,116 @@ var doc = `{
                 }
             }
         },
+        "models.QhjAgreementChangeLog": {
+            "type": "object",
+            "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
+                "agreementfrequency": {
+                    "description": "协议频率 - 1:首次 2:每次 [登录为2, 其它为1]",
+                    "type": "integer"
+                },
+                "agreementid": {
+                    "description": "协议ID",
+                    "type": "integer"
+                },
+                "agreementname": {
+                    "description": "协议名称",
+                    "type": "string"
+                },
+                "agreementno": {
+                    "description": "协议编号",
+                    "type": "string"
+                },
+                "agreementtype": {
+                    "description": "协议类型 - 1:注册 2:登录 3:交易",
+                    "type": "integer"
+                },
+                "agreementversion": {
+                    "description": "协议版本号",
+                    "type": "integer"
+                },
+                "logid": {
+                    "description": "流水ID(SEQ_QHJ_AGREEMENTCHANGELOG)",
+                    "type": "integer"
+                },
+                "reviserid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "revisersrc": {
+                    "description": "修改来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.QhjAgreementConfig": {
+            "type": "object",
+            "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
+                "agreementfrequency": {
+                    "description": "协议频率 - 1:首次 2:每次 [登录为2, 其它为1]",
+                    "type": "integer"
+                },
+                "agreementid": {
+                    "description": "协议ID(SEQ_QHJ_AGREEMENTCONFIG)",
+                    "type": "integer"
+                },
+                "agreementname": {
+                    "description": "协议名称",
+                    "type": "string"
+                },
+                "agreementno": {
+                    "description": "协议编号",
+                    "type": "string"
+                },
+                "agreementtype": {
+                    "description": "协议类型 - 1:注册 2:登录 3:交易",
+                    "type": "integer"
+                },
+                "agreementversion": {
+                    "description": "协议版本号(从1开始每次修改加1)",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "creatorsrc": {
+                    "description": "创建来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "isvalid": {
+                    "description": "是否有效 - 0:无效 1:有效",
+                    "type": "integer"
+                },
+                "reviserid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "revisersrc": {
+                    "description": "修改来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjBankAccountSign": {
             "type": "object",
             "properties": {
@@ -23090,6 +23567,120 @@ var doc = `{
                 }
             }
         },
+        "models.QhjCustomerSignLog": {
+            "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"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "logid": {
+                    "description": "流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)",
+                    "type": "integer"
+                },
+                "nodetype": {
+                    "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                    "type": "integer"
+                },
+                "signadressurl": {
+                    "description": "签约文件地址",
+                    "type": "string"
+                },
+                "signtimestamp": {
+                    "description": "签约状态时间戳",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "客户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "客户名称",
+                    "type": "string"
+                }
+            }
+        },
+        "models.QhjCustomerSignStatus": {
+            "type": "object",
+            "properties": {
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "nodetype": {
+                    "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易",
+                    "type": "integer"
+                },
+                "signtimestamp": {
+                    "description": "签约状态时间戳",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "创建交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "客户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "客户名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjMgrAccountOutInApply": {
             "type": "object",
             "properties": {
@@ -23837,6 +24428,47 @@ var doc = `{
                 }
             }
         },
+        "models.QhjNodeAgreementConfig": {
+            "type": "object",
+            "properties": {
+                "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"
+                }
+            }
+        },
         "models.QhjParentAreaList": {
             "type": "object",
             "properties": {

+ 632 - 0
docs/swagger.json

@@ -8533,6 +8533,373 @@
                 }
             }
         },
+        "/QhjSys/QueryAgreementChangeLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询协议配置变更流水",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "协议ID",
+                        "name": "agreementid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议版本号",
+                        "name": "agreementversion",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议类型 - 1:注册 2:登录 3:交易",
+                        "name": "agreementtype",
+                        "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.QhjAgreementChangeLog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryAgreementConfig": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询协议配置",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "协议ID",
+                        "name": "agreementid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议版本号",
+                        "name": "agreementversion",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "协议类型 - 1:注册 2:登录 3:交易",
+                        "name": "agreementtype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否有效 - 0:无效 1:有效",
+                        "name": "isvalid",
+                        "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.QhjAgreementConfig"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryCustomerSignStatus": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询客户协议签约状态",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "客户ID",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易",
+                        "name": "nodetype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                        "name": "goodsid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "创建交易日(yyyyMMdd)",
+                        "name": "tradedate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "用户名称(模糊匹配)",
+                        "name": "username",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjCustomerSignStatus"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryNodeAgreementConfig": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询协议节点配置",
+                "parameters": [
+                    {
+                        "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.QhjNodeAgreementConfig"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/QhjSys/QueryQhjCustomerSignLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(协议和签约信息)"
+                ],
+                "summary": "查询客户协议签约流水",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)",
+                        "name": "logid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "客户ID",
+                        "name": "userid",
+                        "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": "string",
+                        "description": "用户名称(模糊匹配)",
+                        "name": "username",
+                        "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.QhjCustomerSignLog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Quote/QueryHistoryDatas": {
             "get": {
                 "security": [
@@ -22477,6 +22844,116 @@
                 }
             }
         },
+        "models.QhjAgreementChangeLog": {
+            "type": "object",
+            "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
+                "agreementfrequency": {
+                    "description": "协议频率 - 1:首次 2:每次 [登录为2, 其它为1]",
+                    "type": "integer"
+                },
+                "agreementid": {
+                    "description": "协议ID",
+                    "type": "integer"
+                },
+                "agreementname": {
+                    "description": "协议名称",
+                    "type": "string"
+                },
+                "agreementno": {
+                    "description": "协议编号",
+                    "type": "string"
+                },
+                "agreementtype": {
+                    "description": "协议类型 - 1:注册 2:登录 3:交易",
+                    "type": "integer"
+                },
+                "agreementversion": {
+                    "description": "协议版本号",
+                    "type": "integer"
+                },
+                "logid": {
+                    "description": "流水ID(SEQ_QHJ_AGREEMENTCHANGELOG)",
+                    "type": "integer"
+                },
+                "reviserid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "revisersrc": {
+                    "description": "修改来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.QhjAgreementConfig": {
+            "type": "object",
+            "properties": {
+                "agreementcontent": {
+                    "description": "协议内容",
+                    "type": "string"
+                },
+                "agreementfrequency": {
+                    "description": "协议频率 - 1:首次 2:每次 [登录为2, 其它为1]",
+                    "type": "integer"
+                },
+                "agreementid": {
+                    "description": "协议ID(SEQ_QHJ_AGREEMENTCONFIG)",
+                    "type": "integer"
+                },
+                "agreementname": {
+                    "description": "协议名称",
+                    "type": "string"
+                },
+                "agreementno": {
+                    "description": "协议编号",
+                    "type": "string"
+                },
+                "agreementtype": {
+                    "description": "协议类型 - 1:注册 2:登录 3:交易",
+                    "type": "integer"
+                },
+                "agreementversion": {
+                    "description": "协议版本号(从1开始每次修改加1)",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "creatorsrc": {
+                    "description": "创建来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "isvalid": {
+                    "description": "是否有效 - 0:无效 1:有效",
+                    "type": "integer"
+                },
+                "reviserid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "revisersrc": {
+                    "description": "修改来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjBankAccountSign": {
             "type": "object",
             "properties": {
@@ -23074,6 +23551,120 @@
                 }
             }
         },
+        "models.QhjCustomerSignLog": {
+            "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"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "logid": {
+                    "description": "流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)",
+                    "type": "integer"
+                },
+                "nodetype": {
+                    "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出",
+                    "type": "integer"
+                },
+                "signadressurl": {
+                    "description": "签约文件地址",
+                    "type": "string"
+                },
+                "signtimestamp": {
+                    "description": "签约状态时间戳",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "客户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "客户名称",
+                    "type": "string"
+                }
+            }
+        },
+        "models.QhjCustomerSignStatus": {
+            "type": "object",
+            "properties": {
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [默认为0, NodeType\u003e=3 的为商品值]",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "nodetype": {
+                    "description": "环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易",
+                    "type": "integer"
+                },
+                "signtimestamp": {
+                    "description": "签约状态时间戳",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "创建交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "客户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "客户名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjMgrAccountOutInApply": {
             "type": "object",
             "properties": {
@@ -23821,6 +24412,47 @@
                 }
             }
         },
+        "models.QhjNodeAgreementConfig": {
+            "type": "object",
+            "properties": {
+                "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"
+                }
+            }
+        },
         "models.QhjParentAreaList": {
             "type": "object",
             "properties": {

+ 428 - 0
docs/swagger.yaml

@@ -9411,6 +9411,87 @@ definitions:
         description: 账户类型 1-个人 2-企业
         type: integer
     type: object
+  models.QhjAgreementChangeLog:
+    properties:
+      agreementcontent:
+        description: 协议内容
+        type: string
+      agreementfrequency:
+        description: 协议频率 - 1:首次 2:每次 [登录为2, 其它为1]
+        type: integer
+      agreementid:
+        description: 协议ID
+        type: integer
+      agreementname:
+        description: 协议名称
+        type: string
+      agreementno:
+        description: 协议编号
+        type: string
+      agreementtype:
+        description: 协议类型 - 1:注册 2:登录 3:交易
+        type: integer
+      agreementversion:
+        description: 协议版本号
+        type: integer
+      logid:
+        description: 流水ID(SEQ_QHJ_AGREEMENTCHANGELOG)
+        type: integer
+      reviserid:
+        description: 修改人
+        type: integer
+      revisersrc:
+        description: 修改来源 - 1:管理端 2:终端
+        type: integer
+      updatetime:
+        description: 更新时间
+        type: string
+    type: object
+  models.QhjAgreementConfig:
+    properties:
+      agreementcontent:
+        description: 协议内容
+        type: string
+      agreementfrequency:
+        description: 协议频率 - 1:首次 2:每次 [登录为2, 其它为1]
+        type: integer
+      agreementid:
+        description: 协议ID(SEQ_QHJ_AGREEMENTCONFIG)
+        type: integer
+      agreementname:
+        description: 协议名称
+        type: string
+      agreementno:
+        description: 协议编号
+        type: string
+      agreementtype:
+        description: 协议类型 - 1:注册 2:登录 3:交易
+        type: integer
+      agreementversion:
+        description: 协议版本号(从1开始每次修改加1)
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人
+        type: integer
+      creatorsrc:
+        description: 创建来源 - 1:管理端 2:终端
+        type: integer
+      isvalid:
+        description: 是否有效 - 0:无效 1:有效
+        type: integer
+      reviserid:
+        description: 修改人
+        type: integer
+      revisersrc:
+        description: 修改来源 - 1:管理端 2:终端
+        type: integer
+      updatetime:
+        description: 更新时间
+        type: string
+    type: object
   models.QhjBankAccountSign:
     properties:
       accountcode:
@@ -9856,6 +9937,90 @@ definitions:
         description: 用户名称
         type: string
     type: object
+  models.QhjCustomerSignLog:
+    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
+      createtime:
+        description: 创建时间
+        type: string
+      goodscode:
+        description: 商品代码
+        type: string
+      goodsid:
+        description: 商品ID [默认为0, NodeType>=3 的为商品值]
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      logid:
+        description: 流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)
+        type: integer
+      nodetype:
+        description: 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
+        type: integer
+      signadressurl:
+        description: 签约文件地址
+        type: string
+      signtimestamp:
+        description: 签约状态时间戳
+        type: string
+      userid:
+        description: 客户ID
+        type: integer
+      username:
+        description: 客户名称
+        type: string
+    type: object
+  models.QhjCustomerSignStatus:
+    properties:
+      createtime:
+        description: 创建时间
+        type: string
+      goodscode:
+        description: 商品代码
+        type: string
+      goodsid:
+        description: 商品ID [默认为0, NodeType>=3 的为商品值]
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      nodetype:
+        description: 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易
+        type: integer
+      signtimestamp:
+        description: 签约状态时间戳
+        type: string
+      tradedate:
+        description: 创建交易日(yyyyMMdd)
+        type: string
+      updatetime:
+        description: 更新时间
+        type: string
+      userid:
+        description: 客户ID
+        type: integer
+      username:
+        description: 客户名称
+        type: string
+    type: object
   models.QhjMgrAccountOutInApply:
     properties:
       accountcode:
@@ -10418,6 +10583,36 @@ definitions:
         description: 账户类型 1-个人 2-企业
         type: integer
     type: object
+  models.QhjNodeAgreementConfig:
+    properties:
+      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
+    type: object
   models.QhjParentAreaList:
     properties:
       accountname:
@@ -19558,6 +19753,239 @@ paths:
       summary: 查询持仓汇总
       tags:
       - 大连千海金(PCWeb)
+  /QhjSys/QueryAgreementChangeLog:
+    get:
+      parameters:
+      - description: 协议ID
+        in: query
+        name: agreementid
+        type: integer
+      - description: 协议版本号
+        in: query
+        name: agreementversion
+        type: integer
+      - description: 协议类型 - 1:注册 2:登录 3:交易
+        in: query
+        name: agreementtype
+        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.QhjAgreementChangeLog'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询协议配置变更流水
+      tags:
+      - 大连千海金(协议和签约信息)
+  /QhjSys/QueryAgreementConfig:
+    get:
+      parameters:
+      - description: 协议ID
+        in: query
+        name: agreementid
+        type: integer
+      - description: 协议版本号
+        in: query
+        name: agreementversion
+        type: integer
+      - description: 协议类型 - 1:注册 2:登录 3:交易
+        in: query
+        name: agreementtype
+        type: integer
+      - description: 是否有效 - 0:无效 1:有效
+        in: query
+        name: isvalid
+        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.QhjAgreementConfig'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询协议配置
+      tags:
+      - 大连千海金(协议和签约信息)
+  /QhjSys/QueryCustomerSignStatus:
+    get:
+      parameters:
+      - description: 客户ID
+        in: query
+        name: userid
+        type: integer
+      - description: 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易
+        in: query
+        name: nodetype
+        type: integer
+      - description: 商品ID [默认为0, NodeType>=3 的为商品值]
+        in: query
+        name: goodsid
+        type: integer
+      - description: 创建交易日(yyyyMMdd)
+        in: query
+        name: tradedate
+        type: string
+      - description: 用户名称(模糊匹配)
+        in: query
+        name: username
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjCustomerSignStatus'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询客户协议签约状态
+      tags:
+      - 大连千海金(协议和签约信息)
+  /QhjSys/QueryNodeAgreementConfig:
+    get:
+      parameters:
+      - 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.QhjNodeAgreementConfig'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询协议节点配置
+      tags:
+      - 大连千海金(协议和签约信息)
+  /QhjSys/QueryQhjCustomerSignLog:
+    get:
+      parameters:
+      - description: 流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)
+        in: query
+        name: logid
+        type: integer
+      - description: 客户ID
+        in: query
+        name: userid
+        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: 用户名称(模糊匹配)
+        in: query
+        name: username
+        type: string
+      - 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.QhjCustomerSignLog'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询客户协议签约流水
+      tags:
+      - 大连千海金(协议和签约信息)
   /Quote/QueryHistoryDatas:
     get:
       parameters:

+ 15 - 11
models/qhj.go

@@ -1729,16 +1729,18 @@ func (r *QhjPayOrder) GetDataEx() (interface{}, error) {
 
 // Qhjgoodsex 交易商品扩展表(千海金)
 type Qhjgoodsex struct {
-	Goodsid               int32   `json:"goodsid"  xorm:"GOODSID"`                             // 商品ID(自增ID SEQ_GOODS)
-	Minamount             float64 `json:"minamount"  xorm:"MINAMOUNT"`                         // 最小购买金额
-	Canfinance            int32   `json:"canfinance"  xorm:"CANFINANCE"`                       // 是否支持融资 - 0:不支持 1:支持【69:铂金宝】
-	Canregularlybuy       int32   `json:"canregularlybuy"  xorm:"CANREGULARLYBUY"`             // 是否支持定投 - 0:不支持 1:支持【69:铂金宝】
-	Regularlybuyminqty    float64 `json:"regularlybuyminqty"  xorm:"REGULARLYBUYMINQTY"`       // 定投最小数量
-	Regularlybuyminamount float64 `json:"regularlybuyminamount"  xorm:"REGULARLYBUYMINAMOUNT"` // 定投最小金额
-	Deliverygoodsid       int32   `json:"deliverygoodsid"  xorm:"DELIVERYGOODSID"`             // 现货品种ID
-	Wrstandardid          int32   `json:"wrstandardid"  xorm:"WRSTANDARDID"`                   // 现货商品ID
-	Spotgoodsbrandid      int32   `json:"spotgoodsbrandid"  xorm:"SPOTGOODSBRANDID"`           // 现货品牌ID -  存“DGFactoryItem”表"DGFactoryItemID"
-	Defaulttradeuserid    int64   `json:"defaulttradeuserid"  xorm:"DEFAULTTRADEUSERID"`       // 默认交易用户ID
+	Goodsid                 int32   `json:"goodsid"  xorm:"GOODSID"`                                   // 商品ID(自增ID SEQ_GOODS)
+	Minamount               float64 `json:"minamount"  xorm:"MINAMOUNT"`                               // 最小购买金额
+	Canfinance              int32   `json:"canfinance"  xorm:"CANFINANCE"`                             // 是否支持融资 - 0:不支持 1:支持【69:铂金宝】
+	Canregularlybuy         int32   `json:"canregularlybuy"  xorm:"CANREGULARLYBUY"`                   // 是否支持定投 - 0:不支持 1:支持【69:铂金宝】
+	Regularlybuyminqty      float64 `json:"regularlybuyminqty"  xorm:"REGULARLYBUYMINQTY"`             // 定投最小数量
+	Regularlybuyminamount   float64 `json:"regularlybuyminamount"  xorm:"REGULARLYBUYMINAMOUNT"`       // 定投最小金额
+	Deliverygoodsid         int32   `json:"deliverygoodsid"  xorm:"DELIVERYGOODSID"`                   // 现货品种ID
+	Wrstandardid            int32   `json:"wrstandardid"  xorm:"WRSTANDARDID"`                         // 现货商品ID
+	Spotgoodsbrandid        int32   `json:"spotgoodsbrandid"  xorm:"SPOTGOODSBRANDID"`                 // 现货品牌ID -  存“DGFactoryItem”表"DGFactoryItemID"
+	Defaulttradeuserid      int64   `json:"defaulttradeuserid"  xorm:"DEFAULTTRADEUSERID"`             // 默认交易用户ID
+	VISIBILITYFORPERSONAL   int32   `json:"visibilityforpersonal"  xorm:"'VISIBILITYFORPERSONAL'"`     // 个人客户是否可见 - 0:不可见 1:可见
+	VISIBILITYFORENTERPRISE int32   `json:"visibilityforenterprise"  xorm:"'VISIBILITYFORENTERPRISE'"` // 企业客户是否可见 - 0:不可见 1:可见
 }
 
 func (r *Qhjgoodsex) calc() {
@@ -1755,7 +1757,9 @@ func (r *Qhjgoodsex) buildSql() string {
 		"       t.DELIVERYGOODSID," +
 		"       t.WRSTANDARDID," +
 		"       t.SPOTGOODSBRANDID," +
-		"       t.DEFAULTTRADEUSERID" +
+		"       t.DEFAULTTRADEUSERID," +
+		"       t.VISIBILITYFORPERSONAL," +
+		"       t.VISIBILITYFORENTERPRISE" +
 		"  FROM QHJ_GOODSEX t" +
 		"  LEFT JOIN GOODS g on t.goodsid=g.goodsid" +
 		" WHERE 1 = 1"

+ 318 - 0
models/qhjAgreement.go

@@ -0,0 +1,318 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/6/30 9:31
+* @Modify  : 2021/6/30 9:31
+ */
+
+package models
+
+import (
+	"mtp2_if/db"
+	"mtp2_if/utils"
+)
+
+// QhjAgreementConfig 协议配置
+type QhjAgreementConfig struct {
+	AGREEMENTID        int64  `json:"agreementid"  xorm:"AGREEMENTID" form:"agreementid"`                      // 协议ID(SEQ_QHJ_AGREEMENTCONFIG)
+	AGREEMENTVERSION   int32  `json:"agreementversion"  xorm:"AGREEMENTVERSION" form:"agreementversion"`       // 协议版本号(从1开始每次修改加1)
+	AGREEMENTNO        string `json:"agreementno"  xorm:"AGREEMENTNO" form:"agreementno"`                      // 协议编号
+	AGREEMENTNAME      string `json:"agreementname"  xorm:"AGREEMENTNAME" form:"agreementname"`                // 协议名称
+	AGREEMENTTYPE      int32  `json:"agreementtype"  xorm:"AGREEMENTTYPE" form:"agreementtype"`                // 协议类型 - 1:注册 2:登录 3:交易
+	AGREEMENTFREQUENCY int32  `json:"agreementfrequency"  xorm:"AGREEMENTFREQUENCY" form:"agreementfrequency"` // 协议频率 - 1:首次 2:每次 [登录为2, 其它为1]
+	AGREEMENTCONTENT   string `json:"agreementcontent"  xorm:"AGREEMENTCONTENT" form:"agreementcontent"`       // 协议内容
+	ISVALID            int32  `json:"isvalid"  xorm:"ISVALID" form:"isvalid"`                                  // 是否有效 - 0:无效 1:有效
+	CREATORSRC         int32  `json:"creatorsrc"  xorm:"CREATORSRC" form:"creatorsrc"`                         // 创建来源 - 1:管理端 2:终端
+	CREATORID          int64  `json:"creatorid"  xorm:"CREATORID" form:"creatorid"`                            // 创建人
+	CREATETIME         string `json:"createtime"  xorm:"CREATETIME" form:"createtime"`                         // 创建时间
+	REVISERSRC         int32  `json:"revisersrc"  xorm:"REVISERSRC" form:"revisersrc"`                         // 修改来源 - 1:管理端 2:终端
+	REVISERID          int64  `json:"reviserid"  xorm:"REVISERID" form:"reviserid"`                            // 修改人
+	UPDATETIME         string `json:"updatetime"  xorm:"UPDATETIME" form:"updatetime"`                         // 更新时间
+}
+
+func (r *QhjAgreementConfig) calc() {
+
+}
+
+func (r *QhjAgreementConfig) buildSql() string {
+	var sqlId utils.SQLVal = "SELECT t.AGREEMENTID," +
+		"       t.AGREEMENTVERSION," +
+		"       t.AGREEMENTNO," +
+		"       t.AGREEMENTNAME," +
+		"       t.AGREEMENTTYPE," +
+		"       t.AGREEMENTFREQUENCY," +
+		"       to_char(t.AGREEMENTCONTENT) AGREEMENTCONTENT," +
+		"       t.ISVALID," +
+		"       t.CREATORSRC," +
+		"       t.CREATORID," +
+		"       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       t.REVISERSRC," +
+		"       t.REVISERID," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME" +
+		"  FROM QHJ_AgreementConfig t" +
+		" WHERE 1 = 1"
+	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)
+	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)
+	}
+
+	return sqlId.String()
+}
+
+// GetDataEx 获取协议配置
+func (r *QhjAgreementConfig) GetDataEx() (interface{}, error) {
+	sData := make([]QhjAgreementConfig, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// QhjAgreementChangeLog 协议配置变更流水
+type QhjAgreementChangeLog struct {
+	LOGID              int64  `json:"logid"  xorm:"LOGID" form:"logid"`                                        // 流水ID(SEQ_QHJ_AGREEMENTCHANGELOG)
+	AGREEMENTID        int64  `json:"agreementid"  xorm:"AGREEMENTID" form:"agreementid"`                      // 协议ID
+	AGREEMENTVERSION   int32  `json:"agreementversion"  xorm:"AGREEMENTVERSION" form:"agreementversion"`       // 协议版本号
+	AGREEMENTNO        string `json:"agreementno"  xorm:"AGREEMENTNO" form:"agreementno"`                      // 协议编号
+	AGREEMENTNAME      string `json:"agreementname"  xorm:"AGREEMENTNAME" form:"agreementname"`                // 协议名称
+	AGREEMENTTYPE      int32  `json:"agreementtype"  xorm:"AGREEMENTTYPE" form:"agreementtype"`                // 协议类型 - 1:注册 2:登录 3:交易
+	AGREEMENTFREQUENCY int32  `json:"agreementfrequency"  xorm:"AGREEMENTFREQUENCY" form:"agreementfrequency"` // 协议频率 - 1:首次 2:每次 [登录为2, 其它为1]
+	AGREEMENTCONTENT   string `json:"agreementcontent"  xorm:"AGREEMENTCONTENT" form:"agreementcontent"`       // 协议内容
+	REVISERSRC         int32  `json:"revisersrc"  xorm:"REVISERSRC" form:"revisersrc"`                         // 修改来源 - 1:管理端 2:终端
+	REVISERID          int64  `json:"reviserid"  xorm:"REVISERID" form:"reviserid"`                            // 修改人
+	UPDATETIME         string `json:"updatetime"  xorm:"UPDATETIME" form:"updatetime"`                         // 更新时间
+}
+
+func (r *QhjAgreementChangeLog) calc() {
+
+}
+
+func (r *QhjAgreementChangeLog) buildSql() string {
+	var sqlId utils.SQLVal = "SELECT t.LOGID," +
+		"       t.AGREEMENTID," +
+		"       t.AGREEMENTVERSION," +
+		"       t.AGREEMENTNO," +
+		"       t.AGREEMENTNAME," +
+		"       t.AGREEMENTTYPE," +
+		"       t.AGREEMENTFREQUENCY," +
+		"       to_char(t.AGREEMENTCONTENT) AGREEMENTCONTENT," +
+		"       t.REVISERSRC," +
+		"       t.REVISERID," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME" +
+		"  FROM QHJ_AGREEMENTCHANGELOG t" +
+		" WHERE 1 = 1"
+	sqlId.AndEx("t.logid", r.LOGID, r.LOGID > 0)
+	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)
+	}
+
+	return sqlId.String()
+}
+
+// GetDataEx 获取协议配置变更流水
+func (r *QhjAgreementChangeLog) GetDataEx() (interface{}, error) {
+	sData := make([]QhjAgreementChangeLog, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// QhjNodeAgreementConfig 协议节点配置
+type QhjNodeAgreementConfig 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"`          // 协议名称
+}
+
+func (r *QhjNodeAgreementConfig) calc() {
+
+}
+
+func (r *QhjNodeAgreementConfig) buildSql() string {
+	var sqlId utils.SQLVal = "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" +
+		"  FROM QHJ_NODEAGREEMENTCONFIG t" +
+		"  LEFT JOIN QHJ_AGREEMENTCONFIG c on t.agreementid=c.agreementid" +
+		" WHERE 1 = 1"
+	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)
+	if r.AGREEMENTNO != "" {
+		sqlId.JoinFormat(" and c.agreementno like '%%%v%%'", r.AGREEMENTNO)
+	}
+	if r.AGREEMENTNAME != "" {
+		sqlId.JoinFormat(" and c.agreementname like '%%%v%%'", r.AGREEMENTNAME)
+	}
+	return sqlId.String()
+}
+
+// GetDataEx 获取协议节点配置
+func (r *QhjNodeAgreementConfig) GetDataEx() (interface{}, error) {
+	sData := make([]QhjNodeAgreementConfig, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// QhjCustomerSignStatus 协议签约状态
+type QhjCustomerSignStatus struct {
+	NODETYPE      int32  `json:"nodetype"  xorm:"NODETYPE" form:"nodetype"`                // 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出  99:首次交易
+	USERID        int64  `json:"userid"  xorm:"USERID" form:"userid"`                      // 客户ID
+	CREATETIME    string `json:"createtime"  xorm:"CREATETIME" form:"createtime"`          // 创建时间
+	GOODSID       int32  `json:"goodsid"  xorm:"GOODSID" form:"goodsid"`                   // 商品ID [默认为0, NodeType>=3 的为商品值]
+	SIGNTIMESTAMP string `json:"signtimestamp"  xorm:"SIGNTIMESTAMP" form:"signtimestamp"` // 签约状态时间戳
+	TRADEDATE     string `json:"tradedate"  xorm:"TRADEDATE" form:"tradedate"`             // 创建交易日(yyyyMMdd)
+	UPDATETIME    string `json:"updatetime"  xorm:"UPDATETIME" form:"updatetime"`          // 更新时间
+
+	USERNAME  string `json:"username"  xorm:"USERNAME" form:"USERNAME"`    // 客户名称
+	GOODSNAME string `json:"goodsname"  xorm:"GOODSNAME" form:"GOODSNAME"` // 商品名称
+	GOODSCODE string `json:"goodscode"  xorm:"GOODSCODE" form:"GOODSCODE"` // 商品代码
+}
+
+func (r *QhjCustomerSignStatus) calc() {
+
+}
+
+func (r *QhjCustomerSignStatus) buildSql() string {
+	var sqlId utils.SQLVal = "SELECT t.USERID," +
+		"       t.NODETYPE," +
+		"       t.GOODSID," +
+		"       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       t.TRADEDATE," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"       t.SIGNTIMESTAMP," +
+		"       u.accountname username," +
+		"       g.goodscode," +
+		"       g.goodsname" +
+		"  FROM QHJ_CUSTOMERSIGNSTATUS t" +
+		"  LEFT JOIN USERACCOUNT u on t.userid=u.userid" +
+		"  LEFT JOIN GOODS g on t.goodsid=g.goodsid" +
+		" WHERE 1 = 1"
+	sqlId.AndEx("t.userid", r.USERID, r.USERID > 0)
+	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)
+	}
+	return sqlId.String()
+}
+
+// GetDataEx 获取协议签约状态
+func (r *QhjCustomerSignStatus) GetDataEx() (interface{}, error) {
+	sData := make([]QhjCustomerSignStatus, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// QhjCustomerSignLog 客户协议签约流水
+type QhjCustomerSignLog struct {
+	AGREEMENTVERSION int32  `json:"agreementversion"  xorm:"AGREEMENTVERSION" form:"agreementversion"` // 协议版本号
+	NODETYPE         int32  `json:"nodetype"  xorm:"NODETYPE" form:"nodetype"`                         // 环节类型 - 1:注册  2:登录 3:购买 4:融资购买 5:定投 6:卖出
+	LOGID            int64  `json:"logid"  xorm:"LOGID" form:"logid"`                                  // 流水ID(SEQ_QHJ_CUSTOMERSIGNLOG)
+	USERID           int64  `json:"userid"  xorm:"USERID" form:"userid"`                               // 客户ID
+	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 的为商品值]
+	SIGNADRESSURL    string `json:"signadressurl"  xorm:"SIGNADRESSURL" form:"signadressurl"`          // 签约文件地址
+	SIGNTIMESTAMP    string `json:"signtimestamp"  xorm:"SIGNTIMESTAMP" form:"signtimestamp"`          // 签约状态时间戳
+
+	USERNAME         string `json:"username"  xorm:"USERNAME" form:"USERNAME"`                         // 客户名称
+	GOODSNAME        string `json:"goodsname"  xorm:"GOODSNAME" form:"GOODSNAME"`                      // 商品名称
+	GOODSCODE        string `json:"goodscode"  xorm:"GOODSCODE" form:"GOODSCODE"`                      // 商品代码
+	AGREEMENTNO      string `json:"agreementno"  xorm:"AGREEMENTNO" form:"agreementno"`                // 协议编号
+	AGREEMENTNAME    string `json:"agreementname"  xorm:"AGREEMENTNAME" form:"agreementname"`          // 协议名称
+	AGREEMENTTYPE    int32  `json:"agreementtype"  xorm:"AGREEMENTTYPE" form:"agreementtype"`          // 协议类型 - 1:注册 2:登录 3:交易
+	AGREEMENTCONTENT string `json:"agreementcontent"  xorm:"AGREEMENTCONTENT" form:"agreementcontent"` // 协议内容
+}
+
+func (r *QhjCustomerSignLog) calc() {
+
+}
+
+func (r *QhjCustomerSignLog) buildSql() string {
+	var sqlId utils.SQLVal = "SELECT t.LOGID," +
+		"       t.USERID," +
+		"       t.NODETYPE," +
+		"       t.GOODSID," +
+		"       t.AGREEMENTID," +
+		"       t.AGREEMENTVERSION," +
+		"       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       t.SIGNTIMESTAMP," +
+		"       t.SIGNADRESSURL," +
+		"       c.agreementno," +
+		"       c.agreementname," +
+		"       c.agreementtype," +
+		"       to_char(c.agreementcontent) agreementcontent," +
+		"       u.accountname username," +
+		"       g.goodscode," +
+		"       g.goodsname" +
+		"  FROM QHJ_CUSTOMERSIGNLOG t" +
+		"  LEFT JOIN QHJ_AGREEMENTCONFIG c on t.agreementid=c.agreementid" +
+		"  LEFT JOIN USERACCOUNT u on t.userid=u.userid" +
+		"  LEFT JOIN GOODS g on t.goodsid=g.goodsid" +
+		" WHERE 1 = 1"
+	sqlId.AndEx("t.logid", r.LOGID, r.LOGID > 0)
+	sqlId.AndEx("t.userid", r.USERID, r.USERID > 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)
+	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)
+	}
+	return sqlId.String()
+}
+
+// GetDataEx 获取客户协议签约流水
+func (r *QhjCustomerSignLog) GetDataEx() (interface{}, error) {
+	sData := make([]QhjCustomerSignLog, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 1
models/qhjPCWeb.go

@@ -716,7 +716,7 @@ func (r *QhjMgrTradeDetail) GetDataEx() (interface{}, error) {
 		v.TRADEAMOUNT, v.TRADEQTY = sData[i].TRADEAMOUNT, sData[i].TRADEQTY
 		v.TRADEDATE, v.TRADETIME = sData[i].TRADEDATE, sData[i].TRADETIME
 		v.GOODSID, v.ORDERID = sData[i].GOODSID, sData[i].ORDERID
-		v.TRADEPRICE = sData[i].TRADEPRICE
+		v.TRADEPRICE, v.BUYORSELL = sData[i].TRADEPRICE, sData[i].BUYORSELL
 		zoonFun := NewZoomFun(int(v.QTYDECIMALPLACE))
 		zoonFun(&v.TRADEQTY)
 		sData2 = append(sData2, v)

+ 10 - 0
routers/router.go

@@ -489,6 +489,16 @@ func InitRouter() *gin.Engine {
 		qhjPCWebR.GET("QueryContract", qhjPCWeb.QueryContract)
 	}
 
+	// **********************千海金(协议和签约)**************************
+	qhjAgreementR := apiR.Group("QhjSys")
+	{
+		qhjAgreementR.GET("QueryAgreementConfig", qhj.QueryAgreementConfig)
+		qhjAgreementR.GET("QueryAgreementChangeLog", qhj.QueryAgreementChangeLog)
+		qhjAgreementR.GET("QueryNodeAgreementConfig", qhj.QueryNodeAgreementConfig)
+		qhjAgreementR.GET("QueryCustomerSignStatus", qhj.QueryCustomerSignStatus)
+		qhjAgreementR.GET("QueryQhjCustomerSignLog", qhj.QueryQhjCustomerSignLog)
+	}
+
 	return r
 }