Bladeren bron

大连千海金:增加查询融资明细/明细详情接口

zou.yingbin 4 jaren geleden
bovenliggende
commit
7ca41a5a29
6 gewijzigde bestanden met toevoegingen van 741 en 0 verwijderingen
  1. 55 0
      controllers/qhj/qryQhj.go
  2. 206 0
      docs/docs.go
  3. 206 0
      docs/swagger.json
  4. 141 0
      docs/swagger.yaml
  5. 124 0
      models/qhj.go
  6. 9 0
      routers/router.go

+ 55 - 0
controllers/qhj/qryQhj.go

@@ -0,0 +1,55 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/6/1 14:59
+* @Modify  : 2021/6/1 14:59
+ */
+
+package qhj
+
+import (
+	"github.com/gin-gonic/gin"
+	"mtp2_if/global/app"
+	"mtp2_if/models"
+)
+
+// QueryContract
+// @Summary 查询融资明细(合同)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户ID"
+// @Param scfcontractid query int false "scf合同id"
+// @Success 200 {array} models.QhjContract
+// @Failure 500 {object} app.Response
+// @Router /Qhj/QueryContract [get]
+// @Tags 大连千海金
+func QueryContract(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	req := struct {
+		USERID        int64 `form:"userid" binding:"required"` // 用户id
+		SCFCONTRACTID int64 `form:"scfcontractid"`             // scf合同id
+	}{}
+	a.DoBindReq(&req)
+	m := models.QhjContract{USERID: req.USERID}
+	a.DoGetDataI(&m)
+}
+
+// QueryContractLog
+// @Summary 查询融资明细流水(融资明细详情页中的流水)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param scfcontractid query int true "scf合同id"
+// @Param amounttype query string false "资金类型(逗号隔开) - 1:首付款 2:尾款 3:利息 4:追加款"
+// @Success 200 {array} models.QhjContractLog
+// @Failure 500 {object} app.Response
+// @Router /Qhj/QueryContractLog [get]
+// @Tags 大连千海金
+func QueryContractLog(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	req := struct {
+		SCFCONTRACTID int64  `form:"scfcontractid" binding:"required"` // scf合同id
+		AMOUNTTYPE    string `form:"amounttype"`                       // 资金类型(逗号隔开) - 1:首付款2:尾款 3:利息  4:追加款
+	}{}
+	a.DoBindReq(&req)
+	m := models.QhjContractLog{SCFCONTRACTID: req.SCFCONTRACTID, FilterType: req.AMOUNTTYPE}
+	a.DoGetDataI(&m)
+}

+ 206 - 0
docs/docs.go

@@ -6739,6 +6739,102 @@ var doc = `{
                 }
             }
         },
+        "/Qhj/QueryContract": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询融资明细(合同)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "scf合同id",
+                        "name": "scfcontractid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjContract"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Qhj/QueryContractLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询融资明细流水(融资明细详情)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "scf合同id",
+                        "name": "scfcontractid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金类型(逗号隔开) - 1:首付款 2:尾款 3:利息 4:追加款",
+                        "name": "amounttype",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjContractLog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Quote/QueryHistoryDatas": {
             "get": {
                 "security": [
@@ -19739,6 +19835,116 @@ var doc = `{
                 }
             }
         },
