|
|
@@ -519,7 +519,7 @@ func (r *Ermcpjrlinkpos) buildSql() string {
|
|
|
t.OPTIONCODE,
|
|
|
t.CLOSEPL,
|
|
|
t.NETQTY,
|
|
|
- ((t.TotalBuyHoldAmount - t.TotalSellHoldAmount) / NetQty) AVERAGEPRICE,
|
|
|
+ ((t.TotalBuyHoldAmount - t.TotalSellHoldAmount) / (t.NetQty * g.agreeunit)) AVERAGEPRICE,
|
|
|
mg.middlegoodsname,
|
|
|
mg.middlegoodscode,
|
|
|
(t.NETQTY * gc.convertratio * g.agreeunit) FUTUREHEDGEQTY
|
|
|
@@ -1437,8 +1437,12 @@ func (r *Ermcp8RunningHedgeditem) ParseFromProto(p *pb.Ermcp2HedgedItemInfo) {
|
|
|
r.Hedgeditemnum = p.Hedgeditemext.Item.GetHedgedItemNum()
|
|
|
r.Hedgeditemname = p.Hedgeditemext.Item.GetHedgedItemName()
|
|
|
r.Hedgedtype = int32(p.Hedgeditemext.Item.GetHedgedType())
|
|
|
- r.Planstartdate = p.Hedgeditemext.Item.GetPlanStartDate().GetDateStr()
|
|
|
- r.Planenddate = p.Hedgeditemext.Item.GetPlanEndDate().GetDateStr()
|
|
|
+ if p, err := time.Parse("2006-01-02 15:04:05", p.Hedgeditemext.Item.GetPlanStartDate().GetDateStr()); err == nil {
|
|
|
+ r.Planstartdate = p.Format("2006-01-02")
|
|
|
+ }
|
|
|
+ if p, err := time.Parse("2006-01-02 15:04:05", p.Hedgeditemext.Item.GetPlanEndDate().GetDateStr()); err == nil {
|
|
|
+ r.Planenddate = p.Format("2006-01-02")
|
|
|
+ }
|
|
|
r.Hedgerate = p.Hedgeditemext.Item.GetHedgeRate()
|
|
|
r.Tradeuserid = int64(*p.Hedgeditemext.Item.TradeUserID)
|
|
|
r.Areauserid = int64(*p.Hedgeditemext.Item.AreaUserID)
|