Ver Fonte

修改敞口明细查询BUG

gitmuchinfo há 3 anos atrás
pai
commit
ca967d37b5
2 ficheiros alterados com 4 adições e 1 exclusões
  1. 3 1
      models/ermcp8.go
  2. 1 0
      models/ermcpExposure.go

+ 3 - 1
models/ermcp8.go

@@ -1703,6 +1703,7 @@ func (r *Ermcp2stockspotchangelog) buildSql() string {
 			t.LOGVALUE,
 			s.CONTRACTNO,
 			u1.ACCOUNTNAME,
+			t.TradeDate,
 			(t.LOGVALUE * c.CONVERTRATIO * (1/(1 + ws.VATRATE))) MIDDLEGOODSCHANGE
 		FROM ERMCP2_StockSpotChangeLog t
 		LEFT JOIN ERMS2_WRSConvertDetail c ON c.WRStandardID = t.WRStandardID
@@ -1710,7 +1711,7 @@ func (r *Ermcp2stockspotchangelog) buildSql() string {
 		LEFT JOIN WRStandard ws ON ws.WRStandardID = t.WRStandardID
 		LEFT JOIN ERMCP_SPOTCONTRACT s ON s.SPOTCONTRACTID = t.RELATEDID
 		LEFT JOIN useraccount u ON u.userid = s.CUSTOMERUSERID
-		LEFT JOIN useraccount u1 ON u.userid = s.TRADEUSERID
+		LEFT JOIN useraccount u1 ON u1.userid = s.TRADEUSERID
 		WHERE t.userid = %v AND mg.MiddleGoodsID = %v
 	`
 	// var sqlId utils.SQLVal = `
@@ -1795,6 +1796,7 @@ func (r *Ermcp2hedgeditemsDetail) buildSql() string {
 		SELECT DISTINCT
 			to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME,
 			t.SPOTTYPE,
+			t.HEDGEDTYPE,
 			wr.WRSTANDARDNAME,
 			e.ENUMDICNAME,
 			h.UNEXEQTY,

+ 1 - 0
models/ermcpExposure.go

@@ -804,6 +804,7 @@ func (r *ErmcpExposurePostion) ParseFromHedgePos(val *ErmcpTradeGoods, data *Erm
 	}
 	r.ACCOUNTID = data.ACCOUNTID
 	r.HEDGEACCOUNTCODE = data.HEDGEACCOUNTCODE
+	r.CurHedgeQty = float64(r.CurQty) * float64(val.AGREEUNIT) * val.CONVERTRATIO
 }
 
 // GetDataEx 获取敞口明细期货头寸