Pārlūkot izejas kodu

Merge branch 'master' of 192.168.30.132:MTP2.0/MTP20_IF

zhou.xiaoning 4 gadi atpakaļ
vecāks
revīzija
0442b81041
6 mainītis faili ar 25 papildinājumiem un 1 dzēšanām
  1. 1 0
      controllers/ermcp3/qryErmcp3.go
  2. 6 0
      docs/docs.go
  3. 6 0
      docs/swagger.json
  4. 4 0
      docs/swagger.yaml
  5. 2 1
      models/ermcp3.go
  6. 6 0
      models/wrTrade2.go

+ 1 - 0
controllers/ermcp3/qryErmcp3.go

@@ -585,6 +585,7 @@ func QuerySCMiddleGoods(c *gin.Context) {
 // @Produce json
 // @Security ApiKeyAuth
 // @Param userid query int true "用户ID(填登录用户的userid)"
+// @Param linkstatus query int false "关联状态 1:成功 2:失败"
 // @Param tradeid query string false "期货订单号(模糊匹配)"
 // @Param contractno query string false "现货编号(模糊匹配)"
 // @Param taname query string false "期货账户(模糊匹配)"

+ 6 - 0
docs/docs.go

@@ -4891,6 +4891,12 @@ var doc = `{
                         "required": true
                     },
                     {
+                        "type": "integer",
+                        "description": "关联状态 1:成功 2:失败",
+                        "name": "linkstatus",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "期货订单号(模糊匹配)",
                         "name": "tradeid",

+ 6 - 0
docs/swagger.json

@@ -4875,6 +4875,12 @@
                         "required": true
                     },
                     {
+                        "type": "integer",
+                        "description": "关联状态 1:成功 2:失败",
+                        "name": "linkstatus",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "期货订单号(模糊匹配)",
                         "name": "tradeid",

+ 4 - 0
docs/swagger.yaml

@@ -21983,6 +21983,10 @@ paths:
         name: userid
         required: true
         type: integer
+      - description: 关联状态 1:成功 2:失败
+        in: query
+        name: linkstatus
+        type: integer
       - description: 期货订单号(模糊匹配)
         in: query
         name: tradeid

+ 2 - 1
models/ermcp3.go

@@ -3133,7 +3133,7 @@ func (r *Ermcp3SCMiddleGoods) GetDataEx() (interface{}, error) {
 type Ermcp3TradeLinkDetail struct {
 	LINKDETAILID   string  `json:"linkdetailid"  xorm:"LINKDETAILID" form:"linkdetailid"`       // 关联ID(614+Unix秒时间戳(10位)+xxxxxx)
 	SPOTCONTRACTID string  `json:"spotcontractid"  xorm:"SPOTCONTRACTID" form:"spotcontractid"` // 现货合同\套保计划ID [4,10,11 - 现货合同ID]  [9:套期保值(计划) - 套保计划ID]
-	LINKSTATUS     int32   `json:"linkstatus"  xorm:"LINKSTATUS"`                               // 关联状态 - 1:成功 2:失败
+	LINKSTATUS     int32   `json:"linkstatus"  xorm:"LINKSTATUS" form:"linkstatus"`             // 关联状态 - 1:成功 2:失败
 	RETCODE        int32   `json:"retcode"  xorm:"RETCODE"`                                     // 返回码
 	TRADEID        string  `json:"tradeid"  xorm:"TRADEID" form:"tradeid"`                      // 期货订单号 | 内部成交单ID
 	BUYORSELL      int32   `json:"buyorsell"  xorm:"BUYORSELL"`                                 // 方向 - 0:买 1:卖
@@ -3233,6 +3233,7 @@ select t.LINKSTATUS,
  where 1 = 1
 `
 	sqlId.JoinFormat(" and %v in (ta.relateduserid, ta.userid)", r.AREAUSERID)
+	sqlId.AndEx("t.linkstatus", r.LINKSTATUS, r.LINKSTATUS > 0)
 	sqlId.AndLike("t.TRADEID", r.TRADEID)
 	sqlId.AndLike("s.contractno", r.CONTRACTNO)
 	sqlId.AndLike("ta.accountname", r.TANAME)

+ 6 - 0
models/wrTrade2.go

@@ -3795,10 +3795,16 @@ func (r *WrSpotGroupTradeSum) calc() {
 
 	if r.LASTAVGPRICE < 1e-8 {
 		r.LASTAVGPRICE2 = "-"
+	} else {
+		r.LASTAVGPRICE2 = r.LASTAVGPRICE.string()
 	}
+
 	if r.TODAYAVGPRICE < 1e-8 {
 		r.TODAYAVGPRICE2 = "-"
+	} else {
+		r.TODAYAVGPRICE2 = r.TODAYAVGPRICE.string()
 	}
+
 	if r.TODAYAVGPRICE > 1e-8 && r.LASTAVGPRICE > 1e-8 {
 		r.LASTAVGPRICE2 = r.LASTAVGPRICE.string()
 		r.TODAYAVGPRICE2 = r.TODAYAVGPRICE.string()