qryWrTrade.go 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/7/20 18:30
  4. * @Modify : 2021/7/20 18:30
  5. */
  6. package wrTrade2
  7. import (
  8. "github.com/gin-gonic/gin"
  9. "mtp2_if/global/app"
  10. "mtp2_if/models"
  11. )
  12. // QueryOrderQuote
  13. // @Summary 查询大厅行情列表
  14. // @Description 仓单交易 wrfactortypeid 唯一确定1条记录, 仓单预售 wrfactortypeid + deliverymonth 唯一确定1条记录
  15. // @Produce json
  16. // @Security ApiKeyAuth
  17. // @Param page query int false "页码"
  18. // @Param pagesize query int false "每页条数"
  19. // @Param marketid query int false "仓单贸易市场id"
  20. // @Param wrpricetype query int true "价格方式 - 1:固定价 2-浮动价"
  21. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  22. // @Param dgitemname query string false "商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm"
  23. // @Param warehouseid query int false "仓库id(筛选条件)"
  24. // @Param deliverygoodsid query int false "品种id"
  25. // @Param wrfactortypeid query int false "仓单要素id"
  26. // @Param deliverymonth query string false "交收月(yyyy-mm) 仓单预售填写"
  27. // @Success 200 {array} models.WrOrderQuote
  28. // @Failure 500 {object} app.Response
  29. // @Router /WrTrade2/QueryOrderQuote [get]
  30. // @Tags 仓单贸易v2
  31. func QueryOrderQuote(c *gin.Context) {
  32. a := app.GinUtils{Gin: app.Gin{C: c}}
  33. m := models.WrOrderQuote{}
  34. a.DoBindReq(&m)
  35. a.DoGetDataByPage(&m)
  36. }
  37. // QueryOrderQuoteDetail
  38. // @Summary 查询买卖大厅
  39. // @Produce json
  40. // @Security ApiKeyAuth
  41. // @Param page query int false "页码"
  42. // @Param pagesize query int false "每页条数"
  43. // @Param marketid query int false "仓单贸易市场id"
  44. // @Param wrpricetype query int true "价格方式 - 1:固定价 2-浮动价"
  45. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  46. // @Param wrfactortypeid query int true "仓单要素id"
  47. // @Param goodsid query int false "期货商品id(浮动价方式时填)"
  48. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  49. // @Param deliverymonth query string false "交收月(yyyy-mm) 查仓单预售的买卖大厅时填写"
  50. // @Success 200 {array} models.WrOrderQuoteDetail
  51. // @Failure 500 {object} app.Response
  52. // @Router /WrTrade2/QueryOrderQuoteDetail [get]
  53. // @Tags 仓单贸易v2
  54. func QueryOrderQuoteDetail(c *gin.Context) {
  55. a := app.GinUtils{Gin: app.Gin{C: c}}
  56. m := models.WrOrderQuoteDetail{}
  57. a.DoBindReq(&m)
  58. a.DoGetDataByPage(&m)
  59. }
  60. // QueryWrPosition
  61. // @Summary 查询现货(预售)仓单持仓
  62. // @Description 页面 现货仓单->现货汇总/库存汇总; 预售仓单->订单汇总
  63. // @Produce json
  64. // @Security ApiKeyAuth
  65. // @Param userid query int true "用户id"
  66. // @Param querytype query int true "查询类型 1-现货汇总 2-库存汇总(订单汇总)"
  67. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  68. // @Success 200 {array} models.WrPosition
  69. // @Failure 500 {object} app.Response
  70. // @Router /WrTrade2/QueryWrPosition [get]
  71. // @Tags 仓单贸易v2
  72. func QueryWrPosition(c *gin.Context) {
  73. a := app.GinUtils{Gin: app.Gin{C: c}}
  74. m := models.WrPosition{}
  75. a.DoBindReq(&m)
  76. a.DoGetDataI(&m)
  77. }
  78. // QueryWrOrderDetail
  79. // @Summary 查询仓单委托单(挂单)
  80. // @Description 页面 现货仓单 | 预售仓单 -> 挂单
  81. // @Produce json
  82. // @Security ApiKeyAuth
  83. // @Param page query int false "页码"
  84. // @Param pagesize query int false "每页条数"
  85. // @Param userid query int true "用户id"
  86. // @Param marketid query int false "仓单贸易市场id"
  87. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  88. // @Success 200 {array} models.WrOrderDetail
  89. // @Failure 500 {object} app.Response
  90. // @Router /WrTrade2/QueryWrOrderDetail [get]
  91. // @Tags 仓单贸易v2
  92. func QueryWrOrderDetail(c *gin.Context) {
  93. a := app.GinUtils{Gin: app.Gin{C: c}}
  94. m := models.WrOrderDetail{}
  95. a.DoBindReq(&m)
  96. a.DoGetDataByPage(&m)
  97. }
  98. // QueryWrSpecialMatchOrder
  99. // @Summary 查询指定成交
  100. // @Description 页面 现货仓单 | 预售仓单 -> 指定成交
  101. // @Produce json
  102. // @Security ApiKeyAuth
  103. // @Param page query int false "页码"
  104. // @Param pagesize query int false "每页条数"
  105. // @Param userid query int true "用户id"
  106. // @Param marketid query int false "仓单贸易市场id"
  107. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  108. // @Success 200 {array} models.WrSpecialMatchOrder
  109. // @Failure 500 {object} app.Response
  110. // @Router /WrTrade2/QueryWrSpecialMatchOrder [get]
  111. // @Tags 仓单贸易v2
  112. func QueryWrSpecialMatchOrder(c *gin.Context) {
  113. a := app.GinUtils{Gin: app.Gin{C: c}}
  114. m := models.WrSpecialMatchOrder{}
  115. a.DoBindReq(&m)
  116. a.DoGetDataByPage(&m)
  117. }
  118. // QueryWrTradeDetail
  119. // @Summary 查询仓单成交明细
  120. // @Produce json
  121. // @Security ApiKeyAuth
  122. // @Param page query int false "页码"
  123. // @Param pagesize query int false "每页条数"
  124. // @Param userid query int true "用户id"
  125. // @Param marketid query int false "仓单贸易市场id"
  126. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  127. // @Success 200 {array} models.WrTradeDetail
  128. // @Failure 500 {object} app.Response
  129. // @Router /WrTrade2/QueryWrTradeDetail [get]
  130. // @Tags 仓单贸易v2
  131. func QueryWrTradeDetail(c *gin.Context) {
  132. a := app.GinUtils{Gin: app.Gin{C: c}}
  133. m := models.WrTradeDetail{}
  134. a.DoBindReq(&m)
  135. a.DoGetDataByPage(&m)
  136. }
  137. // QueryWrGoodsInfo
  138. // @Summary 查询仓单商品信息
  139. // @Produce json
  140. // @Security ApiKeyAuth
  141. // @Param marketid query int false "仓单贸易市场id"
  142. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  143. // @Param wrfactortypeid query int true "仓单要素id"
  144. // @Success 200 {array} models.WrGoodsInfo
  145. // @Failure 500 {object} app.Response
  146. // @Router /WrTrade2/QueryWrGoodsInfo [get]
  147. // @Tags 仓单贸易v2
  148. func QueryWrGoodsInfo(c *gin.Context) {
  149. a := app.GinUtils{Gin: app.Gin{C: c}}
  150. m := models.WrGoodsInfo{}
  151. a.DoBindReq(&m)
  152. a.DoGetDataI(&m)
  153. }
  154. // QueryPerformancePlan
  155. // @Summary 查询履约信息
  156. // @Produce json
  157. // @Security ApiKeyAuth
  158. // @Param userid query int true "用户id"
  159. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  160. // @Success 200 {array} models.WrPerformancePlan
  161. // @Failure 500 {object} app.Response
  162. // @Router /WrTrade2/QueryPerformancePlan [get]
  163. // @Tags 仓单贸易v2
  164. func QueryPerformancePlan(c *gin.Context) {
  165. a := app.GinUtils{Gin: app.Gin{C: c}}
  166. m := models.WrPerformancePlan{}
  167. a.DoBindReq(&m)
  168. a.DoGetDataI(&m)
  169. }
  170. // QueryHoldLB
  171. // @Summary 查询仓单持有记录
  172. // @Description 页面 现货仓单->现货明细? , 表名叫仓单持有记录, 有挂单特有维度,为防误解汇总也有相关维度, 新写接口,不跟汇总合在一起了。
  173. // @Produce json
  174. // @Security ApiKeyAuth
  175. // @Param accountid query int true "资金账号"
  176. // @Param warehouseid query int false "仓库id"
  177. // @Param deliverygoodsid query int false "品种id"
  178. // @Param wrstandardid query int false "品类id"
  179. // @Success 200 {array} models.WrHoldLB
  180. // @Failure 500 {object} app.Response
  181. // @Router /WrTrade2/QueryHoldLB [get]
  182. // @Tags 仓单贸易v2
  183. func QueryHoldLB(c *gin.Context) {
  184. a := app.GinUtils{Gin: app.Gin{C: c}}
  185. m := models.WrHoldLB{}
  186. a.DoBindReq(&m)
  187. a.DoGetDataI(&m)
  188. }
  189. // QueryFilterItem
  190. // @Summary 查询筛选框列表
  191. // @Produce json
  192. // @Security ApiKeyAuth
  193. // @Param itype query string true "类型(可多选,逗号隔开) 1-品种 2-品类(商品) 3-仓库"
  194. // @Success 200 {array} models.WrFilterItem
  195. // @Failure 500 {object} app.Response
  196. // @Router /WrTrade2/QueryFilterItem [get]
  197. // @Tags 仓单贸易v2
  198. func QueryFilterItem(c *gin.Context) {
  199. a := app.GinUtils{Gin: app.Gin{C: c}}
  200. m := models.WrFilterItem{}
  201. a.DoBindReq(&m)
  202. a.DoGetDataI(&m)
  203. }
  204. // QueryFaProductDetail
  205. // @Summary 查询融资产品列表
  206. // @Description 页面 买卖大厅 -> 选择融资方案
  207. // @Produce json
  208. // @Security ApiKeyAuth
  209. // @Param wrfactortypeid query int true "仓单要素id"
  210. // @Success 200 {array} models.WrFAProductDetail
  211. // @Failure 500 {object} app.Response
  212. // @Router /WrTrade2/QueryFaProductDetail [get]
  213. // @Tags 仓单贸易v2
  214. func QueryFaProductDetail(c *gin.Context) {
  215. a := app.GinUtils{Gin: app.Gin{C: c}}
  216. m := models.WrFAProductDetail{}
  217. a.DoBindReq(&m)
  218. a.DoGetDataI(&m)
  219. }
  220. // QueryWrFactorTypeInfo
  221. // @Summary 查询仓单要素详细信息
  222. // @Produce json
  223. // @Security ApiKeyAuth
  224. // @Param wrfactortypeid query int true "仓单要素id"
  225. // @Success 200 {array} models.WrFactorTypeInfo
  226. // @Failure 500 {object} app.Response
  227. // @Router /WrTrade2/QueryWrFactorTypeInfo [get]
  228. // @Tags 仓单贸易v2
  229. func QueryWrFactorTypeInfo(c *gin.Context) {
  230. a := app.GinUtils{Gin: app.Gin{C: c}}
  231. m := models.WrFactorTypeInfo{}
  232. a.DoBindReq(&m)
  233. a.DoGetDataI(&m)
  234. }
  235. // QueryWrMarketTradeConfig
  236. // @Summary 查询市场交易参数配置
  237. // @Produce json
  238. // @Security ApiKeyAuth
  239. // @Param marketid query int false "市场id"
  240. // @Success 200 {array} models.WrMarketTradeConfig
  241. // @Failure 500 {object} app.Response
  242. // @Router /WrTrade2/QueryWrMarketTradeConfig [get]
  243. // @Tags 仓单贸易v2
  244. func QueryWrMarketTradeConfig(c *gin.Context) {
  245. a := app.GinUtils{Gin: app.Gin{C: c}}
  246. m := models.WrMarketTradeConfig{}
  247. a.DoBindReq(&m)
  248. a.DoGetDataI(&m)
  249. }
  250. // QueryFtDeliveryGoods
  251. // @Summary 查询品种品类筛选框列表
  252. // @Produce json
  253. // @Security ApiKeyAuth
  254. // @Success 200 {array} models.WrFtDeliveryGoods
  255. // @Failure 500 {object} app.Response
  256. // @Router /WrTrade2/QueryFtDeliveryGoods [get]
  257. // @Tags 仓单贸易v2
  258. func QueryFtDeliveryGoods(c *gin.Context) {
  259. a := app.GinUtils{Gin: app.Gin{C: c}}
  260. m := models.WrFtDeliveryGoods{}
  261. a.DoBindReq(&m)
  262. a.DoGetDataI(&m)
  263. }
  264. // QueryWrStandardFactoryItem
  265. // @Summary 查询品类要素定义项
  266. // @Produce json
  267. // @Security ApiKeyAuth
  268. // @Param wrstandardid query int true "品类id"
  269. // @Success 200 {array} models.WrStandardFactoryItemEx
  270. // @Failure 500 {object} app.Response
  271. // @Router /WrTrade2/QueryWrStandardFactoryItem [get]
  272. // @Tags 仓单贸易v2
  273. func QueryWrStandardFactoryItem(c *gin.Context) {
  274. a := app.GinUtils{Gin: app.Gin{C: c}}
  275. m := models.WrStandardFactoryItemEx{}
  276. a.DoBindReq(&m)
  277. a.DoGetDataI(&m)
  278. }