qryWrTrade.go 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  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. "mtp2_if/global/app"
  9. "mtp2_if/global/e"
  10. "mtp2_if/logger"
  11. "mtp2_if/models"
  12. "net/http"
  13. "github.com/gin-gonic/gin"
  14. )
  15. // QueryOrderQuote
  16. // @Summary 查询大厅行情列表
  17. // @Description 仓单交易 wrfactortypeid 唯一确定1条记录, 仓单预售 wrfactortypeid + deliverymonth 唯一确定1条记录
  18. // @Produce json
  19. // @Security ApiKeyAuth
  20. // @Param page query int false "页码"
  21. // @Param pagesize query int false "每页条数"
  22. // @Param marketid query int false "仓单贸易市场id"
  23. // @Param wrpricetype query int true "价格方式 - 1:固定价 2-浮动价"
  24. // @Param haswr query int false "0:仓单预售 1:仓单贸易"
  25. // @Param dgitemname query string false "商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm"
  26. // @Param warehouseid query int false "仓库id(筛选条件)"
  27. // @Param deliverygoodsid query int false "品种id"
  28. // @Param wrstandardid query int false "品类id"
  29. // @Param brandid query int false "品牌id(dgfactoryitemid)"
  30. // @Param yearsid query int false "年份id(dgfactoryitemid)"
  31. // @Param wrfactortypeid query int false "仓单要素id"
  32. // @Param deliverymonth query string false "交收月(yyyy-mm) 仓单预售填写"
  33. // @Success 200 {array} models.WrOrderQuote
  34. // @Failure 500 {object} app.Response
  35. // @Router /WrTrade2/QueryOrderQuote [get]
  36. // @Tags 仓单贸易v2
  37. func QueryOrderQuote(c *gin.Context) {
  38. a := app.GinUtils{Gin: app.Gin{C: c}}
  39. m := models.WrOrderQuote{HasWr: -1}
  40. a.DoBindReq(&m)
  41. a.DoGetDataByPage(&m)
  42. }
  43. // QueryOrderQuoteDetail
  44. // @Summary 查询买卖大厅
  45. // @Produce json
  46. // @Security ApiKeyAuth
  47. // @Param page query int false "页码"
  48. // @Param pagesize query int false "每页条数"
  49. // @Param marketid query int false "仓单贸易市场id"
  50. // @Param wrpricetype query int true "价格方式 - 1:固定价 2-浮动价"
  51. // @Param haswr query int false "0:仓单预售 1:仓单贸易"
  52. // @Param wrfactortypeid query int true "仓单要素id"
  53. // @Param goodsid query int false "期货商品id(浮动价方式时填)"
  54. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  55. // @Param deliverymonth query string false "交收月(yyyy-mm) 查仓单预售的买卖大厅时填写"
  56. // @Success 200 {array} models.WrOrderQuoteDetail
  57. // @Failure 500 {object} app.Response
  58. // @Router /WrTrade2/QueryOrderQuoteDetail [get]
  59. // @Tags 仓单贸易v2
  60. func QueryOrderQuoteDetail(c *gin.Context) {
  61. a := app.GinUtils{Gin: app.Gin{C: c}}
  62. m := models.WrOrderQuoteDetail{HasWr: -1}
  63. a.DoBindReq(&m)
  64. a.DoGetDataByPage(&m)
  65. }
  66. // QueryOrderQuoteMyq
  67. // @Summary 查询贸易圈挂牌大厅
  68. // @Description
  69. // @Produce json
  70. // @Security ApiKeyAuth
  71. // @Param page query int false "页码"
  72. // @Param pagesize query int false "每页条数"
  73. // @Param userid query int true "用户id"
  74. // @Param marketid query int false "仓单贸易市场id"
  75. // @Param haswr query int false "0:仓单预售 1:仓单贸易"
  76. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  77. // @Param deliverygoodsid query int false "品种id"
  78. // @Param wrstandardid query int false "品类id"
  79. // @Param deliverymonth query string false "交收月(yyyy-mm) 仓单预售填写"
  80. // @Param dgitemname query string false "商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm"
  81. // @Success 200 {array} models.WrQuoteOrderMyq
  82. // @Failure 500 {object} app.Response
  83. // @Router /WrTrade2/QueryOrderQuoteMyq [get]
  84. // @Tags 仓单贸易v2
  85. func QueryOrderQuoteMyq(c *gin.Context) {
  86. a := app.GinUtils{Gin: app.Gin{C: c}}
  87. m := models.WrQuoteOrderMyq{HasWr: -1}
  88. a.DoBindReq(&m)
  89. a.DoGetDataByPage(&m)
  90. }
  91. // QueryWrPosition
  92. // @Summary 查询现货(预售)仓单持仓
  93. // @Description 页面 现货仓单->现货汇总/库存汇总; 预售仓单->订单汇总
  94. // @Produce json
  95. // @Security ApiKeyAuth
  96. // @Param userid query int true "用户id"
  97. // @Param querytype query int true "查询类型 1-现货汇总 2-库存汇总(订单汇总)"
  98. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  99. // @Param dgitemname query string false "商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm"
  100. // @Param warehouseid query int false "仓库id(筛选条件)"
  101. // @Param deliverygoodsid query int false "品种id"
  102. // @Param wrstandardid query int false "品类id"
  103. // @Success 200 {array} models.WrPosition
  104. // @Failure 500 {object} app.Response
  105. // @Router /WrTrade2/QueryWrPosition [get]
  106. // @Tags 仓单贸易v2
  107. func QueryWrPosition(c *gin.Context) {
  108. a := app.GinUtils{Gin: app.Gin{C: c}}
  109. m := models.WrPosition{}
  110. a.DoBindReq(&m)
  111. a.DoGetDataI(&m)
  112. }
  113. // QueryWrOrderDetail
  114. // @Summary 查询仓单委托单
  115. // @Description 页面 现货仓单 | 预售仓单 -> 委托单
  116. // @Produce json
  117. // @Security ApiKeyAuth
  118. // @Param page query int false "页码"
  119. // @Param pagesize query int false "每页条数"
  120. // @Param userid query int true "用户id"
  121. // @Param marketid query int false "仓单贸易市场id"
  122. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  123. // @Param bcancel query int false "是否仅查可撤单据 1:可撤 注:此参数仅对当前记录有效, 且不含47模式市场"
  124. // @Param wrtradetype query int false "仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)"
  125. // @Param begindate query string false "开始交易日(yyyymmdd)"
  126. // @Param enddate query string false "结束交易日(yyyymmdd)"
  127. // @Success 200 {array} models.WrOrderDetail
  128. // @Failure 500 {object} app.Response
  129. // @Router /WrTrade2/QueryWrOrderDetail [get]
  130. // @Tags 仓单贸易v2
  131. func QueryWrOrderDetail(c *gin.Context) {
  132. a := app.GinUtils{Gin: app.Gin{C: c}}
  133. m := models.WrOrderDetail{}
  134. a.DoBindReq(&m)
  135. a.DoGetDataByPage(&m)
  136. }
  137. // QueryWrSpecialMatchOrder
  138. // @Summary 查询指定成交
  139. // @Description 页面 现货仓单 | 预售仓单 -> 指定成交
  140. // @Produce json
  141. // @Security ApiKeyAuth
  142. // @Param page query int false "页码"
  143. // @Param pagesize query int false "每页条数"
  144. // @Param userid query int true "用户id"
  145. // @Param marketid query int false "仓单贸易市场id"
  146. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  147. // @Param isspecified query int false "1:指定好友(贸易圈) 2:指定对手 - [挂牌]"
  148. // @Success 200 {array} models.WrSpecialMatchOrder
  149. // @Failure 500 {object} app.Response
  150. // @Router /WrTrade2/QueryWrSpecialMatchOrder [get]
  151. // @Tags 仓单贸易v2
  152. func QueryWrSpecialMatchOrder(c *gin.Context) {
  153. a := app.GinUtils{Gin: app.Gin{C: c}}
  154. m := models.WrSpecialMatchOrder{}
  155. a.DoBindReq(&m)
  156. a.DoGetDataByPage(&m)
  157. }
  158. // QueryWrTradeDetail
  159. // @Summary 查询仓单成交明细
  160. // @Produce json
  161. // @Security ApiKeyAuth
  162. // @Param page query int false "页码"
  163. // @Param pagesize query int false "每页条数"
  164. // @Param userid query int true "用户id"
  165. // @Param marketid query int false "仓单贸易市场id"
  166. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  167. // @Param begindate query string false "开始交易日(yyyymmdd)"
  168. // @Param enddate query string false "结束交易日(yyyymmdd)"
  169. // @Success 200 {array} models.WrTradeDetail
  170. // @Failure 500 {object} app.Response
  171. // @Router /WrTrade2/QueryWrTradeDetail [get]
  172. // @Tags 仓单贸易v2
  173. func QueryWrTradeDetail(c *gin.Context) {
  174. a := app.GinUtils{Gin: app.Gin{C: c}}
  175. m := models.WrTradeDetail{}
  176. a.DoBindReq(&m)
  177. a.DoGetDataByPage(&m)
  178. }
  179. // QueryWrGoodsInfo
  180. // @Summary 查询仓单商品信息
  181. // @Produce json
  182. // @Security ApiKeyAuth
  183. // @Param marketid query int false "仓单贸易市场id"
  184. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  185. // @Param wrfactortypeid query int true "仓单要素id"
  186. // @Param tmplateid query int false "履约模板id(如果指定了履约模板id,履约信息将按模板id查, 否则去市场配置表中找模板)"
  187. // @Success 200 {array} models.WrGoodsInfo
  188. // @Failure 500 {object} app.Response
  189. // @Router /WrTrade2/QueryWrGoodsInfo [get]
  190. // @Tags 仓单贸易v2
  191. func QueryWrGoodsInfo(c *gin.Context) {
  192. a := app.GinUtils{Gin: app.Gin{C: c}}
  193. m := models.WrGoodsInfo{}
  194. a.DoBindReq(&m)
  195. a.DoGetDataI(&m)
  196. }
  197. // QueryPerformancePlan
  198. // @Summary 查询履约信息
  199. // @Produce json
  200. // @Security ApiKeyAuth
  201. // @Param userid query int true "用户id"
  202. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  203. // @Param status query string false "履约状态(可多个,逗号隔开) 1:待激活 2:正常 3:处理错误 4:违约待处理 5:违约处理中 6:完成 7.违约已完成 8:释放冻结失败 9:超时待处理 10:超时关闭"
  204. // @Param begindate query string false "开始交易日(yyyymmdd)"
  205. // @Param enddate query string false "结束交易日(yyyymmdd)"
  206. // @Success 200 {array} models.WrPerformancePlan
  207. // @Failure 500 {object} app.Response
  208. // @Router /WrTrade2/QueryPerformancePlan [get]
  209. // @Tags 仓单贸易v2
  210. func QueryPerformancePlan(c *gin.Context) {
  211. a := app.GinUtils{Gin: app.Gin{C: c}}
  212. m := models.WrPerformancePlan{}
  213. a.DoBindReq(&m)
  214. a.DoGetDataI(&m)
  215. }
  216. // QueryHoldLB
  217. // @Summary 查询仓单持有记录
  218. // @Description 页面 现货仓单->现货明细? , 表名叫仓单持有记录, 有挂单特有维度,为防误解汇总也有相关维度, 新写接口,不跟汇总合在一起了。
  219. // @Produce json
  220. // @Security ApiKeyAuth
  221. // @Param accountid query int true "资金账号"
  222. // @Param warehouseid query int false "仓库id"
  223. // @Param deliverygoodsid query int false "品种id"
  224. // @Param wrstandardid query int false "品类id"
  225. // @Param wrfactortypeid query int false "仓单要素id"
  226. // @Param dgitemname query string false "商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm"
  227. // @Success 200 {array} models.WrHoldLB
  228. // @Failure 500 {object} app.Response
  229. // @Router /WrTrade2/QueryHoldLB [get]
  230. // @Tags 仓单贸易v2
  231. func QueryHoldLB(c *gin.Context) {
  232. a := app.GinUtils{Gin: app.Gin{C: c}}
  233. m := models.WrHoldLB{}
  234. a.DoBindReq(&m)
  235. a.DoGetDataI(&m)
  236. }
  237. // QueryFilterItem
  238. // @Summary 查询筛选框列表 - 作废(以前给pcweb简单筛选框用的,后来改版了)
  239. // @Produce json
  240. // @Security ApiKeyAuth
  241. // @Param itype query string true "类型(可多选,逗号隔开) 1-品种 2-品类(商品) 3-仓库"
  242. // @Success 200 {array} models.WrFilterItem
  243. // @Failure 500 {object} app.Response
  244. // @Router /WrTrade2/QueryFilterItem [get]
  245. // @Tags 仓单贸易v2
  246. func QueryFilterItem(c *gin.Context) {
  247. a := app.GinUtils{Gin: app.Gin{C: c}}
  248. m := models.WrFilterItem{}
  249. a.DoBindReq(&m)
  250. a.DoGetDataI(&m)
  251. }
  252. // QueryFaProductDetail
  253. // @Summary 查询融资产品列表
  254. // @Description 页面 买卖大厅 -> 选择融资方案
  255. // @Produce json
  256. // @Security ApiKeyAuth
  257. // @Param wrfactortypeid query int true "仓单要素id"
  258. // @Success 200 {array} models.WrFAProductDetail
  259. // @Failure 500 {object} app.Response
  260. // @Router /WrTrade2/QueryFaProductDetail [get]
  261. // @Tags 仓单贸易v2
  262. func QueryFaProductDetail(c *gin.Context) {
  263. a := app.GinUtils{Gin: app.Gin{C: c}}
  264. m := models.WrFAProductDetail{}
  265. a.DoBindReq(&m)
  266. a.DoGetDataI(&m)
  267. }
  268. // QueryWrFactorTypeInfo
  269. // @Summary 查询仓单要素详细信息
  270. // @Produce json
  271. // @Security ApiKeyAuth
  272. // @Param wrfactortypeid query int true "仓单要素id"
  273. // @Success 200 {array} models.WrFactorTypeInfo
  274. // @Failure 500 {object} app.Response
  275. // @Router /WrTrade2/QueryWrFactorTypeInfo [get]
  276. // @Tags 仓单贸易v2
  277. func QueryWrFactorTypeInfo(c *gin.Context) {
  278. a := app.GinUtils{Gin: app.Gin{C: c}}
  279. m := models.WrFactorTypeInfo{}
  280. a.DoBindReq(&m)
  281. a.DoGetDataI(&m)
  282. }
  283. // QueryWrFactorTypeInfoEx
  284. // @Summary 查询仓单要素详细信息列表项
  285. // @Produce json
  286. // @Security ApiKeyAuth
  287. // @Param wrfactortypeid query int true "仓单要素id"
  288. // @Success 200 {array} models.WrTypeItem
  289. // @Failure 500 {object} app.Response
  290. // @Router /WrTrade2/QueryWrFactorTypeInfoEx [get]
  291. // @Tags 仓单贸易v2
  292. func QueryWrFactorTypeInfoEx(c *gin.Context) {
  293. a := app.GinUtils{Gin: app.Gin{C: c}}
  294. m := models.WrFactorTypeInfoEx{}
  295. a.DoBindReq(&m)
  296. a.DoGetDataI(&m)
  297. }
  298. // QueryWrMarketTradeConfig
  299. // @Summary 查询市场交易参数配置
  300. // @Produce json
  301. // @Security ApiKeyAuth
  302. // @Param marketid query int false "市场id"
  303. // @Success 200 {array} models.WrMarketTradeConfig
  304. // @Failure 500 {object} app.Response
  305. // @Router /WrTrade2/QueryWrMarketTradeConfig [get]
  306. // @Tags 仓单贸易v2
  307. func QueryWrMarketTradeConfig(c *gin.Context) {
  308. a := app.GinUtils{Gin: app.Gin{C: c}}
  309. m := models.WrMarketTradeConfig{}
  310. a.DoBindReq(&m)
  311. a.DoGetDataI(&m)
  312. }
  313. // QueryFtDeliveryGoods
  314. // @Summary 查询品种品类筛选框列表
  315. // @Produce json
  316. // @Security ApiKeyAuth
  317. // @Success 200 {array} models.WrFtDeliveryGoods
  318. // @Failure 500 {object} app.Response
  319. // @Router /WrTrade2/QueryFtDeliveryGoods [get]
  320. // @Tags 仓单贸易v2
  321. func QueryFtDeliveryGoods(c *gin.Context) {
  322. a := app.GinUtils{Gin: app.Gin{C: c}}
  323. m := models.WrFtDeliveryGoods{}
  324. a.DoBindReq(&m)
  325. a.DoGetDataI(&m)
  326. }
  327. // QueryWrStandardFactoryItem
  328. // @Summary 查询品类要素定义项
  329. // @Produce json
  330. // @Security ApiKeyAuth
  331. // @Param wrstandardid query int true "品类id"
  332. // @Success 200 {array} models.WrStandardFactoryItemEx
  333. // @Failure 500 {object} app.Response
  334. // @Router /WrTrade2/QueryWrStandardFactoryItem [get]
  335. // @Tags 仓单贸易v2
  336. func QueryWrStandardFactoryItem(c *gin.Context) {
  337. a := app.GinUtils{Gin: app.Gin{C: c}}
  338. m := models.WrStandardFactoryItemEx{}
  339. a.DoBindReq(&m)
  340. a.DoGetDataI(&m)
  341. }
  342. // QueryWrPerformancePlanStep
  343. // @Summary 查询履约信息详情
  344. // @Produce json
  345. // @Security ApiKeyAuth
  346. // @Param planid query int true "履约计划id(performanceplanid)"
  347. // @Param curstepid query int false "当前步骤id"
  348. // @Success 200 {array} models.WrPerformancePlanStep
  349. // @Failure 500 {object} app.Response
  350. // @Router /WrTrade2/QueryWrPerformancePlanStep [get]
  351. // @Tags 仓单贸易v2
  352. func QueryWrPerformancePlanStep(c *gin.Context) {
  353. a := app.GinUtils{Gin: app.Gin{C: c}}
  354. m := models.WrPerformancePlanStep{}
  355. a.DoBindReq(&m)
  356. a.DoGetDataI(&m)
  357. }
  358. // QueryWrFinanceBuyApply
  359. // @Summary 查询融资购买申请
  360. // @Description 页面 融资信息+ / 申请单
  361. // @Produce json
  362. // @Security ApiKeyAuth
  363. // @Param userid query int true "用户id"
  364. // @Success 200 {array} models.WrFinanceBuyApply
  365. // @Failure 500 {object} app.Response
  366. // @Router /WrTrade2/QueryWrFinanceBuyApply [get]
  367. // @Tags 仓单贸易v2
  368. func QueryWrFinanceBuyApply(c *gin.Context) {
  369. a := app.GinUtils{Gin: app.Gin{C: c}}
  370. m := models.WrFinanceBuyApply{}
  371. a.DoBindReq(&m)
  372. a.DoGetDataI(&m)
  373. }
  374. // QueryWrScfContract
  375. // @Summary 查询仓单贸易融资合同
  376. // @Produce json
  377. // @Security ApiKeyAuth
  378. // @Param userid query int true "用户id"
  379. // @Param scfcontractid query int false "融资合同id"
  380. // @Success 200 {array} models.WrScfContract
  381. // @Failure 500 {object} app.Response
  382. // @Router /WrTrade2/QueryWrScfContract [get]
  383. // @Tags 仓单贸易v2
  384. func QueryWrScfContract(c *gin.Context) {
  385. a := app.GinUtils{Gin: app.Gin{C: c}}
  386. m := models.WrScfContract{}
  387. a.DoBindReq(&m)
  388. a.DoGetDataI(&m)
  389. }
  390. // QueryWrBuybackDetail
  391. // @Summary 查询仓单回购明细
  392. // @Produce json
  393. // @Security ApiKeyAuth
  394. // @Param scfcontractid query int false "融资合同id"
  395. // @Success 200 {array} models.WrBuybackDetail
  396. // @Failure 500 {object} app.Response
  397. // @Router /WrTrade2/QueryWrBuybackDetail [get]
  398. // @Tags 仓单贸易v2
  399. func QueryWrBuybackDetail(c *gin.Context) {
  400. a := app.GinUtils{Gin: app.Gin{C: c}}
  401. m := models.WrBuybackDetail{}
  402. a.DoBindReq(&m)
  403. a.DoGetDataI(&m)
  404. }
  405. // QueryWrScfContractInterest
  406. // @Summary 查询融资合同费用明细
  407. // @Produce json
  408. // @Security ApiKeyAuth
  409. // @Param scfcontractid query int false "融资合同id"
  410. // @Success 200 {array} models.WrScfContractInterest
  411. // @Failure 500 {object} app.Response
  412. // @Router /WrTrade2/QueryWrScfContractInterest [get]
  413. // @Tags 仓单贸易v2
  414. func QueryWrScfContractInterest(c *gin.Context) {
  415. a := app.GinUtils{Gin: app.Gin{C: c}}
  416. m := models.WrScfContractInterest{}
  417. a.DoBindReq(&m)
  418. a.DoGetDataI(&m)
  419. }
  420. // QueryWrOutInApply
  421. // @Summary 查询提货申请
  422. // @Produce json
  423. // @Security ApiKeyAuth
  424. // @Param userid query int true "用户id"
  425. // @Param begindate query string false "开始交易日(yyyymmdd)"
  426. // @Param enddate query string false "结束交易日(yyyymmdd)"
  427. // @Success 200 {array} models.WrOutInApply
  428. // @Failure 500 {object} app.Response
  429. // @Router /WrTrade2/QueryWrOutInApply [get]
  430. // @Tags 仓单贸易v2
  431. func QueryWrOutInApply(c *gin.Context) {
  432. a := app.GinUtils{Gin: app.Gin{C: c}}
  433. m := models.WrOutInApply{}
  434. a.DoBindReq(&m)
  435. a.DoGetDataI(&m)
  436. }
  437. // QueryWrDeliveryDetail
  438. // @Summary 查询交收
  439. // @Produce json
  440. // @Security ApiKeyAuth
  441. // @Param userid query int true "用户id"
  442. // @Param accountid query int false "资金账号id"
  443. // @Param begindate query string false "开始交易日(yyyymmdd)"
  444. // @Param enddate query string false "结束交易日(yyyymmdd)"
  445. // @Success 200 {array} models.WrDeliveryDetail
  446. // @Failure 500 {object} app.Response
  447. // @Router /WrTrade2/QueryWrDeliveryDetail [get]
  448. // @Tags 仓单贸易v2
  449. func QueryWrDeliveryDetail(c *gin.Context) {
  450. a := app.GinUtils{Gin: app.Gin{C: c}}
  451. m := models.WrDeliveryDetail{}
  452. a.DoBindReq(&m)
  453. a.DoGetDataI(&m)
  454. }
  455. // QueryWrBsGoodsInfo
  456. // @Summary 查询合约交易买卖大厅详情
  457. // @Description 合约交易/买卖大厅/详情
  458. // @Produce json
  459. // @Security ApiKeyAuth
  460. // @Param goodsid query int true "商品id"
  461. // @Success 200 {array} models.WrBsGoodsInfo
  462. // @Failure 500 {object} app.Response
  463. // @Router /WrTrade2/QueryWrBsGoodsInfo [get]
  464. // @Tags 仓单贸易v2
  465. func QueryWrBsGoodsInfo(c *gin.Context) {
  466. a := app.GinUtils{Gin: app.Gin{C: c}}
  467. m := models.WrBsGoodsInfo{}
  468. a.DoBindReq(&m)
  469. a.DoGetDataI(&m)
  470. }
  471. // QueryWrTradeOrderDetail
  472. // @Summary 查询合约交易买卖大厅
  473. // @Produce json
  474. // @Security ApiKeyAuth
  475. // @Param page query int false "页码"
  476. // @Param pagesize query int false "每页条数"
  477. // @Param goodsid query int true "商品id"
  478. // @Param buyorsell query int true "买卖方向 0-买 1-卖"
  479. // @Success 200 {array} models.WrTradeOrderDetail
  480. // @Failure 500 {object} app.Response
  481. // @Router /WrTrade2/QueryWrTradeOrderDetail [get]
  482. // @Tags 仓单贸易v2
  483. func QueryWrTradeOrderDetail(c *gin.Context) {
  484. a := app.GinUtils{Gin: app.Gin{C: c}}
  485. m := models.WrTradeOrderDetail{}
  486. a.DoBindReq(&m)
  487. a.DoGetDataByPage(&m)
  488. }
  489. // QueryWrAverageTradePrice
  490. // @Summary 查询成交价(历史走势)
  491. // @Produce json
  492. // @Security ApiKeyAuth
  493. // @Param page query int false "页码"
  494. // @Param pagesize query int false "每页条数"
  495. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  496. // @Param wrfactortypeid query int true "仓单要素id"
  497. // @Success 200 {array} models.WrAverageTradePrice
  498. // @Failure 500 {object} app.Response
  499. // @Router /WrTrade2/QueryWrAverageTradePrice [get]
  500. // @Tags 仓单贸易v2
  501. func QueryWrAverageTradePrice(c *gin.Context) {
  502. a := app.GinUtils{Gin: app.Gin{C: c}}
  503. m := models.WrAverageTradePrice{}
  504. a.DoBindReq(&m)
  505. a.DoGetDataByPage(&m)
  506. }
  507. // QueryWrDeliveryAvalidHoldLB
  508. // @Summary 查询合约交收可点选仓单
  509. // @Produce json
  510. // @Security ApiKeyAuth
  511. // @Param accountid query int true "资金账号"
  512. // @Param goodsid query int true "商品id"
  513. // @Success 200 {array} models.WrDeliveryAvalidHoldLB
  514. // @Failure 500 {object} app.Response
  515. // @Router /WrTrade2/QueryWrDeliveryAvalidHoldLB [get]
  516. // @Tags 仓单贸易v2
  517. func QueryWrDeliveryAvalidHoldLB(c *gin.Context) {
  518. a := app.GinUtils{Gin: app.Gin{C: c}}
  519. m := models.WrDeliveryAvalidHoldLB{}
  520. a.DoBindReq(&m)
  521. a.DoGetDataI(&m)
  522. }
  523. // QueryWrUserFriend
  524. // @Summary 查询我的朋友
  525. // @Produce json
  526. // @Security ApiKeyAuth
  527. // @Param userid query int true "用户id"
  528. // @Param newuserid query int false "新朋友userid, 如果填写了此项则查找新朋友"
  529. // @Success 200 {array} models.WrUserFriend
  530. // @Failure 500 {object} app.Response
  531. // @Router /WrTrade2/QueryWrUserFriend [get]
  532. // @Tags 仓单贸易v2
  533. func QueryWrUserFriend(c *gin.Context) {
  534. a := app.GinUtils{Gin: app.Gin{C: c}}
  535. m := models.WrUserFriend{}
  536. a.DoBindReq(&m)
  537. a.DoGetDataI(&m)
  538. }
  539. // QueryWrFriendApply
  540. // @Summary 查询好友申请记录
  541. // @Produce json
  542. // @Security ApiKeyAuth
  543. // @Param userid query int true "用户id"
  544. // @Success 200 {array} models.WrFriendApply
  545. // @Failure 500 {object} app.Response
  546. // @Router /WrTrade2/QueryWrFriendApply [get]
  547. // @Tags 仓单贸易v2
  548. func QueryWrFriendApply(c *gin.Context) {
  549. a := app.GinUtils{Gin: app.Gin{C: c}}
  550. m := models.WrFriendApply{}
  551. a.DoBindReq(&m)
  552. a.DoGetDataI(&m)
  553. }
  554. // QueryPermancePlanTmp
  555. // @Summary 查询履约模板
  556. // @Description 返回指定用户的模板和公共模板(用户id为空)
  557. // @Description 注意:天津麦顿客户 填写marketid参数,其它参数不用填;其它客户不用填marketid字段
  558. // @Produce json
  559. // @Security ApiKeyAuth
  560. // @Param userid query int false "用户id"
  561. // @Param tmptype query string false "模板类型(逗号隔开), 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式--失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式"
  562. // @Param includepub query int false "是否包含公共模板(用户id为空的) 1-包含"
  563. // @Param marketid query int false "市场id(天津麦顿指定此参数,其它不用)"
  564. // @Success 200 {array} models.WrPerformanceTemplateEx
  565. // @Failure 500 {object} app.Response
  566. // @Router /WrTrade2/QueryPermancePlanTmp [get]
  567. // @Tags 仓单贸易v2
  568. func QueryPermancePlanTmp(c *gin.Context) {
  569. a := app.GinUtils{Gin: app.Gin{C: c}}
  570. m := models.WrPerformanceTemplateEx{}
  571. m.MARKETID = -1
  572. a.DoBindReq(&m)
  573. a.DoGetDataI(&m)
  574. }
  575. // QueryWrTradeBargainApply
  576. // @Summary 查询议价单
  577. // @Description 1.页面 挂单/议价单, 只需传单号就行 <br>2.页面 议价->我的议价 参数 userid=登录userid <br>3.页面 议价->对方议价 填写matchuserid=登录用户id
  578. // @Produce json
  579. // @Security ApiKeyAuth
  580. // @Param userid query int false "议价人id(摘牌方)"
  581. // @Param matchuserid query int false "挂牌方id(查对方议价时,填写此项)"
  582. // @Param wrtradeorderid query int false "关联委托单id"
  583. // @Param haswr query int true "0:仓单预售 1:仓单贸易"
  584. // @Param begindate query string false "开始交易日(yyyymmdd)"
  585. // @Param enddate query string false "结束交易日(yyyymmdd)"
  586. // @Success 200 {array} models.WRTradeBargainApply
  587. // @Failure 500 {object} app.Response
  588. // @Router /WrTrade2/QueryWrTradeBargainApply [get]
  589. // @Tags 仓单贸易v2
  590. func QueryWrTradeBargainApply(c *gin.Context) {
  591. a := app.GinUtils{Gin: app.Gin{C: c}}
  592. m := models.WRTradeBargainApply{}
  593. a.DoBindReq(&m)
  594. a.DoGetDataI(&m)
  595. }
  596. // QueryWrPerformanceStepType
  597. // @Summary 查询履约步骤枚举
  598. // @Produce json
  599. // @Security ApiKeyAuth
  600. // @Success 200 {array} models.WrPerformanceStepType
  601. // @Failure 500 {object} app.Response
  602. // @Router /WrTrade2/QueryWrPerformanceStepType [get]
  603. // @Tags 仓单贸易v2
  604. func QueryWrPerformanceStepType(c *gin.Context) {
  605. a := app.GinUtils{Gin: app.Gin{C: c}}
  606. m := models.WrPerformanceStepType{}
  607. a.DoBindReq(&m)
  608. a.DoGetDataI(&m)
  609. }
  610. // QueryWrUserReceiptInfo
  611. // @Summary 查询发票信息
  612. // @Produce json
  613. // @Security ApiKeyAuth
  614. // @Param userid query int false "用户id"
  615. // @Param receipttype query int false "发票类型 - 1:个人 2:企业"
  616. // @Success 200 {array} models.WrUserReceiptInfo
  617. // @Failure 500 {object} app.Response
  618. // @Router /WrTrade2/QueryWrUserReceiptInfo [get]
  619. // @Tags 仓单贸易v2
  620. func QueryWrUserReceiptInfo(c *gin.Context) {
  621. a := app.GinUtils{Gin: app.Gin{C: c}}
  622. m := models.WrUserReceiptInfo{}
  623. a.DoBindReq(&m)
  624. a.DoGetDataI(&m)
  625. }
  626. // QuerySiteColumnDetail
  627. // @Summary 查询资讯
  628. // @Produce json
  629. // @Security ApiKeyAuth
  630. // @Param page query int false "页码"
  631. // @Param pagesize query int false "每页条数"
  632. // @Param columnid query int false "所属栏目id"
  633. // @Success 200 {array} models.WrSiteColumnDetail
  634. // @Failure 500 {object} app.Response
  635. // @Router /WrTrade2/QuerySiteColumnDetail [get]
  636. // @Tags 仓单贸易v2
  637. func QuerySiteColumnDetail(c *gin.Context) {
  638. a := app.GinUtils{Gin: app.Gin{C: c}}
  639. m := models.WrSiteColumnDetail{COLUMNID: -9999999999}
  640. a.DoBindReq(&m)
  641. a.DoGetDataByPage(&m)
  642. }
  643. // QueryDeliveryGoodsSection
  644. // @Summary 查询板块(分类)
  645. // @Produce json
  646. // @Security ApiKeyAuth
  647. // @Success 200 {array} models.WrDeliveryGoodsSection
  648. // @Failure 500 {object} app.Response
  649. // @Router /WrTrade2/QueryDeliveryGoodsSection [get]
  650. // @Tags 仓单贸易v2
  651. func QueryDeliveryGoodsSection(c *gin.Context) {
  652. a := app.GinUtils{Gin: app.Gin{C: c}}
  653. m := models.WrDeliveryGoodsSection{}
  654. a.DoBindReq(&m)
  655. a.DoGetDataI(&m)
  656. }
  657. // QuerySpotGroupTradeSum
  658. // @Summary 查询指数
  659. // @Produce json
  660. // @Security ApiKeyAuth
  661. // @Success 200 {array} models.WrSpotGroupTradeSumEx
  662. // @Failure 500 {object} app.Response
  663. // @Router /WrTrade2/QuerySpotGroupTradeSum [get]
  664. // @Tags 仓单贸易v2
  665. func QuerySpotGroupTradeSum(c *gin.Context) {
  666. a := app.GinUtils{Gin: app.Gin{C: c}}
  667. m := models.WrSpotGroupTradeSumEx{}
  668. a.DoBindReq(&m)
  669. a.DoGetDataI(&m)
  670. }
  671. // QuerySpotGroupTradeSumDetail
  672. // @Summary 查询指数详细(价格走势图)
  673. // @Description 查询的结果将会按日期 从小到大 排序
  674. // @Produce json
  675. // @Security ApiKeyAuth
  676. // @param deliverygoodsid query int true "现货商品id"
  677. // @param lastnum query int false "查询最新多少条记录(如不填写此项, 默认查30条)"
  678. // @Success 200 {array} models.WrSpotGroupTradeSumDetail
  679. // @Failure 500 {object} app.Response
  680. // @Router /WrTrade2/QuerySpotGroupTradeSumDetail [get]
  681. // @Tags 仓单贸易v2
  682. func QuerySpotGroupTradeSumDetail(c *gin.Context) {
  683. a := app.GinUtils{Gin: app.Gin{C: c}}
  684. m := models.WrSpotGroupTradeSumDetail{}
  685. a.DoBindReq(&m)
  686. a.DoGetDataI(&m)
  687. }
  688. // QueryWrPreSaleInfo
  689. // @Summary 查询新品发布
  690. // @Produce json
  691. // @Security ApiKeyAuth
  692. // @param marketid query int false "市场id"
  693. // @param presalestatus query string false "预售状态(逗号隔开,如1,2,3) 1:未开始 2:进行中 3:已结束 4:已关闭"
  694. // @param lotteryflag query int false "摇号标识 - 0:未摇号 1:已摇号"
  695. // @param lastnum query int false "最近多少条记录(按创建时间倒序)"
  696. // @Success 200 {array} models.WrPreSaleInfo
  697. // @Failure 500 {object} app.Response
  698. // @Router /WrTrade2/QueryWrPreSaleInfo [get]
  699. // @Tags 仓单贸易v2
  700. func QueryWrPreSaleInfo(c *gin.Context) {
  701. a := app.GinUtils{Gin: app.Gin{C: c}}
  702. m := models.WrPreSaleInfo{LOTTERYFLAG: -1}
  703. a.DoBindReq(&m)
  704. a.DoGetDataI(&m)
  705. }
  706. // QueryWrReckonSpotGoodsTradeSum
  707. // @Summary 查询价格走势
  708. // @Produce json
  709. // @Security ApiKeyAuth
  710. // @param marketid query int true "市场id"
  711. // @param wrstandardid query int true "现货商品id"
  712. // @Param begindate query string false "开始交易日(yyyymmdd)"
  713. // @Param enddate query string false "结束交易日(yyyymmdd)"
  714. // @param lastnum query int false "最近多少条记录(按交易日倒序)"
  715. // @param istoday query bool false "是否今日"
  716. // @Success 200 {array} models.WrReckonSpotGoodsTradeSum
  717. // @Failure 500 {object} app.Response
  718. // @Router /WrTrade2/QueryWrReckonSpotGoodsTradeSum [get]
  719. // @Tags 仓单贸易v2
  720. func QueryWrReckonSpotGoodsTradeSum(c *gin.Context) {
  721. a := app.GinUtils{Gin: app.Gin{C: c}}
  722. m := models.WrReckonSpotGoodsTradeSum{}
  723. a.DoBindReq(&m)
  724. a.DoGetDataI(&m)
  725. }
  726. // QueryWrSearchUser
  727. // @Summary 查询用户
  728. // @Produce json
  729. // @Security ApiKeyAuth
  730. // @param username query string true "用户名称(模糊匹配)"
  731. // @Success 200 {array} models.WrSearchUser
  732. // @Failure 500 {object} app.Response
  733. // @Router /WrTrade2/QueryWrSearchUser [get]
  734. // @Tags 仓单贸易v2
  735. func QueryWrSearchUser(c *gin.Context) {
  736. a := app.GinUtils{Gin: app.Gin{C: c}}
  737. m := models.WrSearchUser{}
  738. a.DoBindReq(&m)
  739. a.DoGetDataI(&m)
  740. }
  741. // QueryWrDraftUserInfo
  742. // @Summary 查询实名认证信息
  743. // @Produce json
  744. // @Security ApiKeyAuth
  745. // @Param userid query int true "用户ID"
  746. // @Param userstatus query int false "用户状态 1:正常 2:注销"
  747. // @Success 200 {array} models.WrDraftUserInfo
  748. // @Failure 500 {object} app.Response
  749. // @Router /WrTrade2/QueryWrDraftUserInfo [get]
  750. // @Tags 仓单贸易v2
  751. func QueryWrDraftUserInfo(c *gin.Context) {
  752. a := app.GinUtils{Gin: app.Gin{C: c}}
  753. m := models.WrDraftUserInfo{}
  754. a.DoBindReq(&m)
  755. a.DoGetDataI(&m)
  756. }
  757. // QueryWrBrandAndYears
  758. // @Summary 查询品牌和年份
  759. // @Produce json
  760. // @Security ApiKeyAuth
  761. // @Success 200 {array} models.WrBrandAndYears
  762. // @Failure 500 {object} app.Response
  763. // @Router /WrTrade2/QueryWrBrandAndYears [get]
  764. // @Tags 仓单贸易v2
  765. func QueryWrBrandAndYears(c *gin.Context) {
  766. a := app.GinUtils{Gin: app.Gin{C: c}}
  767. m := models.WrBrandAndYears{}
  768. a.DoBindReq(&m)
  769. a.DoGetDataI(&m)
  770. }
  771. // QueryWrClientAdSpaceConfig
  772. // @Summary 查询固定广告配置
  773. // @Produce json
  774. // @Security ApiKeyAuth
  775. // @Success 200 {array} models.WrClientAdSpaceConfig
  776. // @Failure 500 {object} app.Response
  777. // @Router /WrTrade2/QueryWrClientAdSpaceConfig [get]
  778. // @Tags 仓单贸易v2
  779. func QueryWrClientAdSpaceConfig(c *gin.Context) {
  780. a := app.GinUtils{Gin: app.Gin{C: c}}
  781. m := models.WrClientAdSpaceConfig{}
  782. a.DoBindReq(&m)
  783. a.DoGetDataI(&m)
  784. }
  785. // QueryXhcpSellBackApply
  786. // @Summary 查询我的回收申请(新会陈皮)
  787. // @Produce json
  788. // @Security ApiKeyAuth
  789. // @Param userid query int true "用户ID"
  790. // @Success 200 {array} models.Xhcpsellbackapply
  791. // @Failure 500 {object} app.Response
  792. // @Router /WrTrade2/QueryXhcpSellBackApply [get]
  793. // @Tags 仓单贸易v2
  794. func QueryXhcpSellBackApply(c *gin.Context) {
  795. a := app.GinUtils{Gin: app.Gin{C: c}}
  796. m := models.Xhcpsellbackapply{}
  797. a.DoBindReq(&m)
  798. a.DoGetDataI(&m)
  799. }
  800. // InsertXhcpSellBackApply
  801. // @Summary 新增回收申请(新会陈皮)
  802. // @Produce json
  803. // @Security ApiKeyAuth
  804. // @Param jsonBody body models.XhcpSellBackApplyEx true "回收申请"
  805. // @Success 200 {object} app.Response
  806. // @Failure 500 {object} app.Response
  807. // @Router /WrTrade2/InsertXhcpSellBackApply [post]
  808. // @Tags 仓单贸易v2
  809. func InsertXhcpSellBackApply(c *gin.Context) {
  810. a := app.GinUtils{Gin: app.Gin{C: c}}
  811. m := models.XhcpSellBackApplyEx{}
  812. a.DoBindReq(&m)
  813. if err := m.Insert(); err == nil {
  814. a.Response(http.StatusOK, e.SUCCESS, "OK")
  815. } else {
  816. logger.GetLogger().Errorf("insert fail, %v", err)
  817. a.Response(http.StatusBadRequest, e.ERROR_OPERATION_FAILED, nil)
  818. }
  819. }
  820. // QueryWrTradeQuote
  821. // @Summary 查询仓单贸易成交行情
  822. // @Produce json
  823. // @Security ApiKeyAuth
  824. // @param wrstandardid query int true "现货商品id"
  825. // @Param begindate query string true "开始日期(yyyymmdd)"
  826. // @Param enddate query string true "结束日期(yyyymmdd)"
  827. // @param marketid query int false "市场id"
  828. // @Success 200 {array} models.Wrtradetradequote
  829. // @Failure 500 {object} app.Response
  830. // @Router /WrTrade2/QueryWrTradeQuote [get]
  831. // @Tags 仓单贸易v2
  832. func QueryWrTradeQuote(c *gin.Context) {
  833. a := app.GinUtils{Gin: app.Gin{C: c}}
  834. m := models.Wrtradetradequote{}
  835. a.DoBindReq(&m)
  836. a.DoGetDataI(&m)
  837. }