|
|
@@ -8,6 +8,7 @@ import (
|
|
|
"mtp2_if/pb"
|
|
|
"mtp2_if/rediscli"
|
|
|
"mtp2_if/utils"
|
|
|
+ "sort"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
@@ -1450,6 +1451,12 @@ type Ermcp8RunningHedgeditem struct {
|
|
|
USERID int64 `json:"-" form:"userid" binding:"required"` // 用户id, 用于过滤
|
|
|
}
|
|
|
|
|
|
+type Ermcp8RunningHedgeditems []Ermcp8RunningHedgeditem
|
|
|
+
|
|
|
+func (s Ermcp8RunningHedgeditems) Len() int { return len(s) }
|
|
|
+func (s Ermcp8RunningHedgeditems) Less(i, j int) bool { return s[i].Createtime < s[j].Createtime }
|
|
|
+func (s Ermcp8RunningHedgeditems) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|
|
+
|
|
|
func (r *Ermcp8RunningHedgeditem) ParseFromProto(p *pb.Ermcp2HedgedItemInfo) {
|
|
|
r.Hedgeditemid = strconv.Itoa(int(*p.Hedgeditemext.Item.HedgedItemID))
|
|
|
r.Hedgeditemnum = p.Hedgeditemext.Item.GetHedgedItemNum()
|
|
|
@@ -1578,6 +1585,8 @@ func (r *Ermcp8RunningHedgeditem) GetDataEx(userID int) (interface{}, error) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 按Updatetime倒序排序
|
|
|
+ sort.Sort(sort.Reverse(Ermcp8RunningHedgeditems(sData)))
|
|
|
|
|
|
return sData, nil
|
|
|
}
|
|
|
@@ -1998,7 +2007,8 @@ func (r *Unlinkermcphedgeplan) buildSql() string {
|
|
|
wr.WRSTANDARDNAME,
|
|
|
t.PLANQTY,
|
|
|
e.ENUMDICNAME,
|
|
|
- t.HEDGEPLANSTATUS
|
|
|
+ t.HEDGEPLANSTATUS,
|
|
|
+ t.WRSTANDARDID
|
|
|
FROM ERMCP_HedgePlan t
|
|
|
LEFT JOIN USERACCOUNT u on u.userid = t.tradeuserid
|
|
|
LEFT JOIN WRStandard wr ON wr.wrstandardid = t.wrstandardid
|