quote.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. package quote
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. "mtp2_if/models"
  7. "mtp2_if/mtpcache"
  8. "mtp2_if/utils"
  9. "net/http"
  10. "strings"
  11. "time"
  12. "github.com/gin-gonic/gin"
  13. "github.com/shopspring/decimal"
  14. )
  15. // QueryQuoteDayReq 获取商品盘面信息请求参数
  16. type QueryQuoteDayReq struct {
  17. GoodsCodes string `form:"goodsCodes"`
  18. }
  19. // QueryQuoteDayRsp 获取商品盘面信息返回模型
  20. type QueryQuoteDayRsp struct {
  21. Exchangedate int64 `json:"exchangedate"` // 交易日
  22. Goodscode string `json:"goodscode"` // 商品代码
  23. Exchangecode int `json:"exchangecode"` // 交易所代码
  24. Preclose float64 `json:"preclose"` // 昨收
  25. Opentime time.Time `json:"opentime"` // 开盘时间
  26. Opened float64 `json:"opened"` // 开盘价
  27. Highest float64 `json:"highest"` // 最高价
  28. Lowest float64 `json:"lowest"` // 最低价
  29. Lasttime string `json:"lasttime"` // 行情时间(只有现价变化行情时间才变化)
  30. Utclasttime time.Time `json:"utclasttime"` // utc的行情时间
  31. Last float64 `json:"last"` // 最新价
  32. Lastvolume int64 `json:"lastvolume"` // 最新成交量
  33. Lastturnover float64 `json:"lastturnover` // 最新成交金额
  34. Totalbidvolume int64 `json:"totalbidvolume"` // 外盘
  35. Totalaskvolume int64 `json:"totalaskvolume"` // 内盘
  36. Totalvolume int64 `json:"totalvolume"` // 总量
  37. Totalturnover float64 `json:"totalturnover"` // 总金额
  38. Bid float64 `json:"bid"` // 买1
  39. Bid2 float64 `json:"bid2"` // 买2
  40. Bid3 float64 `json:"bid3"` // 买3
  41. Bid4 float64 `json:"bid4"` // 买4
  42. Bid5 float64 `json:"bid5"` // 买5
  43. Bidvolume int64 `json:"bidvolume"` // 买量1
  44. Bidvolume2 int64 `json:"bidvolume2"` // 买量2
  45. Bidvolume3 int64 `json:"bidvolume3"` // 买量3
  46. Bidvolume4 int64 `json:"bidvolume4"` // 买量4
  47. Bidvolume5 int64 `json:"bidvolume5"` // 买量5
  48. Ask float64 `json:"ask"` // 卖1
  49. Ask2 float64 `json:"ask2"` // 卖2
  50. Ask3 float64 `json:"ask3"` // 卖3
  51. Ask4 float64 `json:"ask4"` // 卖4
  52. Ask5 float64 `json:"ask5"` // 卖5
  53. Askvolume int64 `json:"askvolume"` // 卖量1
  54. Askvolume2 int64 `json:"askvolume2"` // 卖量2
  55. Askvolume3 int64 `json:"askvolume3"` // 卖量3
  56. Askvolume4 int64 `json:"askvolume4"` // 卖量4
  57. Askvolume5 int64 `json:"askvolume5"` // 卖量5
  58. Presettle float64 `json:"presettle"` // 昨结价
  59. Settle float64 `json:"settle"` // 结算价
  60. Preholdvolume int64 `json:"preholdvolume"` // 昨持仓
  61. Holdvolume int64 `json:"holdvolume"` // 持仓
  62. Averageprice float64 `json:"averageprice"` // 均价
  63. Orderid int64 `json:"orderid"` // 序号
  64. Limitup float64 `json:"limitup"` // 涨停价
  65. Limitdown float64 `json:"limitdown"` // 跌停价
  66. Inventory int64 `json:"inventory"` // 库存
  67. Holdincrement int64 `json:"holdincrement"` // 单笔持仓
  68. Iscleared int `json:"iscleared"` // 是否清盘标志
  69. Issettled int `json:"issettled"` // 是否结算标志
  70. Bidqueueinfo string `json:"bidqueueinfo"` // 大利市买港股用
  71. Askqueueinfo string `json:"askqueueinfo"` // 大利市卖港股用
  72. Bidorderid int64 `json:"bidorderid"` // 买单号1
  73. Bidorderid2 int64 `json:"bidorderid2"` // 买单号2
  74. Bidorderid3 int64 `json:"bidorderid3"` // 买单号3
  75. Bidorderid4 int64 `json:"bidorderid4"` // 买单号4
  76. Bidorderid5 int64 `json:"bidorderid5"` // 买单号5
  77. Askorderid int64 `json:"askorderid"` // 卖单号1
  78. Askorderid2 int64 `json:"askorderid2"` // 卖单号2
  79. Askorderid3 int64 `json:"askorderid3"` // 卖单号3
  80. Askorderid4 int64 `json:"askorderid4"` // 卖单号4
  81. Askorderid5 int64 `json:"askorderid5"` // 卖单号5
  82. Lastlot int64 `json:"lastlot"` // 最新成交手数
  83. Totallot int64 `json:"totallot"` // 总手数
  84. Strikeprice float64 `json:"strikeprice"` // 发行价
  85. Cleartime int64 `json:"cleartime"` // 清盘时间
  86. Calloptionpremiums int64 `json:"calloptionpremiums"` // 认购期权1
  87. Calloptionpremiums2 int64 `json:"calloptionpremiums2"` // 认购期权2
  88. Calloptionpremiums3 int64 `json:"calloptionpremiums3"` // 认购期权3
  89. Calloptionpremiums4 int64 `json:"calloptionpremiums4"` // 认购期权4
  90. Calloptionpremiums5 int64 `json:"calloptionpremiums5"` // 认购期权5
  91. Putoptionpremiums int64 `json:"putoptionpremiums"` // 认沽期权1
  92. Putoptionpremiums2 int64 `json:"putoptionpremiums2"` // 认沽期权2
  93. Putoptionpremiums3 int64 `json:"putoptionpremiums3"` // 认沽期权3
  94. Putoptionpremiums4 int64 `json:"putoptionpremiums4"` // 认沽期权4
  95. Putoptionpremiums5 int64 `json:"putoptionpremiums5"` // 认沽期权5
  96. Nontotalvolume int64 `json:"nontotalvolume"` // 非交易总量
  97. Nontotalholdervolume int64 `json:"nontotalholdervolume"` // 非交易持仓量
  98. Nontotalturnover int64 `json:"nontotalturnover"` // 非交易总金额
  99. Nontotallot int64 `json:"nontotallot"` // 非交易总手数
  100. Publictradetype string `json:"publictradetype"` // 公共交易标志类型 港股专用
  101. Iep float64 `json:"iep"` // 平衡价 港股专用
  102. Iev float64 `json:"iev"` // 平衡量 港股专用
  103. Grepmarketprice float64 `json:"grepmarketprice"` // 暗盘价 港股专用
  104. Bid6 float64 `json:"bid6"` // 买6
  105. Bid7 float64 `json:"bid7"` // 买7
  106. Bid8 float64 `json:"bid8"` // 买8
  107. Bid9 float64 `json:"bid9"` // 买9
  108. Bid10 float64 `json:"bid10"` // 买10
  109. Bidvolume6 int64 `json:"bidvolume6"` // 买量6
  110. Bidvolume7 int64 `json:"bidvolume7"` // 买量7
  111. Bidvolume8 int64 `json:"bidvolume8"` // 买量8
  112. Bidvolume9 int64 `json:"bidvolume9"` // 买量9
  113. Bidvolume10 int64 `json:"bidvolume10"` // 买量10
  114. Ask6 float64 `json:"ask6"` // 卖6
  115. Ask7 float64 `json:"ask7"` // 卖7
  116. Ask8 float64 `json:"ask8"` // 卖8
  117. Ask9 float64 `json:"ask9"` // 卖9
  118. Ask10 float64 `json:"ask10"` // 卖10
  119. Askvolume6 int64 `json:"askvolume6"` // 卖量6
  120. Askvolume7 int64 `json:"askvolume7"` // 卖量7
  121. Askvolume8 int64 `json:"askvolume8"` // 卖量8
  122. Askvolume9 int64 `json:"askvolume9"` // 卖量9
  123. Askvolume10 int64 `json:"askvolume10"` // 卖量10
  124. Bidordervolume int64 `json:"bidordervolume"` // 买单量1
  125. Bidordervolume2 int64 `json:"bidordervolume2"` // 买单量2
  126. Bidordervolume3 int64 `json:"bidordervolume3"` // 买单量3
  127. Bidordervolume4 int64 `json:"bidordervolume4"` // 买单量4
  128. Bidordervolume5 int64 `json:"bidordervolume5"` // 买单量5
  129. Bidordervolume6 int64 `json:"bidordervolume6"` // 买单量6
  130. Bidordervolume7 int64 `json:"bidordervolume7"` // 买单量7
  131. Bidordervolume8 int64 `json:"bidordervolume8"` // 买单量8
  132. Bidordervolume9 int64 `json:"bidordervolume9"` // 买单量9
  133. Bidordervolume10 int64 `json:"bidordervolume10"` // 买单量10
  134. Askordervolume int64 `json:"askordervolume"` // 卖单量1
  135. Askordervolume2 int64 `json:"askordervolume2"` // 卖单量2
  136. Askordervolume3 int64 `json:"askordervolume3"` // 卖单量3
  137. Askordervolume4 int64 `json:"askordervolume4"` // 卖单量4
  138. Askordervolume5 int64 `json:"askordervolume5"` // 卖单量5
  139. Askordervolume6 int64 `json:"askordervolume6"` // 卖单量6
  140. Askordervolume7 int64 `json:"askordervolume7"` // 卖单量7
  141. Askordervolume8 int64 `json:"askordervolume8"` // 卖单量8
  142. Askordervolume9 int64 `json:"askordervolume9"` // 卖单量9
  143. Askordervolume10 int64 `json:"askordervolume10"` // 卖单量10
  144. }
  145. // QueryQuoteDay 获取商品盘面信息
  146. // @Summary 获取商品盘面信息
  147. // @Produce json
  148. // @Security ApiKeyAuth
  149. // @Param goodsCodes query string false "此参数不填则查所有;商品代码列表,格式:CU2102,CU2103,AL2107"
  150. // @Success 200 {object} QueryQuoteDayRsp
  151. // @Failure 500 {object} app.Response
  152. // @Router /Quote/QueryQuoteDay [get]
  153. // @Tags 行情服务
  154. func QueryQuoteDay(c *gin.Context) {
  155. appG := app.Gin{C: c}
  156. // 获取请求参数
  157. var req QueryQuoteDayReq
  158. if err := appG.C.ShouldBindQuery(&req); err != nil {
  159. logger.GetLogger().Errorf("QueryQuoteDay failed: %s", err.Error())
  160. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  161. return
  162. }
  163. rsp := make([]QueryQuoteDayRsp, 0)
  164. quoteDays, err := models.GetQuoteDays(req.GoodsCodes)
  165. if err != nil {
  166. logger.GetLogger().Errorf("QueryQuoteDay failed: %s", err.Error())
  167. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  168. return
  169. }
  170. for _, v := range quoteDays {
  171. // 获取对应的商品信息
  172. goods, bFind := mtpcache.GetGoods(v.Goodscode)
  173. if bFind {
  174. lt, _ := decimal.NewFromFloat(utils.IntToFloat64(int(v.Lastturnover), int(goods.DECIMALPLACE))).Round(2).Float64() // 按行情服务要求,金额类需要先除以商品报价小数位再按2位小数四舍五入
  175. tt, _ := decimal.NewFromFloat(utils.IntToFloat64(int(v.Totalturnover), int(goods.DECIMALPLACE))).Round(2).Float64()
  176. rsp = append(rsp, QueryQuoteDayRsp{
  177. Exchangedate: v.Exchangedate,
  178. Goodscode: v.Goodscode,
  179. Exchangecode: v.Exchangecode,
  180. Preclose: utils.IntToFloat64(int(v.Preclose), int(goods.DECIMALPLACE)),
  181. Opentime: time.Unix(int64(v.Opentime), 0),
  182. Opened: utils.IntToFloat64(int(v.Opened), int(goods.DECIMALPLACE)),
  183. Highest: utils.IntToFloat64(int(v.Highest), int(goods.DECIMALPLACE)),
  184. Lowest: utils.IntToFloat64(int(v.Lowest), int(goods.DECIMALPLACE)),
  185. Lasttime: v.Lasttime,
  186. Utclasttime: time.Unix(int64(v.Utclasttime), 0),
  187. Last: utils.IntToFloat64(int(v.Last), int(goods.DECIMALPLACE)),
  188. Lastvolume: v.Lastvolume,
  189. Lastturnover: lt,
  190. Totalbidvolume: v.Totalbidvolume,
  191. Totalaskvolume: v.Totalaskvolume,
  192. Totalvolume: v.Totalvolume,
  193. Totalturnover: tt,
  194. Bid: utils.IntToFloat64(int(v.Bid), int(goods.DECIMALPLACE)),
  195. Bid2: utils.IntToFloat64(int(v.Bid2), int(goods.DECIMALPLACE)),
  196. Bid3: utils.IntToFloat64(int(v.Bid3), int(goods.DECIMALPLACE)),
  197. Bid4: utils.IntToFloat64(int(v.Bid4), int(goods.DECIMALPLACE)),
  198. Bid5: utils.IntToFloat64(int(v.Bid5), int(goods.DECIMALPLACE)),
  199. Bidvolume: v.Bidvolume,
  200. Bidvolume2: v.Bidvolume2,
  201. Bidvolume3: v.Bidvolume3,
  202. Bidvolume4: v.Bidvolume4,
  203. Bidvolume5: v.Bidvolume5,
  204. Ask: utils.IntToFloat64(int(v.Ask), int(goods.DECIMALPLACE)),
  205. Ask2: utils.IntToFloat64(int(v.Ask2), int(goods.DECIMALPLACE)),
  206. Ask3: utils.IntToFloat64(int(v.Ask3), int(goods.DECIMALPLACE)),
  207. Ask4: utils.IntToFloat64(int(v.Ask4), int(goods.DECIMALPLACE)),
  208. Ask5: utils.IntToFloat64(int(v.Ask5), int(goods.DECIMALPLACE)),
  209. Askvolume: v.Askvolume,
  210. Askvolume2: v.Askvolume2,
  211. Askvolume3: v.Askvolume3,
  212. Askvolume4: v.Askvolume4,
  213. Askvolume5: v.Askvolume5,
  214. Presettle: utils.IntToFloat64(int(v.Presettle), int(goods.DECIMALPLACE)),
  215. Settle: utils.IntToFloat64(int(v.Settle), int(goods.DECIMALPLACE)),
  216. Preholdvolume: v.Preholdvolume,
  217. Holdvolume: v.Holdvolume,
  218. Averageprice: utils.IntToFloat64(int(v.Averageprice), int(goods.DECIMALPLACE)),
  219. Orderid: v.Orderid,
  220. Limitup: utils.IntToFloat64(int(v.Limitup), int(goods.DECIMALPLACE)),
  221. Limitdown: utils.IntToFloat64(int(v.Limitdown), int(goods.DECIMALPLACE)),
  222. Inventory: v.Inventory,
  223. Holdincrement: v.Holdincrement,
  224. Iscleared: v.Iscleared,
  225. Issettled: v.Issettled,
  226. Bidqueueinfo: v.Bidqueueinfo,
  227. Askqueueinfo: v.Askqueueinfo,
  228. Bidorderid: v.Bidorderid,
  229. Bidorderid2: v.Bidorderid2,
  230. Bidorderid3: v.Bidorderid3,
  231. Bidorderid4: v.Bidorderid4,
  232. Bidorderid5: v.Bidorderid5,
  233. Askorderid: v.Askorderid,
  234. Askorderid2: v.Askorderid2,
  235. Askorderid3: v.Askorderid3,
  236. Askorderid4: v.Askorderid4,
  237. Askorderid5: v.Askorderid5,
  238. Lastlot: v.Lastlot,
  239. Totallot: v.Totallot,
  240. Strikeprice: utils.IntToFloat64(int(v.Strikeprice), int(goods.DECIMALPLACE)),
  241. Cleartime: v.Cleartime,
  242. Calloptionpremiums: v.Calloptionpremiums,
  243. Calloptionpremiums2: v.Calloptionpremiums2,
  244. Calloptionpremiums3: v.Calloptionpremiums3,
  245. Calloptionpremiums4: v.Calloptionpremiums4,
  246. Calloptionpremiums5: v.Calloptionpremiums5,
  247. Putoptionpremiums: v.Putoptionpremiums,
  248. Putoptionpremiums2: v.Putoptionpremiums2,
  249. Putoptionpremiums3: v.Putoptionpremiums3,
  250. Putoptionpremiums4: v.Putoptionpremiums4,
  251. Putoptionpremiums5: v.Putoptionpremiums5,
  252. Nontotalvolume: v.Nontotalvolume,
  253. Nontotalholdervolume: v.Nontotalholdervolume,
  254. Nontotalturnover: v.Nontotalturnover,
  255. Nontotallot: v.Nontotallot,
  256. Publictradetype: v.Publictradetype,
  257. Iep: utils.IntToFloat64(int(v.Iep), int(goods.DECIMALPLACE)),
  258. Iev: utils.IntToFloat64(int(v.Iev), int(goods.DECIMALPLACE)),
  259. Grepmarketprice: utils.IntToFloat64(int(v.Grepmarketprice), int(goods.DECIMALPLACE)),
  260. Bid6: utils.IntToFloat64(int(v.Bid6), int(goods.DECIMALPLACE)),
  261. Bid7: utils.IntToFloat64(int(v.Bid7), int(goods.DECIMALPLACE)),
  262. Bid8: utils.IntToFloat64(int(v.Bid8), int(goods.DECIMALPLACE)),
  263. Bid9: utils.IntToFloat64(int(v.Bid9), int(goods.DECIMALPLACE)),
  264. Bid10: utils.IntToFloat64(int(v.Bid10), int(goods.DECIMALPLACE)),
  265. Bidvolume6: v.Bidvolume6,
  266. Bidvolume7: v.Bidvolume7,
  267. Bidvolume8: v.Bidvolume8,
  268. Bidvolume9: v.Bidvolume9,
  269. Bidvolume10: v.Bidvolume10,
  270. Ask6: utils.IntToFloat64(int(v.Ask6), int(goods.DECIMALPLACE)),
  271. Ask7: utils.IntToFloat64(int(v.Ask7), int(goods.DECIMALPLACE)),
  272. Ask8: utils.IntToFloat64(int(v.Ask8), int(goods.DECIMALPLACE)),
  273. Ask9: utils.IntToFloat64(int(v.Ask9), int(goods.DECIMALPLACE)),
  274. Ask10: utils.IntToFloat64(int(v.Ask10), int(goods.DECIMALPLACE)),
  275. Askvolume6: v.Askvolume6,
  276. Askvolume7: v.Askvolume7,
  277. Askvolume8: v.Askvolume8,
  278. Askvolume9: v.Askvolume9,
  279. Askvolume10: v.Askvolume10,
  280. Bidordervolume: v.Bidordervolume,
  281. Bidordervolume2: v.Bidordervolume2,
  282. Bidordervolume3: v.Bidordervolume3,
  283. Bidordervolume4: v.Bidordervolume4,
  284. Bidordervolume5: v.Bidordervolume5,
  285. Bidordervolume6: v.Bidordervolume6,
  286. Bidordervolume7: v.Bidordervolume7,
  287. Bidordervolume8: v.Bidordervolume8,
  288. Bidordervolume9: v.Bidordervolume9,
  289. Bidordervolume10: v.Bidordervolume10,
  290. Askordervolume: v.Askordervolume,
  291. Askordervolume2: v.Askordervolume2,
  292. Askordervolume3: v.Askordervolume3,
  293. Askordervolume4: v.Askordervolume4,
  294. Askordervolume5: v.Askordervolume5,
  295. Askordervolume6: v.Askordervolume6,
  296. Askordervolume7: v.Askordervolume7,
  297. Askordervolume8: v.Askordervolume8,
  298. Askordervolume9: v.Askordervolume9,
  299. Askordervolume10: v.Askordervolume10,
  300. })
  301. }
  302. }
  303. // 查询成功
  304. logger.GetLogger().Debugln("QueryQuoteDay successed, rows: %v", len(rsp))
  305. appG.Response(http.StatusOK, e.SUCCESS, rsp)
  306. }
  307. type GetTouristQuoteDayReq struct {
  308. Goodscodes string `form:"goodsCodes" binding:"required"` // 商品代码列表,格式:1,2,3
  309. }
  310. // GetTouristQuoteDay 获取游客商品盘面信息
  311. // @Summary 获取游客商品盘面信息
  312. // @Produce json
  313. // @Param goodsCodes query string true "商品代码列表,格式:1,2,3"
  314. // @Success 200 {array} QueryQuoteDayRsp
  315. // @Failure 500 {object} app.Response
  316. // @Router /Quote/GetTouristQuoteDay [get]
  317. // @Tags 行情服务
  318. func GetTouristQuoteDay(c *gin.Context) {
  319. appG := app.Gin{C: c}
  320. // 获取请求参数
  321. var req GetTouristQuoteDayReq
  322. if err := appG.C.ShouldBindQuery(&req); err != nil {
  323. logger.GetLogger().Errorf("GetTouristQuoteDay failed: %s", err.Error())
  324. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  325. return
  326. }
  327. g := strings.Split(req.Goodscodes, ",")
  328. quoteDays, err := models.GetRedisQuoteDays(g)
  329. if err != nil {
  330. logger.GetLogger().Errorf("GetTouristQuoteDay failed: %s", err.Error())
  331. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  332. return
  333. }
  334. rsp := make([]QueryQuoteDayRsp, 0)
  335. for _, v := range quoteDays {
  336. // 获取对应的商品信息
  337. goods, bFind := mtpcache.GetGoods(v.Goodscode)
  338. if bFind {
  339. rsp = append(rsp, QueryQuoteDayRsp{
  340. Exchangedate: v.Exchangedate,
  341. Goodscode: v.Goodscode,
  342. Exchangecode: v.Exchangecode,
  343. Preclose: utils.IntToFloat64(int(v.Preclose), int(goods.DECIMALPLACE)),
  344. Opentime: time.Unix(int64(v.Opentime), 0),
  345. Opened: utils.IntToFloat64(int(v.Opened), int(goods.DECIMALPLACE)),
  346. Highest: utils.IntToFloat64(int(v.Highest), int(goods.DECIMALPLACE)),
  347. Lowest: utils.IntToFloat64(int(v.Lowest), int(goods.DECIMALPLACE)),
  348. Lasttime: v.Lasttime,
  349. Utclasttime: time.Unix(int64(v.Utclasttime), 0),
  350. Last: utils.IntToFloat64(int(v.Last), int(goods.DECIMALPLACE)),
  351. Lastvolume: v.Lastvolume,
  352. Lastturnover: utils.IntToFloat64(int(v.Lastturnover), int(goods.DECIMALPLACE)),
  353. Totalbidvolume: v.Totalbidvolume,
  354. Totalaskvolume: v.Totalaskvolume,
  355. Totalvolume: v.Totalvolume,
  356. Totalturnover: utils.IntToFloat64(int(v.Totalturnover), int(goods.DECIMALPLACE)),
  357. Bid: utils.IntToFloat64(int(v.Bid), int(goods.DECIMALPLACE)),
  358. Bid2: utils.IntToFloat64(int(v.Bid2), int(goods.DECIMALPLACE)),
  359. Bid3: utils.IntToFloat64(int(v.Bid3), int(goods.DECIMALPLACE)),
  360. Bid4: utils.IntToFloat64(int(v.Bid4), int(goods.DECIMALPLACE)),
  361. Bid5: utils.IntToFloat64(int(v.Bid5), int(goods.DECIMALPLACE)),
  362. Bidvolume: v.Bidvolume,
  363. Bidvolume2: v.Bidvolume2,
  364. Bidvolume3: v.Bidvolume3,
  365. Bidvolume4: v.Bidvolume4,
  366. Bidvolume5: v.Bidvolume5,
  367. Ask: utils.IntToFloat64(int(v.Ask), int(goods.DECIMALPLACE)),
  368. Ask2: utils.IntToFloat64(int(v.Ask2), int(goods.DECIMALPLACE)),
  369. Ask3: utils.IntToFloat64(int(v.Ask3), int(goods.DECIMALPLACE)),
  370. Ask4: utils.IntToFloat64(int(v.Ask4), int(goods.DECIMALPLACE)),
  371. Ask5: utils.IntToFloat64(int(v.Ask5), int(goods.DECIMALPLACE)),
  372. Askvolume: v.Askvolume,
  373. Askvolume2: v.Askvolume2,
  374. Askvolume3: v.Askvolume3,
  375. Askvolume4: v.Askvolume4,
  376. Askvolume5: v.Askvolume5,
  377. Presettle: utils.IntToFloat64(int(v.Presettle), int(goods.DECIMALPLACE)),
  378. Settle: utils.IntToFloat64(int(v.Settle), int(goods.DECIMALPLACE)),
  379. Preholdvolume: v.Preholdvolume,
  380. Holdvolume: v.Holdvolume,
  381. Averageprice: utils.IntToFloat64(int(v.Averageprice), int(goods.DECIMALPLACE)),
  382. Orderid: v.Orderid,
  383. Limitup: utils.IntToFloat64(int(v.Limitup), int(goods.DECIMALPLACE)),
  384. Limitdown: utils.IntToFloat64(int(v.Limitdown), int(goods.DECIMALPLACE)),
  385. Inventory: v.Inventory,
  386. Holdincrement: v.Holdincrement,
  387. Iscleared: v.Iscleared,
  388. Issettled: v.Issettled,
  389. Bidqueueinfo: v.Bidqueueinfo,
  390. Askqueueinfo: v.Askqueueinfo,
  391. Bidorderid: v.Bidorderid,
  392. Bidorderid2: v.Bidorderid2,
  393. Bidorderid3: v.Bidorderid3,
  394. Bidorderid4: v.Bidorderid4,
  395. Bidorderid5: v.Bidorderid5,
  396. Askorderid: v.Askorderid,
  397. Askorderid2: v.Askorderid2,
  398. Askorderid3: v.Askorderid3,
  399. Askorderid4: v.Askorderid4,
  400. Askorderid5: v.Askorderid5,
  401. Lastlot: v.Lastlot,
  402. Totallot: v.Totallot,
  403. Strikeprice: utils.IntToFloat64(int(v.Strikeprice), int(goods.DECIMALPLACE)),
  404. Cleartime: v.Cleartime,
  405. Calloptionpremiums: v.Calloptionpremiums,
  406. Calloptionpremiums2: v.Calloptionpremiums2,
  407. Calloptionpremiums3: v.Calloptionpremiums3,
  408. Calloptionpremiums4: v.Calloptionpremiums4,
  409. Calloptionpremiums5: v.Calloptionpremiums5,
  410. Putoptionpremiums: v.Putoptionpremiums,
  411. Putoptionpremiums2: v.Putoptionpremiums2,
  412. Putoptionpremiums3: v.Putoptionpremiums3,
  413. Putoptionpremiums4: v.Putoptionpremiums4,
  414. Putoptionpremiums5: v.Putoptionpremiums5,
  415. Nontotalvolume: v.Nontotalvolume,
  416. Nontotalholdervolume: v.Nontotalholdervolume,
  417. Nontotalturnover: v.Nontotalturnover,
  418. Nontotallot: v.Nontotallot,
  419. Publictradetype: v.Publictradetype,
  420. Iep: utils.IntToFloat64(int(v.Iep), int(goods.DECIMALPLACE)),
  421. Iev: utils.IntToFloat64(int(v.Iev), int(goods.DECIMALPLACE)),
  422. Grepmarketprice: utils.IntToFloat64(int(v.Grepmarketprice), int(goods.DECIMALPLACE)),
  423. Bid6: utils.IntToFloat64(int(v.Bid6), int(goods.DECIMALPLACE)),
  424. Bid7: utils.IntToFloat64(int(v.Bid7), int(goods.DECIMALPLACE)),
  425. Bid8: utils.IntToFloat64(int(v.Bid8), int(goods.DECIMALPLACE)),
  426. Bid9: utils.IntToFloat64(int(v.Bid9), int(goods.DECIMALPLACE)),
  427. Bid10: utils.IntToFloat64(int(v.Bid10), int(goods.DECIMALPLACE)),
  428. Bidvolume6: v.Bidvolume6,
  429. Bidvolume7: v.Bidvolume7,
  430. Bidvolume8: v.Bidvolume8,
  431. Bidvolume9: v.Bidvolume9,
  432. Bidvolume10: v.Bidvolume10,
  433. Ask6: utils.IntToFloat64(int(v.Ask6), int(goods.DECIMALPLACE)),
  434. Ask7: utils.IntToFloat64(int(v.Ask7), int(goods.DECIMALPLACE)),
  435. Ask8: utils.IntToFloat64(int(v.Ask8), int(goods.DECIMALPLACE)),
  436. Ask9: utils.IntToFloat64(int(v.Ask9), int(goods.DECIMALPLACE)),
  437. Ask10: utils.IntToFloat64(int(v.Ask10), int(goods.DECIMALPLACE)),
  438. Askvolume6: v.Askvolume6,
  439. Askvolume7: v.Askvolume7,
  440. Askvolume8: v.Askvolume8,
  441. Askvolume9: v.Askvolume9,
  442. Askvolume10: v.Askvolume10,
  443. Bidordervolume: v.Bidordervolume,
  444. Bidordervolume2: v.Bidordervolume2,
  445. Bidordervolume3: v.Bidordervolume3,
  446. Bidordervolume4: v.Bidordervolume4,
  447. Bidordervolume5: v.Bidordervolume5,
  448. Bidordervolume6: v.Bidordervolume6,
  449. Bidordervolume7: v.Bidordervolume7,
  450. Bidordervolume8: v.Bidordervolume8,
  451. Bidordervolume9: v.Bidordervolume9,
  452. Bidordervolume10: v.Bidordervolume10,
  453. Askordervolume: v.Askordervolume,
  454. Askordervolume2: v.Askordervolume2,
  455. Askordervolume3: v.Askordervolume3,
  456. Askordervolume4: v.Askordervolume4,
  457. Askordervolume5: v.Askordervolume5,
  458. Askordervolume6: v.Askordervolume6,
  459. Askordervolume7: v.Askordervolume7,
  460. Askordervolume8: v.Askordervolume8,
  461. Askordervolume9: v.Askordervolume9,
  462. Askordervolume10: v.Askordervolume10,
  463. })
  464. }
  465. }
  466. // 查询成功
  467. // logger.GetLogger().Debugln("GetTouristQuoteDay successed, rows: %v", len(rsp))
  468. appG.Response(http.StatusOK, e.SUCCESS, rsp)
  469. }