order.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package sbyj
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. "mtp2_if/models"
  7. "net/http"
  8. "github.com/gin-gonic/gin"
  9. )
  10. // GetMyOrders 获取我的订单列表
  11. // @Summary 获取我的订单列表
  12. // @Produce json
  13. // @Security ApiKeyAuth
  14. // @Param userId query int true "用户ID"
  15. // @Param goodsId query int false "商品ID"
  16. // @Success 200 {array} models.RedisTradeHolderDetailEx
  17. // @Failure 500 {object} app.Response
  18. // @Router /sbyj/GetMyOrders [get]
  19. // @Tags 水贝亿爵
  20. func GetMyOrders(c *gin.Context) {
  21. appG := app.Gin{C: c}
  22. // 获取请求参数
  23. var req GetMyOrdersReq
  24. if err := appG.C.ShouldBindQuery(&req); err != nil {
  25. logger.GetLogger().Errorf("GetMyOrders failed: %s", err.Error())
  26. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  27. return
  28. }
  29. // 获取数据
  30. d := models.RedisTradeHolderDetailEx{}
  31. rsp, err := d.GetDataEx(req.UserId, req.GoodsId)
  32. if err != nil {
  33. // 查询失败
  34. logger.GetLogger().Errorf("GetMyOrders failed: %s", err.Error())
  35. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  36. return
  37. }
  38. // 查询成功返回
  39. appG.Response(http.StatusOK, e.SUCCESS, rsp)
  40. }
  41. // QueryMyTradegoodsdeliveryoffline 查询我的交收
  42. // @Summary 查询我的交收
  43. // @Produce json
  44. // @Security ApiKeyAuth
  45. // @Param userid query int true "用户ID"
  46. // @Param status query string false "格式:1,2,3 交收单状态2(52模式使用) - 1:待审核 2:待确认 3:待付款 4:付款中 5:已完成付款 6:处理中 20:交收完成 21:审核拒绝 22:确认过期 23:付款过期 24:财务撤销 -- 枚举deliveryStatus"
  47. // @Param page query int false "页码"
  48. // @Param pagesize query int false "每页条数"
  49. // @Success 200 {array} models.MyTradegoodsdeliveryoffline
  50. // @Failure 500 {object} app.Response
  51. // @Router /sbyj/QueryMyTradegoodsdeliveryoffline [get]
  52. // @Tags 水贝亿爵
  53. func QueryMyTradegoodsdeliveryoffline(c *gin.Context) {
  54. a := app.GinUtils{Gin: app.Gin{C: c}}
  55. m := models.MyTradegoodsdeliveryoffline{}
  56. a.DoBindReq(&m)
  57. a.DoGetDataByPage(&m)
  58. }
  59. // QueryMyDeliveryofflinedetail 查询我的交收-订单明细
  60. // @Summary 查询我的交收-订单明细
  61. // @Produce json
  62. // @Security ApiKeyAuth
  63. // @Param userid query int true "用户ID"
  64. // @Param deliveryorderid query string true "交收单号(905+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)"
  65. // @Param page query int false "页码"
  66. // @Param pagesize query int false "每页条数"
  67. // @Success 200 {array} models.MyDeliveryofflinedetail
  68. // @Failure 500 {object} app.Response
  69. // @Router /sbyj/QueryMyDeliveryofflinedetail [get]
  70. // @Tags 水贝亿爵
  71. func QueryMyDeliveryofflinedetail(c *gin.Context) {
  72. a := app.GinUtils{Gin: app.Gin{C: c}}
  73. m := models.MyDeliveryofflinedetail{}
  74. a.DoBindReq(&m)
  75. a.DoGetDataByPage(&m)
  76. }
  77. // QueryMyDeliveryofflineoperatelog 查询我的交收-操作明细
  78. // @Summary 查询我的交收-操作明细
  79. // @Produce json
  80. // @Security ApiKeyAuth
  81. // @Param deliveryorderid query string true "交收单号(905+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)"
  82. // @Param operatetype query int false "操作类型 - 1:交收流程 2:付款流水"
  83. // @Param deliverypaymode query int false "付款方式 - 1:线上支付2:线下支付 - 枚举deliveryPayMode"
  84. // @Param confirmstatus query int false "确认状态 - 1:未确认 2:已确认 - 枚举confirmStatus"
  85. // @Param page query int false "页码"
  86. // @Param pagesize query int false "每页条数"
  87. // @Success 200 {array} models.MyDeliveryofflineoperatelog
  88. // @Failure 500 {object} app.Response
  89. // @Router /sbyj/QueryMyDeliveryofflineoperatelog [get]
  90. // @Tags 水贝亿爵
  91. func QueryMyDeliveryofflineoperatelog(c *gin.Context) {
  92. a := app.GinUtils{Gin: app.Gin{C: c}}
  93. m := models.MyDeliveryofflineoperatelog{}
  94. a.DoBindReq(&m)
  95. a.DoGetDataByPage(&m)
  96. }
  97. // QueryTradeHolderDetailEx 查询我的订单
  98. // @Summary 查询我的订单
  99. // @Produce json
  100. // @Security ApiKeyAuth
  101. // @Param accountid query int true "资金账户"
  102. // @Param tradedate query string false "交易日(yyyyMMdd)"
  103. // @Param goodsid query int false "商品ID"
  104. // @Param page query int false "页码"
  105. // @Param pagesize query int false "每页条数"
  106. // @Success 200 {array} models.Tradeholderdetailex
  107. // @Failure 500 {object} app.Response
  108. // @Router /sbyj/QueryTradeHolderDetailEx [get]
  109. // @Tags 水贝亿爵
  110. func QueryTradeHolderDetailEx(c *gin.Context) {
  111. a := app.GinUtils{Gin: app.Gin{C: c}}
  112. m := models.Tradeholderdetailex{}
  113. a.DoBindReq(&m)
  114. a.DoGetDataByPage(&m)
  115. }