Parcourir la source

/Ferroalloy/QuerySpotgoodsPrice :返回“priceflag”

deng.yinping il y a 2 ans
Parent
commit
75d72d61e0
4 fichiers modifiés avec 24 ajouts et 10 suppressions
  1. 4 0
      docs/docs.go
  2. 4 0
      docs/swagger.json
  3. 3 0
      docs/swagger.yaml
  4. 13 10
      models/ferroalloy.go

+ 4 - 0
docs/docs.go

@@ -48645,6 +48645,10 @@ const docTemplate = `{
                     "description": "上日价格",
                     "type": "number"
                 },
+                "priceflag": {
+                    "description": "点价标识(1:为可点价-本月招标价已发布,否则为0)",
+                    "type": "integer"
+                },
                 "spotgoodsprice": {
                     "description": "当前价格",
                     "type": "number"

+ 4 - 0
docs/swagger.json

@@ -48636,6 +48636,10 @@
                     "description": "上日价格",
                     "type": "number"
                 },
+                "priceflag": {
+                    "description": "点价标识(1:为可点价-本月招标价已发布,否则为0)",
+                    "type": "integer"
+                },
                 "spotgoodsprice": {
                     "description": "当前价格",
                     "type": "number"

+ 3 - 0
docs/swagger.yaml

@@ -20437,6 +20437,9 @@ definitions:
       prespotgoodsprice:
         description: 上日价格
         type: number
+      priceflag:
+        description: 点价标识(1:为可点价-本月招标价已发布,否则为0)
+        type: integer
       spotgoodsprice:
         description: 当前价格
         type: number

+ 13 - 10
models/ferroalloy.go

@@ -1895,15 +1895,15 @@ func (r *THJUserLevelInfo) Get() (err error) {
 
 // Spotgoodsprice 现货市价
 type Spotgoodsprice struct {
-	WRSTANDARDID      int64   `json:"wrstandardid" xorm:"WRSTANDARDID" form:"wrstandardid"` // 现货商品ID(通用则为0)
-	WRSTANDARDCODE    string  `json:"wrstandardcode" xorm:"WRSTANDARDCODE"`                 // 现货商品代码
-	WRSTANDARDNAME    string  `json:"wrstandardname" xorm:"WRSTANDARDNAME"`                 // 现货商品名称
-	SPOTGOODSPRICE    float64 `json:"spotgoodsprice" xorm:"SPOTGOODSPRICE"`                 // 当前价格
-	PRESPOTGOODSPRICE float64 `json:"prespotgoodsprice" xorm:"PRESPOTGOODSPRICE"`           // 上日价格
-	TRADEDATE         string  `json:"tradedate" xorm:"TRADEDATE"`                           // 交易日(yyyyMMdd)
-	SPOTGOODSQTY      float64 `json:"spotgoodsqty" xorm:"SPOTGOODSQTY"`                     // 招标量
-
-	PageEx `xorm:"extends"` // 页码信息
+	WRSTANDARDID      int64            `json:"wrstandardid" xorm:"WRSTANDARDID" form:"wrstandardid"` // 现货商品ID(通用则为0)
+	WRSTANDARDCODE    string           `json:"wrstandardcode" xorm:"WRSTANDARDCODE"`                 // 现货商品代码
+	WRSTANDARDNAME    string           `json:"wrstandardname" xorm:"WRSTANDARDNAME"`                 // 现货商品名称
+	SPOTGOODSPRICE    float64          `json:"spotgoodsprice" xorm:"SPOTGOODSPRICE"`                 // 当前价格
+	PRESPOTGOODSPRICE float64          `json:"prespotgoodsprice" xorm:"PRESPOTGOODSPRICE"`           // 上日价格
+	TRADEDATE         string           `json:"tradedate" xorm:"TRADEDATE"`                           // 交易日(yyyyMMdd)
+	SPOTGOODSQTY      float64          `json:"spotgoodsqty" xorm:"SPOTGOODSQTY"`                     // 招标量
+	PRICEFLAG         int              `json:"priceflag" xorm:"PRICEFLAG"`                           // 点价标识(1:为可点价-本月招标价已发布,否则为0)
+	PageEx            `xorm:"extends"` // 页码信息
 }
 
 func (r *Spotgoodsprice) calc() {
@@ -1919,7 +1919,10 @@ func (r *Spotgoodsprice) buildSql() string {
 		t.prespotgoodsprice, 
 		t.spotgoodsprice,
 		t.spotgoodsqty,
-		to_char(to_date(t.TRADEDATE, 'yyyymmdd'), 'yyyy-mm-dd') TRADEDATE
+		to_char(to_date(t.TRADEDATE, 'yyyymmdd'), 'yyyy-mm-dd') TRADEDATE,
+		case
+         when substr(t.tradedate, 0, 6) - to_char(sysdate, 'yyyyMM') = 0 then 1
+         else 0 end priceflag
   	from ERMCP_SpotGoodsPrice t
 	left join wrstandard wr
     	on t.wrstandardid = wr.wrstandardid