Sfoglia il codice sorgente

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

zhou.xiaoning 4 anni fa
parent
commit
53cd36d8c2
2 ha cambiato i file con 8 aggiunte e 11 eliminazioni
  1. 3 7
      models/ermcp.go
  2. 5 4
      models/ermcpExposure.go

+ 3 - 7
models/ermcp.go

@@ -216,13 +216,9 @@ type ErmcpModel struct {
 }
 
 func (r *ErmcpModel) calc() {
-	r.TotalAmount = r.LoanAmount + r.ReckonOtherAmount + r.Margin
-	if r.Contracctstatus == 3 {
-		// 已完结的合同, 不再计算待支收额,=0
-		r.UnpayAmount = 0
-	} else {
-		r.UnpayAmount = r.TotalAmount - r.ReckonedAmount
-	}
+	// #94293 公式调整:合计总额不再加保证金
+	r.TotalAmount = r.LoanAmount + r.ReckonOtherAmount
+	r.UnpayAmount = r.TotalAmount - r.ReckonedAmount
 
 	if r.Contracttype == 1 {
 		//采购合同, 取销售方名称

+ 5 - 4
models/ermcpExposure.go

@@ -151,7 +151,7 @@ func (r *ErmcpExposureDetailModel) buildSql() string {
 		"       t.logtype," +
 		"       t.contracttype," +
 		"       wc.wrstandardid," +
-		"       tmp.qty," +
+		"       t.qty / t.convertfactor / t.convertratio as qty," +
 		"       t.convertfactor," +
 		"       t.convertratio," +
 		"       t.qty changeQty," +
@@ -176,7 +176,7 @@ func (r *ErmcpExposureDetailModel) buildSql() string {
 		"  left join tmp" +
 		"    on t.logtype = tmp.LogType" +
 		"   and t.relatedid = tmp.relatedid" +
-		"  where t.middlegoodsid=%v and t.areauserid=%v"
+		"  where t.middlegoodsid=%v and t.areauserid=%v and t.tradedate=to_char(sysdate, 'yyyymmdd')"
 
 	return fmt.Sprintf(str, r.MiddlegoodsId, r.Areauserid)
 }
@@ -293,7 +293,7 @@ type ErmcpAreaSpotDetailModel struct {
 	WrstandardId   int32   `json:"-"`                                       // 现货商品ID
 }
 
-// buildSql 组建查询SQL
+// buildSql 组建查询SQL(只查当前日期的)
 func (r *ErmcpAreaSpotDetailModel) buildSql() string {
 	str := "with tmp as" +
 		" (select to_char(t.hedgeplanid) relatedid," +
@@ -327,7 +327,8 @@ func (r *ErmcpAreaSpotDetailModel) buildSql() string {
 		"   and t.areauserid = %v" +
 		"   and t.wrstandardid = %v" +
 		"  left join wrstandard w" +
-		"    on t.wrstandardid = w.wrstandardid"
+		"    on t.wrstandardid = w.wrstandardid" +
+		"  where t.tradedate=to_char(sysdate, 'yyyymmdd')"
 
 	return fmt.Sprintf(str, r.UserId, r.WrstandardId, r.UserId, r.WrstandardId, r.UserId, r.WrstandardId)
 }