Ver código fonte

计算我的订单中的金额等

zhou.xiaoning 5 anos atrás
pai
commit
6ecb131c3f
4 arquivos alterados com 161 adições e 10 exclusões
  1. 40 0
      docs/docs.go
  2. 40 0
      docs/swagger.json
  3. 30 0
      docs/swagger.yaml
  4. 51 10
      models/hsby.go

+ 40 - 0
docs/docs.go

@@ -3819,6 +3819,10 @@ var doc = `{
                     "description": "涨停价",
                     "type": "number"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -3827,6 +3831,10 @@ var doc = `{
                     "description": "介绍图片[多张用逗号分隔]",
                     "type": "string"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "vendorattr": {
                     "description": "供应商附件(多张,逗号分隔)",
                     "type": "string"
@@ -3941,6 +3949,10 @@ var doc = `{
                     "description": "商品状态- 2:未上市 3:上市",
                     "type": "integer"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -3953,6 +3965,10 @@ var doc = `{
                     "description": "预售数量",
                     "type": "integer"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "refprice": {
                     "description": "参考价格[一口价]",
                     "type": "number"
@@ -4028,6 +4044,10 @@ var doc = `{
                     "description": "报价单位",
                     "type": "string"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -4040,6 +4060,10 @@ var doc = `{
                     "description": "预售数量",
                     "type": "integer"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "refprice": {
                     "description": "参考价格[一口价]",
                     "type": "number"
@@ -4111,6 +4135,10 @@ var doc = `{
                     "description": "现价",
                     "type": "number"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -4119,6 +4147,10 @@ var doc = `{
                     "description": "介绍图片[多张用逗号分隔]",
                     "type": "string"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "videourls": {
                     "description": "介绍视频[多张用逗号分隔]",
                     "type": "string"
@@ -4144,6 +4176,10 @@ var doc = `{
                     "description": "账户ID[报价币种]",
                     "type": "integer"
                 },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
                 "buyorsell": {
                     "description": "买卖 - 0:买 1:卖",
                     "type": "integer"
@@ -4184,6 +4220,10 @@ var doc = `{
                     "description": "\"我的订单\"显示状态- 1:抢购中 2:求购中 3:已完成 4:已撤消 5:委托失败",
                     "type": "integer"
                 },
+                "orderamount": {
+                    "description": "委托金额",
+                    "type": "number"
+                },
                 "orderid": {
                     "description": "委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
                     "type": "string"

+ 40 - 0
docs/swagger.json

@@ -3803,6 +3803,10 @@
                     "description": "涨停价",
                     "type": "number"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -3811,6 +3815,10 @@
                     "description": "介绍图片[多张用逗号分隔]",
                     "type": "string"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "vendorattr": {
                     "description": "供应商附件(多张,逗号分隔)",
                     "type": "string"
@@ -3925,6 +3933,10 @@
                     "description": "商品状态- 2:未上市 3:上市",
                     "type": "integer"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -3937,6 +3949,10 @@
                     "description": "预售数量",
                     "type": "integer"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "refprice": {
                     "description": "参考价格[一口价]",
                     "type": "number"
@@ -4012,6 +4028,10 @@
                     "description": "报价单位",
                     "type": "string"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -4024,6 +4044,10 @@
                     "description": "预售数量",
                     "type": "integer"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "refprice": {
                     "description": "参考价格[一口价]",
                     "type": "number"
@@ -4095,6 +4119,10 @@
                     "description": "现价",
                     "type": "number"
                 },
+                "lotsize": {
+                    "description": "最小变动单位",
+                    "type": "number"
+                },
                 "marketid": {
                     "description": "所属市场ID",
                     "type": "integer"
@@ -4103,6 +4131,10 @@
                     "description": "介绍图片[多张用逗号分隔]",
                     "type": "string"
                 },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
                 "videourls": {
                     "description": "介绍视频[多张用逗号分隔]",
                     "type": "string"
@@ -4128,6 +4160,10 @@
                     "description": "账户ID[报价币种]",
                     "type": "integer"
                 },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
                 "buyorsell": {
                     "description": "买卖 - 0:买 1:卖",
                     "type": "integer"
@@ -4168,6 +4204,10 @@
                     "description": "\"我的订单\"显示状态- 1:抢购中 2:求购中 3:已完成 4:已撤消 5:委托失败",
                     "type": "integer"
                 },
+                "orderamount": {
+                    "description": "委托金额",
+                    "type": "number"
+                },
                 "orderid": {
                     "description": "委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
                     "type": "string"

+ 30 - 0
docs/swagger.yaml

@@ -1311,12 +1311,18 @@ definitions:
       limitup:
         description: 涨停价
         type: number
+      lotsize:
+        description: 最小变动单位
+        type: number
       marketid:
         description: 所属市场ID
         type: integer
       picurls:
         description: 介绍图片[多张用逗号分隔]
         type: string
+      quoteminunit:
+        description: 行情最小变动单位 [整数,报价小数位一起使用]
+        type: integer
       vendorattr:
         description: 供应商附件(多张,逗号分隔)
         type: string
@@ -1402,6 +1408,9 @@ definitions:
       goodsstatus:
         description: 商品状态- 2:未上市 3:上市
         type: integer
+      lotsize:
+        description: 最小变动单位
+        type: number
       marketid:
         description: 所属市场ID
         type: integer
@@ -1411,6 +1420,9 @@ definitions:
       presaleqty:
         description: 预售数量
         type: integer
+      quoteminunit:
+        description: 行情最小变动单位 [整数,报价小数位一起使用]
+        type: integer
       refprice:
         description: 参考价格[一口价]
         type: number
@@ -1467,6 +1479,9 @@ definitions:
       goodunit:
         description: 报价单位
         type: string
+      lotsize:
+        description: 最小变动单位
+        type: number
       marketid:
         description: 所属市场ID
         type: integer
@@ -1476,6 +1491,9 @@ definitions:
       presaleqty:
         description: 预售数量
         type: integer
+      quoteminunit:
+        description: 行情最小变动单位 [整数,报价小数位一起使用]
+        type: integer
       refprice:
         description: 参考价格[一口价]
         type: number
@@ -1529,12 +1547,18 @@ definitions:
       last:
         description: 现价
         type: number
+      lotsize:
+        description: 最小变动单位
+        type: number
       marketid:
         description: 所属市场ID
         type: integer
       picurls:
         description: 介绍图片[多张用逗号分隔]
         type: string
+      quoteminunit:
+        description: 行情最小变动单位 [整数,报价小数位一起使用]
+        type: integer
       videourls:
         description: 介绍视频[多张用逗号分隔]
         type: string
@@ -1549,6 +1573,9 @@ definitions:
       accountid:
         description: 账户ID[报价币种]
         type: integer
+      agreeunit:
+        description: 合约单位
+        type: number
       buyorsell:
         description: 买卖 - 0:买 1:卖
         type: integer
@@ -1579,6 +1606,9 @@ definitions:
       mybuystatus:
         description: '"我的订单"显示状态- 1:抢购中 2:求购中 3:已完成 4:已撤消 5:委托失败'
         type: integer
+      orderamount:
+        description: 委托金额
+        type: number
       orderid:
         description: 委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
         type: string

+ 51 - 10
models/hsby.go

@@ -2,6 +2,7 @@ package models
 
 import (
 	"fmt"
+	"math"
 	"mtp2_if/db"
 	"mtp2_if/utils"
 	"strconv"
@@ -55,6 +56,7 @@ type HsbyTopGoods struct {
 	Goodsname    string `json:"goodsname"  xorm:"'GOODSNAME'" binding:"required"` // 商品名称
 	Decimalplace int64  `json:"decimalplace"  xorm:"'DECIMALPLACE'"`              // 报价小数位
 	Marketid     int64  `json:"marketid"  xorm:"'MARKETID'" binding:"required"`   // 所属市场ID
+	Quoteminunit int64  `json:"quoteminunit"  xorm:"'QUOTEMINUNIT'"`              // 行情最小变动单位 [整数,报价小数位一起使用]
 
 	Hotindex  int32  `json:"hotindex"  xorm:"'HOTINDEX'"`   // 景点热度
 	Videourls string `json:"videourls"  xorm:"'VIDEOURLS'"` // 介绍视频[多张用逗号分隔]
@@ -63,7 +65,8 @@ type HsbyTopGoods struct {
 	Currency     string `json:"currency" xorm:"'CURRENCY'"`         // 货币
 	Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
 
-	Last float64 `json:"last" xorm:"-"` // 现价
+	Last    float64 `json:"last" xorm:"-"`    // 现价
+	LotSize float64 `json:"lotsize" xorm:"-"` // 最小变动单位
 }
 
 // GetHsbyTopGoodses 获取热门商品列表
@@ -115,10 +118,15 @@ func GetHsbyTopGoodses(marketIDs string, descProvinceID, descCityID int) ([]Hsby
 		return nil, err
 	}
 	for i, g := range topGoodses {
+		topGoods := &topGoodses[i]
+		// FIXME: - 这里应该使用 Duck Typing,后期再处理
+		// 计算最小变动单位
+		lotSize := float64(topGoods.Quoteminunit) * math.Pow(0.1, float64(topGoods.Decimalplace))
+		topGoods.LotSize, _ = strconv.ParseFloat(utils.FormatFloat(lotSize, int(topGoods.Decimalplace)), 64)
+
 		for _, q := range quoteDays {
 			if g.Goodscode == q.Goodscode {
 				if q.Last != 0 {
-					topGoods := &topGoodses[i]
 					topGoods.Last = utils.IntToFloat64(int(q.Last), int(g.Decimalplace))
 				}
 
@@ -137,6 +145,7 @@ type HsbyListingGoodsDetail struct {
 	Goodsname    string `json:"goodsname"  xorm:"'GOODSNAME'" binding:"required"` // 商品名称
 	Decimalplace int64  `json:"decimalplace"  xorm:"'DECIMALPLACE'"`              // 报价小数位
 	Marketid     int64  `json:"marketid"  xorm:"'MARKETID'" binding:"required"`   // 所属市场ID
+	Quoteminunit int64  `json:"quoteminunit"  xorm:"'QUOTEMINUNIT'"`              // 行情最小变动单位 [整数,报价小数位一起使用]
 
 	Hotindex       int32  `json:"hotindex"  xorm:"'HOTINDEX'"`             // 景点热度
 	Videourls      string `json:"videourls"  xorm:"'VIDEOURLS'"`           // 介绍视频[多张用逗号分隔]
@@ -155,6 +164,7 @@ type HsbyListingGoodsDetail struct {
 	Last      float64 `json:"last" xorm:"-"`      // 现价
 	Limitup   float64 `json:"limitup" xorm:"-"`   // 涨停价
 	Limitdown float64 `json:"limitdown" xorm:"-"` // 跌停价
+	LotSize   float64 `json:"lotsize" xorm:"-"`   // 最小变动单位
 }
 
 // GetHsbyListingGoodsDetail 获取二级市场(挂牌点选)商品信息详情
@@ -168,7 +178,7 @@ func GetHsbyListingGoodsDetail(goodsID int) (*HsbyListingGoodsDetail, error) {
 	// 获取挂牌商品信息,以及扩展表信息
 	// FIXME: - 这里使用Get方法,会造成SQL语句的嵌套出错,后期再研究
 	session := engine.Table("GOODS").
-		Select(`GOODS.GOODSID, GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.MARKETID,
+		Select(`GOODS.GOODSID, GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.MARKETID, GOODS.QUOTEMINUNIT, 
 				HSBY_GOODSEX.HOTINDEX, HSBY_GOODSEX.VIDEOURLS, HSBY_GOODSEX.PICURLS, HSBY_GOODSEX.DESCPROVINCEID, HSBY_GOODSEX.Desccityid, HSBY_GOODSEX.Goodsdesc,
 				ENUMDICITEM.ENUMDICNAME CURRENCY, ENUMDICITEM.PARAM2 CURRENCYSIGN, 
 				HSBY_SUPPLIERINFO.VENDORNAME, HSBY_SUPPLIERINFO.VENDORPHONE, HSBY_SUPPLIERINFO.VENDORATTR`).
@@ -202,6 +212,11 @@ func GetHsbyListingGoodsDetail(goodsID int) (*HsbyListingGoodsDetail, error) {
 		}
 	}
 
+	// FIXME: - 这里应该使用 Duck Typing,后期再处理
+	// 计算最小变动单位
+	lotSize := float64(hsbyListingGoodsDetail.Quoteminunit) * math.Pow(0.1, float64(hsbyListingGoodsDetail.Decimalplace))
+	hsbyListingGoodsDetail.LotSize, _ = strconv.ParseFloat(utils.FormatFloat(lotSize, int(hsbyListingGoodsDetail.Decimalplace)), 64)
+
 	return &hsbyListingGoodsDetail, nil
 }
 
@@ -232,7 +247,7 @@ func GetHsbyGoodsOrderDetails(goodsID, buyOrSell int, price float64) ([]HsbyGood
 	hsbyGoodsOrderDetails := make([]HsbyGoodsOrderDetail, 0)
 	session := engine.Table("TRADE_ORDERDETAIL").
 		Select(`to_char(TRADE_ORDERDETAIL.ORDERID) ORDERID, TRADE_ORDERDETAIL.BUYORSELL, TRADE_ORDERDETAIL.ORDERTIME, TRADE_ORDERDETAIL.ORDERPRICE, (TRADE_ORDERDETAIL.ORDERQTY - TRADE_ORDERDETAIL.TRADEQTY - TRADE_ORDERDETAIL.CANCELQTY) ENABLEQTY,
-			substr(USERINFO.CUSTOMERNAME,0,1)||'****' as CUSTOMERNAME`).
+				substr(USERINFO.CUSTOMERNAME,0,1)||'****' as CUSTOMERNAME`).
 		Join("LEFT", "TAACCOUNT", "TAACCOUNT.ACCOUNTID = TRADE_ORDERDETAIL.ACCOUNTID").
 		Join("LEFT", "USERINFO", "USERINFO.USERID = TAACCOUNT.RELATEDUSERID").
 		Where("(TRADE_ORDERDETAIL.LISTINGSELECTTYPE = 1 or TRADE_ORDERDETAIL.LISTINGSELECTTYPE = 3) and (TRADE_ORDERDETAIL.ORDERSTATUS = 3 or TRADE_ORDERDETAIL.ORDERSTATUS = 7)").
@@ -299,9 +314,10 @@ type HybsMyBuyOrderDetail struct {
 	Listingselecttype int32     `json:"listingselecttype"  xorm:"'LISTINGSELECTTYPE'"`    // 挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
 	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'"`              // 报价小数位
+	Goodscode    string  `json:"goodscode"  xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
+	Goodsname    string  `json:"goodsname"  xorm:"'GOODSNAME'" binding:"required"` // 商品名称
+	Decimalplace int64   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`              // 报价小数位
+	Agreeunit    float64 `json:"agreeunit"  xorm:"'AGREEUNIT'"`                    // 合约单位
 
 	Picurls string `json:"picurls"  xorm:"'PICURLS'"` // 介绍图片[多张用逗号分隔]
 
@@ -311,7 +327,8 @@ type HybsMyBuyOrderDetail struct {
 
 	Vendorname string `json:"vendorname"  xorm:"'VENDORNAME'"` // 供应商名称
 
-	MyBuyStatus int `json:"mybuystatus" xorm:"-"` // "我的订单"显示状态- 1:抢购中 2:求购中 3:已完成 4:已撤消 5:委托失败
+	MyBuyStatus int     `json:"mybuystatus" xorm:"-"` // "我的订单"显示状态- 1:抢购中 2:求购中 3:已完成 4:已撤消 5:委托失败
+	Orderamount float64 `json:"" xorm:"-"`            // 委托金额
 }
 
 // GetHsbyBuyMyOrderDetails 获取“我的订单”数据(包括一二级市场)
@@ -356,7 +373,7 @@ func GetHsbyBuyMyOrderDetails(accountIDs string, myBuyStatus int) ([]HybsMyBuyOr
 	hybsMyBuyOrderDetails := make([]HybsMyBuyOrderDetail, 0)
 	session := engine.Table("TRADE_ORDERDETAIL").
 		Select(`to_char(TRADE_ORDERDETAIL.ORDERID) ORDERID, TRADE_ORDERDETAIL.*, 
-				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
 				HSBY_GOODSEX.PICURLS, 
 				MARKET.TRADEMODE, 
 				ENUMDICITEM.PARAM2 CURRENCYSIGN,
@@ -383,6 +400,9 @@ func GetHsbyBuyMyOrderDetails(accountIDs string, myBuyStatus int) ([]HybsMyBuyOr
 	for i := range hybsMyBuyOrderDetails {
 		detail := &hybsMyBuyOrderDetails[i]
 
+		// 委托金额 = 委托价格 * 委托数量 * 合约单位
+		detail.Orderamount = detail.Orderprice * float64(detail.Orderqty) * float64(detail.Agreeunit)
+
 		if detail.Trademode == 71 && (detail.Orderstatus == 3 || detail.Orderstatus == 7) {
 			// 抢购中
 			detail.MyBuyStatus = 1
@@ -431,6 +451,7 @@ func GetHsbyMyGoods(accountIDs string) ([]HsbyMyGoods, error) {
 	engine := db.GetEngine()
 
 	hsbyMyGoodses := make([]HsbyMyGoods, 0)
+	// 此定制版本,只查询出当前手数(期末)大于0的数据 (TRADEPOSITION.BUYCURPOSITIONQTY > 0)
 	if err := engine.Table("TRADEPOSITION").
 		Select(`TRADEPOSITION.*, 
 				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
@@ -439,7 +460,7 @@ func GetHsbyMyGoods(accountIDs string) ([]HsbyMyGoods, error) {
 		Join("LEFT", "GOODS", "GOODS.GOODSID = TRADEPOSITION.GOODSID").
 		Join("INNER", "HSBY_GOODSEX", "HSBY_GOODSEX.GOODSID = GOODS.GOODSID").
 		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
-		Where(fmt.Sprintf("TRADEPOSITION.ACCOUNTID in (%s)", accountIDs)).Find(&hsbyMyGoodses); err != nil {
+		Where(fmt.Sprintf("TRADEPOSITION.BUYCURPOSITIONQTY > 0 and TRADEPOSITION.ACCOUNTID in (%s)", accountIDs)).Find(&hsbyMyGoodses); err != nil {
 		return nil, err
 	}
 
@@ -462,6 +483,7 @@ type HsbyPreGoods struct {
 	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'"`              // 行情最小变动单位 [整数,报价小数位一起使用]
 
 	Relatedgoodsid int64     `json:"relatedgoodsid"  xorm:"'RELATEDGOODSID'"` // 关联交易合约ID
 	Presaleqty     int64     `json:"presaleqty"  xorm:"'PRESALEQTY'"`         // 预售数量
@@ -474,6 +496,8 @@ type HsbyPreGoods struct {
 
 	Videourls string `json:"videourls"  xorm:"'VIDEOURLS'"` // 介绍视频[多张用逗号分隔]
 	Picurls   string `json:"picurls"  xorm:"'PICURLS'"`     // 介绍图片[多张用逗号分隔]
+
+	LotSize float64 `json:"lotsize" xorm:"-"` // 最小变动单位
 }
 
 // GetHsbyPreGoodses 获取“新品上市”商品列表(一级市场产能预售)
@@ -507,6 +531,15 @@ func GetHsbyPreGoodses(marketIDs string, descProvinceID, descCityID int) ([]Hsby
 		return nil, err
 	}
 
+	for i := range preGoodses {
+		preGoods := &preGoodses[i]
+
+		// FIXME: - 这里应该使用 Duck Typing,后期再处理
+		// 计算最小变动单位
+		lotSize := float64(preGoods.Quoteminunit) * math.Pow(0.1, float64(preGoods.Decimalplace))
+		preGoods.LotSize, _ = strconv.ParseFloat(utils.FormatFloat(lotSize, int(preGoods.Decimalplace)), 64)
+	}
+
 	return preGoodses, nil
 }
 
@@ -518,6 +551,7 @@ type HsbyPreGoodsDetail struct {
 	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'"`              // 行情最小变动单位 [整数,报价小数位一起使用]
 
 	Relatedgoodsid int64     `json:"relatedgoodsid"  xorm:"'RELATEDGOODSID'"` // 关联交易合约ID
 	Presaleqty     int64     `json:"presaleqty"  xorm:"'PRESALEQTY'"`         // 预售数量
@@ -538,6 +572,8 @@ type HsbyPreGoodsDetail struct {
 	Vendorname  string `json:"vendorname"  xorm:"'VENDORNAME'"`   // 供应商名称
 	Vendorphone string `json:"vendorphone"  xorm:"'VENDORPHONE'"` // 供应商客服电话
 	Vendorattr  string `json:"vendorattr"  xorm:"'VENDORATTR'"`   // 供应商附件(多张,逗号分隔)
+
+	LotSize float64 `json:"lotsize" xorm:"-"` // 最小变动单位
 }
 
 // GetHsbyPreGoodsDetail 获取一级市场(产能预售)商品信息详情
@@ -573,5 +609,10 @@ func GetHsbyPreGoodsDetail(goodsID int) (*HsbyPreGoodsDetail, error) {
 	}
 	preGoodsDetail := details[0]
 
+	// FIXME: - 这里应该使用 Duck Typing,后期再处理
+	// 计算最小变动单位
+	lotSize := float64(preGoodsDetail.Quoteminunit) * math.Pow(0.1, float64(preGoodsDetail.Decimalplace))
+	preGoodsDetail.LotSize, _ = strconv.ParseFloat(utils.FormatFloat(lotSize, int(preGoodsDetail.Decimalplace)), 64)
+
 	return &preGoodsDetail, nil
 }