Przeglądaj źródła

1、增加首页统计数据接口;
2、增加钻石计算器接口;
3、增加证书查询接口。

zhou.xiaoning 3 lat temu
rodzic
commit
4484e375b2

+ 38 - 0
controllers/guangzuan/home.go

@@ -0,0 +1,38 @@
+package guangzuan
+
+import (
+	"mtp2_if/global/app"
+	"mtp2_if/global/e"
+	"mtp2_if/logger"
+	"mtp2_if/models"
+	"net/http"
+
+	"github.com/gin-gonic/gin"
+)
+
+// HomeData
+// @Summary  首页统计数据
+// @Produce  json
+// @Security ApiKeyAuth
+// @Security LoginID
+// @Security Group
+// @Param    userid query    int true "用户ID"
+// @Success  200    {object} models.GZHomeData
+// @Failure  500    {object} app.Response
+// @Router   /Guangzuan/HomeData [get]
+// @Tags     广钻
+func HomeData(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.GZHomeData{}
+	if err := a.C.ShouldBind(&m); err != nil {
+		a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	if err := m.GetGZHomeData(); err == nil {
+		a.Gin.Response(http.StatusOK, e.SUCCESS, m)
+	} else {
+		logger.GetLogger().Errorf("query fail, %v", err)
+		a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}

+ 76 - 0
controllers/guangzuan/utils.go

@@ -0,0 +1,76 @@
+package guangzuan
+
+import (
+	"mtp2_if/global/app"
+	"mtp2_if/global/e"
+	"mtp2_if/logger"
+	"mtp2_if/models"
+	"net/http"
+
+	"github.com/gin-gonic/gin"
+)
+
+// PriceCalc
+// @Summary  钻石价格计算器
+// @Produce  json
+// @Security ApiKeyAuth
+// @Security LoginID
+// @Security Group
+// @Param    zsshape   query    int     true  "形状 - 1:BR(圆形)  2:PS(异形)"
+// @Param    zscolor   query    string  true  "颜色(D-M)"
+// @Param    zsclarity query    string  true  "净度"
+// @Param    weight    query    float64 true  "重量"
+// @Param    rate      query    float64 true  "汇率"
+// @Param    discount  query    float64 false "折扣(%), 方向(加:10, 减:-10 )"
+// @Success  200       {array}  models.Gzrapaportprice
+// @Failure  500 {object} app.Response
+// @Router   /Guangzuan/PriceCalc [get]
+// @Tags     广钻
+func PriceCalc(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Gzrapaportprice{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// GzCertAddressConfig
+// @Summary  Rapaport最新报价表(广钻)
+// @Produce  json
+// @Security ApiKeyAuth
+// @Security LoginID
+// @Security Group
+// @Success  200 {array}  models.Gzcertaddressconfig
+// @Failure  500 {object} app.Response
+// @Router   /Guangzuan/GzCertAddressConfig [get]
+// @Tags     广钻
+func GzCertAddressConfig(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Gzcertaddressconfig{}
+	if d, err := m.GetAll(); err == nil {
+		a.Gin.Response(http.StatusOK, e.SUCCESS, d)
+	} else {
+		logger.GetLogger().Errorf("query fail, %v", err)
+		a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}
+
+// GzCertAddressParam
+// @Summary  钻石证书地址参数
+// @Produce  json
+// @Security ApiKeyAuth
+// @Security LoginID
+// @Security Group
+// @Success  200 {array}  models.Gzcertaddressparam
+// @Failure  500       {object} app.Response
+// @Router   /Guangzuan/GzCertAddressParam [get]
+// @Tags     广钻
+func GzCertAddressParam(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Gzcertaddressparam{}
+	if d, err := m.GetAll(); err == nil {
+		a.Gin.Response(http.StatusOK, e.SUCCESS, d)
+	} else {
+		logger.GetLogger().Errorf("query fail, %v", err)
+		a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}

+ 1 - 1
controllers/qhj/qryQhj.go

@@ -333,7 +333,7 @@ func QuerySiteColumnDetail(c *gin.Context) {
 // @Param    enddate     query    string false "申请截止日期(格式yyyymmdd)"
 // @Param    likename    query    string false "模糊搜索名称"
 // @Param    applystatus query    int    false "状态 1-待审核 2-审核通过 3-审核拒绝"
-// @Param    querytype   query    int    false "查询类型 1-提现(出金) 2-充值(金)"
+// @Param    querytype   query    int    false "查询类型 1-提现(出金) 2-充值(金)"
 // @Success  200         {array}  models.QhjAccountOutInApply
 // @Failure  500         {object} app.Response
 // @Router   /Qhj/QueryAccountInOutApply [get]

+ 1 - 1
controllers/wrTrade2/qryWrTrade.go

@@ -885,7 +885,7 @@ func InsertXhcpSellBackApply(c *gin.Context) {
 // @Tags     仓单贸易v2
 func QueryWrTradeQuote(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
-	m := models.Wrtradetradequote{}
+	m := models.Wrtradetradequote1{}
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }

+ 326 - 9
docs/docs.go

@@ -7594,6 +7594,211 @@ const docTemplate = `{
                 }
             }
         },
+        "/Guangzuan/GzCertAddressConfig": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "Rapaport最新报价表(广钻)",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Gzcertaddressconfig"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/GzCertAddressParam": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "钻石证书地址参数",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Gzcertaddressparam"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/HomeData": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "首页统计数据",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.GZHomeData"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/PriceCalc": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "钻石价格计算器",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "形状 - 1:BR(圆形)  2:PS(异形)",
+                        "name": "zsshape",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "颜色(D-M)",
+                        "name": "zscolor",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "净度",
+                        "name": "zsclarity",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "number",
+                        "description": "重量",
+                        "name": "weight",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "number",
+                        "description": "汇率",
+                        "name": "rate",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "number",
+                        "description": "折扣(%), 方向(加:10, 减:-10 )",
+                        "name": "discount",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Gzrapaportprice"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryBuyOrder": {
             "get": {
                 "security": [
@@ -9164,7 +9369,7 @@ const docTemplate = `{
                     },
                     {
                         "type": "integer",
-                        "description": "查询类型 1-提现(出金) 2-充值(金)",
+                        "description": "查询类型 1-提现(出金) 2-充值(金)",
                         "name": "querytype",
                         "in": "query"
                     }
@@ -29202,6 +29407,31 @@ const docTemplate = `{
                 }
             }
         },
+        "models.GZHomeData": {
+            "type": "object",
+            "properties": {
+                "purchasedtransactions": {
+                    "description": "已购买的交易",
+                    "type": "integer"
+                },
+                "transactioninpurchase": {
+                    "description": "求购中的交易",
+                    "type": "integer"
+                },
+                "transactionsonsale": {
+                    "description": "出售中的交易",
+                    "type": "integer"
+                },
+                "transactionssold": {
+                    "description": "已卖出的交易",
+                    "type": "integer"
+                },
+                "unhandledmessage": {
+                    "description": "未处理消息",
+                    "type": "integer"
+                }
+            }
+        },
         "models.GZWarehouseinfo": {
             "type": "object",
             "properties": {
@@ -29665,6 +29895,81 @@ const docTemplate = `{
                 }
             }
         },
+        "models.Gzcertaddressconfig": {
+            "type": "object",
+            "properties": {
+                "certregion": {
+                    "description": "证书地域 - 1:国内 2:国际",
+                    "type": "integer"
+                },
+                "certtype": {
+                    "description": "证书类型",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "显示顺序",
+                    "type": "integer"
+                },
+                "orgcnname": {
+                    "description": "机构名称(中文)",
+                    "type": "string"
+                },
+                "orgenname": {
+                    "description": "机构名称(英文)",
+                    "type": "string"
+                },
+                "queryaddress": {
+                    "description": "查询地址",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.Gzcertaddressparam": {
+            "type": "object",
+            "properties": {
+                "certtype": {
+                    "description": "证书类型",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "参数顺序",
+                    "type": "integer"
+                },
+                "paramkey": {
+                    "description": "参数Key",
+                    "type": "string"
+                },
+                "paramname": {
+                    "description": "参数名称",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.Gzrapaportprice": {
+            "type": "object",
+            "properties": {
+                "dollar": {
+                    "description": "美元",
+                    "type": "string"
+                },
+                "rmb": {
+                    "description": "人民币",
+                    "type": "string"
+                }
+            }
+        },
         "models.Hedgeinnerholderdetail": {
             "type": "object",
             "required": [
@@ -42996,14 +43301,14 @@ const docTemplate = `{
         "models.Wrtradetradequote": {
             "type": "object",
             "properties": {
-                "begindate": {
-                    "description": "开始日期(结果含开始日期) yyyymmdd",
-                    "type": "string"
-                },
                 "buyaccountid": {
                     "description": "买方账号ID",
                     "type": "integer"
                 },
+                "buychargevalue": {
+                    "description": "买方手续费",
+                    "type": "number"
+                },
                 "buyuserid": {
                     "description": "买方用户ID",
                     "type": "integer"
@@ -43012,18 +43317,30 @@ const docTemplate = `{
                     "description": "现货品种ID",
                     "type": "integer"
                 },
-                "enddate": {
-                    "description": "结束日期(结果含结束日期) yyyymmdd",
-                    "type": "string"
+                "exchangerate": {
+                    "description": "汇率",
+                    "type": "number"
                 },
                 "marketid": {
                     "description": "市场ID",
                     "type": "integer"
                 },
+                "oritradeamount": {
+                    "description": "成交金额[商品币种]",
+                    "type": "number"
+                },
+                "performanceplanid": {
+                    "description": "履约计划ID/合同ID",
+                    "type": "integer"
+                },
                 "sellaccountid": {
                     "description": "卖方账号ID",
                     "type": "integer"
                 },
+                "sellchargevalue": {
+                    "description": "卖方手续费",
+                    "type": "number"
+                },
                 "selluserid": {
                     "description": "卖方用户ID",
                     "type": "integer"
@@ -43058,7 +43375,7 @@ const docTemplate = `{
                 },
                 "wrtradedetailid": {
                     "description": "仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "string"
+                    "type": "integer"
                 }
             }
         },

+ 326 - 9
docs/swagger.json

@@ -7585,6 +7585,211 @@
                 }
             }
         },
+        "/Guangzuan/GzCertAddressConfig": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "Rapaport最新报价表(广钻)",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Gzcertaddressconfig"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/GzCertAddressParam": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "钻石证书地址参数",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Gzcertaddressparam"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/HomeData": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "首页统计数据",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.GZHomeData"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/PriceCalc": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "钻石价格计算器",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "形状 - 1:BR(圆形)  2:PS(异形)",
+                        "name": "zsshape",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "颜色(D-M)",
+                        "name": "zscolor",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "净度",
+                        "name": "zsclarity",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "number",
+                        "description": "重量",
+                        "name": "weight",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "number",
+                        "description": "汇率",
+                        "name": "rate",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "number",
+                        "description": "折扣(%), 方向(加:10, 减:-10 )",
+                        "name": "discount",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Gzrapaportprice"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryBuyOrder": {
             "get": {
                 "security": [
@@ -9155,7 +9360,7 @@
                     },
                     {
                         "type": "integer",
-                        "description": "查询类型 1-提现(出金) 2-充值(金)",
+                        "description": "查询类型 1-提现(出金) 2-充值(金)",
                         "name": "querytype",
                         "in": "query"
                     }
@@ -29193,6 +29398,31 @@
                 }
             }
         },
+        "models.GZHomeData": {
+            "type": "object",
+            "properties": {
+                "purchasedtransactions": {
+                    "description": "已购买的交易",
+                    "type": "integer"
+                },
+                "transactioninpurchase": {
+                    "description": "求购中的交易",
+                    "type": "integer"
+                },
+                "transactionsonsale": {
+                    "description": "出售中的交易",
+                    "type": "integer"
+                },
+                "transactionssold": {
+                    "description": "已卖出的交易",
+                    "type": "integer"
+                },
+                "unhandledmessage": {
+                    "description": "未处理消息",
+                    "type": "integer"
+                }
+            }
+        },
         "models.GZWarehouseinfo": {
             "type": "object",
             "properties": {
@@ -29656,6 +29886,81 @@
                 }
             }
         },
+        "models.Gzcertaddressconfig": {
+            "type": "object",
+            "properties": {
+                "certregion": {
+                    "description": "证书地域 - 1:国内 2:国际",
+                    "type": "integer"
+                },
+                "certtype": {
+                    "description": "证书类型",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "显示顺序",
+                    "type": "integer"
+                },
+                "orgcnname": {
+                    "description": "机构名称(中文)",
+                    "type": "string"
+                },
+                "orgenname": {
+                    "description": "机构名称(英文)",
+                    "type": "string"
+                },
+                "queryaddress": {
+                    "description": "查询地址",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.Gzcertaddressparam": {
+            "type": "object",
+            "properties": {
+                "certtype": {
+                    "description": "证书类型",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "参数顺序",
+                    "type": "integer"
+                },
+                "paramkey": {
+                    "description": "参数Key",
+                    "type": "string"
+                },
+                "paramname": {
+                    "description": "参数名称",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.Gzrapaportprice": {
+            "type": "object",
+            "properties": {
+                "dollar": {
+                    "description": "美元",
+                    "type": "string"
+                },
+                "rmb": {
+                    "description": "人民币",
+                    "type": "string"
+                }
+            }
+        },
         "models.Hedgeinnerholderdetail": {
             "type": "object",
             "required": [
@@ -42987,14 +43292,14 @@
         "models.Wrtradetradequote": {
             "type": "object",
             "properties": {
-                "begindate": {
-                    "description": "开始日期(结果含开始日期) yyyymmdd",
-                    "type": "string"
-                },
                 "buyaccountid": {
                     "description": "买方账号ID",
                     "type": "integer"
                 },
+                "buychargevalue": {
+                    "description": "买方手续费",
+                    "type": "number"
+                },
                 "buyuserid": {
                     "description": "买方用户ID",
                     "type": "integer"
@@ -43003,18 +43308,30 @@
                     "description": "现货品种ID",
                     "type": "integer"
                 },
-                "enddate": {
-                    "description": "结束日期(结果含结束日期) yyyymmdd",
-                    "type": "string"
+                "exchangerate": {
+                    "description": "汇率",
+                    "type": "number"
                 },
                 "marketid": {
                     "description": "市场ID",
                     "type": "integer"
                 },
+                "oritradeamount": {
+                    "description": "成交金额[商品币种]",
+                    "type": "number"
+                },
+                "performanceplanid": {
+                    "description": "履约计划ID/合同ID",
+                    "type": "integer"
+                },
                 "sellaccountid": {
                     "description": "卖方账号ID",
                     "type": "integer"
                 },
+                "sellchargevalue": {
+                    "description": "卖方手续费",
+                    "type": "number"
+                },
                 "selluserid": {
                     "description": "卖方用户ID",
                     "type": "integer"
@@ -43049,7 +43366,7 @@
                 },
                 "wrtradedetailid": {
                     "description": "仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "string"
+                    "type": "integer"
                 }
             }
         },

+ 211 - 8
docs/swagger.yaml

@@ -9841,6 +9841,24 @@ definitions:
     required:
     - goodsno
     type: object
+  models.GZHomeData:
+    properties:
+      purchasedtransactions:
+        description: 已购买的交易
+        type: integer
+      transactioninpurchase:
+        description: 求购中的交易
+        type: integer
+      transactionsonsale:
+        description: 出售中的交易
+        type: integer
+      transactionssold:
+        description: 已卖出的交易
+        type: integer
+      unhandledmessage:
+        description: 未处理消息
+        type: integer
+    type: object
   models.GZWarehouseinfo:
     properties:
       address:
@@ -10186,6 +10204,60 @@ definitions:
     - goodscode
     - tradedate
     type: object
+  models.Gzcertaddressconfig:
+    properties:
+      certregion:
+        description: 证书地域 - 1:国内 2:国际
+        type: integer
+      certtype:
+        description: 证书类型
+        type: string
+      orderindex:
+        description: 显示顺序
+        type: integer
+      orgcnname:
+        description: 机构名称(中文)
+        type: string
+      orgenname:
+        description: 机构名称(英文)
+        type: string
+      queryaddress:
+        description: 查询地址
+        type: string
+      remark:
+        description: 备注
+        type: string
+      updatetime:
+        description: 更新时间
+        type: string
+    type: object
+  models.Gzcertaddressparam:
+    properties:
+      certtype:
+        description: 证书类型
+        type: string
+      orderindex:
+        description: 参数顺序
+        type: integer
+      paramkey:
+        description: 参数Key
+        type: string
+      paramname:
+        description: 参数名称
+        type: string
+      updatetime:
+        description: 更新时间
+        type: string
+    type: object
+  models.Gzrapaportprice:
+    properties:
+      dollar:
+        description: 美元
+        type: string
+      rmb:
+        description: 人民币
+        type: string
+    type: object
   models.Hedgeinnerholderdetail:
     properties:
       accountid:
@@ -20070,27 +20142,36 @@ definitions:
     type: object
   models.Wrtradetradequote:
     properties:
-      begindate:
-        description: 开始日期(结果含开始日期) yyyymmdd
-        type: string
       buyaccountid:
         description: 买方账号ID
         type: integer
+      buychargevalue:
+        description: 买方手续费
+        type: number
       buyuserid:
         description: 买方用户ID
         type: integer
       deliverygoodsid:
         description: 现货品种ID
         type: integer
-      enddate:
-        description: 结束日期(结果含结束日期) yyyymmdd
-        type: string
+      exchangerate:
+        description: 汇率
+        type: number
       marketid:
         description: 市场ID
         type: integer
+      oritradeamount:
+        description: 成交金额[商品币种]
+        type: number
+      performanceplanid:
+        description: 履约计划ID/合同ID
+        type: integer
       sellaccountid:
         description: 卖方账号ID
         type: integer
+      sellchargevalue:
+        description: 卖方手续费
+        type: number
       selluserid:
         description: 卖方用户ID
         type: integer
@@ -20117,7 +20198,7 @@ definitions:
         type: integer
       wrtradedetailid:
         description: 仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
-        type: string
+        type: integer
     type: object
   models.XHBRAND:
     properties:
@@ -27142,6 +27223,128 @@ paths:
       summary: 获取钻石详情
       tags:
       - 广钻
+  /Guangzuan/GzCertAddressConfig:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Gzcertaddressconfig'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      - LoginID: []
+      - Group: []
+      summary: Rapaport最新报价表(广钻)
+      tags:
+      - 广钻
+  /Guangzuan/GzCertAddressParam:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Gzcertaddressparam'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      - LoginID: []
+      - Group: []
+      summary: 钻石证书地址参数
+      tags:
+      - 广钻
+  /Guangzuan/HomeData:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/models.GZHomeData'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      - LoginID: []
+      - Group: []
+      summary: 首页统计数据
+      tags:
+      - 广钻
+  /Guangzuan/PriceCalc:
+    get:
+      parameters:
+      - description: 形状 - 1:BR(圆形)  2:PS(异形)
+        in: query
+        name: zsshape
+        required: true
+        type: integer
+      - description: 颜色(D-M)
+        in: query
+        name: zscolor
+        required: true
+        type: string
+      - description: 净度
+        in: query
+        name: zsclarity
+        required: true
+        type: string
+      - description: 重量
+        in: query
+        name: weight
+        required: true
+        type: number
+      - description: 汇率
+        in: query
+        name: rate
+        required: true
+        type: number
+      - description: 折扣(%), 方向(加:10, 减:-10 )
+        in: query
+        name: discount
+        type: number
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Gzrapaportprice'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      - LoginID: []
+      - Group: []
+      summary: 钻石价格计算器
+      tags:
+      - 广钻
   /Guangzuan/QueryBuyOrder:
     get:
       parameters:
@@ -28111,7 +28314,7 @@ paths:
         in: query
         name: applystatus
         type: integer
-      - description: 查询类型 1-提现(出金) 2-充值(金)
+      - description: 查询类型 1-提现(出金) 2-充值(金)
         in: query
         name: querytype
         type: integer

+ 141 - 9
models/guangzuan.go

@@ -2248,13 +2248,145 @@ func (r *MyFavorite) GetDataByPage() (interface{}, error, int, int, int) {
 
 // Gzrapaportprice Rapaport最新报价表(广钻)
 type Gzrapaportprice struct {
-	ZSSHAPE     int32     `json:"zsshape" xorm:"ZSSHAPE"`         // 形状 - 1:BR(圆形)  2:PS(异形)
-	ZSSIZESTART float64   `json:"zssizestart" xorm:"ZSSIZESTART"` // 尺寸1
-	ZSSIZEEND   float64   `json:"zssizeend" xorm:"ZSSIZEEND"`     // 尺寸2
-	ZSCOLOR     string    `json:"zscolor" xorm:"ZSCOLOR"`         // 颜色(D-M)
-	ZSCLARITY   string    `json:"zsclarity" xorm:"ZSCLARITY"`     // 净度
-	QUOTEDATE   time.Time `json:"quotedate" xorm:"QUOTEDATE"`     // 报价日期(yyyyMMdd)
-	ZSPRICE     float64   `json:"zsprice" xorm:"ZSPRICE"`         // 价格(美元)
-	CREATETIME  time.Time `json:"createtime" xorm:"CREATETIME"`   // 创建时间
-	ORDERINDEX  int64     `json:"orderindex" xorm:"ORDERINDEX"`   // 顺序
+	ZSSHAPE     int32     `json:"-" xorm:"ZSSHAPE" form:"zsshape" binding:"required"`     // 形状 - 1:BR(圆形)  2:PS(异形)
+	ZSSIZESTART float64   `json:"-" xorm:"ZSSIZESTART"`                                   // 尺寸1
+	ZSSIZEEND   float64   `json:"-" xorm:"ZSSIZEEND"`                                     // 尺寸2
+	ZSCOLOR     string    `json:"-" xorm:"ZSCOLOR" form:"zscolor" binding:"required"`     // 颜色(D-M)
+	ZSCLARITY   string    `json:"-" xorm:"ZSCLARITY" form:"zsclarity" binding:"required"` // 净度
+	QUOTEDATE   time.Time `json:"-" xorm:"QUOTEDATE"`                                     // 报价日期(yyyyMMdd)
+	ZSPRICE     float64   `json:"-" xorm:"ZSPRICE"`                                       // 价格(美元)
+	CREATETIME  time.Time `json:"-" xorm:"CREATETIME"`                                    // 创建时间
+	ORDERINDEX  int64     `json:"-" xorm:"ORDERINDEX"`                                    // 顺序
+
+	WEIGHT   float64 `json:"-" form:"weight" binding:"required"` // 重量
+	RATE     float64 `json:"-" form:"rate" binding:"required"`   // 汇率
+	DISCOUNT int     `json:"-" form:"discount"`                  // 折扣(%), 方向(加:10, 减:-10 )
+
+	DOLLAR string `json:"dollar"` // 美元
+	RMB    string `json:"rmb"`    // 人民币
+}
+
+func (r *Gzrapaportprice) calc(weight, rate float64, discount int) {
+	//  $(美元值): ZSPRICE * (1+(折扣值/100) * 折扣方向),  -- 折扣方向(加:1, 减:-1 )
+	// ¥(人民币值):美元值* 汇率;
+	dollar := r.ZSPRICE * (1 + (float64(discount) / 100)) * weight
+	r.DOLLAR = utils.FormatFloat(dollar, 2)
+	r.RMB = utils.FormatFloat(dollar*rate, 2)
+}
+
+func (r *Gzrapaportprice) buildSql() string {
+	var sqlId utils.SQLVal = `
+	SELECT 
+		t.zsprice 
+	FROM GZ_RapaportPrice t
+	WHERE t.zsshape = %v AND t.zscolor = '%v' AND t.zsclarity = '%v'
+	`
+	sqlId.FormatParam(r.ZSSHAPE, r.ZSCOLOR, r.ZSCLARITY)
+	sqlId.JoinFormat(" AND t.zssizestart <= %v AND t.zssizeend >= %v", r.WEIGHT, r.WEIGHT)
+
+	return sqlId.String()
+}
+
+// GetDataEx 从数据库中查询数据
+func (r *Gzrapaportprice) GetDataEx() (interface{}, error) {
+	e := db.GetEngine()
+	s := e.SQL(r.buildSql())
+	sData := make([]Gzrapaportprice, 0)
+	if err := s.Find(&sData); err != nil {
+		return nil, err
+	}
+	for i := range sData {
+		sData[i].calc(r.WEIGHT, r.RATE, r.DISCOUNT)
+	}
+	return sData, nil
+}
+
+// Gzcertaddressconfig 钻石证书地址配置表
+type Gzcertaddressconfig struct {
+	CERTTYPE     string    `json:"certtype" xorm:"CERTTYPE"`         // 证书类型
+	ORGCNNAME    string    `json:"orgcnname" xorm:"ORGCNNAME"`       // 机构名称(中文)
+	ORGENNAME    string    `json:"orgenname" xorm:"ORGENNAME"`       // 机构名称(英文)
+	CERTREGION   int32     `json:"certregion" xorm:"CERTREGION"`     // 证书地域 - 1:国内 2:国际
+	QUERYADDRESS string    `json:"queryaddress" xorm:"QUERYADDRESS"` // 查询地址
+	REMARK       string    `json:"remark" xorm:"REMARK"`             // 备注
+	UPDATETIME   time.Time `json:"updatetime" xorm:"UPDATETIME"`     // 更新时间
+	ORDERINDEX   int32     `json:"orderindex" xorm:"ORDERINDEX"`     // 显示顺序
+}
+
+// TableName is GZ_CERTADDRESSCONFIG
+func (r *Gzcertaddressconfig) TableName() string {
+	return "GZ_CERTADDRESSCONFIG"
+}
+
+func (r *Gzcertaddressconfig) GetAll() (data []Gzcertaddressconfig, err error) {
+	err = db.GetEngine().Find(&data)
+	return
+}
+
+// Gzcertaddressparam 钻石证书地址参数表
+type Gzcertaddressparam struct {
+	CERTTYPE   string    `json:"certtype" xorm:"CERTTYPE"`     // 证书类型
+	PARAMKEY   string    `json:"paramkey" xorm:"PARAMKEY"`     // 参数Key
+	PARAMNAME  string    `json:"paramname" xorm:"PARAMNAME"`   // 参数名称
+	ORDERINDEX int32     `json:"orderindex" xorm:"ORDERINDEX"` // 参数顺序
+	UPDATETIME time.Time `json:"updatetime" xorm:"UPDATETIME"` // 更新时间
+}
+
+// TableName is GZ_CERTADDRESSPARAM
+func (r *Gzcertaddressparam) TableName() string {
+	return "GZ_CERTADDRESSPARAM"
+}
+
+func (r *Gzcertaddressparam) GetAll() (data []Gzcertaddressparam, err error) {
+	err = db.GetEngine().Find(&data)
+	return
+}
+
+// GZHomeData 广钻首页统计数据
+type GZHomeData struct {
+	TransactionsOnSale    int `json:"transactionsonsale"`    // 出售中的交易
+	TransactionInPurchase int `json:"transactioninpurchase"` // 求购中的交易
+	PurchasedTransactions int `json:"purchasedtransactions"` // 已购买的交易
+	TransactionsSold      int `json:"transactionssold"`      // 已卖出的交易
+	UnhandledMessage      int `json:"unhandledmessage"`      // 未处理消息
+
+	USERID uint64 `json:"-" form:"userid" binding:"required"` // 用户ID
+}
+
+func (r *GZHomeData) GetGZHomeData() (err error) {
+	w1 := make([]Wrtradeorderdetail, 0)
+	if err = db.GetEngine().Table("WRTRADE_ORDERDETAIL").Where("MarketID=67201 AND WRTradeOrderStatus IN (3,7) AND BuyOrSell = 1").And("UserID=?", r.USERID).Find(&w1); err != nil {
+		return
+	}
+	r.TransactionsOnSale = len(w1)
+
+	w2 := make([]Wrtradeorderdetail, 0)
+	if err = db.GetEngine().Table("WRTRADE_ORDERDETAIL").Where("MarketID=67201 AND WRTradeOrderStatus IN (3,7) AND BuyOrSell = 0").And("UserID=?", r.USERID).Find(&w2); err != nil {
+		return
+	}
+	r.TransactionInPurchase = len(w2)
+
+	w3 := make([]Wrtradeorderdetail, 0)
+	if err = db.GetEngine().Table("WRTRADE_TRADEQUOTE T").Select("T.*").Where("T.MarketID=67201").And("T.BuyUserID=?", r.USERID).Find(&w3); err != nil {
+		return
+	}
+	r.PurchasedTransactions = len(w3)
+
+	w4 := make([]Wrtradeorderdetail, 0)
+	if err = db.GetEngine().Table("WRTRADE_TRADEQUOTE T").Select("T.*").Where("T.MarketID=67201").And("T.SellUserID=?", r.USERID).Find(&w4); err != nil {
+		return
+	}
+	r.TransactionsSold = len(w4)
+
+	w5 := make([]Wrtradebargainapply, 0)
+	if err = db.GetEngine().Table("WRTRADE_BARGAINAPPLY T").Select("T.*").Where("T.MarketID=67201 AND T.ApplyStatus=1").And("T.MatchUserID=?", r.USERID).Find(&w5); err != nil {
+		return
+	}
+	w6 := make([]Gzselldelistingapply, 0)
+	if err = db.GetEngine().Table("GZ_SELLDELISTINGAPPLY T").Select("T.*").Where("T.MarketID=67201 AND T.ApplyStatus=1").And("T.BuyUserID=?", r.USERID).Find(&w6); err != nil {
+		return
+	}
+	r.UnhandledMessage = len(w5) + len(w6)
+
+	return
 }

+ 173 - 0
models/ori.go

@@ -0,0 +1,173 @@
+package models
+
+import "time"
+
+// Wrtradeorderdetail 仓单贸易委托表 - 导历史
+type Wrtradeorderdetail struct {
+	WRTRADEORDERID        int64     `json:"wrtradeorderid" xorm:"WRTRADEORDERID"`               // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+	TRADEDATE             string    `json:"tradedate" xorm:"TRADEDATE"`                         // 交易日(yyyyMMdd)
+	WRTRADETYPE           int32     `json:"wrtradetype" xorm:"WRTRADETYPE"`                     // 仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
+	BUYORSELL             int32     `json:"buyorsell" xorm:"BUYORSELL"`                         // 买卖 - 0:买 1:卖
+	RELATEDWRTRADEORDERID int64     `json:"relatedwrtradeorderid" xorm:"RELATEDWRTRADEORDERID"` // 关联委托单号(摘牌委托关联挂牌委托单ID)
+	MARKETID              int64     `json:"marketid" xorm:"MARKETID"`                           // 市场ID
+	USERID                int64     `json:"userid" xorm:"USERID"`                               // 用户ID
+	ACCOUNTID             int64     `json:"accountid" xorm:"ACCOUNTID"`                         // 资金账号
+	WRFACTORTYPEID        int64     `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"`               // 仓单要素类型ID/商品ID(77)
+	ORDERQTY              int64     `json:"orderqty" xorm:"ORDERQTY"`                           // 委托数量
+	TRADEQTY              int64     `json:"tradeqty" xorm:"TRADEQTY"`                           // 成交数量
+	CANCELQTY             int64     `json:"cancelqty" xorm:"CANCELQTY"`                         // 撤销数量
+	WRPRICETYPE           int32     `json:"wrpricetype" xorm:"WRPRICETYPE"`                     // 价格方式 - 1:固定价 2-浮动价  -   [挂牌]
+	FIXEDPRICE            float64   `json:"fixedprice" xorm:"FIXEDPRICE"`                       // 固定价格    -   [挂牌]
+	ISSPECIFIED           int32     `json:"isspecified" xorm:"ISSPECIFIED"`                     // 是否指定对手 - 0:不指定 1:指定好友(贸易圈) 2:指定对手    -   [挂牌]
+	PRICEFACTOR           float64   `json:"pricefactor" xorm:"PRICEFACTOR"`                     // 价格系数(浮动价时填写)    -   [挂牌]
+	PRICEMOVE             float64   `json:"pricemove" xorm:"PRICEMOVE"`                         // 升贴水(浮动价时填写)    -   [挂牌]
+	FIRSTRATIO            float64   `json:"firstratio" xorm:"FIRSTRATIO"`                       // 首付比率 - [挂牌时指定,摘牌时使用]
+	WRTRANSFERUSERID      int64     `json:"wrtransferuserid" xorm:"WRTRANSFERUSERID"`           // 仓单受让用户 - [摘牌]
+	TRADEPRICE            float64   `json:"tradeprice" xorm:"TRADEPRICE"`                       // 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)* 商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+	FREEZEFIRSTAMOUNT     float64   `json:"freezefirstamount" xorm:"FREEZEFIRSTAMOUNT"`         // 冻结首付金额 - [摘牌]
+	UNFREEZEFIRSTAMOUNT   float64   `json:"unfreezefirstamount" xorm:"UNFREEZEFIRSTAMOUNT"`     // 解冻首付金额 - [摘牌]
+	PERFORMANCETEMPLATEID int64     `json:"performancetemplateid" xorm:"PERFORMANCETEMPLATEID"` // 履约计划模板ID
+	VALIDTYPE             int32     `json:"validtype" xorm:"VALIDTYPE"`                         // 有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效
+	VALIDTIME             time.Time `json:"validtime" xorm:"VALIDTIME"`                         // 有效期限
+	ORDERTIME             time.Time `json:"ordertime" xorm:"ORDERTIME"`                         // 委托时间
+	CANCELTIME            time.Time `json:"canceltime" xorm:"CANCELTIME"`                       // 撤销时间
+	WRTRADEORDERSTATUS    int32     `json:"wrtradeorderstatus" xorm:"WRTRADEORDERSTATUS"`       // 委托状态 - 参考枚举'WRTradeOrderStatus' - 1:委托请求  2:待冻结  3:委托成功  4:委托失败  5:配对成功  6:已撤  7:部成  8:已成  9:部成部撤  10:成交失败  11:委托拒绝  12:经过摘牌(先摘后挂专用)  13:冻结成功(通道交易专用)  14:通道已撤  15:通道部成部撤  16:成交失败违约(荷兰式竞拍专用)  17:冻结PD成功  18:冻结PD失败  19:冻结能量成功  20:冻结能量失败  21:预约已报价  22:过期未付  23:优惠券处理中  24:仓单生成失败  25:首付扣款失败  26:履约失败  27:撤单解冻贷款失败
+	CLIENTTICKET          string    `json:"clientticket" xorm:"CLIENTTICKET"`                   // 客户端流水号
+	ORDERSRC              int32     `json:"ordersrc" xorm:"ORDERSRC"`                           // 委托来源 - 1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结
+	CLIENTTYPE            int32     `json:"clienttype" xorm:"CLIENTTYPE"`                       // 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+	UUID                  string    `json:"-" xorm:"-"`                                         // 发起端唯一id
+	CLIENTORDERTIME       time.Time `json:"clientordertime" xorm:"CLIENTORDERTIME"`             // 客户端委托时间
+	RETCODE               int32     `json:"retcode" xorm:"RETCODE"`                             // 错误代码
+	OPERATORID            int64     `json:"operatorid" xorm:"OPERATORID"`                       // 操作员ID
+	PRICEDISPLAYMODE      int32     `json:"pricedisplaymode" xorm:"PRICEDISPLAYMODE"`           // 浮动价显示方式 - 1:合并显示 2:分开显示1: 价格显示一个值 :(商品拟合价*价格系统+升贴水)2: 价格显示两个值:(商品拟合价*价格系统)  、 升贴水
+	FREEZEMARGIN          float64   `json:"freezemargin" xorm:"FREEZEMARGIN"`                   // 冻结保证金
+	UNFREEZEMARGIN        float64   `json:"unfreezemargin" xorm:"UNFREEZEMARGIN"`               // 解冻保证金
+	FREEZECHARGE          float64   `json:"freezecharge" xorm:"FREEZECHARGE"`                   // 冻结手续费
+	UNFREEZECHARGE        float64   `json:"unfreezecharge" xorm:"UNFREEZECHARGE"`               // 解冻手续费
+	MARGINALGORITHM       int32     `json:"marginalgorithm" xorm:"MARGINALGORITHM"`             // 保证金方式 - 1:比率  2:固定
+	MARGINVALUE           float64   `json:"marginvalue" xorm:"MARGINVALUE"`                     // 保证金设置值
+	CHARGEALGORITHM       int32     `json:"chargealgorithm" xorm:"CHARGEALGORITHM"`             // 手续费收取方式 1:比率  2:固定
+	CHARGEALGORITHMVALUE  float64   `json:"chargealgorithmvalue" xorm:"CHARGEALGORITHMVALUE"`   // 手续费设置值(交易所部分)
+	CHARGEALGORITHMVALUE2 float64   `json:"chargealgorithmvalue2" xorm:"CHARGEALGORITHMVALUE2"` // 手续费设置值(会员部分)
+	CANBARGAIN            int32     `json:"canbargain" xorm:"CANBARGAIN"`                       // 是否可议价 - 0:不可 1:可
+	WRBARGAINID           int64     `json:"wrbargainid" xorm:"WRBARGAINID"`                     // 议价申请单ID
+	ATTACHMENT1           string    `json:"attachment1" xorm:"ATTACHMENT1"`                     // 附件1
+	ATTACHMENT2           string    `json:"attachment2" xorm:"ATTACHMENT2"`                     // 附件2
+	REMARK                string    `json:"remark" xorm:"REMARK"`                               // 备注
+	APPLYID               int64     `json:"applyid" xorm:"APPLYID"`                             // 申请单ID
+	PERFORMANCEWAY        int32     `json:"performanceway" xorm:"PERFORMANCEWAY"`               // 交货模式 - 1:履约计划 2:分步履约 3:分步提货[文昌]
+	BUYRELEASERATIO       float64   `json:"buyreleaseratio" xorm:"BUYRELEASERATIO"`             // 买方释放比率[2:分步履约]
+	SELLRELEASERATIO      float64   `json:"sellreleaseratio" xorm:"SELLRELEASERATIO"`           // 卖方释放比率[2:分步履约]
+	EXECUTEMODE           int32     `json:"executemode" xorm:"EXECUTEMODE"`                     // 执行方式[2:分步履约] - 1:顺序执行 2:交叉执行
+	EXECUTESIDE           int32     `json:"executeside" xorm:"EXECUTESIDE"`                     // 执行方[2:分步履约] - 1:买方 2:卖方
+	MINQTY                int32     `json:"minqty" xorm:"MINQTY"`                               // 最小执行量[2:分步履约]
+	HOLDDAYS              int32     `json:"holddays" xorm:"HOLDDAYS"`                           // 合同期限[2:分步履约]
+	AUCTIONWRTYPE         int32     `json:"auctionwrtype" xorm:"AUCTIONWRTYPE"`                 // 仓单类型 - 1:无仓单 2:有仓单 3;有无仓单均可
+	HASWR                 int32     `json:"haswr" xorm:"HASWR"`                                 // 是否有仓单-卖方 - 0:无仓单 1:有仓单
+	LIMITEDPRICE          float64   `json:"limitedprice" xorm:"LIMITEDPRICE"`                   // 限制价格 - 浮动价,买方为最高价,卖方为最低价
+	CANPART               int32     `json:"canpart" xorm:"CANPART"`                             // 是否允许部份摘牌 - 0:不允许 1:允许
+	WRID                  int64     `json:"wrid" xorm:"WRID"`                                   // 关联仓单ID
+	DELIVERYMONTH         string    `json:"deliverymonth" xorm:"DELIVERYMONTH"`                 // 交收月(yyyy-MM) [无仓单HasWR =0]
+	DELIVERYGOODSID       int32     `json:"deliverygoodsid" xorm:"DELIVERYGOODSID"`             // 现货品种ID
+	WRSTANDARDID          int64     `json:"wrstandardid" xorm:"WRSTANDARDID"`                   // 现货商品ID
+	DELISTMINQTY          int32     `json:"delistminqty" xorm:"DELISTMINQTY"`                   // 起摘数量
+	MARGINFLAG            int32     `json:"marginflag" xorm:"MARGINFLAG"`                       // 挂牌是否指定保证金 - 0:未指定 1:指定
+	ALLFRIENDSFLAG        int32     `json:"allfriendsflag" xorm:"ALLFRIENDSFLAG"`               // 是否全好友可见 - 0:否 1:是
+	PRESALEAPPLYID        int64     `json:"presaleapplyid" xorm:"PRESALEAPPLYID"`               // 关联预售申请ID[47:仓单预售]
+	PRESALETYPE           int32     `json:"presaletype" xorm:"PRESALETYPE"`                     // 预售类型 - 1:摇号 2:配售[47:仓单预售]
+	EXCHANGERATE          float64   `json:"exchangerate" xorm:"EXCHANGERATE"`                   // 汇率[67]
+	ORDERAMOUNT           float64   `json:"orderamount" xorm:"ORDERAMOUNT"`                     // 挂牌金额[账户] [67]= OrderQty * FixedPrice * ExchangeRate /100
+}
+
+// TableName is WRTRADE_ORDERDETAIL
+func (r *Wrtradeorderdetail) TableName() string {
+	return "WRTRADE_ORDERDETAIL"
+}
+
+// Wrtradetradequote 仓单贸易成交行情表
+type Wrtradetradequote struct {
+	WRTRADEDETAILID   int64     `json:"wrtradedetailid" xorm:"WRTRADEDETAILID"`     // 仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
+	TRADEDATE         string    `json:"tradedate" xorm:"TRADEDATE"`                 // 交易日(yyyyMMdd)
+	MARKETID          int32     `json:"marketid" xorm:"MARKETID"`                   // 市场ID
+	WRFACTORTYPEID    int64     `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"`       // 仓单要素类型ID
+	DELIVERYGOODSID   int32     `json:"deliverygoodsid" xorm:"DELIVERYGOODSID"`     // 现货品种ID
+	WRSTANDARDID      int32     `json:"wrstandardid" xorm:"WRSTANDARDID"`           // 现货商品ID
+	BUYUSERID         int64     `json:"buyuserid" xorm:"BUYUSERID"`                 // 买方用户ID
+	BUYACCOUNTID      int64     `json:"buyaccountid" xorm:"BUYACCOUNTID"`           // 买方账号ID
+	SELLUSERID        int64     `json:"selluserid" xorm:"SELLUSERID"`               // 卖方用户ID
+	SELLACCOUNTID     int64     `json:"sellaccountid" xorm:"SELLACCOUNTID"`         // 卖方账号ID
+	TRADETIME         time.Time `json:"tradetime" xorm:"TRADETIME"`                 // 成交时间
+	TRADEPRICE        float64   `json:"tradeprice" xorm:"TRADEPRICE"`               // 成交价格
+	TRADEQTY          int64     `json:"tradeqty" xorm:"TRADEQTY"`                   // 成交数量
+	TRADEAMOUNT       float64   `json:"tradeamount" xorm:"TRADEAMOUNT"`             // 成交金额
+	PERFORMANCEPLANID int64     `json:"performanceplanid" xorm:"PERFORMANCEPLANID"` // 履约计划ID/合同ID
+	EXCHANGERATE      float64   `json:"exchangerate" xorm:"EXCHANGERATE"`           // 汇率
+	BUYCHARGEVALUE    float64   `json:"buychargevalue" xorm:"BUYCHARGEVALUE"`       // 买方手续费
+	SELLCHARGEVALUE   float64   `json:"sellchargevalue" xorm:"SELLCHARGEVALUE"`     // 卖方手续费
+	ORITRADEAMOUNT    float64   `json:"oritradeamount" xorm:"ORITRADEAMOUNT"`       // 成交金额[商品币种]
+}
+
+// TableName is WRTRADE_TRADEQUOTE
+func (r *Wrtradetradequote) TableName() string {
+	return "WRTRADE_TRADEQUOTE"
+}
+
+// Wrtradebargainapply 仓单贸易议价申请表 - 导历史
+type Wrtradebargainapply struct {
+	WRBARGAINID    int64     `json:"wrbargainid" xorm:"WRBARGAINID"`       // 议价申请单ID(327+Unix秒时间戳(10位)+xxxxxx)
+	WRTRADEORDERID int64     `json:"wrtradeorderid" xorm:"WRTRADEORDERID"` // 关联委托单ID
+	TRADEDATE      string    `json:"tradedate" xorm:"TRADEDATE"`           // 交易日(yyyyMMdd)
+	MARKETID       int64     `json:"marketid" xorm:"MARKETID"`             // 市场ID
+	USERID         int64     `json:"userid" xorm:"USERID"`                 // 摘牌人用户ID
+	ACCOUNTID      int64     `json:"accountid" xorm:"ACCOUNTID"`           // 摘牌资金账号
+	BUYORSELL      int32     `json:"buyorsell" xorm:"BUYORSELL"`           // 买卖 - 0:买 1:卖
+	APPLYQTY       int64     `json:"applyqty" xorm:"APPLYQTY"`             // 摘牌数量
+	APPLYPRICE     string    `json:"applyprice" xorm:"APPLYPRICE"`         // 申请价格
+	APPLYSTATUS    int32     `json:"applystatus" xorm:"APPLYSTATUS"`       // 申请状态 - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+	HANDLESTATUS   int32     `json:"handlestatus" xorm:"HANDLESTATUS"`     // 处理状态
+	APPLYTIME      time.Time `json:"applytime" xorm:"APPLYTIME"`           // 申请时间
+	APPLYREMARK    string    `json:"applyremark" xorm:"APPLYREMARK"`       // 申请备注
+	CONFIRMQTY     int64     `json:"confirmqty" xorm:"CONFIRMQTY"`         // 可接受数量(拒绝时填写)-作废
+	CONFIRMPRICE   float64   `json:"confirmprice" xorm:"CONFIRMPRICE"`     // 可接受价格(拒绝时填写)-作废
+	CONFIRMUSERID  int64     `json:"confirmuserid" xorm:"CONFIRMUSERID"`   // 确认人
+	CONFIRMTIME    time.Time `json:"confirmtime" xorm:"CONFIRMTIME"`       // 确认时间
+	CONFIRMREMARK  string    `json:"confirmremark" xorm:"CONFIRMREMARK"`   // 确认备注
+	REFPRICE       string    `json:"refprice" xorm:"REFPRICE"`             // 参考价格
+	RETCODE        int32     `json:"retcode" xorm:"RETCODE"`               // 委托返回代码
+	MATCHUSERID    int64     `json:"matchuserid" xorm:"MATCHUSERID"`       // 挂牌方用户ID
+	MATCHACCOUNTID int64     `json:"matchaccountid" xorm:"MATCHACCOUNTID"` // 挂牌方资金账号
+	LADINGBILLID   int64     `json:"ladingbillid" xorm:"LADINGBILLID"`     // 摘牌方提单ID [卖]
+	SUBNUM         int32     `json:"subnum" xorm:"SUBNUM"`                 // 摘牌方提单子单号 [卖]
+}
+
+// TableName is WRTRADE_BARGAINAPPLY
+func (r *Wrtradebargainapply) TableName() string {
+	return "WRTRADE_BARGAINAPPLY"
+}
+
+// Gzselldelistingapply 卖摘牌申请表
+type Gzselldelistingapply struct {
+	SELLDELISTINGAPPLYID int64     `json:"selldelistingapplyid" xorm:"SELLDELISTINGAPPLYID"` // 卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)
+	BUYWRTRADEORDERID    int64     `json:"buywrtradeorderid" xorm:"BUYWRTRADEORDERID"`       // 买委托单ID
+	BUYUSERID            int64     `json:"buyuserid" xorm:"BUYUSERID"`                       // 买方用户ID
+	SELLUSERID           int64     `json:"selluserid" xorm:"SELLUSERID"`                     // 卖方用户ID
+	SELLACCOUNTID        int64     `json:"sellaccountid" xorm:"SELLACCOUNTID"`               // 卖方账户ID
+	WRSTANDARDID         int64     `json:"wrstandardid" xorm:"WRSTANDARDID"`                 // 现货商品ID
+	WRFACTORTYPEID       int64     `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"`             // 仓单要素类型ID
+	APPLYQTY             float64   `json:"applyqty" xorm:"APPLYQTY"`                         // 申请数量
+	APPLYPRICE           float64   `json:"applyprice" xorm:"APPLYPRICE"`                     // 申请价格
+	APPLYSTATUS          int32     `json:"applystatus" xorm:"APPLYSTATUS"`                   // 申请状态 - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+	APPLYREMARK          string    `json:"applyremark" xorm:"APPLYREMARK"`                   // 申请备注
+	APPLYTIME            time.Time `json:"applytime" xorm:"APPLYTIME"`                       // 申请时间
+	AUDITREMARK          string    `json:"auditremark" xorm:"AUDITREMARK"`                   // 确认备注
+	SELLTRADEORDERID     int64     `json:"selltradeorderid" xorm:"SELLTRADEORDERID"`         // 卖方委托ID(买方确认成交后更新)
+	AUDITTIME            time.Time `json:"audittime" xorm:"AUDITTIME"`                       // 确认时间
+	LADINGBILLID         int64     `json:"ladingbillid" xorm:"LADINGBILLID"`                 // 卖方提单ID
+	SUBNUM               int32     `json:"subnum" xorm:"SUBNUM"`                             // 卖方提单子单号
+	MARKETID             int32     `json:"marketid" xorm:"MARKETID"`                         // 市场ID
+}
+
+// TableName is GZ_SELLDELISTINGAPPLY
+func (r *Gzselldelistingapply) TableName() string {
+	return "GZ_SELLDELISTINGAPPLY"
+}

+ 6 - 6
models/wrTrade2.go

@@ -5140,7 +5140,7 @@ func (r *XhcpSellBackApplyEx) Insert() error {
 }
 
 // Wrtradetradequote 仓单贸易成交行情表
-type Wrtradetradequote struct {
+type Wrtradetradequote1 struct {
 	WRTRADEDETAILID string    `json:"wrtradedetailid"  xorm:"WRTRADEDETAILID"`               // 仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
 	TRADEDATE       string    `json:"tradedate"  xorm:"TRADEDATE"`                           // 交易日(yyyyMMdd)
 	MARKETID        int32     `json:"marketid"  xorm:"MARKETID"  form:"marketid"`            // 市场ID
@@ -5161,15 +5161,15 @@ type Wrtradetradequote struct {
 }
 
 // TableName is WRTRADE_TRADEQUOTE
-func (r *Wrtradetradequote) TableName() string {
+func (r *Wrtradetradequote1) TableName() string {
 	return "WRTRADE_TRADEQUOTE"
 }
 
-func (r *Wrtradetradequote) calc() {
+func (r *Wrtradetradequote1) calc() {
 
 }
 
-func (r *Wrtradetradequote) buildSql() string {
+func (r *Wrtradetradequote1) buildSql() string {
 	var sqlId utils.SQLVal = `
 	SELECT 
 		to_char(t.WRTRADEDETAILID) WRTRADEDETAILID,
@@ -5198,8 +5198,8 @@ func (r *Wrtradetradequote) buildSql() string {
 	return sqlId.String()
 }
 
-func (r *Wrtradetradequote) GetDataEx() (interface{}, error) {
-	sData := make([]Wrtradetradequote, 0)
+func (r *Wrtradetradequote1) GetDataEx() (interface{}, error) {
+	sData := make([]Wrtradetradequote1, 0)
 	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
 	for i := range sData {
 		sData[i].calc()

+ 4 - 0
routers/router.go

@@ -669,6 +669,10 @@ func InitRouter() *gin.Engine {
 		guangzuanR.GET("GetGoods", guangzuan.GetGoods)
 		guangzuanR.GET("QueryMyPerformanc", guangzuan.QueryMyPerformanc)
 		guangzuanR.GET("QueryMyFavorite", guangzuan.QueryMyFavorite)
+		guangzuanR.GET("PriceCalc", guangzuan.PriceCalc)
+		guangzuanR.GET("GzCertAddressConfig", guangzuan.GzCertAddressConfig)
+		guangzuanR.GET("GzCertAddressParam", guangzuan.GzCertAddressParam)
+		guangzuanR.GET("HomeData", guangzuan.HomeData)
 	}
 
 	return r