zhou.xiaoning %!s(int64=3) %!d(string=hai) anos
pai
achega
47c11ca189
Modificáronse 2 ficheiros con 7 adicións e 7 borrados
  1. 1 1
      controllers/ermcp8/qryErmcp8.go
  2. 6 6
      models/ermcp8.go

+ 1 - 1
controllers/ermcp8/qryErmcp8.go

@@ -108,7 +108,7 @@ func QueryERMCPPatradeLinkDetail(c *gin.Context) {
 // @Tags 企业风险管理v8
 func QueryInternalUncorrelatedTradeDetail(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
-	m := models.InternalUncorrelatedTradeDetail{}
+	m := models.InternalUncorrelatedTradeDetail{BUYORSELL: -1}
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }

+ 6 - 6
models/ermcp8.go

@@ -585,11 +585,11 @@ type InternalUncorrelatedTradeDetail struct {
 	ACCOUNTNAME string    `json:"accountname" xorm:"ACCOUNTNAME" form:"accountname"` // 套期主体
 	ENABLEQTY   float64   `json:"enableqty" xorm:"ENABLEQTY"`                        // 项目可关联手数 = 成交手数 - 关联数量
 
-	USERID    int64  `form:"userid" binding:"required"`  // 用户编号
-	BEGINDATE string `json:"-" form:"begindate"`         // 起始日期, 格式:yyyymmdd
-	ENDDATE   string `json:"-" form:"enddate"`           // 终止日期, 格式:yyyymmdd
-	GOODSCODE string `json:"goodscode" form:"goodscode"` // 合约代码
-	GOODSNAME string `json:"goodsname" form:"goodsname"` // 合约名称
+	USERID    int64  `json:"-" form:"userid" binding:"required"` // 用户编号
+	BEGINDATE string `json:"-" form:"begindate"`                 // 起始日期, 格式:yyyymmdd
+	ENDDATE   string `json:"-" form:"enddate"`                   // 终止日期, 格式:yyyymmdd
+	GOODSCODE string `json:"goodscode" form:"goodscode"`         // 合约代码
+	GOODSNAME string `json:"goodsname" form:"goodsname"`         // 合约名称
 }
 
 func (r *InternalUncorrelatedTradeDetail) calc() {
@@ -638,7 +638,7 @@ func (r *InternalUncorrelatedTradeDetail) buildSql() string {
 	sqlId.AndLike("g.goodscode", r.GOODSCODE)
 	sqlId.AndLike("g.goodsname", r.GOODSNAME)
 	sqlId.AndEx("ept.TRADEID", r.TRADEID, r.TRADEID != "")
-	sqlId.And("ept.BUYORSELL", r.BUYORSELL)
+	sqlId.AndEx("ept.BUYORSELL", r.BUYORSELL, r.BUYORSELL != -1)
 	sqlId.AndLikes2("ta.accountname", "ta.accountid", r.ACCOUNTNAME)
 	sqlId.OrderByDesc("ept.tradetime")