tradeService.go 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. package guangzuan
  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. // QueryGZCJJCOrder
  11. // @Summary 查询出境检测单据
  12. // @Produce json
  13. // @Security ApiKeyAuth
  14. // @Security LoginID
  15. // @Security Group
  16. // @Param userid query int true "用户ID"
  17. // @Param page query int false "页码"
  18. // @Param pagesize query int false "每页条数"
  19. // @Success 200 {array} models.GzcjjcorderM
  20. // @Failure 500 {object} app.Response
  21. // @Router /Guangzuan/QueryGZCJJCOrder [get]
  22. // @Tags 广钻
  23. func QueryGZCJJCOrder(c *gin.Context) {
  24. a := app.GinUtils{Gin: app.Gin{C: c}}
  25. m := models.GzcjjcorderM{}
  26. a.DoBindReq(&m)
  27. a.DoGetDataByPage(&m)
  28. }
  29. // QueryGZCJJCOrderDetail
  30. // @Summary 查询出境检测单据明细(批次信息)
  31. // @Produce json
  32. // @Security ApiKeyAuth
  33. // @Security LoginID
  34. // @Security Group
  35. // @Param userid query int true "用户ID"
  36. // @Param orderid query int false "单据ID"
  37. // @Param page query int false "页码"
  38. // @Param pagesize query int false "每页条数"
  39. // @Success 200 {array} models.GzcjjcorderdetailM
  40. // @Failure 500 {object} app.Response
  41. // @Router /Guangzuan/QueryGZCJJCOrderDetail [get]
  42. // @Tags 广钻
  43. func QueryGZCJJCOrderDetail(c *gin.Context) {
  44. a := app.GinUtils{Gin: app.Gin{C: c}}
  45. m := models.GzcjjcorderdetailM{}
  46. a.DoBindReq(&m)
  47. a.DoGetDataByPage(&m)
  48. }
  49. // QueryGZCJBSOrderFile
  50. // @Summary 出境保税单据文件
  51. // @Produce json
  52. // @Security ApiKeyAuth
  53. // @Security LoginID
  54. // @Security Group
  55. // @Param orderid query int true "单据ID"
  56. // @Param page query int false "页码"
  57. // @Param pagesize query int false "每页条数"
  58. // @Success 200 {array} models.GzcjbsorderfileM
  59. // @Failure 500 {object} app.Response
  60. // @Router /Guangzuan/QueryGZCJBSOrderFile [get]
  61. // @Tags 广钻
  62. func QueryGZCJBSOrderFile(c *gin.Context) {
  63. a := app.GinUtils{Gin: app.Gin{C: c}}
  64. m := models.GzcjbsorderfileM{}
  65. a.DoBindReq(&m)
  66. a.DoGetDataByPage(&m)
  67. }
  68. // QueryGZBSFWOrder
  69. // @Summary 查询保税服务单据
  70. // @Produce json
  71. // @Security ApiKeyAuth
  72. // @Security LoginID
  73. // @Security Group
  74. // @Param userid query int true "用户ID"
  75. // @Param executestatus query int false "执行状态 - 1:未生效 2:进行中 3:已结束"
  76. // @Param page query int false "页码"
  77. // @Param pagesize query int false "每页条数"
  78. // @Success 200 {array} models.GzbsfworderM
  79. // @Failure 500 {object} app.Response
  80. // @Router /Guangzuan/QueryGZBSFWOrder [get]
  81. // @Tags 广钻
  82. func QueryGZBSFWOrder(c *gin.Context) {
  83. a := app.GinUtils{Gin: app.Gin{C: c}}
  84. m := models.GzbsfworderM{}
  85. a.DoBindReq(&m)
  86. a.DoGetDataByPage(&m)
  87. }
  88. // QueryGZBSFWOrderDetail
  89. // @Summary 查询保税服务单据明细
  90. // @Produce json
  91. // @Security ApiKeyAuth
  92. // @Security LoginID
  93. // @Security Group
  94. // @Param userid query int true "用户ID"
  95. // @Param orderid query int false "单据ID"
  96. // @Param page query int false "页码"
  97. // @Param pagesize query int false "每页条数"
  98. // @Success 200 {array} models.GzbsfworderdetailM
  99. // @Failure 500 {object} app.Response
  100. // @Router /Guangzuan/QueryGZBSFWOrderDetail [get]
  101. // @Tags 广钻
  102. func QueryGZBSFWOrderDetail(c *gin.Context) {
  103. a := app.GinUtils{Gin: app.Gin{C: c}}
  104. m := models.GzbsfworderdetailM{}
  105. a.DoBindReq(&m)
  106. a.DoGetDataByPage(&m)
  107. }
  108. // GZBSFWOrderOperate
  109. // @Summary 保税服务单据操作信息
  110. // @Produce json
  111. // @Security ApiKeyAuth
  112. // @Security LoginID
  113. // @Security Group
  114. // @Param orderid query int true "单据ID"
  115. // @Success 200 {array} models.Gzbsfworderoperate
  116. // @Failure 500 {object} app.Response
  117. // @Router /Guangzuan/GZBSFWOrderOperate [get]
  118. // @Tags 广钻
  119. func GZBSFWOrderOperate(c *gin.Context) {
  120. a := app.GinUtils{Gin: app.Gin{C: c}}
  121. m := models.Gzbsfworderoperate{}
  122. if err := a.C.ShouldBind(&m); err != nil {
  123. a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  124. return
  125. }
  126. if d, err := m.GetDataByOrderIDAndStatus(); err == nil {
  127. a.Gin.Response(http.StatusOK, e.SUCCESS, d)
  128. } else {
  129. logger.GetLogger().Errorf("query fail, %v", err)
  130. a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  131. }
  132. }