Kaynağa Gözat

[新会陈皮]
查询可撤仓单挂单接口

zou.yingbin 3 yıl önce
ebeveyn
işleme
ed0a8908b4

+ 1 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -122,6 +122,7 @@ func QueryWrPosition(c *gin.Context) {
 // @Param userid query int true "用户id"
 // @Param marketid query int false "仓单贸易市场id"
 // @Param haswr query int true "0:仓单预售 1:仓单贸易"
+// @Param bcancel query int false "是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场"
 // @Param begindate query string false "开始交易日(yyyymmdd)"
 // @Param enddate query string false "结束交易日(yyyymmdd)"
 // @Success 200 {array} models.WrOrderDetail

+ 10 - 0
docs/docs.go

@@ -13372,6 +13372,12 @@ var doc = `{
                         "required": true
                     },
                     {
+                        "type": "integer",
+                        "description": "是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场",
+                        "name": "bcancel",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "开始交易日(yyyymmdd)",
                         "name": "begindate",
@@ -35421,6 +35427,10 @@ var doc = `{
                     "description": "挂牌金额 = 委托数量 * 固定价或升贴水",
                     "type": "number"
                 },
+                "bcancel": {
+                    "description": "是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场",
+                    "type": "integer"
+                },
                 "begindate": {
                     "description": "开始交易日(yyyymmdd)",
                     "type": "string"

+ 10 - 0
docs/swagger.json

@@ -13357,6 +13357,12 @@
                         "required": true
                     },
                     {
+                        "type": "integer",
+                        "description": "是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场",
+                        "name": "bcancel",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "开始交易日(yyyymmdd)",
                         "name": "begindate",
@@ -35406,6 +35412,10 @@
                     "description": "挂牌金额 = 委托数量 * 固定价或升贴水",
                     "type": "number"
                 },
+                "bcancel": {
+                    "description": "是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场",
+                    "type": "integer"
+                },
                 "begindate": {
                     "description": "开始交易日(yyyymmdd)",
                     "type": "string"

+ 7 - 0
docs/swagger.yaml

@@ -15735,6 +15735,9 @@ definitions:
       amount:
         description: 挂牌金额 = 委托数量 * 固定价或升贴水
         type: number
+      bcancel:
+        description: 是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场
+        type: integer
       begindate:
         description: 开始交易日(yyyymmdd)
         type: string
@@ -27920,6 +27923,10 @@ paths:
         name: haswr
         required: true
         type: integer
+      - description: 是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场
+        in: query
+        name: bcancel
+        type: integer
       - description: 开始交易日(yyyymmdd)
         in: query
         name: begindate

+ 7 - 0
models/wrTrade2.go

@@ -668,6 +668,7 @@ type WrOrderDetail struct {
 
 	BEGINDATE string `json:"begindate" form:"begindate"` // 开始交易日(yyyymmdd)
 	ENDDATE   string `json:"enddate" form:"enddate"`     // 结束交易日(yyyymmdd)
+	BCancel   int32  `json:"bcancel" form:"bcancel"`     // 是否仅查可撤单据 1:可撤  注:此参数仅对当前记录有效, 且不含47模式市场
 }
 
 func (r *WrOrderDetail) calc() {
@@ -789,6 +790,12 @@ select t.HASWR,
 	sqlId.And("t.USERID", r.USERID)
 	sqlId.And("t.haswr", r.HASWR)
 	sqlId.AndEx("t.marketid", r.MARKETID, r.MARKETID > 0)
+
+	if r.BCancel == 1 {
+		// 只查委托状态=3 委托成功的单, 且不含47模式的
+		sqlId.Join(" and t.WRTRADEORDERSTATUS=3 and t.marketid not in(select marketid from market where trademode = 47)")
+	}
+
 	sqlId.Join(" order by t.ORDERTIME desc")
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()