qryWrTrade.go 10 KB

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