Selaa lähdekoodia

Merge branch 'master' of http://192.168.31.240:3000/MTP2.0_New/MTP20_IF

muchinfo 2 kuukautta sitten
vanhempi
commit
6cf1e098b0
7 muutettua tiedostoa jossa 57 lisäystä ja 27 poistoa
  1. 14 6
      docs/docs.go
  2. 14 6
      docs/swagger.json
  3. 12 6
      docs/swagger.yaml
  4. 11 3
      models/ermcpGoods.go
  5. 2 2
      models/goods.go
  6. 2 2
      models/sbyj.go
  7. 2 2
      mtpcache/goods.go

+ 14 - 6
docs/docs.go

@@ -37664,6 +37664,10 @@ const docTemplate = `{
                     "description": "Banner图片(2:1)(逗号分隔)",
                     "type": "string"
                 },
+                "basecurrencycode": {
+                    "description": "基础货币代码(80:Goodscurrencyid)",
+                    "type": "string"
+                },
                 "buyotherfeealgorithm": {
                     "description": "买交收其它费用算法",
                     "type": "integer"
@@ -37705,7 +37709,7 @@ const docTemplate = `{
                     "type": "number"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID(80:计价货币)",
                     "type": "integer"
                 },
                 "cutmode": {
@@ -37741,7 +37745,7 @@ const docTemplate = `{
                     "type": "string"
                 },
                 "goodscurrencyid": {
-                    "description": "合约货币ID",
+                    "description": "合约货币ID(80:基础货币)",
                     "type": "integer"
                 },
                 "goodsgroupid": {
@@ -37852,6 +37856,10 @@ const docTemplate = `{
                     "description": "成交量小数位",
                     "type": "integer"
                 },
+                "quotecurrencycode": {
+                    "description": "计价货币代码(80:currencyid)",
+                    "type": "string"
+                },
                 "quotegear": {
                     "description": "行情档位(1-10)",
                     "type": "integer"
@@ -40986,7 +40994,7 @@ const docTemplate = `{
                     "type": "integer"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID(80:计价货币)",
                     "type": "integer"
                 },
                 "cutmode": {
@@ -41022,7 +41030,7 @@ const docTemplate = `{
                     "type": "string"
                 },
                 "goodscurrencyid": {
-                    "description": "合约货币ID",
+                    "description": "合约货币ID(80:基础货币)",
                     "type": "integer"
                 },
                 "goodsgroupid": {
@@ -59125,7 +59133,7 @@ const docTemplate = `{
                     "type": "integer"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID(80:计价货币)",
                     "type": "integer"
                 },
                 "cutmode": {
@@ -59161,7 +59169,7 @@ const docTemplate = `{
                     "type": "string"
                 },
                 "goodscurrencyid": {
-                    "description": "合约货币ID",
+                    "description": "合约货币ID(80:基础货币)",
                     "type": "integer"
                 },
                 "goodsgroupid": {

+ 14 - 6
docs/swagger.json

@@ -37656,6 +37656,10 @@
                     "description": "Banner图片(2:1)(逗号分隔)",
                     "type": "string"
                 },
+                "basecurrencycode": {
+                    "description": "基础货币代码(80:Goodscurrencyid)",
+                    "type": "string"
+                },
                 "buyotherfeealgorithm": {
                     "description": "买交收其它费用算法",
                     "type": "integer"
@@ -37697,7 +37701,7 @@
                     "type": "number"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID(80:计价货币)",
                     "type": "integer"
                 },
                 "cutmode": {
@@ -37733,7 +37737,7 @@
                     "type": "string"
                 },
                 "goodscurrencyid": {
-                    "description": "合约货币ID",
+                    "description": "合约货币ID(80:基础货币)",
                     "type": "integer"
                 },
                 "goodsgroupid": {
@@ -37844,6 +37848,10 @@
                     "description": "成交量小数位",
                     "type": "integer"
                 },
+                "quotecurrencycode": {
+                    "description": "计价货币代码(80:currencyid)",
+                    "type": "string"
+                },
                 "quotegear": {
                     "description": "行情档位(1-10)",
                     "type": "integer"
@@ -40978,7 +40986,7 @@
                     "type": "integer"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID(80:计价货币)",
                     "type": "integer"
                 },
                 "cutmode": {
@@ -41014,7 +41022,7 @@
                     "type": "string"
                 },
                 "goodscurrencyid": {
-                    "description": "合约货币ID",
+                    "description": "合约货币ID(80:基础货币)",
                     "type": "integer"
                 },
                 "goodsgroupid": {
@@ -59117,7 +59125,7 @@
                     "type": "integer"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID(80:计价货币)",
                     "type": "integer"
                 },
                 "cutmode": {
@@ -59153,7 +59161,7 @@
                     "type": "string"
                 },
                 "goodscurrencyid": {
-                    "description": "合约货币ID",
+                    "description": "合约货币ID(80:基础货币)",
                     "type": "integer"
                 },
                 "goodsgroupid": {

+ 12 - 6
docs/swagger.yaml

@@ -9689,6 +9689,9 @@ definitions:
       bannerurls:
         description: Banner图片(2:1)(逗号分隔)
         type: string
+      basecurrencycode:
+        description: 基础货币代码(80:Goodscurrencyid)
+        type: string
       buyotherfeealgorithm:
         description: 买交收其它费用算法
         type: integer
@@ -9720,7 +9723,7 @@ definitions:
         description: 强平最新价浮动比例 - 方式为2时使用  (<1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价
         type: number
       currencyid:
-        description: 报价货币ID
+        description: 报价货币ID(80:计价货币)
         type: integer
       cutmode:
         description: 斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓
@@ -9747,7 +9750,7 @@ definitions:
         description: 商品代码(内部)
         type: string
       goodscurrencyid:
-        description: 合约货币ID
+        description: 合约货币ID(80:基础货币)
         type: integer
       goodsgroupid:
         description: 所属商品组ID
@@ -9830,6 +9833,9 @@ definitions:
       qtydecimalplace:
         description: 成交量小数位
         type: integer
+      quotecurrencycode:
+        description: 计价货币代码(80:currencyid)
+        type: string
       quotegear:
         description: 行情档位(1-10)
         type: integer
@@ -12138,7 +12144,7 @@ definitions:
         description: 创建人
         type: integer
       currencyid:
-        description: 报价货币ID
+        description: 报价货币ID(80:计价货币)
         type: integer
       cutmode:
         description: 斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓
@@ -12165,7 +12171,7 @@ definitions:
         description: 商品代码(内部)
         type: string
       goodscurrencyid:
-        description: 合约货币ID
+        description: 合约货币ID(80:基础货币)
         type: integer
       goodsgroupid:
         description: 所属商品组ID
@@ -25610,7 +25616,7 @@ definitions:
         description: 创建人
         type: integer
       currencyid:
-        description: 报价货币ID
+        description: 报价货币ID(80:计价货币)
         type: integer
       cutmode:
         description: 斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓
@@ -25637,7 +25643,7 @@ definitions:
         description: 商品代码(内部)
         type: string
       goodscurrencyid:
-        description: 合约货币ID
+        description: 合约货币ID(80:基础货币)
         type: integer
       goodsgroupid:
         description: 所属商品组ID

+ 11 - 3
models/ermcpGoods.go

@@ -32,7 +32,7 @@ type ErmcpGoods struct {
 	Marketid              int64     `json:"marketid"  xorm:"'MARKETID'" binding:"required"`      // 所属市场ID
 	Goodsgroupid          int64     `json:"goodsgroupid"  xorm:"'GOODSGROUPID'"`                 // 所属商品组ID
 	Goodsstatus           int64     `json:"goodsstatus"  xorm:"'GOODSSTATUS'"`                   // 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
-	Currencyid            int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                     // 报价货币ID
+	Currencyid            int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                     // 报价货币ID(80:计价货币)
 	Goodunitid            int64     `json:"goodunitid"  xorm:"'GOODUNITID'"`                     // 报价单位ID
 	Agreeunit             float64   `json:"agreeunit"  xorm:"'AGREEUNIT'"`                       // 合约单位
 	Decimalplace          int64     `json:"decimalplace"  xorm:"'DECIMALPLACE'"`                 // 报价小数位
@@ -66,7 +66,7 @@ type ErmcpGoods struct {
 	Closepricemode        int64     `json:"closepricemode"  xorm:"'CLOSEPRICEMODE'"`             // 强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
 	Closepriceparam       float64   `json:"closepriceparam"  xorm:"'CLOSEPRICEPARAM'"`           // 强平最新价浮动比例 - 方式为2时使用  (<1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价
 	Qtydecimalplace       int64     `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"`           // 成交量小数位
-	Goodscurrencyid       int64     `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"`           // 合约货币ID
+	Goodscurrencyid       int64     `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"`           // 合约货币ID(80:基础货币)
 	Goodsquotetype        int64     `json:"-"  xorm:"'GOODSQUOTETYPE'"`                          // 合约报价类型: 1-直接报价  2-间接报价
 	Quotegear             int64     `json:"quotegear"  xorm:"'QUOTEGEAR'"`                       // 行情档位(1-10)
 	Outgoodscode          string    `json:"outgoodscode"  xorm:"'OUTGOODSCODE'"`                 // 商品代码(外部)
@@ -123,6 +123,9 @@ type ErmcpGoods struct {
 	SLRATIOUP      float64 `json:"slratioup" xorm:"SLRATIOUP"`           // 止损比例上限
 	SLRATIODEFAULT float64 `json:"slratiodefault" xorm:"SLRATIODEFAULT"` // 止损默认比例
 
+	BASECURRENCYCODE  string `json:"basecurrencycode" xorm:"BASECURRENCYCODE"`   // 基础货币代码(80:Goodscurrencyid)
+	QUOTECURRENCYCODE string `json:"quotecurrencycode" xorm:"QUOTECURRENCYCODE"` // 计价货币代码(80:currencyid)
+
 }
 
 // GetErmcpGoodses 企业风管专用获取商品信息的方法
@@ -190,12 +193,17 @@ func GetErmcpGoodses(userid int64, lastUpdateTime string, loginID int64) ([]Ermc
 			EX.TPRATIODEFAULT,
 			EX.SLRATIODOWN,
 			EX.SLRATIOUP,
-			EX.SLRATIODEFAULT        
+			EX.SLRATIODEFAULT,
+			EN1.ENUMDICNAME BASECURRENCYCODE,
+			EN2.ENUMDICNAME QUOTECURRENCYCODE     
 			`).
 		Join("LEFT", "MARKET M", "M.MARKETID = G.MARKETID").
 		Join("LEFT", "GOODSMARGINCONFIG GM", "GM.GOODSID = G.GOODSID AND GM.ISDEFAULT = 1").
 		Join("LEFT", "GOODSEX EX", "EX.GOODSID = G.GOODSID").
 		Join("LEFT", "GOODSGROUP GG", "GG.GOODSGROUPID = G.GOODSGROUPID").
+		Join("LEFT", "(SELECT T.ENUMITEMNAME, T.ENUMDICNAME FROM ENUMDICITEM T WHERE ENUMDICCODE = 'digitalcurrency') EN1", "EN1.ENUMITEMNAME = G.GOODSCURRENCYID").
+		Join("LEFT", "(SELECT T.ENUMITEMNAME, T.ENUMDICNAME FROM ENUMDICITEM T WHERE ENUMDICCODE = 'digitalcurrency') EN2", "EN2.ENUMITEMNAME = G.CURRENCYID").
+		Join("LEFT", "GOODSGROUP GG", "GG.GOODSGROUPID = G.GOODSGROUPID").
 		Where("G.GOODSSTATUS in (3)")
 	if loginID != 0 {
 		session = session.In("G.MARKETID", ids)

+ 2 - 2
models/goods.go

@@ -16,7 +16,7 @@ type Goods struct {
 	Marketid              int64     `json:"marketid"  xorm:"'MARKETID'" binding:"required"`        // 所属市场ID
 	Goodsgroupid          int64     `json:"goodsgroupid"  xorm:"'GOODSGROUPID'"`                   // 所属商品组ID
 	Goodsstatus           int64     `json:"goodsstatus"  xorm:"'GOODSSTATUS'"`                     // 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
-	Currencyid            int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                       // 报价货币ID
+	Currencyid            int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                       // 报价货币ID(80:计价货币)
 	Goodunitid            int64     `json:"goodunitid"  xorm:"'GOODUNITID'"`                       // 报价单位ID
 	Agreeunit             float64   `json:"agreeunit"  xorm:"'AGREEUNIT'"`                         // 合约单位
 	Decimalplace          int64     `json:"decimalplace"  xorm:"'DECIMALPLACE'"`                   // 报价小数位
@@ -50,7 +50,7 @@ type Goods struct {
 	Closepricemode        int64     `json:"closepricemode"  xorm:"'CLOSEPRICEMODE'"`               // 强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
 	Closepriceparam       float64   `json:"closepriceparam"  xorm:"'CLOSEPRICEPARAM'"`             // 强平最新价浮动比例 - 方式为2时使用  (<1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价
 	Qtydecimalplace       int64     `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"`             // 成交量小数位
-	Goodscurrencyid       int64     `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"`             // 合约货币ID
+	Goodscurrencyid       int64     `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"`             // 合约货币ID(80:基础货币)
 	Goodsquotetype        int64     `json:"goodsquotetype"  xorm:"'GOODSQUOTETYPE'"`               // 合约报价类型: 1-直接报价  2-间接报价
 	Quotegear             int64     `json:"quotegear"  xorm:"'QUOTEGEAR'"`                         // 行情档位(1-10)
 	Outgoodscode          string    `json:"outgoodscode"  xorm:"'OUTGOODSCODE'"`                   // 商品代码(外部)

+ 2 - 2
models/sbyj.go

@@ -22,7 +22,7 @@ type TouristGoods struct {
 	Marketid              int64     `json:"marketid"  xorm:"'MARKETID'" binding:"required"`        // 所属市场ID
 	Goodsgroupid          int64     `json:"goodsgroupid"  xorm:"'GOODSGROUPID'"`                   // 所属商品组ID
 	Goodsstatus           int64     `json:"goodsstatus"  xorm:"'GOODSSTATUS'"`                     // 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
-	Currencyid            int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                       // 报价货币ID
+	Currencyid            int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                       // 报价货币ID(80:计价货币)
 	Goodunitid            int64     `json:"goodunitid"  xorm:"'GOODUNITID'"`                       // 报价单位ID
 	Agreeunit             float64   `json:"agreeunit"  xorm:"'AGREEUNIT'"`                         // 合约单位
 	Decimalplace          int64     `json:"decimalplace"  xorm:"'DECIMALPLACE'"`                   // 报价小数位
@@ -56,7 +56,7 @@ type TouristGoods struct {
 	Closepricemode        int64     `json:"closepricemode"  xorm:"'CLOSEPRICEMODE'"`               // 强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
 	Closepriceparam       float64   `json:"closepriceparam"  xorm:"'CLOSEPRICEPARAM'"`             // 强平最新价浮动比例 - 方式为2时使用  (<1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价
 	Qtydecimalplace       int64     `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"`             // 成交量小数位
-	Goodscurrencyid       int64     `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"`             // 合约货币ID
+	Goodscurrencyid       int64     `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"`             // 合约货币ID(80:基础货币)
 	Goodsquotetype        int64     `json:"goodsquotetype"  xorm:"'GOODSQUOTETYPE'"`               // 合约报价类型: 1-直接报价  2-间接报价
 	Quotegear             int64     `json:"quotegear"  xorm:"'QUOTEGEAR'"`                         // 行情档位(1-10)
 	Outgoodscode          string    `json:"outgoodscode"  xorm:"'OUTGOODSCODE'"`                   // 商品代码(外部)

+ 2 - 2
mtpcache/goods.go

@@ -88,12 +88,12 @@ type Goods struct {
 	MARKETID        string  `json:"marketid"  xorm:"'MARKETID'"`               // 所属市场ID
 	GOODSGROUPID    int32   `json:"goodsgroupid"  xorm:"'GOODSGROUPID'"`       // 所属商品组ID
 	GOODSSTATUS     int32   `json:"goodsstatus"  xorm:"'GOODSSTATUS'"`         // 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
-	CURRENCYID      int32   `json:"currencyid"  xorm:"'CURRENCYID'"`           // 报价货币ID
+	CURRENCYID      int32   `json:"currencyid"  xorm:"'CURRENCYID'"`           // 报价货币ID(80:计价货币)
 	GOODUNITID      int32   `json:"goodunitid"  xorm:"'GOODUNITID'"`           // 报价单位ID
 	AGREEUNIT       float64 `json:"agreeunit"  xorm:"'AGREEUNIT'"`             // 合约乘数
 	DECIMALPLACE    int32   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`       // 报价小数位
 	QTYDECIMALPLACE int32   `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"` // 成交量小数位
-	GOODSCURRENCYID int32   `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"` // 合约货币ID
+	GOODSCURRENCYID int32   `json:"goodscurrencyid"  xorm:"'GOODSCURRENCYID'"` // 合约货币ID(80:基础货币)
 	REFGOODSID      int64   `json:"refgoodsid"  xorm:"'REFGOODSID'"`           // 参考商品ID
 	REFGOODSCODE    string  `json:"refgoodscode"  xorm:"'REFGOODSCODE'"`       // 参考商品代码
 	THUMURLS        string  `json:"thumurls" xorm:"THUMURLS"`                  // 缩略图片(1:1)(逗号分隔)