Jelajahi Sumber

通用单据成交单查询加goodsid过滤

zou.yingbin 4 tahun lalu
induk
melakukan
36d4c99d1c
4 mengubah file dengan 42 tambahan dan 0 penghapusan
  1. 10 0
      controllers/order/order.go
  2. 12 0
      docs/docs.go
  3. 12 0
      docs/swagger.json
  4. 8 0
      docs/swagger.yaml

+ 10 - 0
controllers/order/order.go

@@ -381,6 +381,7 @@ type QueryTradeDetailReq struct {
 	TradeMode string `form:"tradeMode"`
 	BuildType int    `form:"buildType"`
 	TradeType string `form:"tradeType"`
+	GoodsID   int    `form:"goodsID"`
 }
 
 // QueryTradeDetailRsp 成交单查询返回模型
@@ -406,6 +407,7 @@ type QueryTradeDetailRsp struct {
 // @Param tradeMode query string false "交易模式 - 格式:1,2,3"
 // @Param buildType query int false "委托单据类型"
 // @Param tradeType query string false "成交类别 - 格式:1,2,3"
+// @Param goodsID query int false "商品ID"
 // @Success 200 {object} QueryTradeDetailRsp
 // @Failure 500 {object} app.Response
 // @Router /Order/QueryTradeDetail [get]
@@ -440,6 +442,9 @@ func QueryTradeDetail(c *gin.Context) {
 	if req.OrderID > 0 {
 		s = s.And("TRADE_TRADEDETAIL.ORDERID = ?", req.OrderID)
 	}
+	if req.GoodsID > 0 {
+		s = s.And("TRADE_TRADEDETAIL.GOODSID = ?", req.GoodsID)
+	}
 	if len(req.TradeMode) > 0 {
 		s = s.And(fmt.Sprintf("MARKET.TRADEMODE in (%s)", req.TradeMode))
 	}
@@ -466,6 +471,7 @@ type QueryHisTradeDetailReq struct {
 	AccountID string `form:"accountID" binding:"required"`
 	TradeID   int    `form:"tradeID"`
 	OrderID   int    `form:"orderID"`
+	GoodsID   int    `form:"goodsID"`
 	TradeMode string `form:"tradeMode"`
 	BuildType int    `form:"buildType"`
 	TradeType string `form:"tradeType"`
@@ -493,6 +499,7 @@ type QueryHisTradeDetailRsp struct {
 // @Param accountID query string true "资金账户 - 格式:1,2,3"
 // @Param tradeID query int false "成交单号"
 // @Param orderID query int false "委托单号"
+// @Param goodsID query int false "商品ID"
 // @Param tradeMode query string false "交易模式 - 格式:1,2,3"
 // @Param buildType query int false "委托单据类型"
 // @Param tradeType query string false "成交类别 - 格式:1,2,3"
@@ -532,6 +539,9 @@ func QueryHisTradeDetail(c *gin.Context) {
 	if req.OrderID > 0 {
 		s = s.And("HIS_TRADE_TRADEDETAIL.ORDERID = ?", req.OrderID)
 	}
+	if req.GoodsID > 0 {
+		s = s.And("TRADE_TRADEDETAIL.GOODSID = ?", req.GoodsID)
+	}
 	if len(req.TradeMode) > 0 {
 		s = s.And(fmt.Sprintf("MARKET.TRADEMODE in (%s)", req.TradeMode))
 	}

+ 12 - 0
docs/docs.go

@@ -6750,6 +6750,12 @@ var doc = `{
                         "in": "query"
                     },
                     {
+                        "type": "integer",
+                        "description": "商品ID",
+                        "name": "goodsID",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "交易模式 - 格式:1,2,3",
                         "name": "tradeMode",
@@ -6916,6 +6922,12 @@ var doc = `{
                         "description": "成交类别 - 格式:1,2,3",
                         "name": "tradeType",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品ID",
+                        "name": "goodsID",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 12 - 0
docs/swagger.json

@@ -6734,6 +6734,12 @@
                         "in": "query"
                     },
                     {
+                        "type": "integer",
+                        "description": "商品ID",
+                        "name": "goodsID",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "交易模式 - 格式:1,2,3",
                         "name": "tradeMode",
@@ -6900,6 +6906,12 @@
                         "description": "成交类别 - 格式:1,2,3",
                         "name": "tradeType",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品ID",
+                        "name": "goodsID",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 8 - 0
docs/swagger.yaml

@@ -17679,6 +17679,10 @@ paths:
         in: query
         name: orderID
         type: integer
+      - description: 商品ID
+        in: query
+        name: goodsID
+        type: integer
       - description: 交易模式 - 格式:1,2,3
         in: query
         name: tradeMode
@@ -17787,6 +17791,10 @@ paths:
         in: query
         name: tradeType
         type: string
+      - description: 商品ID
+        in: query
+        name: goodsID
+        type: integer
       produces:
       - application/json
       responses: