瀏覽代碼

"出售大厅"和“我的出售”增加“钻石分类描述”出参;修改“我的库存”接口,可使用于“我要出售”业务

zhou.xiaoning 3 年之前
父節點
當前提交
b4f045571e
共有 4 個文件被更改,包括 73 次插入19 次删除
  1. 16 0
      docs/docs.go
  2. 16 0
      docs/swagger.json
  3. 12 0
      docs/swagger.yaml
  4. 29 19
      models/guangzuan.go

+ 16 - 0
docs/docs.go

@@ -28001,6 +28001,10 @@ const docTemplate = `{
                     "description": "钻石分类 - 枚举”ZSCategory“",
                     "type": "integer"
                 },
+                "zscategorydisplay": {
+                    "description": "钻石分类 - 描述",
+                    "type": "string"
+                },
                 "zscurrencytype": {
                     "description": "货币类型 - 枚举“ZSCurrencyType”",
                     "type": "integer"
@@ -28049,6 +28053,10 @@ const docTemplate = `{
                     "description": "金伯利证书重量 - 类型:3",
                     "type": "string"
                 },
+                "ladingbillid": {
+                    "description": "提单ID(208+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
                 "marketprice": {
                     "description": "市场价",
                     "type": "string"
@@ -28097,6 +28105,10 @@ const docTemplate = `{
                     "description": "配石描述 - 类型:4",
                     "type": "string"
                 },
+                "subnum": {
+                    "description": "提单子单号",
+                    "type": "integer"
+                },
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
@@ -29164,6 +29176,10 @@ const docTemplate = `{
                     "description": "钻石分类 - 枚举”ZSCategory“",
                     "type": "integer"
                 },
+                "zscategorydisplay": {
+                    "description": "钻石分类 - 描述",
+                    "type": "string"
+                },
                 "zscurrencytype": {
                     "description": "货币类型 - 枚举“ZSCurrencyType”",
                     "type": "integer"

+ 16 - 0
docs/swagger.json

@@ -27992,6 +27992,10 @@
                     "description": "钻石分类 - 枚举”ZSCategory“",
                     "type": "integer"
                 },
+                "zscategorydisplay": {
+                    "description": "钻石分类 - 描述",
+                    "type": "string"
+                },
                 "zscurrencytype": {
                     "description": "货币类型 - 枚举“ZSCurrencyType”",
                     "type": "integer"
@@ -28040,6 +28044,10 @@
                     "description": "金伯利证书重量 - 类型:3",
                     "type": "string"
                 },
+                "ladingbillid": {
+                    "description": "提单ID(208+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
                 "marketprice": {
                     "description": "市场价",
                     "type": "string"
@@ -28088,6 +28096,10 @@
                     "description": "配石描述 - 类型:4",
                     "type": "string"
                 },
+                "subnum": {
+                    "description": "提单子单号",
+                    "type": "integer"
+                },
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
@@ -29155,6 +29167,10 @@
                     "description": "钻石分类 - 枚举”ZSCategory“",
                     "type": "integer"
                 },
+                "zscategorydisplay": {
+                    "description": "钻石分类 - 描述",
+                    "type": "string"
+                },
                 "zscurrencytype": {
                     "description": "货币类型 - 枚举“ZSCurrencyType”",
                     "type": "integer"

+ 12 - 0
docs/swagger.yaml

@@ -11056,6 +11056,9 @@ definitions:
       zscategory:
         description: 钻石分类 - 枚举”ZSCategory“
         type: integer
+      zscategorydisplay:
+        description: 钻石分类 - 描述
+        type: string
       zscurrencytype:
         description: 货币类型 - 枚举“ZSCurrencyType”
         type: integer
@@ -11091,6 +11094,9 @@ definitions:
       kpweight:
         description: 金伯利证书重量 - 类型:3
         type: string
+      ladingbillid:
+        description: 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
       marketprice:
         description: 市场价
         type: string
@@ -11127,6 +11133,9 @@ definitions:
       stonedesc:
         description: 配石描述 - 类型:4
         type: string
+      subnum:
+        description: 提单子单号
+        type: integer
       userid:
         description: 用户ID
         type: integer
@@ -11916,6 +11925,9 @@ definitions:
       zscategory:
         description: 钻石分类 - 枚举”ZSCategory“
         type: integer
+      zscategorydisplay:
+        description: 钻石分类 - 描述
+        type: string
       zscurrencytype:
         description: 货币类型 - 枚举“ZSCurrencyType”
         type: integer

+ 29 - 19
models/guangzuan.go

@@ -161,10 +161,12 @@ type MyWRPosition struct {
 	ZSCZCOLOR3TYPE      int32   `json:"zsczcolor3type" xorm:"ZSCZCOLOR3TYPE"`              // 彩钻颜色3 - 枚举”ZSCZColor3Type“ - 类型:5
 	ISVALID             int32   `json:"isvalid" xorm:"ISVALID"`                            // 是否有效 - 0:无效 1:有效
 
-	TOTALQTY   int64   `json:"-" xorm:"TOTALQTY"`
-	FREEZEQTY  int64   `json:"-" xorm:"FREEZEQTY"`
-	FTOTALQTY  float64 `json:"ftotalqty"`  // 库存数量:WRPosition表:TOTALQTY /100 , 保留两位小数
-	FFREEZEQTY float64 `json:"ffreezeqty"` // 冻结数量:WRPosition表:FREEZEQTY/100 , 保留两位小数
+	QTY          int64   `json:"-" xorm:"QTY"`
+	FREEZERQTY   int64   `json:"-" xorm:"FREEZERQTY"`
+	FTOTALQTY    float64 `json:"ftotalqty"`                        // 库存数量:WRPosition表:TOTALQTY /100 , 保留两位小数
+	FFREEZEQTY   float64 `json:"ffreezeqty"`                       // 冻结数量:WRPosition表:FREEZEQTY/100 , 保留两位小数
+	LADINGBILLID int64   `json:"ladingbillid" xorm:"LADINGBILLID"` // 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
+	SUBNUM       int32   `json:"subnum" xorm:"SUBNUM"`             // 提单子单号
 
 	PageEx `xorm:"extends"` // 页码信息
 
@@ -172,13 +174,13 @@ type MyWRPosition struct {
 }
 
 func (r *MyWRPosition) calc() {
-	if r.TOTALQTY != 0 {
-		a := SFLOAT64(r.TOTALQTY / 100)
+	if r.QTY != 0 {
+		a := SFLOAT64(r.QTY / 100)
 		a.Round(2)
 		r.FTOTALQTY = a.Float64()
 	}
-	if r.FREEZEQTY != 0 {
-		a := SFLOAT64(r.FREEZEQTY / 100)
+	if r.FREEZERQTY != 0 {
+		a := SFLOAT64(r.FREEZERQTY / 100)
 		a.Round(2)
 		r.FFREEZEQTY = a.Float64()
 	}
@@ -187,12 +189,14 @@ func (r *MyWRPosition) calc() {
 func (r *MyWRPosition) buildSql() string {
 	var sqlId utils.SQLVal = `
 	SELECT 
-		t.TOTALQTY,
-		t.FREEZEQTY,
+		t.QTY,
+		t.FREEZERQTY,
+		t.LADINGBILLID,
+		t.SUBNUM,
 		wr.* 
-	FROM WRPosition t
+	FROM WRHoldLB t
 	INNER JOIN WRFactorType ft ON t.wrfactortypeid = ft.wrfactortypeid
-	INNER JOIN View_GZ_WRStandard_Ex_Query wr ON ft.wrstandardid = wr.wrstandardid 
+	INNER JOIN View_GZ_WRStandard_Ex_Query wr ON ft.wrstandardid = wr.wrstandardid
 	WHERE t.wruserid = %v
 	`
 
@@ -328,8 +332,9 @@ type SellOrderQueryReq struct {
 
 // SellOrder 出售大厅委托单
 type SellOrder struct {
-	ZSALLPROPERTIES string `json:"-" xorm:"ZSALLPROPERTIES" form:"zsallproperties"`      // 商品(查询字段-模糊查询)
-	SELLUSERNAME    string `json:"sellusername" xorm:"SELLUSERNAME" form:"sellusername"` // 卖方(查询字段-模糊查询)
+	ZSALLPROPERTIES   string `json:"-" xorm:"ZSALLPROPERTIES" form:"zsallproperties"`      // 商品(查询字段-模糊查询)
+	SELLUSERNAME      string `json:"sellusername" xorm:"SELLUSERNAME" form:"sellusername"` // 卖方(查询字段-模糊查询)
+	ZSCATEGORYDISPLAY string `json:"zscategorydisplay" xorm:"ZSCATEGORYDISPLAY"`           // 钻石分类 - 描述
 
 	WRSTANDARDID   int64  `json:"wrstandardid" xorm:"WRSTANDARDID"`               // 现货商品ID
 	USERID         int64  `json:"userid" xorm:"USERID"`                           // 用户ID
@@ -437,6 +442,7 @@ func (r *SellOrder) buildSql() string {
 	SELECT
 		(t.ORDERQTY / 100) TOTALQTY,
 		((t.ORDERQTY - t.TRADEQTY) / 100) REMAINQTY,
+		q.ZSCATEGORYDISPLAY,
 		q.SELLUSERNAME,
 		q.ZSCATEGORY,
 		q.ZSCURRENCYTYPE,
@@ -462,6 +468,7 @@ func (r *SellOrder) buildQueryDiamond() string {
 	SELECT
 		(t.ORDERQTY / 100) TOTALQTY,
 		((t.ORDERQTY - t.TRADEQTY) / 100) REMAINQTY,
+		q.ZSCATEGORYDISPLAY,
 		q.SELLUSERNAME,
 		q.ZSCATEGORY,
 		q.ZSCURRENCYTYPE,
@@ -655,11 +662,12 @@ func (r *MyBuyOrder) GetDataByPage() (interface{}, error, int, int, int) {
 type MySellOrder struct {
 	ZSALLPROPERTIES string `json:"-" xorm:"ZSALLPROPERTIES" form:"zsallproperties"` // 商品(查询字段-模糊查询)
 
-	WRSTANDARDID   int64  `json:"wrstandardid" xorm:"WRSTANDARDID"`                      // 现货商品ID
-	USERID         int64  `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
-	ZSCATEGORY     int32  `json:"zscategory" xorm:"ZSCATEGORY" form:"zscategory"`        // 钻石分类 - 枚举”ZSCategory“
-	ZSCURRENCYTYPE int32  `json:"zscurrencytype" xorm:"ZSCURRENCYTYPE"`                  // 货币类型 - 枚举“ZSCurrencyType”
-	GOODSNO        string `json:"goodsno" xorm:"GOODSNO"`                                // 商品编号
+	WRSTANDARDID      int64  `json:"wrstandardid" xorm:"WRSTANDARDID"`                      // 现货商品ID
+	USERID            int64  `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
+	ZSCATEGORY        int32  `json:"zscategory" xorm:"ZSCATEGORY" form:"zscategory"`        // 钻石分类 - 枚举”ZSCategory“
+	ZSCURRENCYTYPE    int32  `json:"zscurrencytype" xorm:"ZSCURRENCYTYPE"`                  // 货币类型 - 枚举“ZSCurrencyType”
+	GOODSNO           string `json:"goodsno" xorm:"GOODSNO"`                                // 商品编号
+	ZSCATEGORYDISPLAY string `json:"zscategorydisplay" xorm:"ZSCATEGORYDISPLAY"`            // 钻石分类 - 描述
 
 	WRTRADEORDERID        int64     `json:"wrtradeorderid" xorm:"WRTRADEORDERID" form:"wrtradeorderid"` // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
 	TRADEDATE             string    `json:"tradedate" xorm:"TRADEDATE"`                                 // 交易日(yyyyMMdd)
@@ -733,6 +741,7 @@ func (r *MySellOrder) buildSql() string {
 		q.ZSCATEGORY,
 		q.ZSCURRENCYTYPE,
 		q.GOODSNO, 
+		q.ZSCATEGORYDISPLAY,
 		t.* 
 	FROM WRTrade_OrderDetail t
 	INNER JOIN View_GZ_WRStandard_Ex_Query q ON t.wrstandardid = q.wrstandardid
@@ -756,6 +765,7 @@ func (r *MySellOrder) buildSql_His() string {
 		q.ZSCATEGORY,
 		q.ZSCURRENCYTYPE,
 		q.GOODSNO, 
+		q.ZSCATEGORYDISPLAY,
 		t.* 
 	FROM HIS_WRTrade_OrderDetail t
 	INNER JOIN View_GZ_WRStandard_Ex_Query q ON t.wrstandardid = q.wrstandardid