|
|
@@ -524,22 +524,22 @@ func GetHsbyMyGoods(accountIDs string) ([]HsbyMyGoods, error) {
|
|
|
|
|
|
// HsbyPreGoods 新品上市商品(一级市场产能预售)
|
|
|
type HsbyPreGoods struct {
|
|
|
- Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
- Goodscode string `json:"goodscode" xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
|
|
|
- Goodsname string `json:"goodsname" xorm:"'GOODSNAME'" binding:"required"` // 商品名称
|
|
|
- Decimalplace int64 `json:"decimalplace" xorm:"'DECIMALPLACE'"` // 报价小数位
|
|
|
- Marketid int64 `json:"marketid" xorm:"'MARKETID'" binding:"required"` // 所属市场ID
|
|
|
- Goodsstatus int64 `json:"goodsstatus" xorm:"'GOODSSTATUS'"` // 商品状态- 2:未上市 3:上市
|
|
|
- Quoteminunit int64 `json:"quoteminunit" xorm:"'QUOTEMINUNIT'"` // 行情最小变动单位 [整数,报价小数位一起使用]
|
|
|
- Agreeunit float64 `json:"agreeunit" xorm:"'AGREEUNIT'"` // 合约单位
|
|
|
-
|
|
|
- Relatedgoodsid int64 `json:"relatedgoodsid" xorm:"'RELATEDGOODSID'"` // 关联交易合约ID
|
|
|
- Presaleqty int64 `json:"presaleqty" xorm:"'PRESALEQTY'"` // 预售数量
|
|
|
- Starttime time.Time `json:"starttime" xorm:"'STARTTIME'"` // 预售开始时间
|
|
|
- Endtime time.Time `json:"endtime" xorm:"'ENDTIME'"` // 预售结束时间
|
|
|
- Refprice float64 `json:"refprice" xorm:"'REFPRICE'"` // 参考价格[一口价]
|
|
|
- Presaledqty int64 `json:"presaledqty" xorm:"'PRESALEDQTY'"` // 已预售量(预售结束时更新)
|
|
|
- EnableQty int64 `json:"enableqty" xorm:"ENABLEQTY"` // 剩余数量
|
|
|
+ Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
+ Goodscode string `json:"goodscode" xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
|
|
|
+ Goodsname string `json:"goodsname" xorm:"'GOODSNAME'" binding:"required"` // 商品名称
|
|
|
+ Decimalplace int64 `json:"decimalplace" xorm:"'DECIMALPLACE'"` // 报价小数位
|
|
|
+ Marketid int64 `json:"marketid" xorm:"'MARKETID'" binding:"required"` // 所属市场ID
|
|
|
+ Goodsstatus int64 `json:"goodsstatus" xorm:"'GOODSSTATUS'"` // 商品状态- 2:未上市 3:上市
|
|
|
+ Quoteminunit int64 `json:"quoteminunit" xorm:"'QUOTEMINUNIT'"` // 行情最小变动单位 [整数,报价小数位一起使用]
|
|
|
+ Agreeunit float64 `json:"agreeunit" xorm:"'AGREEUNIT'"` // 合约单位
|
|
|
+ Listingdate time.Time `json:"listingdate" xorm:"'LISTINGDATE'"` // 交易开始日期
|
|
|
+ Lasttradedate time.Time `json:"lasttradedate" xorm:"'LASTTRADEDATE'"` // 最后交易日期(状态:待退市)
|
|
|
+
|
|
|
+ Relatedgoodsid int64 `json:"relatedgoodsid" xorm:"'RELATEDGOODSID'"` // 关联交易合约ID
|
|
|
+ Presaleqty int64 `json:"presaleqty" xorm:"'PRESALEQTY'"` // 预售数量
|
|
|
+ Refprice float64 `json:"refprice" xorm:"'REFPRICE'"` // 参考价格[一口价]
|
|
|
+ Presaledqty int64 `json:"presaledqty" xorm:"'PRESALEDQTY'"` // 已预售量(预售结束时更新)
|
|
|
+ EnableQty int64 `json:"enableqty" xorm:"ENABLEQTY"` // 剩余数量
|
|
|
|
|
|
Currency string `json:"currency" xorm:"'CURRENCY'"` // 货币
|
|
|
Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
|
|
|
@@ -560,11 +560,11 @@ func GetHsbyPreGoodses(marketIDs string, descProvinceID, descCityID int) ([]Hsby
|
|
|
engine := db.GetEngine()
|
|
|
|
|
|
// 注意:一级产能预售市场使用的商品实际上是和二级市场有关系的,所以要使用 CPTRADE_PRESALEGOODSEX.RELATEDGOODSID 进行关联
|
|
|
+ // 注意:CPTRADE_PRESALEGOODSEX 表的开始与结束时间是给大宗用的
|
|
|
preGoodses := make([]HsbyPreGoods, 0)
|
|
|
session := engine.Table("GOODS").
|
|
|
Select(`GOODS.*,
|
|
|
- CPTRADE_PRESALEGOODSEX.RELATEDGOODSID, CPTRADE_PRESALEGOODSEX.PRESALEQTY,
|
|
|
- CPTRADE_PRESALEGOODSEX.STARTTIME, CPTRADE_PRESALEGOODSEX.ENDTIME, CPTRADE_PRESALEGOODSEX.REFPRICE,
|
|
|
+ CPTRADE_PRESALEGOODSEX.RELATEDGOODSID, CPTRADE_PRESALEGOODSEX.PRESALEQTY, CPTRADE_PRESALEGOODSEX.REFPRICE,
|
|
|
CPTRADE_PRESALEGOODSEX.PRESALEDQTY, (CPTRADE_PRESALEGOODSEX.PRESALEQTY - CPTRADE_PRESALEGOODSEX.PRESALEDQTY) ENABLEQTY,
|
|
|
ENUMDICITEM.ENUMDICNAME CURRENCY, ENUMDICITEM.PARAM2 CURRENCYSIGN,
|
|
|
HSBY_GOODSEX.VIDEOURLS, HSBY_GOODSEX.PICURLS,
|
|
|
@@ -598,22 +598,22 @@ func GetHsbyPreGoodses(marketIDs string, descProvinceID, descCityID int) ([]Hsby
|
|
|
|
|
|
// HsbyPreGoodsDetail 一级市场(产能预售)商品信息详情
|
|
|
type HsbyPreGoodsDetail struct {
|
|
|
- Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
- Goodscode string `json:"goodscode" xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
|
|
|
- Goodsname string `json:"goodsname" xorm:"'GOODSNAME'" binding:"required"` // 商品名称
|
|
|
- Decimalplace int64 `json:"decimalplace" xorm:"'DECIMALPLACE'"` // 报价小数位
|
|
|
- Marketid int64 `json:"marketid" xorm:"'MARKETID'" binding:"required"` // 所属市场ID
|
|
|
- Goodsstatus int64 `json:"goodsstatus" xorm:"'GOODSSTATUS'"` // 商品状态- 2:未上市 3:上市
|
|
|
- Quoteminunit int64 `json:"quoteminunit" xorm:"'QUOTEMINUNIT'"` // 行情最小变动单位 [整数,报价小数位一起使用]
|
|
|
- Agreeunit float64 `json:"agreeunit" xorm:"'AGREEUNIT'"` // 合约单位
|
|
|
-
|
|
|
- Relatedgoodsid int64 `json:"relatedgoodsid" xorm:"'RELATEDGOODSID'"` // 关联交易合约ID
|
|
|
- Presaleqty int64 `json:"presaleqty" xorm:"'PRESALEQTY'"` // 预售数量
|
|
|
- Starttime time.Time `json:"starttime" xorm:"'STARTTIME'"` // 预售开始时间
|
|
|
- Endtime time.Time `json:"endtime" xorm:"'ENDTIME'"` // 预售结束时间
|
|
|
- Refprice float64 `json:"refprice" xorm:"'REFPRICE'"` // 参考价格[一口价]
|
|
|
- Presaledqty int64 `json:"presaledqty" xorm:"'PRESALEDQTY'"` // 已预售量(预售结束时更新)
|
|
|
- EnableQty int64 `json:"enableqty" xorm:"ENABLEQTY"` // 剩余数量
|
|
|
+ Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
+ Goodscode string `json:"goodscode" xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
|
|
|
+ Goodsname string `json:"goodsname" xorm:"'GOODSNAME'" binding:"required"` // 商品名称
|
|
|
+ Decimalplace int64 `json:"decimalplace" xorm:"'DECIMALPLACE'"` // 报价小数位
|
|
|
+ Marketid int64 `json:"marketid" xorm:"'MARKETID'" binding:"required"` // 所属市场ID
|
|
|
+ Goodsstatus int64 `json:"goodsstatus" xorm:"'GOODSSTATUS'"` // 商品状态- 2:未上市 3:上市
|
|
|
+ Quoteminunit int64 `json:"quoteminunit" xorm:"'QUOTEMINUNIT'"` // 行情最小变动单位 [整数,报价小数位一起使用]
|
|
|
+ Agreeunit float64 `json:"agreeunit" xorm:"'AGREEUNIT'"` // 合约单位
|
|
|
+ Listingdate time.Time `json:"listingdate" xorm:"'LISTINGDATE'"` // 交易开始日期
|
|
|
+ Lasttradedate time.Time `json:"lasttradedate" xorm:"'LASTTRADEDATE'"` // 最后交易日期(状态:待退市)
|
|
|
+
|
|
|
+ Relatedgoodsid int64 `json:"relatedgoodsid" xorm:"'RELATEDGOODSID'"` // 关联交易合约ID
|
|
|
+ Presaleqty int64 `json:"presaleqty" xorm:"'PRESALEQTY'"` // 预售数量
|
|
|
+ Refprice float64 `json:"refprice" xorm:"'REFPRICE'"` // 参考价格[一口价]
|
|
|
+ Presaledqty int64 `json:"presaledqty" xorm:"'PRESALEDQTY'"` // 已预售量(预售结束时更新)
|
|
|
+ EnableQty int64 `json:"enableqty" xorm:"ENABLEQTY"` // 剩余数量
|
|
|
|
|
|
Videourls string `json:"videourls" xorm:"'VIDEOURLS'"` // 介绍视频[多张用逗号分隔]
|
|
|
Picurls string `json:"picurls" xorm:"'PICURLS'"` // 介绍图片[多张用逗号分隔]
|
|
|
@@ -650,8 +650,7 @@ func GetHsbyPreGoodsDetail(goodsID, accountID int) (*HsbyPreGoodsDetail, error)
|
|
|
// FIXME: - 这里使用Get方法,会造成SQL语句的嵌套出错,后期再研究
|
|
|
session := engine.Table("GOODS").
|
|
|
Select(`GOODS.*,
|
|
|
- CPTRADE_PRESALEGOODSEX.RELATEDGOODSID, CPTRADE_PRESALEGOODSEX.PRESALEQTY,
|
|
|
- CPTRADE_PRESALEGOODSEX.STARTTIME, CPTRADE_PRESALEGOODSEX.ENDTIME, CPTRADE_PRESALEGOODSEX.REFPRICE,
|
|
|
+ CPTRADE_PRESALEGOODSEX.RELATEDGOODSID, CPTRADE_PRESALEGOODSEX.PRESALEQTY, CPTRADE_PRESALEGOODSEX.REFPRICE,
|
|
|
CPTRADE_PRESALEGOODSEX.PRESALEDQTY, (CPTRADE_PRESALEGOODSEX.PRESALEQTY - CPTRADE_PRESALEGOODSEX.PRESALEDQTY) ENABLEQTY,
|
|
|
HSBY_GOODSEX.VIDEOURLS, HSBY_GOODSEX.PICURLS, HSBY_GOODSEX.DESCPROVINCEID, HSBY_GOODSEX.Desccityid, HSBY_GOODSEX.Goodsdesc,
|
|
|
ENUMDICITEM.ENUMDICNAME CURRENCY, ENUMDICITEM.PARAM2 CURRENCYSIGN,
|