소스 검색

敞口报表增加“应套总量/应套变动量”字段

zou.yingbin 3 년 전
부모
커밋
cc72dac980
4개의 변경된 파일39개의 추가작업 그리고 11개의 파일을 삭제
  1. 10 2
      docs/docs.go
  2. 10 2
      docs/swagger.json
  3. 8 2
      docs/swagger.yaml
  4. 11 5
      models/ermcp3Report.go

+ 10 - 2
docs/docs.go

@@ -21748,12 +21748,16 @@ var doc = `{
                     "description": "套利变动量",
                     "type": "number"
                 },
+                "diffneedqty": {
+                    "description": "应套变动量 = 应套保量 - 期初应套保量 + 应套利量 - 期初应套利量",
+                    "type": "number"
+                },
                 "diffqty": {
                     "description": "变动量(总敞口)",
                     "type": "number"
                 },
                 "diffspotqty": {
-                    "description": "变动量(现货)",
+                    "description": "变动量(现货) | 除税变动量",
                     "type": "number"
                 },
                 "enddate": {
@@ -21804,6 +21808,10 @@ var doc = `{
                     "description": "应套保敞口比例",
                     "type": "number"
                 },
+                "needqty": {
+                    "description": "应套总量 = 应套保量 + 应套利量",
+                    "type": "number"
+                },
                 "oriarbitrageqty": {
                     "description": "期初套利量",
                     "type": "number"
@@ -21897,7 +21905,7 @@ var doc = `{
                     "type": "number"
                 },
                 "totalspotqty": {
-                    "description": "现货头寸总量",
+                    "description": "现货头寸总量 | 除税总量",
                     "type": "number"
                 },
                 "unitid": {

+ 10 - 2
docs/swagger.json

@@ -21733,12 +21733,16 @@
                     "description": "套利变动量",
                     "type": "number"
                 },
+                "diffneedqty": {
+                    "description": "应套变动量 = 应套保量 - 期初应套保量 + 应套利量 - 期初应套利量",
+                    "type": "number"
+                },
                 "diffqty": {
                     "description": "变动量(总敞口)",
                     "type": "number"
                 },
                 "diffspotqty": {
-                    "description": "变动量(现货)",
+                    "description": "变动量(现货) | 除税变动量",
                     "type": "number"
                 },
                 "enddate": {
@@ -21789,6 +21793,10 @@
                     "description": "应套保敞口比例",
                     "type": "number"
                 },
+                "needqty": {
+                    "description": "应套总量 = 应套保量 + 应套利量",
+                    "type": "number"
+                },
                 "oriarbitrageqty": {
                     "description": "期初套利量",
                     "type": "number"
@@ -21882,7 +21890,7 @@
                     "type": "number"
                 },
                 "totalspotqty": {
-                    "description": "现货头寸总量",
+                    "description": "现货头寸总量 | 除税总量",
                     "type": "number"
                 },
                 "unitid": {

+ 8 - 2
docs/swagger.yaml

@@ -5274,11 +5274,14 @@ definitions:
       diffmgqtyb:
         description: 套利变动量
         type: number
+      diffneedqty:
+        description: 应套变动量 = 应套保量 - 期初应套保量 + 应套利量 - 期初应套利量
+        type: number
       diffqty:
         description: 变动量(总敞口)
         type: number
       diffspotqty:
-        description: 变动量(现货)
+        description: 变动量(现货) | 除税变动量
         type: number
       enddate:
         description: 结束交易日
@@ -5316,6 +5319,9 @@ definitions:
       needhedgeratio:
         description: 应套保敞口比例
         type: number
+      needqty:
+        description: 应套总量 = 应套保量 + 应套利量
+        type: number
       oriarbitrageqty:
         description: 期初套利量
         type: number
@@ -5386,7 +5392,7 @@ definitions:
         description: 应套保总量(现货应套保总量)
         type: number
       totalspotqty:
-        description: 现货头寸总量
+        description: 现货头寸总量 | 除税总量
         type: number
       unitid:
         description: 单位id

+ 11 - 5
models/ermcp3Report.go

@@ -462,7 +462,7 @@ type Ermcp3ExpourseReport struct {
 	SELLPRICEDQTY         float64 `json:"sellpricedqty"  xorm:"'SELLPRICEDQTY'"`                 // 销售合同已定价数量
 	BUYFUTUREQTY          float64 `json:"buyfutureqty"  xorm:"'BUYFUTUREQTY'"`                   // 买入期货数量
 	SELLFUTUREQTY         float64 `json:"sellfutureqty"  xorm:"'SELLFUTUREQTY'"`                 // 卖出期货数量
-	TOTALSPOTQTY          float64 `json:"totalspotqty"  xorm:"'TOTALSPOTQTY'"`                   // 现货头寸总量
+	TOTALSPOTQTY          float64 `json:"totalspotqty"  xorm:"'TOTALSPOTQTY'"`                   // 现货头寸总量 | 除税总量
 	TOTALFUTUREQTY        float64 `json:"totalfutureqty"  xorm:"'TOTALFUTUREQTY'"`               // 期货头寸总量(期货总量)
 	TOTALEXPOSURE         float64 `json:"totalexposure"  xorm:"'TOTALEXPOSURE'"`                 // 实时总敞口(总敞口)
 	TOTALHEDGERATIO       float64 `json:"totalhedgeratio"  xorm:"'TOTALHEDGERATIO'"`             // 敞口比例
@@ -483,7 +483,7 @@ type Ermcp3ExpourseReport struct {
 	ENUMDICNAME string `json:"enumdicname"` // 单位名称
 	ACCOUNTNAME string `json:"accountname"` // 机构名称
 
-	DiffSpotQty  float64 `json:"diffspotqty"`  // 变动量(现货)
+	DiffSpotQty  float64 `json:"diffspotqty"`  // 变动量(现货) | 除税变动量
 	DiffMgQtyA   float64 `json:"diffmgqtya"`   // 套保变动量
 	DiffMgQtyB   float64 `json:"diffmgqtyb"`   // 套利变动量
 	DiffFutuQty  float64 `json:"difffutuqty"`  // 变动量(期货)
@@ -491,9 +491,11 @@ type Ermcp3ExpourseReport struct {
 	DiffHedgeQty float64 `json:"diffhedgeqty"` // 变动量(现货应套保总量)
 	DiffExposure float64 `json:"diffexposure"` // 变动量(套保敞口)
 
-	QueryType int32  `json:"-"`         // 查询类型 1-报表
-	BeginDate string `json:"begindate"` // 开始交易日
-	EndDate   string `json:"enddate"`   // 结束交易日
+	QueryType   int32   `json:"-"`           // 查询类型 1-报表
+	BeginDate   string  `json:"begindate"`   // 开始交易日
+	EndDate     string  `json:"enddate"`     // 结束交易日
+	NEEDQTY     float64 `json:"needqty"`     // 应套总量 = 应套保量 + 应套利量
+	DiffNeedQty float64 `json:"diffneedqty"` // 应套变动量 = 应套保量 - 期初应套保量 + 应套利量 - 期初应套利量
 }
 
 func (r *Ermcp3ExpourseReport) calc() {
@@ -513,6 +515,10 @@ func (r *Ermcp3ExpourseReport) calc() {
 	r.DiffHedgeQty = r.TOTALNEEDHEDGEQTY - r.ORITOTALNEEDHEDGEQTY
 	// 变动量(套保敞口)
 	r.DiffExposure = r.NEEDHEDGEEXPOSOURE - r.ORINEEDHEDGEEXPOSOURE
+	// 应套总量
+	r.NEEDQTY = r.NEEDHEDGEQTY + r.NEEDARBITRAGEQTY
+	// 应套变动量
+	r.DiffNeedQty = r.NEEDHEDGEQTY - r.ORINEEDHEDGEQTY + r.NEEDARBITRAGEQTY - r.ORINEEDARBITRAGEQTY
 }
 
 func (r *Ermcp3ExpourseReport) buildSql() string {