|
|
@@ -1355,9 +1355,6 @@ type HsbyMarketGoods struct {
|
|
|
Accountid int64 `json:"accountid" xorm:"'ACCOUNTID'" binding:"required"` // 账户ID[报价币种]
|
|
|
Buyorsell int32 `json:"buyorsell" xorm:"'BUYORSELL'" binding:"required"` // 买卖 - 0:买 1:卖
|
|
|
Orderprice float64 `json:"orderprice" xorm:"'ORDERPRICE'"` // 委托价格
|
|
|
- Orderqty int64 `json:"orderqty" xorm:"'ORDERQTY'" binding:"required"` // 委托数量
|
|
|
- Tradeqty int64 `json:"tradeqty" xorm:"'TRADEQTY'"` // 成交数量
|
|
|
- Cancelqty int64 `json:"cancelqty" xorm:"'CANCELQTY'"` // 撤单数量
|
|
|
Orderstatus int32 `json:"orderstatus" xorm:"'ORDERSTATUS'"` // 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
|
|
|
|
|
|
Goodscode string `json:"goodscode" xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
|
|
|
@@ -1370,15 +1367,12 @@ type HsbyMarketGoods struct {
|
|
|
Videourls string `json:"videourls" xorm:"'VIDEOURLS'"` // 介绍视频[多张用逗号分隔]
|
|
|
Picurls string `json:"picurls" xorm:"'PICURLS'"` // 介绍图片[多张用逗号分隔]
|
|
|
Categoryid int32 `json:"categoryid" xorm:"'CATEGORYID'"` // 类别ID(WRCATEGORY)
|
|
|
- Goodsdesc string `json:"goodsdesc" xorm:"'GOODSDESC'"` // 商品详情
|
|
|
|
|
|
Currency string `json:"currency" xorm:"'CURRENCY'"` // 货币
|
|
|
Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
|
|
|
|
|
|
Trademode int32 `json:"trademode" xorm:"'TRADEMODE'" binding:"required"` // 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
|
|
|
|
|
|
- Vendorname string `json:"vendorname" xorm:"'VENDORNAME'"` // 供应商名称
|
|
|
-
|
|
|
Customername string `json:"customername" xorm:"'CUSTOMERNAME'"` // 卖家名称
|
|
|
|
|
|
HasCoupon bool `json:"hascoupon" xorm:"-"` // 是否可用优惠卷
|
|
|
@@ -1395,15 +1389,13 @@ func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID int) ([]HsbyMa
|
|
|
session := engine.Table("TRADE_ORDERDETAIL T").
|
|
|
Select(`to_char(T.ORDERID) ORDERIDSTR, T.*,
|
|
|
G.GOODSCODE, G.GOODSNAME, G.DECIMALPLACE, G.QUOTEMINUNIT, G.AGREEUNIT,
|
|
|
- GX.HOTINDEX, GX.VIDEOURLS, GX.PICURLS, GX.CATEGORYID, GX.GOODSDESC,
|
|
|
+ GX.HOTINDEX, GX.PICURLS, GX.CATEGORYID, GX.GOODSDESC,
|
|
|
ENUMDICITEM.ENUMDICNAME CURRENCY, ENUMDICITEM.PARAM2 CURRENCYSIGN,
|
|
|
- M.TRADEMODE,
|
|
|
- H.VENDORNAME`).
|
|
|
+ M.TRADEMODE`).
|
|
|
Join("LEFT", "GOODS G", "G.GOODSID = T.GOODSID").
|
|
|
Join("LEFT", "HSBY_GOODSEX GX", "GX.GOODSID = T.GOODSID").
|
|
|
Join("LEFT", "ENUMDICITEM E", "E.ENUMITEMNAME = G.CURRENCYID and E.ENUMDICCODE = 'currency'").
|
|
|
Join("LEFT", "MARKET M", "M.MARKETID = T.MARKETID").
|
|
|
- Join("LEFT", "HSBY_SUPPLIERINFO H", "H.VENDORID = GX.VENDORID").
|
|
|
Where(fmt.Sprintf("T.MARKETID in (%s)", marketIDs)).
|
|
|
And("T.ORDERSTATUS in (3,7) and T.BUYORSELL = 1 and (T.ORDERQTY - T.TRADEQTY - T.CANCELQTY) > 0")
|
|
|
if categoryID != 0 {
|
|
|
@@ -1491,6 +1483,77 @@ func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID int) ([]HsbyMa
|
|
|
return orders, nil
|
|
|
}
|
|
|
|
|
|
+// HsbyMarketGoodsDetail 特卖商城商品(三级市场商场)
|
|
|
+type HsbyMarketGoodsDetail struct {
|
|
|
+ Orderid string `json:"orderid" xorm:"'ORDERIDSTR'" binding:"required"` // 委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
|
|
|
+ Marketid int32 `json:"marketid" xorm:"'MARKETID'" binding:"required"` // 市场ID
|
|
|
+ Goodsid int32 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID
|
|
|
+ Accountid int64 `json:"accountid" xorm:"'ACCOUNTID'" binding:"required"` // 账户ID[报价币种]
|
|
|
+ Buyorsell int32 `json:"buyorsell" xorm:"'BUYORSELL'" binding:"required"` // 买卖 - 0:买 1:卖
|
|
|
+ Orderprice float64 `json:"orderprice" xorm:"'ORDERPRICE'"` // 委托价格
|
|
|
+ Orderqty int64 `json:"orderqty" xorm:"'ORDERQTY'" binding:"required"` // 委托数量
|
|
|
+ Tradeqty int64 `json:"tradeqty" xorm:"'TRADEQTY'"` // 成交数量
|
|
|
+ Cancelqty int64 `json:"cancelqty" xorm:"'CANCELQTY'"` // 撤单数量
|
|
|
+ Orderstatus int32 `json:"orderstatus" xorm:"'ORDERSTATUS'"` // 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
|
|
|
+
|
|
|
+ Goodscode string `json:"goodscode" xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
|
|
|
+ Goodsname string `json:"goodsname" xorm:"'GOODSNAME'" binding:"required"` // 商品名称
|
|
|
+ Decimalplace int64 `json:"decimalplace" xorm:"'DECIMALPLACE'"` // 报价小数位
|
|
|
+ Quoteminunit int64 `json:"quoteminunit" xorm:"'QUOTEMINUNIT'"` // 行情最小变动单位 [整数,报价小数位一起使用]
|
|
|
+ Agreeunit float64 `json:"agreeunit" xorm:"'AGREEUNIT'"` // 合约单位
|
|
|
+
|
|
|
+ Hotindex int32 `json:"hotindex" xorm:"'HOTINDEX'"` // 景点热度
|
|
|
+ Videourls string `json:"videourls" xorm:"'VIDEOURLS'"` // 介绍视频[多张用逗号分隔]
|
|
|
+ Picurls string `json:"picurls" xorm:"'PICURLS'"` // 介绍图片[多张用逗号分隔]
|
|
|
+ Categoryid int32 `json:"categoryid" xorm:"'CATEGORYID'"` // 类别ID(WRCATEGORY)
|
|
|
+ Goodsdesc string `json:"goodsdesc" xorm:"'GOODSDESC'"` // 商品详情
|
|
|
+
|
|
|
+ Currency string `json:"currency" xorm:"'CURRENCY'"` // 货币
|
|
|
+ Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
|
|
|
+
|
|
|
+ Trademode int32 `json:"trademode" xorm:"'TRADEMODE'" binding:"required"` // 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
|
|
|
+
|
|
|
+ Vendorname string `json:"vendorname" xorm:"'VENDORNAME'"` // 供应商名称
|
|
|
+
|
|
|
+ Customername string `json:"customername" xorm:"'CUSTOMERNAME'"` // 卖家名称
|
|
|
+
|
|
|
+ SellUserID int `json:"sellUserID" xorm:"SELLUSERID"` // 卖方UserID
|
|
|
+}
|
|
|
+
|
|
|
+// GetHsbyMarketGoodsDetail 获取商城商品详情(三级商城)
|
|
|
+func GetHsbyMarketGoodsDetail(orderID int) (*HsbyMarketGoodsDetail, error) {
|
|
|
+ engine := db.GetEngine()
|
|
|
+
|
|
|
+ orders := make([]HsbyMarketGoodsDetail, 0)
|
|
|
+ // 与挂牌点选不一样的是商城是以委托单为主表
|
|
|
+ session := engine.Table("TRADE_ORDERDETAIL T").
|
|
|
+ Select(`to_char(T.ORDERID) ORDERIDSTR, T.*,
|
|
|
+ G.GOODSCODE, G.GOODSNAME, G.DECIMALPLACE, G.QUOTEMINUNIT, G.AGREEUNIT,
|
|
|
+ GX.HOTINDEX, GX.VIDEOURLS, GX.PICURLS, GX.CATEGORYID, GX.GOODSDESC,
|
|
|
+ ENUMDICITEM.ENUMDICNAME CURRENCY, ENUMDICITEM.PARAM2 CURRENCYSIGN,
|
|
|
+ M.TRADEMODE,
|
|
|
+ H.VENDORNAME,
|
|
|
+ U.USERID SELLUSERID, U.CUSTOMERNAME`).
|
|
|
+ Join("LEFT", "GOODS G", "G.GOODSID = T.GOODSID").
|
|
|
+ Join("LEFT", "HSBY_GOODSEX GX", "GX.GOODSID = T.GOODSID").
|
|
|
+ Join("LEFT", "ENUMDICITEM E", "E.ENUMITEMNAME = G.CURRENCYID and E.ENUMDICCODE = 'currency'").
|
|
|
+ Join("LEFT", "MARKET M", "M.MARKETID = T.MARKETID").
|
|
|
+ Join("LEFT", "HSBY_SUPPLIERINFO H", "H.VENDORID = GX.VENDORID").
|
|
|
+ Join("LEFT", "TAACCOUNT TA", "TA.ACCOUNTID = T.ACCOUNTID").
|
|
|
+ Join("LEFT", "USERINFO U", "U.USERID = TA.RELATEDUSERID").
|
|
|
+ Where("T.ORDERID = ?", orderID)
|
|
|
+ if err := session.Find(&orders); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ // 无目标商品
|
|
|
+ if len(orders) == 0 {
|
|
|
+ return nil, nil
|
|
|
+ }
|
|
|
+ hsbyMarketGoodsDetail := orders[0]
|
|
|
+
|
|
|
+ return &hsbyMarketGoodsDetail, nil
|
|
|
+}
|
|
|
+
|
|
|
// MyCoupon 我的优惠卷
|
|
|
type MyCoupon struct {
|
|
|
Accountid int64 `json:"accountid" xorm:"'ACCOUNTID'" binding:"required"` // 资金账户ID
|