trade.go 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package guangzuan
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/models"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // QueryBuyOrder
  8. // @Summary 查询求购大厅委托单
  9. // @Produce json
  10. // @Security ApiKeyAuth
  11. // @Param page query int false "页码"
  12. // @Param pagesize query int false "每页条数"
  13. // @Param zsallproperties query string false "商品(查询字段-模糊查询)"
  14. // @Param zscategory query int false "钻石分类枚举ID"
  15. // @Param wrtradeorderid query int false "委托单号"
  16. // @Param buyusername query string false "买方(查询字段-模糊查询)"
  17. // @Success 200 {array} models.BuyOrder
  18. // @Failure 500 {object} app.Response
  19. // @Router /Guangzuan/QueryBuyOrder [get]
  20. // @Tags 广钻
  21. func QueryBuyOrder(c *gin.Context) {
  22. a := app.GinUtils{Gin: app.Gin{C: c}}
  23. m := models.BuyOrder{}
  24. a.DoBindReq(&m)
  25. a.DoGetDataByPage(&m)
  26. }
  27. // QuerySellOrder
  28. // @Summary 查询出售大厅委托单
  29. // @Produce json
  30. // @Security ApiKeyAuth
  31. // @Param page query int false "页码"
  32. // @Param pagesize query int false "每页条数"
  33. // @Param zsallproperties query string false "商品(查询字段-模糊查询)"
  34. // @Param zscategory query int false "钻石分类枚举ID"
  35. // @Param wrtradeorderid query int false "委托单号"
  36. // @Param buyusername query string false "卖方(查询字段-模糊查询)"
  37. // @Success 200 {array} models.SellOrder
  38. // @Failure 500 {object} app.Response
  39. // @Router /Guangzuan/QuerySellOrder [get]
  40. // @Tags 广钻
  41. func QuerySellOrder(c *gin.Context) {
  42. a := app.GinUtils{Gin: app.Gin{C: c}}
  43. m := models.SellOrder{}
  44. a.DoBindReq(&m)
  45. a.DoGetDataByPage(&m)
  46. }
  47. // QueryDiamond
  48. // @Summary 钻石搜索
  49. // @Produce json
  50. // @Security ApiKeyAuth
  51. // @Param data body models.SellOrderQueryReq true "钻石搜索入参"
  52. // @Success 200 {array} models.SellOrder
  53. // @Failure 500 {object} app.Response
  54. // @Router /Guangzuan/QueryDiamond [post]
  55. // @Tags 广钻
  56. func QueryDiamond(c *gin.Context) {
  57. a := app.GinUtils{Gin: app.Gin{C: c}}
  58. req := models.SellOrderQueryReq{}
  59. a.DoBindJsonReq(&req)
  60. m := models.SellOrder{
  61. IsQueryDiamond: true,
  62. ZSCATEGORY: req.ZSCATEGORY,
  63. ZSCURRENCYTYPE_S: req.ZSCURRENCYTYPE,
  64. WAREHOUSEID: req.WAREHOUSEID,
  65. WEIGHT: req.WEIGHT1,
  66. WEIGHT_END: req.WEIGHT2,
  67. WEIGHTAVG: req.WEIGHTAVG1,
  68. WEIGHTAVG_END: req.WEIGHTAVG2,
  69. ZSSHAPETYPE: req.ZSSHAPETYPE,
  70. ZSCOLORTYPE: req.ZSCOLORTYPE,
  71. ZSCLARITYTYPE: req.ZSCLARITYTYPE,
  72. ZSCUTTYPE: req.ZSCUTTYPE,
  73. ZSSYMMETRYTYPE: req.ZSSYMMETRYTYPE,
  74. ZSPOLISHTYPE: req.ZSPOLISHTYPE,
  75. ZSFLUORESCENCETYPE: req.ZSFLUORESCENCETYPE,
  76. ZSCERTTYPE: req.ZSCERTTYPE,
  77. ORIGIN: req.ORIGIN,
  78. ZSSTYLETYPE: req.ZSSTYLETYPE,
  79. ZSCZCOLOR1TYPE: req.ZSCZCOLOR1TYPE,
  80. PageEx: models.PageEx{Page: req.Page, PageSize: req.PageSize},
  81. }
  82. a.DoGetDataByPage(&m)
  83. }