Преглед изворни кода

/Ferroalloy/QuerySpotgoodsPrice:当前交易日且DiffPrice>0的PriceFlag为1
/Ferroalloy/QueryTHJPurchaseTradeDetail: 返回添加“todaypointincome”

deng.yinping пре 2 година
родитељ
комит
ba963ae682
4 измењених фајлова са 31 додато и 15 уклоњено
  1. 5 1
      docs/docs.go
  2. 5 1
      docs/swagger.json
  3. 4 1
      docs/swagger.yaml
  4. 17 12
      models/ferroalloy.go

+ 5 - 1
docs/docs.go

@@ -50136,7 +50136,7 @@ const docTemplate = `{
                     "type": "number"
                 },
                 "pointtimes": {
-                    "description": "点价总次",
+                    "description": "点价总次",
                     "type": "integer"
                 },
                 "presaleapplyid": {
@@ -50195,6 +50195,10 @@ const docTemplate = `{
                     "description": "状态",
                     "type": "string"
                 },
+                "todaypointincome": {
+                    "description": "点价总收益",
+                    "type": "number"
+                },
                 "tradeamount": {
                     "description": "摘牌总货款",
                     "type": "number"

+ 5 - 1
docs/swagger.json

@@ -50127,7 +50127,7 @@
                     "type": "number"
                 },
                 "pointtimes": {
-                    "description": "点价总次",
+                    "description": "点价总次",
                     "type": "integer"
                 },
                 "presaleapplyid": {
@@ -50186,6 +50186,10 @@
                     "description": "状态",
                     "type": "string"
                 },
+                "todaypointincome": {
+                    "description": "点价总收益",
+                    "type": "number"
+                },
                 "tradeamount": {
                     "description": "摘牌总货款",
                     "type": "number"

+ 4 - 1
docs/swagger.yaml

@@ -21498,7 +21498,7 @@ definitions:
         description: 已点价格
         type: number
       pointtimes:
-        description: 点价总次
+        description: 点价总次
         type: integer
       presaleapplyid:
         description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
@@ -21542,6 +21542,9 @@ definitions:
       thjorderstatusdisplay:
         description: 状态
         type: string
+      todaypointincome:
+        description: 点价总收益
+        type: number
       tradeamount:
         description: 摘牌总货款
         type: number

+ 17 - 12
models/ferroalloy.go

@@ -710,12 +710,13 @@ type Thjpurchasetradedetail struct {
 
 	PRESALESTATUS int32 `json:"presalestatus" xorm:"PRESALESTATUS"` // 预留状态 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
 
-	FIRSTBUYUSERID int64   `json:"firstbuyuserid" xorm:"FIRSTBUYUSERID"` // 买方用户ID(预售摘牌人)
-	AVAILABLETIME  int32   `json:"availabletime" xorm:"AVAILABLETIME"`   // 可用次数
-	POINTPRICE     float64 `json:"pointprice" xorm:"POINTPRICE"`         // 已点价格
-	POINTFLAG      bool    `json:"pointflag" xorm:"POINTFLAG"`           // 是否已点价
-	POINTINCOME    float64 `json:"pointincome" xorm:"POINTINCOME"`       // 点价总收益
-	POINTTIMES     int32   `json:"pointtimes" xorm:"POINTTIMES"`         // 点价总次数
+	FIRSTBUYUSERID   int64   `json:"firstbuyuserid" xorm:"FIRSTBUYUSERID"`     // 买方用户ID(预售摘牌人)
+	AVAILABLETIME    int32   `json:"availabletime" xorm:"AVAILABLETIME"`       // 可用次数
+	POINTPRICE       float64 `json:"pointprice" xorm:"POINTPRICE"`             // 已点价格
+	POINTFLAG        bool    `json:"pointflag" xorm:"POINTFLAG"`               // 是否已点价
+	POINTINCOME      float64 `json:"pointincome" xorm:"POINTINCOME"`           // 点价总收益
+	POINTTIMES       int32   `json:"pointtimes" xorm:"POINTTIMES"`             // 点价总次
+	TODAYPOINTINCOME float64 `json:"todaypointincome" xorm:"TODAYPOINTINCOME"` // 点价总收益
 
 	TYPE int `json:"-" xorm:"-" form:"type"` // 类型 - 0:未完成 1:已完成 2:可点订单 3:已点订单
 
@@ -786,7 +787,8 @@ func (r *Thjpurchasetradedetail) buildSql() string {
 		t.AVAILABLETIME,
 		t.POINTPRICE,
 		t.POINTFLAG,
-		t.POINTINCOME
+		t.POINTINCOME,
+		t.TODAYPOINTINCOME
 	from THJ_PurchaseTradeDetail t
 	inner join WR_PresaleInfo pi 
 		on t.presaleapplyid = pi.presaleapplyid
@@ -877,7 +879,8 @@ func (r *Thjpurchasetradedetail) buildSql2() string {
 		t.AVAILABLETIME,
 		t.POINTPRICE,
 		t.POINTFLAG,
-		t.POINTINCOME
+		t.POINTINCOME,
+		t.TODAYPOINTINCOME
 	from THJ_PurchaseTradeDetail t
 	inner join WR_PresaleInfo pi 
 		on t.presaleapplyid = pi.presaleapplyid
@@ -962,7 +965,8 @@ func (r *Thjpurchasetradedetail) buildSql3() string {
 		t.AVAILABLETIME,
 		t.POINTPRICE,
 		t.POINTFLAG,
-		t.POINTINCOME
+		t.POINTINCOME,
+		t.TODAYPOINTINCOME
 	from THJ_PurchaseTradeDetail t
 	inner join WR_PresaleInfo pi 
 		on t.presaleapplyid = pi.presaleapplyid
@@ -1050,7 +1054,8 @@ func (r *Thjpurchasetradedetail) buildSql4() string {
 		t.AVAILABLETIME,
 		t.POINTPRICE,
 		t.POINTFLAG,
-		t.POINTINCOME
+		t.POINTINCOME,
+		t.TODAYPOINTINCOME
 	from THJ_PurchaseTradeDetail t
 	inner join WR_PresaleInfo pi 
 		on t.presaleapplyid = pi.presaleapplyid
@@ -1934,8 +1939,8 @@ func (r *Spotgoodsprice) buildSql() string {
     	t.diffprice,
 		t.tradedate2,
 		case
-         when substr(t.tradedate, 0, 6) - to_char(sysdate, 'yyyyMM') = 0 then 1
-         else 0 end priceflag
+        	when t.diffprice > 0 and t.tradedate2 in (select t.tradedate from marketrun t where t.marketid=0) then 1
+         	else 0 end priceflag
   	from ERMCP_SpotGoodsPrice t
 	left join wrstandard wr
     	on t.wrstandardid = wr.wrstandardid