Bladeren bron

/Order/QueryTradeDetail 增加增量成交单号入参

zhou.xiaoning 2 jaren geleden
bovenliggende
commit
92a4247735
5 gewijzigde bestanden met toevoegingen van 41 en 20 verwijderingen
  1. 4 4
      controllers/guangzuan/tradeService.go
  2. 21 16
      controllers/order/order.go
  3. 6 0
      docs/docs.go
  4. 6 0
      docs/swagger.json
  5. 4 0
      docs/swagger.yaml

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 21 - 16
controllers/order/order.go

@@ -91,10 +91,10 @@ type QueryTradePositionRsp struct {
 // @Summary  持仓汇总查询(合约市场)
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    accountID query    string true  "资金账户 - 格式:1,2,3"
-// @Param    tradeMode query    string false "交易模式 - 格式:1,2,3"
+// @Param    accountID  query    string true  "资金账户 - 格式:1,2,3"
+// @Param    tradeMode  query    string false "交易模式 - 格式:1,2,3"
 // @Success  200       {object} QueryTradePositionRsp
-// @Failure  500       {object} app.Response
+// @Failure  500        {object} app.Response
 // @Router   /Order/QueryTradePosition [get]
 // @Tags     通用单据
 // 参考通用查询:SearchTradePositionDetail
@@ -534,13 +534,14 @@ func QueryHisTradeOrderDetail(c *gin.Context) {
 
 // QueryTradeDetailReq 成交单查询请求参数
 type QueryTradeDetailReq struct {
-	AccountID string `form:"accountID" binding:"required"`
-	TradeID   int    `form:"tradeID"`
-	OrderID   int    `form:"orderID"`
-	TradeMode string `form:"tradeMode"`
-	BuildType int    `form:"buildType"`
-	TradeType string `form:"tradeType"`
-	GoodsID   int    `form:"goodsID"`
+	AccountID  string `form:"accountID" binding:"required"`
+	TradeID    int    `form:"tradeID"`
+	OrderID    int    `form:"orderID"`
+	TradeMode  string `form:"tradeMode"`
+	BuildType  int    `form:"buildType"`
+	TradeType  string `form:"tradeType"`
+	GoodsID    int    `form:"goodsID"`
+	IncTradeID string `form:"incTradeID"`
 }
 
 // QueryTradeDetailRsp 成交单查询返回模型
@@ -578,13 +579,14 @@ func (r *QueryTradeDetailRsp) calc() {
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param    accountID query    string true  "资金账户 - 格式:1,2,3"
-// @Param    tradeID   query    int    false "成交单号"
-// @Param    orderID   query    int    false "委托单号"
+// @Param    tradeID    query    int    false "成交单号"
+// @Param    orderID    query    int    false "委托单号"
 // @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
+// @Param    buildType  query    int    false "委托单据类型"
+// @Param    tradeType  query    string false "成交类别 - 格式:1,2,3"
+// @Param    goodsID    query    int    false "商品ID"
+// @Param    incTradeID query    string false "增量成交单号,用于增量查询"
+// @Success  200        {object} QueryTradeDetailRsp
 // @Failure  500       {object} app.Response
 // @Router   /Order/QueryTradeDetail [get]
 // @Tags     通用单据
@@ -613,6 +615,9 @@ func QueryTradeDetail(c *gin.Context) {
 				TRADE_ORDERDETAIL.LISTINGSELECTTYPE, TRADE_PAYORDER.ADVANCERATIO, TRADE_PAYORDER.PAYAMOUNT, TRADE_PAYORDER.TRADECHARGE`).
 		Where(fmt.Sprintf("TRADE_TRADEDETAIL.ACCOUNTID in (%s)", req.AccountID)).
 		Desc("TRADE_TRADEDETAIL.TRADETIME")
+	if req.IncTradeID != "" {
+		s = s.And(fmt.Sprintf("TRADE_TRADEDETAIL.TRADEID > %v", req.IncTradeID))
+	}
 	if req.TradeID > 0 {
 		s = s.And("TRADE_TRADEDETAIL.TRADEID = ?", req.TradeID)
 	}

+ 6 - 0
docs/docs.go

@@ -13954,6 +13954,12 @@ const docTemplate = `{
                         "description": "商品ID",
                         "name": "goodsID",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "增量成交单号,用于增量查询",
+                        "name": "incTradeID",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 6 - 0
docs/swagger.json

@@ -13945,6 +13945,12 @@
                         "description": "商品ID",
                         "name": "goodsID",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "增量成交单号,用于增量查询",
+                        "name": "incTradeID",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 4 - 0
docs/swagger.yaml

@@ -37930,6 +37930,10 @@ paths:
         in: query
         name: goodsID
         type: integer
+      - description: 增量成交单号,用于增量查询
+        in: query
+        name: incTradeID
+        type: string
       produces:
       - application/json
       responses: