Parcourir la source

修改挂牌点选商品详情价格BUG

zhou.xiaoning il y a 4 ans
Parent
commit
edcd7d9552
7 fichiers modifiés avec 548 ajouts et 15 suppressions
  1. 6 6
      config/config.xml
  2. 1 1
      controllers/market/market.go
  3. 194 2
      docs/docs.go
  4. 194 2
      docs/swagger.json
  5. 146 1
      docs/swagger.yaml
  6. 5 1
      models/hsby.go
  7. 2 2
      models/quote.go

+ 6 - 6
config/config.xml

@@ -13,11 +13,11 @@
     <DbAddress value="192.168.31.117"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test125"/>
+    <DbUser value="mtp2_test166"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.30.125"/>
+    <Address value="192.168.31.166"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -25,11 +25,11 @@
     <Pwd value=""/>
   </RedisSetting>
   <MqSetting>
-    <Url value="amqp://guest:guest@192.168.30.125:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.166:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.30.125"/>
+    <HostName value="192.168.31.166"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <Username value="quote_test01"/>
@@ -38,8 +38,8 @@
   <MySQLSetting>
     <Host value="192.168.30.140"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test125"/>
-    <Username value="quote_test125"/>
+    <DBName value="historyquote_test166"/>
+    <Username value="quote_test166"/>
     <Password value="123456"/>
   </MySQLSetting>
 </Configuration>

+ 1 - 1
controllers/market/market.go

@@ -100,7 +100,7 @@ type QueryGoodsesByLoginIDReq struct {
 // @Security ApiKeyAuth
 // @Param loginID query int true "登录账号"
 // @Param marketIDs query string false "市场ID列表,格式:1,2,3"
-// @Success 200 {object} models.Market
+// @Success 200 {object} models.Goods
 // @Failure 500 {object} app.Response
 // @Router /Market/QueryGoodsesByLoginID [get]
 // @Tags 通用市场

+ 194 - 2
docs/docs.go

@@ -3185,7 +3185,7 @@ var doc = `{
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.Market"
+                            "$ref": "#/definitions/models.Goods"
                         }
                     },
                     "500": {
@@ -8724,6 +8724,193 @@ var doc = `{
                 }
             }
         },
+        "models.Goods": {
+            "type": "object",
+            "required": [
+                "goodscode",
+                "goodsid",
+                "goodsname",
+                "marketid"
+            ],
+            "properties": {
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "auditaccountid": {
+                    "description": "审核操作员账号",
+                    "type": "integer"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "cancelaccountid": {
+                    "description": "注销操作员账号",
+                    "type": "integer"
+                },
+                "canceltime": {
+                    "description": "注销时间",
+                    "type": "string"
+                },
+                "closepricemode": {
+                    "description": "强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)",
+                    "type": "integer"
+                },
+                "closepriceparam": {
+                    "description": "强平最新价浮动比例 - 方式为2时使用  (\u003c1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价",
+                    "type": "number"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "currencyid": {
+                    "description": "报价货币ID",
+                    "type": "integer"
+                },
+                "cutmode": {
+                    "description": "斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓",
+                    "type": "integer"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "delistingdate": {
+                    "description": "商品退市时间(状态:退市) -- 已作废",
+                    "type": "string"
+                },
+                "delistingmode": {
+                    "description": "退市方式 - 1:退市平仓 2:退市交收 3:不处理(仅期权\\币币兑换)",
+                    "type": "integer"
+                },
+                "deliveryflag": {
+                    "description": "交割标志 - 0:不可交割  1:可交割",
+                    "type": "integer"
+                },
+                "forceclosemode": {
+                    "description": "定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]",
+                    "type": "integer"
+                },
+                "forceclosevalue": {
+                    "description": "定期强平参数 [收益权]",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodscurrencyid": {
+                    "description": "合约货币ID",
+                    "type": "integer"
+                },
+                "goodsgroupid": {
+                    "description": "所属商品组ID",
+                    "type": "integer"
+                },
+                "goodsid": {
+                    "description": "商品ID(自增ID SEQ_GOODS)",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsquotetype": {
+                    "description": "合约报价类型: 1-直接报价  2-间接报价",
+                    "type": "integer"
+                },
+                "goodsstatus": {
+                    "description": "商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市",
+                    "type": "integer"
+                },
+                "goodstradetype": {
+                    "description": "商品交易权限类型 - 1:可建可平 3:不可建可平",
+                    "type": "integer"
+                },
+                "goodunitid": {
+                    "description": "报价单位ID",
+                    "type": "integer"
+                },
+                "hasquoter": {
+                    "description": "是否有报价商 - 0:无报价商 1:有报价商",
+                    "type": "integer"
+                },
+                "hqprotecttime": {
+                    "description": "行情保护时间(秒)",
+                    "type": "integer"
+                },
+                "innerdealmode": {
+                    "description": "内部成交方式[通道交易] - 1:净头寸 2:开平 3:平今",
+                    "type": "integer"
+                },
+                "isbuylimited": {
+                    "description": "是否限制建仓量 - 0:不限制 1:限制",
+                    "type": "integer"
+                },
+                "lasttradedate": {
+                    "description": "最后交易日期(状态:待退市)",
+                    "type": "string"
+                },
+                "listingdate": {
+                    "description": "交易开始日期",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "所属市场ID",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "modifystatus": {
+                    "description": "变更状态 - 1:未变更 2:变更中 3:待审核 4:已审核",
+                    "type": "integer"
+                },
+                "modifytime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "outerdealmode": {
+                    "description": "外部成交方式[通道交易]- 1:净头寸 2:开平 3:平今",
+                    "type": "integer"
+                },
+                "outgoodscode": {
+                    "description": "商品代码(外部)",
+                    "type": "string"
+                },
+                "qtydecimalplace": {
+                    "description": "成交量小数位",
+                    "type": "integer"
+                },
+                "quotegear": {
+                    "description": "行情档位(1-10)",
+                    "type": "integer"
+                },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
+                "quoteshowtype": {
+                    "description": "行情报价类型: 1:成交价 2:买卖中间价 3:含买价 4:含卖价做市模式固定为3:含买价",
+                    "type": "integer"
+                },
+                "quoteshowtypeinterval": {
+                    "description": "行情报价间隔时间(秒)(成交价时为0)",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                }
+            }
+        },
         "models.GoodsIDAndName": {
             "type": "object",
             "required": [
@@ -9508,7 +9695,8 @@ var doc = `{
             "required": [
                 "goodscode",
                 "goodsname",
-                "takeorderid"
+                "takeorderid",
+                "trademode"
             ],
             "properties": {
                 "accountid": {
@@ -9619,6 +9807,10 @@ var doc = `{
                     "description": "交易日(yyyyMMdd)",
                     "type": "string"
                 },
+                "trademode": {
+                    "description": "交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价",
+                    "type": "integer"
+                },
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"

+ 194 - 2
docs/swagger.json

@@ -3169,7 +3169,7 @@
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.Market"
+                            "$ref": "#/definitions/models.Goods"
                         }
                     },
                     "500": {
@@ -8708,6 +8708,193 @@
                 }
             }
         },
+        "models.Goods": {
+            "type": "object",
+            "required": [
+                "goodscode",
+                "goodsid",
+                "goodsname",
+                "marketid"
+            ],
+            "properties": {
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "auditaccountid": {
+                    "description": "审核操作员账号",
+                    "type": "integer"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "cancelaccountid": {
+                    "description": "注销操作员账号",
+                    "type": "integer"
+                },
+                "canceltime": {
+                    "description": "注销时间",
+                    "type": "string"
+                },
+                "closepricemode": {
+                    "description": "强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)",
+                    "type": "integer"
+                },
+                "closepriceparam": {
+                    "description": "强平最新价浮动比例 - 方式为2时使用  (\u003c1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价",
+                    "type": "number"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "currencyid": {
+                    "description": "报价货币ID",
+                    "type": "integer"
+                },
+                "cutmode": {
+                    "description": "斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓",
+                    "type": "integer"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "delistingdate": {
+                    "description": "商品退市时间(状态:退市) -- 已作废",
+                    "type": "string"
+                },
+                "delistingmode": {
+                    "description": "退市方式 - 1:退市平仓 2:退市交收 3:不处理(仅期权\\币币兑换)",
+                    "type": "integer"
+                },
+                "deliveryflag": {
+                    "description": "交割标志 - 0:不可交割  1:可交割",
+                    "type": "integer"
+                },
+                "forceclosemode": {
+                    "description": "定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]",
+                    "type": "integer"
+                },
+                "forceclosevalue": {
+                    "description": "定期强平参数 [收益权]",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodscurrencyid": {
+                    "description": "合约货币ID",
+                    "type": "integer"
+                },
+                "goodsgroupid": {
+                    "description": "所属商品组ID",
+                    "type": "integer"
+                },
+                "goodsid": {
+                    "description": "商品ID(自增ID SEQ_GOODS)",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsquotetype": {
+                    "description": "合约报价类型: 1-直接报价  2-间接报价",
+                    "type": "integer"
+                },
+                "goodsstatus": {
+                    "description": "商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市",
+                    "type": "integer"
+                },
+                "goodstradetype": {
+                    "description": "商品交易权限类型 - 1:可建可平 3:不可建可平",
+                    "type": "integer"
+                },
+                "goodunitid": {
+                    "description": "报价单位ID",
+                    "type": "integer"
+                },
+                "hasquoter": {
+                    "description": "是否有报价商 - 0:无报价商 1:有报价商",
+                    "type": "integer"
+                },
+                "hqprotecttime": {
+                    "description": "行情保护时间(秒)",
+                    "type": "integer"
+                },
+                "innerdealmode": {
+                    "description": "内部成交方式[通道交易] - 1:净头寸 2:开平 3:平今",
+                    "type": "integer"
+                },
+                "isbuylimited": {
+                    "description": "是否限制建仓量 - 0:不限制 1:限制",
+                    "type": "integer"
+                },
+                "lasttradedate": {
+                    "description": "最后交易日期(状态:待退市)",
+                    "type": "string"
+                },
+                "listingdate": {
+                    "description": "交易开始日期",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "所属市场ID",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "modifystatus": {
+                    "description": "变更状态 - 1:未变更 2:变更中 3:待审核 4:已审核",
+                    "type": "integer"
+                },
+                "modifytime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "outerdealmode": {
+                    "description": "外部成交方式[通道交易]- 1:净头寸 2:开平 3:平今",
+                    "type": "integer"
+                },
+                "outgoodscode": {
+                    "description": "商品代码(外部)",
+                    "type": "string"
+                },
+                "qtydecimalplace": {
+                    "description": "成交量小数位",
+                    "type": "integer"
+                },
+                "quotegear": {
+                    "description": "行情档位(1-10)",
+                    "type": "integer"
+                },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
+                "quoteshowtype": {
+                    "description": "行情报价类型: 1:成交价 2:买卖中间价 3:含买价 4:含卖价做市模式固定为3:含买价",
+                    "type": "integer"
+                },
+                "quoteshowtypeinterval": {
+                    "description": "行情报价间隔时间(秒)(成交价时为0)",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                }
+            }
+        },
         "models.GoodsIDAndName": {
             "type": "object",
             "required": [
@@ -9492,7 +9679,8 @@
             "required": [
                 "goodscode",
                 "goodsname",
-                "takeorderid"
+                "takeorderid",
+                "trademode"
             ],
             "properties": {
                 "accountid": {
@@ -9603,6 +9791,10 @@
                     "description": "交易日(yyyyMMdd)",
                     "type": "string"
                 },
+                "trademode": {
+                    "description": "交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价",
+                    "type": "integer"
+                },
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"

+ 146 - 1
docs/swagger.yaml

@@ -2994,6 +2994,146 @@ definitions:
     - enumdicid
     - enumitemname
     type: object
+  models.Goods:
+    properties:
+      agreeunit:
+        description: 合约单位
+        type: number
+      auditaccountid:
+        description: 审核操作员账号
+        type: integer
+      audittime:
+        description: 审核时间
+        type: string
+      cancelaccountid:
+        description: 注销操作员账号
+        type: integer
+      canceltime:
+        description: 注销时间
+        type: string
+      closepricemode:
+        description: 强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
+        type: integer
+      closepriceparam:
+        description: 强平最新价浮动比例 - 方式为2时使用  (<1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价
+        type: number
+      createtime:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人
+        type: integer
+      currencyid:
+        description: 报价货币ID
+        type: integer
+      cutmode:
+        description: 斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓
+        type: integer
+      decimalplace:
+        description: 报价小数位
+        type: integer
+      delistingdate:
+        description: 商品退市时间(状态:退市) -- 已作废
+        type: string
+      delistingmode:
+        description: 退市方式 - 1:退市平仓 2:退市交收 3:不处理(仅期权\币币兑换)
+        type: integer
+      deliveryflag:
+        description: 交割标志 - 0:不可交割  1:可交割
+        type: integer
+      forceclosemode:
+        description: 定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]
+        type: integer
+      forceclosevalue:
+        description: 定期强平参数 [收益权]
+        type: integer
+      goodscode:
+        description: 商品代码(内部)
+        type: string
+      goodscurrencyid:
+        description: 合约货币ID
+        type: integer
+      goodsgroupid:
+        description: 所属商品组ID
+        type: integer
+      goodsid:
+        description: 商品ID(自增ID SEQ_GOODS)
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      goodsquotetype:
+        description: '合约报价类型: 1-直接报价  2-间接报价'
+        type: integer
+      goodsstatus:
+        description: 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
+        type: integer
+      goodstradetype:
+        description: 商品交易权限类型 - 1:可建可平 3:不可建可平
+        type: integer
+      goodunitid:
+        description: 报价单位ID
+        type: integer
+      hasquoter:
+        description: 是否有报价商 - 0:无报价商 1:有报价商
+        type: integer
+      hqprotecttime:
+        description: 行情保护时间(秒)
+        type: integer
+      innerdealmode:
+        description: 内部成交方式[通道交易] - 1:净头寸 2:开平 3:平今
+        type: integer
+      isbuylimited:
+        description: 是否限制建仓量 - 0:不限制 1:限制
+        type: integer
+      lasttradedate:
+        description: 最后交易日期(状态:待退市)
+        type: string
+      listingdate:
+        description: 交易开始日期
+        type: string
+      marketid:
+        description: 所属市场ID
+        type: integer
+      modifierid:
+        description: 修改人
+        type: integer
+      modifystatus:
+        description: 变更状态 - 1:未变更 2:变更中 3:待审核 4:已审核
+        type: integer
+      modifytime:
+        description: 修改时间
+        type: string
+      outerdealmode:
+        description: 外部成交方式[通道交易]- 1:净头寸 2:开平 3:平今
+        type: integer
+      outgoodscode:
+        description: 商品代码(外部)
+        type: string
+      qtydecimalplace:
+        description: 成交量小数位
+        type: integer
+      quotegear:
+        description: 行情档位(1-10)
+        type: integer
+      quoteminunit:
+        description: 行情最小变动单位 [整数,报价小数位一起使用]
+        type: integer
+      quoteshowtype:
+        description: '行情报价类型: 1:成交价 2:买卖中间价 3:含买价 4:含卖价做市模式固定为3:含买价'
+        type: integer
+      quoteshowtypeinterval:
+        description: 行情报价间隔时间(秒)(成交价时为0)
+        type: integer
+      remark:
+        description: 备注
+        type: string
+    required:
+    - goodscode
+    - goodsid
+    - goodsname
+    - marketid
+    type: object
   models.GoodsIDAndName:
     properties:
       goodscode:
@@ -3675,6 +3815,10 @@ definitions:
       tradedate:
         description: 交易日(yyyyMMdd)
         type: string
+      trademode:
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
+          21:竞拍-大宗式 22:受托竞价
+        type: integer
       userid:
         description: 用户ID
         type: integer
@@ -3685,6 +3829,7 @@ definitions:
     - goodscode
     - goodsname
     - takeorderid
+    - trademode
     type: object
   models.HsbyPreGoods:
     properties:
@@ -8561,7 +8706,7 @@ paths:
         "200":
           description: OK
           schema:
-            $ref: '#/definitions/models.Market'
+            $ref: '#/definitions/models.Goods'
         "500":
           description: Internal Server Error
           schema:

+ 5 - 1
models/hsby.go

@@ -1144,6 +1144,8 @@ type HsbyMyPackage struct {
 	Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
 
 	Vendorname string `json:"vendorname"  xorm:"'VENDORNAME'"` // 供应商名称
+
+	Trademode uint32 `json:"trademode"  xorm:"'TRADEMODE'" binding:"required"` // 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
 }
 
 // GetHsbyMyPackages 获取我的包裹信息
@@ -1161,12 +1163,14 @@ func GetHsbyMyPackages(accountIDs string, takeOrderStatus int) ([]HsbyMyPackage,
 				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
 				HSBY_GOODSEX.PICURLS, 
 				ENUMDICITEM.PARAM2 CURRENCYSIGN, 
-				HSBY_SUPPLIERINFO.VENDORNAME`).
+				HSBY_SUPPLIERINFO.VENDORNAME, 
+				M.TRADEMODE`).
 		Join("LEFT", "GOODS", "GOODS.GOODSID = TRADE_GOODSPICKUP.GOODSID").
 		Join("LEFT", "HSBY_GOODSEX", "HSBY_GOODSEX.GOODSID = GOODS.GOODSID").
 		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
 		Join("LEFT", "HSBY_SUPPLIERINFO", "HSBY_SUPPLIERINFO.VENDORID = HSBY_GOODSEX.VENDORID").
 		Join("LEFT", "DIVISION", "DIVISION.AUTOID = TRADE_GOODSPICKUP.DISTRICTID").
+		Join("LEFT", "MARKET M", "M.MARKETID = GOODS.MARKETID").
 		Where(fmt.Sprintf("TRADE_GOODSPICKUP.ACCOUNTID in (%s)", accountIDs))
 	if takeOrderStatus > 0 {
 		session = session.And("TAKEORDERSTATUS = ?", takeOrderStatus)

+ 2 - 2
models/quote.go

@@ -2,6 +2,7 @@ package models
 
 import (
 	"errors"
+	"fmt"
 	"mtp2_if/db"
 	"time"
 
@@ -251,8 +252,7 @@ func GetQuoteDays(goodsCodes string) ([]Quoteday, error) {
 	engine := db.GetMySQLEngine()
 
 	datas := make([]Quoteday, 0)
-	// if err := engine.Where(fmt.Sprintf("goodscode in ('%s')", goodsCodes)).Find(&datas); err != nil {
-	if err := engine.Find(&datas); err != nil {
+	if err := engine.Where(fmt.Sprintf("goodscode in ('%s')", goodsCodes)).Find(&datas); err != nil {
 		return nil, err
 	}