+        "models.QhjContract": {
+            "type": "object",
+            "properties": {
+                "contractconfirmtime": {
+                    "description": "合同确认时间(时间)",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [5:融资单]",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
+                "initmargin": {
+                    "description": "初始保证金(首付款)",
+                    "type": "number"
+                },
+                "lenderamount": {
+                    "description": "贷款金额(总额|订单总额)",
+                    "type": "number"
+                },
+                "marginratio": {
+                    "description": "保证金比率(首付比例)",
+                    "type": "number"
+                },
+                "payamount": {
+                    "description": "已付(已付货款)",
+                    "type": "number"
+                },
+                "recoveredmargin": {
+                    "description": "已追缴保证金",
+                    "type": "number"
+                },
+                "remainamount": {
+                    "description": "合同剩余金额(融资额)",
+                    "type": "number"
+                },
+                "scfcontractid": {
+                    "description": "SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "scfcontracttype": {
+                    "description": "合同类型 - 1:仓单回购 2:仓单质押 3:合作套保 4:资金贷款 5:融资单",
+                    "type": "integer"
+                },
+                "totalinterest": {
+                    "description": "已计总利息(利息)",
+                    "type": "number"
+                },
+                "tradeprice": {
+                    "description": "成交价格(成本价格)",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户名称",
+                    "type": "string"
+                },
+                "wrqty": {
+                    "description": "仓单数量(数量)",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.QhjContractLog": {
+            "type": "object",
+            "properties": {
+                "amount": {
+                    "description": "支付金额",
+                    "type": "number"
+                },
+                "amounttype": {
+                    "description": "资金类型 - 1:首付款2:尾款 3:利息  4:追加款",
+                    "type": "integer"
+                },
+                "logid": {
+                    "description": "LogID(315+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "string"
+                },
+                "remainamount": {
+                    "description": "剩余货款",
+                    "type": "number"
+                },
+                "scfcontractid": {
+                    "description": "SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
         "models.QueryErrorInfosRsp": {
             "type": "object",
             "required": [

+ 206 - 0
docs/swagger.json

@@ -6723,6 +6723,102 @@
                 }
             }
         },
+        "/Qhj/QueryContract": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询融资明细(合同)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "scf合同id",
+                        "name": "scfcontractid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjContract"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Qhj/QueryContractLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询融资明细流水(融资明细详情)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "scf合同id",
+                        "name": "scfcontractid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金类型(逗号隔开) - 1:首付款 2:尾款 3:利息 4:追加款",
+                        "name": "amounttype",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjContractLog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Quote/QueryHistoryDatas": {
             "get": {
                 "security": [
@@ -19723,6 +19819,116 @@
                 }
             }
         },
+        "models.QhjContract": {
+            "type": "object",
+            "properties": {
+                "contractconfirmtime": {
+                    "description": "合同确认时间(时间)",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID [5:融资单]",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
+                "initmargin": {
+                    "description": "初始保证金(首付款)",
+                    "type": "number"
+                },
+                "lenderamount": {
+                    "description": "贷款金额(总额|订单总额)",
+                    "type": "number"
+                },
+                "marginratio": {
+                    "description": "保证金比率(首付比例)",
+                    "type": "number"
+                },
+                "payamount": {
+                    "description": "已付(已付货款)",
+                    "type": "number"
+                },
+                "recoveredmargin": {
+                    "description": "已追缴保证金",
+                    "type": "number"
+                },
+                "remainamount": {
+                    "description": "合同剩余金额(融资额)",
+                    "type": "number"
+                },
+                "scfcontractid": {
+                    "description": "SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "scfcontracttype": {
+                    "description": "合同类型 - 1:仓单回购 2:仓单质押 3:合作套保 4:资金贷款 5:融资单",
+                    "type": "integer"
+                },
+                "totalinterest": {
+                    "description": "已计总利息(利息)",
+                    "type": "number"
+                },
+                "tradeprice": {
+                    "description": "成交价格(成本价格)",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户名称",
+                    "type": "string"
+                },
+                "wrqty": {
+                    "description": "仓单数量(数量)",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.QhjContractLog": {
+            "type": "object",
+            "properties": {
+                "amount": {
+                    "description": "支付金额",
+                    "type": "number"
+                },
+                "amounttype": {
+                    "description": "资金类型 - 1:首付款2:尾款 3:利息  4:追加款",
+                    "type": "integer"
+                },
+                "logid": {
+                    "description": "LogID(315+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "string"
+                },
+                "remainamount": {
+                    "description": "剩余货款",
+                    "type": "number"
+                },
+                "scfcontractid": {
+                    "description": "SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
         "models.QueryErrorInfosRsp": {
             "type": "object",
             "required": [

+ 141 - 0
docs/swagger.yaml

@@ -8702,6 +8702,87 @@ definitions:
         description: 业务类型,1-期现套利,2-仓单回购,3-现货贸易
         type: integer
     type: object
+  models.QhjContract:
+    properties:
+      contractconfirmtime:
+        description: 合同确认时间(时间)
+        type: string
+      enumdicname:
+        description: 单位名称
+        type: string
+      goodscode:
+        description: 商品代码
+        type: string
+      goodsid:
+        description: 商品ID [5:融资单]
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      goodunitid:
+        description: 商品单位id
+        type: integer
+      initmargin:
+        description: 初始保证金(首付款)
+        type: number
+      lenderamount:
+        description: 贷款金额(总额|订单总额)
+        type: number
+      marginratio:
+        description: 保证金比率(首付比例)
+        type: number
+      payamount:
+        description: 已付(已付货款)
+        type: number
+      recoveredmargin:
+        description: 已追缴保证金
+        type: number
+      remainamount:
+        description: 合同剩余金额(融资额)
+        type: number
+      scfcontractid:
+        description: SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      scfcontracttype:
+        description: 合同类型 - 1:仓单回购 2:仓单质押 3:合作套保 4:资金贷款 5:融资单
+        type: integer
+      totalinterest:
+        description: 已计总利息(利息)
+        type: number
+      tradeprice:
+        description: 成交价格(成本价格)
+        type: number
+      userid:
+        description: 用户ID
+        type: integer
+      username:
+        description: 用户名称
+        type: string
+      wrqty:
+        description: 仓单数量(数量)
+        type: integer
+    type: object
+  models.QhjContractLog:
+    properties:
+      amount:
+        description: 支付金额
+        type: number
+      amounttype:
+        description: 资金类型 - 1:首付款2:尾款 3:利息  4:追加款
+        type: integer
+      logid:
+        description: LogID(315+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        type: string
+      remainamount:
+        description: 剩余货款
+        type: number
+      scfcontractid:
+        description: SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      updatetime:
+        description: 更新时间
+        type: string
+    type: object
   models.QueryErrorInfosRsp:
     properties:
       description:
@@ -15817,6 +15898,66 @@ paths:
       summary: 持仓汇总查询(合约市场)
       tags:
       - 通用单据
+  /Qhj/QueryContract:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: scf合同id
+        in: query
+        name: scfcontractid
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjContract'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询融资明细(合同)
+      tags:
+      - 大连千海金
+  /Qhj/QueryContractLog:
+    get:
+      parameters:
+      - description: scf合同id
+        in: query
+        name: scfcontractid
+        required: true
+        type: integer
+      - description: 资金类型(逗号隔开) - 1:首付款 2:尾款 3:利息 4:追加款
+        in: query
+        name: amounttype
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjContractLog'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询融资明细流水(融资明细详情)
+      tags:
+      - 大连千海金
   /Quote/QueryHistoryDatas:
     get:
       parameters:

+ 124 - 0
models/qhj.go

@@ -0,0 +1,124 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/6/1 14:14
+* @Modify  : 2021/6/1 14:14
+ */
+
+package models
+
+import (
+	"fmt"
+	"mtp2_if/db"
+	"mtp2_if/mtpcache"
+	"mtp2_if/utils"
+)
+
+// 大连千海金
+
+// QhjContract 千海金融资明细(合同)
+type QhjContract struct {
+	USERID              int64   `json:"userid"  xorm:"USERID"`                           // 用户ID
+	SCFCONTRACTID       int64   `json:"scfcontractid"  xorm:"SCFCONTRACTID"`             // SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)
+	SCFCONTRACTTYPE     int32   `json:"scfcontracttype"  xorm:"SCFCONTRACTTYPE"`         // 合同类型 - 1:仓单回购 2:仓单质押 3:合作套保 4:资金贷款 5:融资单
+	GOODSID             int32   `json:"goodsid"  xorm:"GOODSID"`                         // 商品ID [5:融资单]
+	CONTRACTCONFIRMTIME string  `json:"contractconfirmtime"  xorm:"CONTRACTCONFIRMTIME"` // 合同确认时间(时间)
+	WRQTY               int32   `json:"wrqty"  xorm:"WRQTY"`                             // 仓单数量(数量)
+	TRADEPRICE          float64 `json:"tradeprice"  xorm:"TRADEPRICE"`                   // 成交价格(成本价格)
+	LENDERAMOUNT        float64 `json:"lenderamount"  xorm:"LENDERAMOUNT"`               // 贷款金额(总额|订单总额)
+	MARGINRATIO         float64 `json:"marginratio"  xorm:"MARGINRATIO"`                 // 保证金比率(首付比例)
+	INITMARGIN          float64 `json:"initmargin"  xorm:"'INITMARGIN'"`                 // 初始保证金(首付款)
+	RECOVEREDMARGIN     float64 `json:"recoveredmargin"  xorm:"'RECOVEREDMARGIN'"`       // 已追缴保证金
+	REMAINAMOUNT        float64 `json:"remainamount"  xorm:"'REMAINAMOUNT'"`             // 合同剩余金额(融资额)
+	TOTALINTEREST       float64 `json:"totalinterest"  xorm:"'TOTALINTEREST'"`           // 已计总利息(利息)
+	GOODSCODE           string  `json:"goodscode"  xorm:"'GOODSCODE'"`                   // 商品代码
+	GOODSNAME           string  `json:"goodsname"  xorm:"'GOODSNAME'"`                   // 商品名称
+	GOODUNITID          int32   `json:"goodunitid"  xorm:"'GOODUNITID'"`                 // 商品单位id
+
+	PAYAMOUNT   float64 `json:"payamount"  xorm:"'PAYAMOUNT'"` // 已付(已付货款)
+	USERNAME    string  `json:"username"  xorm:"'USERNAME'"`   // 用户名称
+	ENUMDICNAME string  `json:"enumdicname"`                   // 单位名称
+}
+
+func (r *QhjContract) calc() {
+	r.USERNAME = mtpcache.GetUserNameByUserId(r.USERID)
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
+	// 已付(已付货款) = 已追缴保证金  + 初始保证金
+	r.PAYAMOUNT = r.RECOVEREDMARGIN + r.INITMARGIN
+}
+
+func (r *QhjContract) buildSql() string {
+	var sqlId utils.SQLVal = "select t.borroweruserid userid," +
+		"       t.scfcontractid," +
+		"       t.scfcontracttype," +
+		"       t.goodsid," +
+		"       to_char(t.contractconfirmtime, 'yyyy-mm-dd hh24:mi:ss') contractconfirmtime," +
+		"       t.wrqty," +
+		"       t.tradeprice," +
+		"       t.lenderamount," +
+		"       t.marginratio," +
+		"       s.initmargin," +
+		"       s.recoveredmargin," +
+		"       s.remainamount," +
+		"       s.totalinterest," +
+		"       g.goodscode," +
+		"       g.goodsname," +
+		"       g.goodunitid" +
+		"  from scf_contract t" +
+		"  left join scf_contractinfo s" +
+		"    on t.scfcontractid = s.scfcontractid" +
+		"  left join goods g" +
+		"    on t.goodsid = g.goodsid" +
+		"  where 1=1"
+	sqlId.And("t.borroweruserid", r.USERID)
+	sqlId.AndEx("t.SCFCONTRACTID", r.SCFCONTRACTID, r.SCFCONTRACTID > 0)
+	return sqlId.String()
+}
+
+// GetDataEx 获取融资明细(合同)
+func (r *QhjContract) GetDataEx() (interface{}, error) {
+	sData := make([]QhjContract, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// QhjContractLog 融资明细流水log
+type QhjContractLog struct {
+	LOGID         string  `json:"logid"  xorm:"LOGID"`                 // LogID(315+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	SCFCONTRACTID int64   `json:"scfcontractid"  xorm:"SCFCONTRACTID"` // SCF合同ID(310+Unix秒时间戳(10位)+xxxxxx)
+	AMOUNTTYPE    int32   `json:"amounttype"  xorm:"AMOUNTTYPE"`       // 资金类型 - 1:首付款2:尾款 3:利息  4:追加款
+	AMOUNT        float64 `json:"amount"  xorm:"AMOUNT"`               // 支付金额
+	REMAINAMOUNT  float64 `json:"remainamount"  xorm:"REMAINAMOUNT"`   // 剩余货款
+	UPDATETIME    string  `json:"updatetime"  xorm:"UPDATETIME"`       // 更新时间
+
+	FilterType string `json:"-"` // 资金类型
+}
+
+func (r *QhjContractLog) calc() {
+}
+
+func (r *QhjContractLog) buildSql() string {
+	var sqlId utils.SQLVal = "SELECT t.LOGID," +
+		"       t.SCFCONTRACTID," +
+		"       t.AMOUNTTYPE," +
+		"       t.AMOUNT," +
+		"       t.REMAINAMOUNT," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME" +
+		"  FROM SCF_CONTRACTAMOUNTLOG t" +
+		" WHERE 1 = 1"
+	sqlId.AndEx("t.SCFCONTRACTID", r.SCFCONTRACTID, r.SCFCONTRACTID > 0)
+	sqlId.JoinEx(len(r.FilterType) > 0, fmt.Sprintf(" and t.AMOUNTTYPE in(%v)", r.FilterType))
+	return sqlId.String()
+}
+
+// GetDataEx 获取融资明细流水log
+func (r *QhjContractLog) GetDataEx() (interface{}, error) {
+	sData := make([]QhjContractLog, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 9 - 0
routers/router.go

@@ -13,6 +13,7 @@ import (
 	"mtp2_if/controllers/hsby"
 	"mtp2_if/controllers/market"
 	"mtp2_if/controllers/order"
+	"mtp2_if/controllers/qhj"
 	"mtp2_if/controllers/quote"
 	"mtp2_if/controllers/search"
 	"mtp2_if/controllers/szdz"
@@ -443,6 +444,14 @@ func InitRouter() *gin.Engine {
 		ermcp3R.GET("/QryAreaSumPL", ermcp3.QryAreaSumPL)
 	}
 
+	// ****************************大连千海金******************************
+	qhjR := apiR.Group("Qhj")
+	qhjR.Use(token.Auth())
+	{
+		qhjR.GET("QueryContract", qhj.QueryContract)
+		qhjR.GET("QueryContractLog", qhj.QueryContractLog)
+	}
+
 	return r
 }