qryWrTrade.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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. // @Param dgitemname query string false "商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm"
  70. // @Param warehouseid query int false "仓库id(筛选条件)"
  71. // @Param deliverygoodsid query int false "品种id"
  72. // @Param wrstandardid query int false "品类id"
  73. // @Success 200 {array} models.WrPosition
  74. // @Failure 500 {object} app.Response
  75. // @Router /WrTrade2/QueryWrPosition [get]
  76. // @Tags 仓单贸易v2
  77. func QueryWrPosition(c *gin.Context) {
  78. a := app.GinUtils{Gin: app.Gin{C: c}}
  79. m := models.WrPosition{}
  80. a.DoBindReq(&m)
  81. a.DoGetDataI(&m)
  82. }
  83. // QueryWrOrderDetail
  84. // @Summary 查询仓单委托单(挂单)
  85. // @Description 页面 现货仓单 | 预售仓单 -> 挂单
  86. // @Produce json
  87. // @Security ApiKeyAuth
  88. // @Param page query int false "页码"
  89. // @Param pagesize query int false "每页条数"
  90. // @Param userid query int true "用户id"
  91. // @Param marketid query int false "仓单贸易市场id"
  92. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  93. // @Success 200 {array} models.WrOrderDetail
  94. // @Failure 500 {object} app.Response
  95. // @Router /WrTrade2/QueryWrOrderDetail [get]
  96. // @Tags 仓单贸易v2
  97. func QueryWrOrderDetail(c *gin.Context) {
  98. a := app.GinUtils{Gin: app.Gin{C: c}}
  99. m := models.WrOrderDetail{}
  100. a.DoBindReq(&m)
  101. a.DoGetDataByPage(&m)
  102. }
  103. // QueryWrSpecialMatchOrder
  104. // @Summary 查询指定成交
  105. // @Description 页面 现货仓单 | 预售仓单 -> 指定成交
  106. // @Produce json
  107. // @Security ApiKeyAuth
  108. // @Param page query int false "页码"
  109. // @Param pagesize query int false "每页条数"
  110. // @Param userid query int true "用户id"
  111. // @Param marketid query int false "仓单贸易市场id"
  112. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  113. // @Success 200 {array} models.WrSpecialMatchOrder
  114. // @Failure 500 {object} app.Response
  115. // @Router /WrTrade2/QueryWrSpecialMatchOrder [get]
  116. // @Tags 仓单贸易v2
  117. func QueryWrSpecialMatchOrder(c *gin.Context) {
  118. a := app.GinUtils{Gin: app.Gin{C: c}}
  119. m := models.WrSpecialMatchOrder{}
  120. a.DoBindReq(&m)
  121. a.DoGetDataByPage(&m)
  122. }
  123. // QueryWrTradeDetail
  124. // @Summary 查询仓单成交明细
  125. // @Produce json
  126. // @Security ApiKeyAuth
  127. // @Param page query int false "页码"
  128. // @Param pagesize query int false "每页条数"
  129. // @Param userid query int true "用户id"
  130. // @Param marketid query int false "仓单贸易市场id"
  131. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  132. // @Success 200 {array} models.WrTradeDetail
  133. // @Failure 500 {object} app.Response
  134. // @Router /WrTrade2/QueryWrTradeDetail [get]
  135. // @Tags 仓单贸易v2
  136. func QueryWrTradeDetail(c *gin.Context) {
  137. a := app.GinUtils{Gin: app.Gin{C: c}}
  138. m := models.WrTradeDetail{}
  139. a.DoBindReq(&m)
  140. a.DoGetDataByPage(&m)
  141. }
  142. // QueryWrGoodsInfo
  143. // @Summary 查询仓单商品信息
  144. // @Produce json
  145. // @Security ApiKeyAuth
  146. // @Param marketid query int false "仓单贸易市场id"
  147. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  148. // @Param wrfactortypeid query int true "仓单要素id"
  149. // @Success 200 {array} models.WrGoodsInfo
  150. // @Failure 500 {object} app.Response
  151. // @Router /WrTrade2/QueryWrGoodsInfo [get]
  152. // @Tags 仓单贸易v2
  153. func QueryWrGoodsInfo(c *gin.Context) {
  154. a := app.GinUtils{Gin: app.Gin{C: c}}
  155. m := models.WrGoodsInfo{}
  156. a.DoBindReq(&m)
  157. a.DoGetDataI(&m)
  158. }
  159. // QueryPerformancePlan
  160. // @Summary 查询履约信息
  161. // @Produce json
  162. // @Security ApiKeyAuth
  163. // @Param userid query int true "用户id"
  164. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  165. // @Success 200 {array} models.WrPerformancePlan
  166. // @Failure 500 {object} app.Response
  167. // @Router /WrTrade2/QueryPerformancePlan [get]
  168. // @Tags 仓单贸易v2
  169. func QueryPerformancePlan(c *gin.Context) {
  170. a := app.GinUtils{Gin: app.Gin{C: c}}
  171. m := models.WrPerformancePlan{}
  172. a.DoBindReq(&m)
  173. a.DoGetDataI(&m)
  174. }
  175. // QueryHoldLB
  176. // @Summary 查询仓单持有记录
  177. // @Description 页面 现货仓单->现货明细? , 表名叫仓单持有记录, 有挂单特有维度,为防误解汇总也有相关维度, 新写接口,不跟汇总合在一起了。
  178. // @Produce json
  179. // @Security ApiKeyAuth
  180. // @Param accountid query int true "资金账号"
  181. // @Param warehouseid query int false "仓库id"
  182. // @Param deliverygoodsid query int false "品种id"
  183. // @Param wrstandardid query int false "品类id"
  184. // @Success 200 {array} models.WrHoldLB
  185. // @Failure 500 {object} app.Response
  186. // @Router /WrTrade2/QueryHoldLB [get]
  187. // @Tags 仓单贸易v2
  188. func QueryHoldLB(c *gin.Context) {
  189. a := app.GinUtils{Gin: app.Gin{C: c}}
  190. m := models.WrHoldLB{}
  191. a.DoBindReq(&m)
  192. a.DoGetDataI(&m)
  193. }
  194. // QueryFilterItem
  195. // @Summary 查询筛选框列表 - 作废(以前给pcweb简单筛选框用的,后来改版了)
  196. // @Produce json
  197. // @Security ApiKeyAuth
  198. // @Param itype query string true "类型(可多选,逗号隔开) 1-品种 2-品类(商品) 3-仓库"
  199. // @Success 200 {array} models.WrFilterItem
  200. // @Failure 500 {object} app.Response
  201. // @Router /WrTrade2/QueryFilterItem [get]
  202. // @Tags 仓单贸易v2
  203. func QueryFilterItem(c *gin.Context) {
  204. a := app.GinUtils{Gin: app.Gin{C: c}}
  205. m := models.WrFilterItem{}
  206. a.DoBindReq(&m)
  207. a.DoGetDataI(&m)
  208. }
  209. // QueryFaProductDetail
  210. // @Summary 查询融资产品列表
  211. // @Description 页面 买卖大厅 -> 选择融资方案
  212. // @Produce json
  213. // @Security ApiKeyAuth
  214. // @Param wrfactortypeid query int true "仓单要素id"
  215. // @Success 200 {array} models.WrFAProductDetail
  216. // @Failure 500 {object} app.Response
  217. // @Router /WrTrade2/QueryFaProductDetail [get]
  218. // @Tags 仓单贸易v2
  219. func QueryFaProductDetail(c *gin.Context) {
  220. a := app.GinUtils{Gin: app.Gin{C: c}}
  221. m := models.WrFAProductDetail{}
  222. a.DoBindReq(&m)
  223. a.DoGetDataI(&m)
  224. }
  225. // QueryWrFactorTypeInfo
  226. // @Summary 查询仓单要素详细信息
  227. // @Produce json
  228. // @Security ApiKeyAuth
  229. // @Param wrfactortypeid query int true "仓单要素id"
  230. // @Success 200 {array} models.WrFactorTypeInfo
  231. // @Failure 500 {object} app.Response
  232. // @Router /WrTrade2/QueryWrFactorTypeInfo [get]
  233. // @Tags 仓单贸易v2
  234. func QueryWrFactorTypeInfo(c *gin.Context) {
  235. a := app.GinUtils{Gin: app.Gin{C: c}}
  236. m := models.WrFactorTypeInfo{}
  237. a.DoBindReq(&m)
  238. a.DoGetDataI(&m)
  239. }
  240. // QueryWrFactorTypeInfoEx
  241. // @Summary 查询仓单要素详细信息列表项
  242. // @Produce json
  243. // @Security ApiKeyAuth
  244. // @Param wrfactortypeid query int true "仓单要素id"
  245. // @Success 200 {array} models.WrTypeItem
  246. // @Failure 500 {object} app.Response
  247. // @Router /WrTrade2/QueryWrFactorTypeInfoEx [get]
  248. // @Tags 仓单贸易v2
  249. func QueryWrFactorTypeInfoEx(c *gin.Context) {
  250. a := app.GinUtils{Gin: app.Gin{C: c}}
  251. m := models.WrFactorTypeInfoEx{}
  252. a.DoBindReq(&m)
  253. a.DoGetDataI(&m)
  254. }
  255. // QueryWrMarketTradeConfig
  256. // @Summary 查询市场交易参数配置
  257. // @Produce json
  258. // @Security ApiKeyAuth
  259. // @Param marketid query int false "市场id"
  260. // @Success 200 {array} models.WrMarketTradeConfig
  261. // @Failure 500 {object} app.Response
  262. // @Router /WrTrade2/QueryWrMarketTradeConfig [get]
  263. // @Tags 仓单贸易v2
  264. func QueryWrMarketTradeConfig(c *gin.Context) {
  265. a := app.GinUtils{Gin: app.Gin{C: c}}
  266. m := models.WrMarketTradeConfig{}
  267. a.DoBindReq(&m)
  268. a.DoGetDataI(&m)
  269. }
  270. // QueryFtDeliveryGoods
  271. // @Summary 查询品种品类筛选框列表
  272. // @Produce json
  273. // @Security ApiKeyAuth
  274. // @Success 200 {array} models.WrFtDeliveryGoods
  275. // @Failure 500 {object} app.Response
  276. // @Router /WrTrade2/QueryFtDeliveryGoods [get]
  277. // @Tags 仓单贸易v2
  278. func QueryFtDeliveryGoods(c *gin.Context) {
  279. a := app.GinUtils{Gin: app.Gin{C: c}}
  280. m := models.WrFtDeliveryGoods{}
  281. a.DoBindReq(&m)
  282. a.DoGetDataI(&m)
  283. }
  284. // QueryWrStandardFactoryItem
  285. // @Summary 查询品类要素定义项
  286. // @Produce json
  287. // @Security ApiKeyAuth
  288. // @Param wrstandardid query int true "品类id"
  289. // @Success 200 {array} models.WrStandardFactoryItemEx
  290. // @Failure 500 {object} app.Response
  291. // @Router /WrTrade2/QueryWrStandardFactoryItem [get]
  292. // @Tags 仓单贸易v2
  293. func QueryWrStandardFactoryItem(c *gin.Context) {
  294. a := app.GinUtils{Gin: app.Gin{C: c}}
  295. m := models.WrStandardFactoryItemEx{}
  296. a.DoBindReq(&m)
  297. a.DoGetDataI(&m)
  298. }
  299. // QueryWrPerformancePlanStep
  300. // @Summary 查询履约信息详情
  301. // @Produce json
  302. // @Security ApiKeyAuth
  303. // @Param planid query int true "履约计划id(performanceplanid)"
  304. // @Param curstepid query int false "当前步骤id"
  305. // @Success 200 {array} models.WrPerformancePlanStep
  306. // @Failure 500 {object} app.Response
  307. // @Router /WrTrade2/QueryWrPerformancePlanStep [get]
  308. // @Tags 仓单贸易v2
  309. func QueryWrPerformancePlanStep(c *gin.Context) {
  310. a := app.GinUtils{Gin: app.Gin{C: c}}
  311. m := models.WrPerformancePlanStep{}
  312. a.DoBindReq(&m)
  313. a.DoGetDataI(&m)
  314. }
  315. // QueryWrFinanceBuyApply
  316. // @Summary 查询融资购买申请
  317. // @Description 页面 融资信息+ / 申请单
  318. // @Produce json
  319. // @Security ApiKeyAuth
  320. // @Param userid query int true "用户id"
  321. // @Success 200 {array} models.WrFinanceBuyApply
  322. // @Failure 500 {object} app.Response
  323. // @Router /WrTrade2/QueryWrFinanceBuyApply [get]
  324. // @Tags 仓单贸易v2
  325. func QueryWrFinanceBuyApply(c *gin.Context) {
  326. a := app.GinUtils{Gin: app.Gin{C: c}}
  327. m := models.WrFinanceBuyApply{}
  328. a.DoBindReq(&m)
  329. a.DoGetDataI(&m)
  330. }
  331. // QueryWrScfContract
  332. // @Summary 查询仓单贸易融资合同
  333. // @Produce json
  334. // @Security ApiKeyAuth
  335. // @Param userid query int true "用户id"
  336. // @Param scfcontractid query int false "融资合同id"
  337. // @Success 200 {array} models.WrScfContract
  338. // @Failure 500 {object} app.Response
  339. // @Router /WrTrade2/QueryWrScfContract [get]
  340. // @Tags 仓单贸易v2
  341. func QueryWrScfContract(c *gin.Context) {
  342. a := app.GinUtils{Gin: app.Gin{C: c}}
  343. m := models.WrScfContract{}
  344. a.DoBindReq(&m)
  345. a.DoGetDataI(&m)
  346. }
  347. // QueryWrBuybackDetail
  348. // @Summary 查询仓单回购明细
  349. // @Produce json
  350. // @Security ApiKeyAuth
  351. // @Param scfcontractid query int false "融资合同id"
  352. // @Success 200 {array} models.WrBuybackDetail
  353. // @Failure 500 {object} app.Response
  354. // @Router /WrTrade2/QueryWrBuybackDetail [get]
  355. // @Tags 仓单贸易v2
  356. func QueryWrBuybackDetail(c *gin.Context) {
  357. a := app.GinUtils{Gin: app.Gin{C: c}}
  358. m := models.WrBuybackDetail{}
  359. a.DoBindReq(&m)
  360. a.DoGetDataI(&m)
  361. }
  362. // QueryWrScfContractInterest
  363. // @Summary 查询融资合同费用明细
  364. // @Produce json
  365. // @Security ApiKeyAuth
  366. // @Param scfcontractid query int false "融资合同id"
  367. // @Success 200 {array} models.WrScfContractInterest
  368. // @Failure 500 {object} app.Response
  369. // @Router /WrTrade2/QueryWrScfContractInterest [get]
  370. // @Tags 仓单贸易v2
  371. func QueryWrScfContractInterest(c *gin.Context) {
  372. a := app.GinUtils{Gin: app.Gin{C: c}}
  373. m := models.WrScfContractInterest{}
  374. a.DoBindReq(&m)
  375. a.DoGetDataI(&m)
  376. }
  377. // QueryWrOutInApply
  378. // @Summary 查询提货申请
  379. // @Produce json
  380. // @Security ApiKeyAuth
  381. // @Param userid query int true "用户id"
  382. // @Success 200 {array} models.WrOutInApply
  383. // @Failure 500 {object} app.Response
  384. // @Router /WrTrade2/QueryWrOutInApply [get]
  385. // @Tags 仓单贸易v2
  386. func QueryWrOutInApply(c *gin.Context) {
  387. a := app.GinUtils{Gin: app.Gin{C: c}}
  388. m := models.WrOutInApply{}
  389. a.DoBindReq(&m)
  390. a.DoGetDataI(&m)
  391. }