Kaynağa Gözat

增加查询三级市场(商城)商品信息详情接口

zhou.xiaoning 4 yıl önce
ebeveyn
işleme
6bee4a23f3
6 değiştirilmiş dosya ile 503 ekleme ve 21 silme
  1. 39 0
      controllers/hsby/hsby.go
  2. 142 4
      docs/docs.go
  3. 142 4
      docs/swagger.json
  4. 105 3
      docs/swagger.yaml
  5. 73 10
      models/hsby.go
  6. 2 0
      routers/router.go

+ 39 - 0
controllers/hsby/hsby.go

@@ -1118,6 +1118,45 @@ func QueryHsbyMarketGoodses(c *gin.Context) {
 	}
 }
 
+// QueryHsbyMarketGoodsDetailReq 查询三级市场(商城)商品信息详情请求参数
+type QueryHsbyMarketGoodsDetailReq struct {
+	OrderID int `form:"orderID" binding:"required"`
+}
+
+// QueryHsbyMarketGoodsDetail 查询三级市场(商城)商品信息详情
+// @Summary 查询三级市场(商城)商品信息详情
+// @Produce json
+// @Security ApiKeyAuth
+// @Param orderID query int true "委托单号"
+// @Success 200 {object} models.HsbyMarketGoodsDetail
+// @Failure 500 {object} app.Response
+// @Router /HSBY/QueryHsbyMarketGoodsDetail [get]
+// @Tags 定制【海商报业】
+func QueryHsbyMarketGoodsDetail(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req QueryHsbyMarketGoodsDetailReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("QueryHsbyMarketGoodsDetail failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	// 获取数据
+	detail, err := models.GetHsbyMarketGoodsDetail(req.OrderID)
+	if err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("QueryHsbyMarketGoodsDetail failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功返回
+	logger.GetLogger().Debugln("QueryHsbyMarketGoodsDetail successed: %v", detail)
+	appG.Response(http.StatusOK, e.SUCCESS, detail)
+}
+
 // QueryMyCouponsReq 我的优惠卷查询请求参数
 type QueryMyCouponsReq struct {
 	AccountIDs string `form:"accountIDs" binding:"required"`

+ 142 - 4
docs/docs.go

@@ -1552,6 +1552,45 @@ var doc = `{
                 }
             }
         },
+        "/HSBY/QueryHsbyMarketGoodsDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "定制【海商报业】"
+                ],
+                "summary": "查询三级市场(商城)商品信息详情",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "委托单号",
+                        "name": "orderID",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.HsbyMarketGoodsDetail"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/QueryHsbyMarketGoodses": {
             "get": {
                 "security": [
@@ -6895,6 +6934,109 @@ var doc = `{
                 "goodsname",
                 "marketid",
                 "orderid",
+                "trademode"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "账户ID[报价币种]",
+                    "type": "integer"
+                },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "categoryid": {
+                    "description": "类别ID(WRCATEGORY)",
+                    "type": "integer"
+                },
+                "currency": {
+                    "description": "货币",
+                    "type": "string"
+                },
+                "currencysign": {
+                    "description": "货币符号",
+                    "type": "string"
+                },
+                "customername": {
+                    "description": "卖家名称",
+                    "type": "string"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "hascoupon": {
+                    "description": "是否可用优惠卷",
+                    "type": "boolean"
+                },
+                "hotindex": {
+                    "description": "景点热度",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "orderid": {
+                    "description": "委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "string"
+                },
+                "orderprice": {
+                    "description": "委托价格",
+                    "type": "number"
+                },
+                "orderstatus": {
+                    "description": "委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)",
+                    "type": "integer"
+                },
+                "picurls": {
+                    "description": "介绍图片[多张用逗号分隔]",
+                    "type": "string"
+                },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
+                "sellUserID": {
+                    "description": "卖方UserID",
+                    "type": "integer"
+                },
+                "trademode": {
+                    "description": "交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价",
+                    "type": "integer"
+                },
+                "videourls": {
+                    "description": "介绍视频[多张用逗号分隔]",
+                    "type": "string"
+                }
+            }
+        },
+        "models.HsbyMarketGoodsDetail": {
+            "type": "object",
+            "required": [
+                "accountid",
+                "buyorsell",
+                "goodscode",
+                "goodsid",
+                "goodsname",
+                "marketid",
+                "orderid",
                 "orderqty",
                 "trademode"
             ],
@@ -6951,10 +7093,6 @@ var doc = `{
                     "description": "商品名称",
                     "type": "string"
                 },
-                "hascoupon": {
-                    "description": "是否可用优惠卷",
-                    "type": "boolean"
-                },
                 "hotindex": {
                     "description": "景点热度",
                     "type": "integer"

+ 142 - 4
docs/swagger.json

@@ -1536,6 +1536,45 @@
                 }
             }
         },
+        "/HSBY/QueryHsbyMarketGoodsDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "定制【海商报业】"
+                ],
+                "summary": "查询三级市场(商城)商品信息详情",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "委托单号",
+                        "name": "orderID",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.HsbyMarketGoodsDetail"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/QueryHsbyMarketGoodses": {
             "get": {
                 "security": [
@@ -6879,6 +6918,109 @@
                 "goodsname",
                 "marketid",
                 "orderid",
+                "trademode"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "账户ID[报价币种]",
+                    "type": "integer"
+                },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "categoryid": {
+                    "description": "类别ID(WRCATEGORY)",
+                    "type": "integer"
+                },
+                "currency": {
+                    "description": "货币",
+                    "type": "string"
+                },
+                "currencysign": {
+                    "description": "货币符号",
+                    "type": "string"
+                },
+                "customername": {
+                    "description": "卖家名称",
+                    "type": "string"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "hascoupon": {
+                    "description": "是否可用优惠卷",
+                    "type": "boolean"
+                },
+                "hotindex": {
+                    "description": "景点热度",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "orderid": {
+                    "description": "委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "string"
+                },
+                "orderprice": {
+                    "description": "委托价格",
+                    "type": "number"
+                },
+                "orderstatus": {
+                    "description": "委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)",
+                    "type": "integer"
+                },
+                "picurls": {
+                    "description": "介绍图片[多张用逗号分隔]",
+                    "type": "string"
+                },
+                "quoteminunit": {
+                    "description": "行情最小变动单位 [整数,报价小数位一起使用]",
+                    "type": "integer"
+                },
+                "sellUserID": {
+                    "description": "卖方UserID",
+                    "type": "integer"
+                },
+                "trademode": {
+                    "description": "交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价",
+                    "type": "integer"
+                },
+                "videourls": {
+                    "description": "介绍视频[多张用逗号分隔]",
+                    "type": "string"
+                }
+            }
+        },
+        "models.HsbyMarketGoodsDetail": {
+            "type": "object",
+            "required": [
+                "accountid",
+                "buyorsell",
+                "goodscode",
+                "goodsid",
+                "goodsname",
+                "marketid",
+                "orderid",
                 "orderqty",
                 "trademode"
             ],
@@ -6935,10 +7077,6 @@
                     "description": "商品名称",
                     "type": "string"
                 },
-                "hascoupon": {
-                    "description": "是否可用优惠卷",
-                    "type": "boolean"
-                },
                 "hotindex": {
                     "description": "景点热度",
                     "type": "integer"

+ 105 - 3
docs/swagger.yaml

@@ -2403,6 +2403,87 @@ definitions:
       buyorsell:
         description: 买卖 - 0:买 1:卖
         type: integer
+      categoryid:
+        description: 类别ID(WRCATEGORY)
+        type: integer
+      currency:
+        description: 货币
+        type: string
+      currencysign:
+        description: 货币符号
+        type: string
+      customername:
+        description: 卖家名称
+        type: string
+      decimalplace:
+        description: 报价小数位
+        type: integer
+      goodscode:
+        description: 商品代码(内部)
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      hascoupon:
+        description: 是否可用优惠卷
+        type: boolean
+      hotindex:
+        description: 景点热度
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      orderid:
+        description: 委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        type: string
+      orderprice:
+        description: 委托价格
+        type: number
+      orderstatus:
+        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交
+          9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤
+          16:成交失败违约(荷兰式竞拍专用)
+        type: integer
+      picurls:
+        description: 介绍图片[多张用逗号分隔]
+        type: string
+      quoteminunit:
+        description: 行情最小变动单位 [整数,报价小数位一起使用]
+        type: integer
+      sellUserID:
+        description: 卖方UserID
+        type: integer
+      trademode:
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
+          21:竞拍-大宗式 22:受托竞价
+        type: integer
+      videourls:
+        description: 介绍视频[多张用逗号分隔]
+        type: string
+    required:
+    - accountid
+    - buyorsell
+    - goodscode
+    - goodsid
+    - goodsname
+    - marketid
+    - orderid
+    - trademode
+    type: object
+  models.HsbyMarketGoodsDetail:
+    properties:
+      accountid:
+        description: 账户ID[报价币种]
+        type: integer
+      agreeunit:
+        description: 合约单位
+        type: number
+      buyorsell:
+        description: 买卖 - 0:买 1:卖
+        type: integer
       cancelqty:
         description: 撤单数量
         type: integer
@@ -2433,9 +2514,6 @@ definitions:
       goodsname:
         description: 商品名称
         type: string
-      hascoupon:
-        description: 是否可用优惠卷
-        type: boolean
       hotindex:
         description: 景点热度
         type: integer
@@ -6189,6 +6267,30 @@ paths:
       summary: 查询二级市场(挂牌点选)商品信息详情
       tags:
       - 定制【海商报业】
+  /HSBY/QueryHsbyMarketGoodsDetail:
+    get:
+      parameters:
+      - description: 委托单号
+        in: query
+        name: orderID
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/models.HsbyMarketGoodsDetail'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询三级市场(商城)商品信息详情
+      tags:
+      - 定制【海商报业】
   /HSBY/QueryHsbyMarketGoodses:
     get:
       parameters:

+ 73 - 10
models/hsby.go

@@ -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

+ 2 - 0
routers/router.go

@@ -274,6 +274,8 @@ func InitRouter() *gin.Engine {
 		hsbyR.GET("/QueryHsbyMarkets", hsby.QueryHsbyMarkets)
 		// 查询特卖商品列表(三级商城)
 		hsbyR.GET("/QueryHsbyMarketGoodses", hsby.QueryHsbyMarketGoodses)
+		// 查询三级市场(商城)商品信息详情
+		hsbyR.GET("/QueryHsbyMarketGoodsDetail", hsby.QueryHsbyMarketGoodsDetail)
 		// 我的优惠卷查询
 		hsbyR.GET("/QueryMyCoupons", hsby.QueryMyCoupons)
 	}