瀏覽代碼

修改BUG

zhou.xiaoning 3 年之前
父節點
當前提交
3320f669c8
共有 5 個文件被更改,包括 139 次插入30 次删除
  1. 1 0
      controllers/guangzuan/wrposition.go
  2. 31 5
      docs/docs.go
  3. 31 5
      docs/swagger.json
  4. 24 5
      docs/swagger.yaml
  5. 52 15
      models/guangzuan.go

+ 1 - 0
controllers/guangzuan/wrposition.go

@@ -19,6 +19,7 @@ import (
 // @Param    zsallproperties query    string false "商品(查询字段-模糊查询)"
 // @Param    zscategorys     query    string false "钻石分类, 格式:1,2,3"
 // @Param    warehouseid     query    int    false "仓库ID"
+// @Param    marketflag      query    int    false "是否上架,0-全部 1-是 2-否"
 // @Success  200             {array}  models.MyWRPosition
 // @Failure  500         {object} app.Response
 // @Router   /Guangzuan/QueryMyWRPosition [get]

+ 31 - 5
docs/docs.go

@@ -8180,6 +8180,12 @@ const docTemplate = `{
                         "description": "仓库ID",
                         "name": "warehouseid",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否上架,0-全部 1-是 2-否",
+                        "name": "marketflag",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -26330,6 +26336,10 @@ const docTemplate = `{
                     "description": "现货商品ID",
                     "type": "integer"
                 },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
                 "zscategory": {
                     "description": "钻石分类 - 枚举”ZSCategory“",
                     "type": "integer"
@@ -27807,6 +27817,10 @@ const docTemplate = `{
                     "description": "价格",
                     "type": "number"
                 },
+                "priceper": {
+                    "description": "克拉单价 - 类型:1,2,3,5",
+                    "type": "string"
+                },
                 "qty": {
                     "description": "申请数量",
                     "type": "number"
@@ -28300,7 +28314,7 @@ const docTemplate = `{
                 },
                 "buywrtradeorderid": {
                     "description": "买委托单ID",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "goodsno": {
                     "description": "-- view_GZ_WRStandard_Ex_Query --",
@@ -28308,7 +28322,7 @@ const docTemplate = `{
                 },
                 "ladingbillid": {
                     "description": "卖方提单ID",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "marketid": {
                     "description": "市场ID",
@@ -28324,11 +28338,11 @@ const docTemplate = `{
                 },
                 "selldelistingapplyid": {
                     "description": "[询价单号]卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "selltradeorderid": {
                     "description": "卖方委托ID(买方确认成交后更新)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "selluserid": {
                     "description": "卖方用户ID",
@@ -28347,7 +28361,7 @@ const docTemplate = `{
                 },
                 "wrfactortypeid": {
                     "description": "仓单要素类型ID",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrstandardid": {
                     "description": "现货商品ID",
@@ -28784,6 +28798,10 @@ const docTemplate = `{
                     "description": "提单ID(208+Unix秒时间戳(10位)+xxxxxx)",
                     "type": "string"
                 },
+                "marketflag": {
+                    "description": "是否上架,0-全部 1-是 2-否",
+                    "type": "integer"
+                },
                 "marketprice": {
                     "description": "市场价",
                     "type": "string"
@@ -28863,6 +28881,10 @@ const docTemplate = `{
                     "description": "现货商品ID",
                     "type": "integer"
                 },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
                 "wruserid": {
                     "description": "登录用户ID",
                     "type": "integer"
@@ -29867,6 +29889,10 @@ const docTemplate = `{
                 "size3": {
                     "type": "string"
                 },
+                "sizedisplay": {
+                    "description": "尺寸",
+                    "type": "string"
+                },
                 "stonedesc": {
                     "type": "string"
                 },

+ 31 - 5
docs/swagger.json

@@ -8171,6 +8171,12 @@
                         "description": "仓库ID",
                         "name": "warehouseid",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否上架,0-全部 1-是 2-否",
+                        "name": "marketflag",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -26321,6 +26327,10 @@
                     "description": "现货商品ID",
                     "type": "integer"
                 },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
                 "zscategory": {
                     "description": "钻石分类 - 枚举”ZSCategory“",
                     "type": "integer"
@@ -27798,6 +27808,10 @@
                     "description": "价格",
                     "type": "number"
                 },
+                "priceper": {
+                    "description": "克拉单价 - 类型:1,2,3,5",
+                    "type": "string"
+                },
                 "qty": {
                     "description": "申请数量",
                     "type": "number"
@@ -28291,7 +28305,7 @@
                 },
                 "buywrtradeorderid": {
                     "description": "买委托单ID",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "goodsno": {
                     "description": "-- view_GZ_WRStandard_Ex_Query --",
@@ -28299,7 +28313,7 @@
                 },
                 "ladingbillid": {
                     "description": "卖方提单ID",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "marketid": {
                     "description": "市场ID",
@@ -28315,11 +28329,11 @@
                 },
                 "selldelistingapplyid": {
                     "description": "[询价单号]卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "selltradeorderid": {
                     "description": "卖方委托ID(买方确认成交后更新)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "selluserid": {
                     "description": "卖方用户ID",
@@ -28338,7 +28352,7 @@
                 },
                 "wrfactortypeid": {
                     "description": "仓单要素类型ID",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrstandardid": {
                     "description": "现货商品ID",
@@ -28775,6 +28789,10 @@
                     "description": "提单ID(208+Unix秒时间戳(10位)+xxxxxx)",
                     "type": "string"
                 },
+                "marketflag": {
+                    "description": "是否上架,0-全部 1-是 2-否",
+                    "type": "integer"
+                },
                 "marketprice": {
                     "description": "市场价",
                     "type": "string"
@@ -28854,6 +28872,10 @@
                     "description": "现货商品ID",
                     "type": "integer"
                 },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
                 "wruserid": {
                     "description": "登录用户ID",
                     "type": "integer"
@@ -29858,6 +29880,10 @@
                 "size3": {
                     "type": "string"
                 },
+                "sizedisplay": {
+                    "description": "尺寸",
+                    "type": "string"
+                },
                 "stonedesc": {
                     "type": "string"
                 },

+ 24 - 5
docs/swagger.yaml

@@ -9719,6 +9719,9 @@ definitions:
       wrstandardid:
         description: 现货商品ID
         type: integer
+      wrtradeorderid:
+        description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        type: string
       zscategory:
         description: 钻石分类 - 枚举”ZSCategory“
         type: integer
@@ -10823,6 +10826,9 @@ definitions:
       price:
         description: 价格
         type: number
+      priceper:
+        description: 克拉单价 - 类型:1,2,3,5
+        type: string
       qty:
         description: 申请数量
         type: number
@@ -11175,13 +11181,13 @@ definitions:
         type: string
       buywrtradeorderid:
         description: 买委托单ID
-        type: integer
+        type: string
       goodsno:
         description: -- view_GZ_WRStandard_Ex_Query --
         type: string
       ladingbillid:
         description: 卖方提单ID
-        type: integer
+        type: string
       marketid:
         description: 市场ID
         type: integer
@@ -11193,10 +11199,10 @@ definitions:
         type: integer
       selldelistingapplyid:
         description: '[询价单号]卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)'
-        type: integer
+        type: string
       selltradeorderid:
         description: 卖方委托ID(买方确认成交后更新)
-        type: integer
+        type: string
       selluserid:
         description: 卖方用户ID
         type: integer
@@ -11210,7 +11216,7 @@ definitions:
         type: number
       wrfactortypeid:
         description: 仓单要素类型ID
-        type: integer
+        type: string
       wrstandardid:
         description: 现货商品ID
         type: integer
@@ -11523,6 +11529,9 @@ definitions:
       ladingbillid:
         description: 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
         type: string
+      marketflag:
+        description: 是否上架,0-全部 1-是 2-否
+        type: integer
       marketprice:
         description: 市场价
         type: string
@@ -11582,6 +11591,9 @@ definitions:
       wrstandardid:
         description: 现货商品ID
         type: integer
+      wrtradeorderid:
+        description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        type: string
       wruserid:
         description: 登录用户ID
         type: integer
@@ -12320,6 +12332,9 @@ definitions:
         type: string
       size3:
         type: string
+      sizedisplay:
+        description: 尺寸
+        type: string
       stonedesc:
         type: string
       totalqty:
@@ -24385,6 +24400,10 @@ paths:
         in: query
         name: warehouseid
         type: integer
+      - description: 是否上架,0-全部 1-是 2-否
+        in: query
+        name: marketflag
+        type: integer
       produces:
       - application/json
       responses:

+ 52 - 15
models/guangzuan.go

@@ -163,16 +163,18 @@ type MyWRPosition struct {
 	ZSCZCOLOR3TYPE      int32   `json:"zsczcolor3type" xorm:"ZSCZCOLOR3TYPE"`              // 彩钻颜色3 - 枚举”ZSCZColor3Type“ - 类型:5
 	ISVALID             int32   `json:"isvalid" xorm:"ISVALID"`                            // 是否有效 - 0:无效 1:有效
 
-	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 string  `json:"ladingbillid" xorm:"LADINGBILLID"` // 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
-	SUBNUM       int32   `json:"subnum" xorm:"SUBNUM"`             // 提单子单号
+	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   string  `json:"ladingbillid" xorm:"LADINGBILLID"`                            // 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
+	SUBNUM         int32   `json:"subnum" xorm:"SUBNUM"`                                        // 提单子单号
+	WRTRADEORDERID string  `json:"wrtradeorderid" xorm:"WRTRADEORDERID1" form:"wrtradeorderid"` // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
 
 	PageEx `xorm:"extends"` // 页码信息
 
-	WRUSERID int64 `json:"wruserid" xorm:"WRUSERID" form:"wruserid" binding:"required"` // 登录用户ID
+	WRUSERID   int64 `json:"wruserid" xorm:"WRUSERID" form:"wruserid" binding:"required"` // 登录用户ID
+	MARKETFLAG int   `json:"marketflag" form:"marketflag"`                                // 是否上架,0-全部 1-是 2-否
 }
 
 func (r *MyWRPosition) calc() {
@@ -186,6 +188,12 @@ func (r *MyWRPosition) calc() {
 		a.Round(2)
 		r.FFREEZEQTY = a.Float64()
 	}
+
+	if r.FREEZERQTY > 0 {
+		r.MARKETFLAG = 1
+	} else {
+		r.MARKETFLAG = 2
+	}
 }
 
 func (r *MyWRPosition) buildSql() string {
@@ -195,10 +203,12 @@ func (r *MyWRPosition) buildSql() string {
 		t.FREEZERQTY,
 		to_char(t.LADINGBILLID) LADINGBILLID,
 		t.SUBNUM,
+		to_char(od.WRTRADEORDERID) WRTRADEORDERID1,
 		wr.* 
 	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
+	LEFT JOIN WRTrade_OrderDetail od ON od.wrstandardid = wr.wrstandardid
 	WHERE t.userid = %v
 	`
 
@@ -382,6 +392,7 @@ type SellOrder struct {
 	STONEDESC                  string  `json:"stonedesc" xorm:"STONEDESC"`                                   //
 	SETTINGMATERIAL            string  `json:"settingmaterial" xorm:"SETTINGMATERIAL"`                       //
 	PRICE                      float64 `json:"price" xorm:"PRICE"`                                           // 价格
+	SIZEDISPLAY                string  `json:"sizedisplay" xorm:"SIZEDISPLAY"`                               // 尺寸
 
 	WRSTANDARDID   int64  `json:"wrstandardid" xorm:"WRSTANDARDID"`     // 现货商品ID
 	USERID         int64  `json:"userid" xorm:"USERID"`                 // 用户ID
@@ -533,6 +544,10 @@ func (r *SellOrder) buildSql() string {
 		q.STONEDESC                 ,
 		q.SETTINGMATERIAL           ,
 		q.PRICE,
+		CASE WHEN
+			q.SIZE1 IS NOT NULL AND q.SIZE2 IS NOT NULL AND q.SIZE2 IS NOT NULL THEN q.SIZE1 || '*' || q.SIZE2 || '*' || q.SIZE3
+			ELSE q.SIZE1
+		END AS SIZEDISPLAY,
 		to_char(t.ORDERTIME, 'yyyy-mm-dd hh24:mi:ss') ORDERTIME1,
 		to_char(t.WRTRADEORDERID) WRTRADEORDERID1,
 		t.WRTRADEORDERID       ,
@@ -653,7 +668,6 @@ func (r *SellOrder) buildQueryDiamond() string {
 		q.PRICE,
 		to_char(t.ORDERTIME, 'yyyy-mm-dd hh24:mi:ss') ORDERTIME1,
 		to_char(t.WRTRADEORDERID) WRTRADEORDERID1,
-		t.WRTRADEORDERID       ,
 		t.TRADEDATE            ,
 		t.WRTRADETYPE          ,
 		t.BUYORSELL            ,
@@ -1448,6 +1462,7 @@ type MyBargainApply struct {
 	ZSCZCOLOR3TYPEDISPLAY      string  `json:"zsczcolor3typedisplay" xorm:"ZSCZCOLOR3TYPEDISPLAY"`           //
 	SIZEDISPLAY                string  `json:"sizedisplay" xorm:"SIZEDISPLAY"`                               // 尺寸
 	PRICE                      float64 `json:"price" xorm:"PRICE"`                                           // 价格
+	PRICEPER                   string  `json:"priceper" xorm:"PRICEPER"`                                     // 克拉单价 - 类型:1,2,3,5
 
 	WRBARGAINID    string    `json:"wrbargainid" xorm:"WRBARGAINID1"`                       // [询价单号]议价申请单ID(327+Unix秒时间戳(10位)+xxxxxx)
 	WRTRADEORDERID int64     `json:"wrtradeorderid" xorm:"WRTRADEORDERID"`                  // 关联委托单ID
@@ -1516,6 +1531,7 @@ func (r *MyBargainApply) buildSql() string {
 			ELSE q.SIZE1
 		END AS SIZEDISPLAY,
 		q.PRICE,
+		q.PRICEPER,
 		(t.APPLYQTY / 100) QTY,
 		to_char(t.APPLYTIME, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME1,
 		to_char(t.WRBARGAINID) WRBARGAINID1,
@@ -1574,22 +1590,22 @@ type MyDelistingApply struct {
 	PRICE   float64 `json:"price" xorm:"PRICE"`     // 价格
 	WEIGHT  float64 `json:"weight" xorm:"WEIGHT"`   // 克拉重量
 
-	SELLDELISTINGAPPLYID int64     `json:"selldelistingapplyid" xorm:"SELLDELISTINGAPPLYID"`              // [询价单号]卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)
-	BUYWRTRADEORDERID    int64     `json:"buywrtradeorderid" xorm:"BUYWRTRADEORDERID"`                    // 买委托单ID
+	SELLDELISTINGAPPLYID string    `json:"selldelistingapplyid" xorm:"SELLDELISTINGAPPLYID1"`             // [询价单号]卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)
+	BUYWRTRADEORDERID    string    `json:"buywrtradeorderid" xorm:"BUYWRTRADEORDERID1"`                   // 买委托单ID
 	BUYUSERID            int64     `json:"buyuserid" xorm:"BUYUSERID"`                                    // 买方用户ID
 	SELLUSERID           int64     `json:"selluserid" xorm:"SELLUSERID" form:"userid" binding:"required"` // 卖方用户ID
 	SELLACCOUNTID        int64     `json:"sellaccountid" xorm:"SELLACCOUNTID"`                            // 卖方账户ID
 	WRSTANDARDID         int64     `json:"wrstandardid" xorm:"WRSTANDARDID"`                              // 现货商品ID
-	WRFACTORTYPEID       int64     `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"`                          // 仓单要素类型ID
+	WRFACTORTYPEID       string    `json:"wrfactortypeid" xorm:"WRFACTORTYPEID1"`                         // 仓单要素类型ID
 	APPLYQTY             float64   `json:"applyqty" xorm:"APPLYQTY"`                                      // 申请数量
 	APPLYPRICE           float64   `json:"applyprice" xorm:"APPLYPRICE"`                                  // 申请价格
 	APPLYSTATUS          int32     `json:"applystatus" xorm:"APPLYSTATUS" form:"applystatus"`             // 申请状态 - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
 	APPLYREMARK          string    `json:"applyremark" xorm:"APPLYREMARK"`                                // 申请备注
 	APPLYTIME            string    `json:"applytime" xorm:"APPLYTIME1"`                                   // 申请时间
 	AUDITREMARK          string    `json:"auditremark" xorm:"AUDITREMARK"`                                // 确认备注
-	SELLTRADEORDERID     int64     `json:"selltradeorderid" xorm:"SELLTRADEORDERID"`                      // 卖方委托ID(买方确认成交后更新)
+	SELLTRADEORDERID     string    `json:"selltradeorderid" xorm:"SELLTRADEORDERID1"`                     // 卖方委托ID(买方确认成交后更新)
 	AUDITTIME            time.Time `json:"audittime" xorm:"AUDITTIME"`                                    // 确认时间
-	LADINGBILLID         int64     `json:"ladingbillid" xorm:"LADINGBILLID"`                              // 卖方提单ID
+	LADINGBILLID         string    `json:"ladingbillid" xorm:"LADINGBILLID1"`                             // 卖方提单ID
 	SUBNUM               int32     `json:"subnum" xorm:"SUBNUM"`                                          // 卖方提单子单号
 	MARKETID             int32     `json:"marketid" xorm:"MARKETID"`                                      // 市场ID
 
@@ -1626,7 +1642,24 @@ func (r *MyDelistingApply) buildSql() string {
 		p.ZSCZCOLOR3TYPEDISPLAY    ,
 		p.WAREHOUSEINFOSDISPLAY    ,
 		to_char(t.APPLYTIME, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME1,
-		t.*
+		to_char(t.SELLDELISTINGAPPLYID) SELLDELISTINGAPPLYID1,
+		to_char(t.BUYWRTRADEORDERID) BUYWRTRADEORDERID1,  
+		t.BUYUSERID        ,  
+		t.SELLUSERID       ,  
+		t.SELLACCOUNTID    ,  
+		t.WRSTANDARDID     ,  
+		to_char(t.WRFACTORTYPEID) WRFACTORTYPEID1  ,  
+		t.APPLYQTY         ,  
+		t.APPLYPRICE       ,  
+		t.APPLYSTATUS      ,  
+		t.APPLYREMARK      ,  
+		t.APPLYTIME        ,  
+		t.AUDITREMARK      ,  
+		to_char(t.SELLTRADEORDERID) SELLTRADEORDERID1,  
+		t.AUDITTIME        ,  
+		to_char(t.LADINGBILLID) LADINGBILLID1   ,  
+		t.SUBNUM           ,  
+		t.MARKETID           
 	FROM GZ_SellDelistingApply t
 	LEFT JOIN VIEW_GZ_BUYORDERDETAIL_QUERY p ON t.BUYWRTRADEORDERID = p.WRTRADEORDERID
 	LEFT JOIN view_GZ_WRStandard_Ex_Query q ON t.WRSTANDARDID = q.WRSTANDARDID
@@ -1726,6 +1759,8 @@ type GZGoods struct {
 	ZSCZCOLOR3TYPE      int32   `json:"zsczcolor3type" xorm:"ZSCZCOLOR3TYPE"`                     // 彩钻颜色3 - 枚举”ZSCZColor3Type“ - 类型:5
 	ISVALID             int32   `json:"isvalid" xorm:"ISVALID"`                                   // 是否有效 - 0:无效 1:有效
 
+	WRTRADEORDERID string `json:"wrtradeorderid" xorm:"WRTRADEORDERID1" form:"wrtradeorderid"` // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+
 	MOBILE string `json:"mobile"` // 手机号码
 }
 
@@ -1745,9 +1780,11 @@ func (r *GZGoods) buildSql() string {
 	var sqlId utils.SQLVal = `
 	SELECT 
 		t.*,
-		u.MOBILE
+		u.MOBILE,
+		to_char(od.WRTRADEORDERID) WRTRADEORDERID1
 	FROM View_GZ_WRStandard_Ex_Query t
 	LEFT JOIN userinfo u ON u.USERID = t.USERID
+	LEFT JOIN WRTrade_OrderDetail od ON od.wrstandardid = t.wrstandardid
 	WHERE GOODSNO = '%v'
 	`
 	sqlId.FormatParam(r.GOODSNO)