Quellcode durchsuchen

查新品发布接口修改字段类型

zou.yingbin vor 3 Jahren
Ursprung
Commit
f33238ba98
4 geänderte Dateien mit 82 neuen und 75 gelöschten Zeilen
  1. 23 17
      docs/docs.go
  2. 12 12
      docs/swagger.json
  3. 12 11
      docs/swagger.yaml
  4. 35 35
      models/wrTrade2.go

+ 23 - 17
docs/docs.go

@@ -1,14 +1,13 @@
-// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
+// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
 // This file was generated by swaggo/swag
-
 package docs
 
 import (
 	"bytes"
 	"encoding/json"
 	"strings"
+	"text/template"
 
-	"github.com/alecthomas/template"
 	"github.com/swaggo/swag"
 )
 
@@ -16,7 +15,7 @@ var doc = `{
     "schemes": {{ marshal .Schemes }},
     "swagger": "2.0",
     "info": {
-        "description": "{{.Description}}",
+        "description": "{{escape .Description}}",
         "title": "{{.Title}}",
         "termsOfService": "http://www.muchinfo.cn",
         "contact": {},
@@ -14333,9 +14332,7 @@ var doc = `{
                 "code": {
                     "type": "integer"
                 },
-                "data": {
-                    "type": "object"
-                },
+                "data": {},
                 "msg": {
                     "type": "string"
                 },
@@ -17415,31 +17412,31 @@ var doc = `{
                     "type": "number"
                 },
                 "diffArbitrageQty": {
-                    "description": "套利变动量",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffExposoureQty": {
-                    "description": "变动量(套保敞口)",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffFutuQty": {
-                    "description": "变动量(期货总量) 平安:保值净持仓量今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffHedgeQty": {
-                    "description": "套保变动量",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffQty": {
-                    "description": "变动量(总敞口) 平安:净敞口今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffSpotHedgeQty": {
-                    "description": "变动量(现货应套保总量) 平安:应套保量今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffSpotQty": {
-                    "description": "变动量(现货总量) = 现货数量 - 期初现货数量 平安:采销定价净值今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "enumdicname": {
@@ -36570,7 +36567,8 @@ var doc = `{
                 },
                 "presaleapplyid": {
                     "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string",
+                    "example": "0"
                 },
                 "presaleqty": {
                     "description": "预售总量",
@@ -36634,7 +36632,8 @@ var doc = `{
                 },
                 "wrfactortypeid": {
                     "description": "仓单要素类型ID - 根据现货商品\\仓库生成",
-                    "type": "integer"
+                    "type": "string",
+                    "example": "0"
                 },
                 "wrstandardid": {
                     "description": "现货商品ID",
@@ -40454,6 +40453,13 @@ func (s *s) ReadDoc() string {
 			a, _ := json.Marshal(v)
 			return string(a)
 		},
+		"escape": func(v interface{}) string {
+			// escape tabs
+			str := strings.Replace(v.(string), "\t", "\\t", -1)
+			// replace " with \", and if that results in \\", replace that with \\\"
+			str = strings.Replace(str, "\"", "\\\"", -1)
+			return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
+		},
 	}).Parse(doc)
 	if err != nil {
 		return doc
@@ -40468,5 +40474,5 @@ func (s *s) ReadDoc() string {
 }
 
 func init() {
-	swag.Register(swag.Name, &s{})
+	swag.Register("swagger", &s{})
 }

+ 12 - 12
docs/swagger.json

@@ -14317,9 +14317,7 @@
                 "code": {
                     "type": "integer"
                 },
-                "data": {
-                    "type": "object"
-                },
+                "data": {},
                 "msg": {
                     "type": "string"
                 },
@@ -17399,31 +17397,31 @@
                     "type": "number"
                 },
                 "diffArbitrageQty": {
-                    "description": "套利变动量",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffExposoureQty": {
-                    "description": "变动量(套保敞口)",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffFutuQty": {
-                    "description": "变动量(期货总量) 平安:保值净持仓量今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffHedgeQty": {
-                    "description": "套保变动量",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffQty": {
-                    "description": "变动量(总敞口) 平安:净敞口今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffSpotHedgeQty": {
-                    "description": "变动量(现货应套保总量) 平安:应套保量今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "diffSpotQty": {
-                    "description": "变动量(现货总量) = 现货数量 - 期初现货数量 平安:采销定价净值今日变动",
+                    "description": "期现数量差 = 套保计划量 - 今日期货关联成交量",
                     "type": "number"
                 },
                 "enumdicname": {
@@ -36554,7 +36552,8 @@
                 },
                 "presaleapplyid": {
                     "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string",
+                    "example": "0"
                 },
                 "presaleqty": {
                     "description": "预售总量",
@@ -36618,7 +36617,8 @@
                 },
                 "wrfactortypeid": {
                     "description": "仓单要素类型ID - 根据现货商品\\仓库生成",
-                    "type": "integer"
+                    "type": "string",
+                    "example": "0"
                 },
                 "wrstandardid": {
                     "description": "现货商品ID",

+ 12 - 11
docs/swagger.yaml

@@ -4,8 +4,7 @@ definitions:
     properties:
       code:
         type: integer
-      data:
-        type: object
+      data: {}
       msg:
         type: string
       page:
@@ -2296,25 +2295,25 @@ definitions:
         description: 套利量
         type: number
       diffArbitrageQty:
-        description: 套利变动
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交
         type: number
       diffExposoureQty:
-        description: 变动量(套保敞口)
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交量
         type: number
       diffFutuQty:
-        description: 变动量(期货总量) 平安:保值净持仓量今日变动
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交量
         type: number
       diffHedgeQty:
-        description: 套保变动
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交
         type: number
       diffQty:
-        description: 变动量(总敞口) 平安:净敞口今日变动
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交量
         type: number
       diffSpotHedgeQty:
-        description: 变动量(现货应套保总量) 平安:应套保量今日变动
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交量
         type: number
       diffSpotQty:
-        description: 变动量(现货总量) = 现货数量 - 期初现货数量 平安:采销定价净值今日变动
+        description: 期现数量差 = 套保计划量 - 今日期货关联成交量
         type: number
       enumdicname:
         description: 单位名称
@@ -16588,7 +16587,8 @@ definitions:
         type: number
       presaleapplyid:
         description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
-        type: integer
+        example: "0"
+        type: string
       presaleqty:
         description: 预售总量
         type: number
@@ -16636,7 +16636,8 @@ definitions:
         type: string
       wrfactortypeid:
         description: 仓单要素类型ID - 根据现货商品\仓库生成
-        type: integer
+        example: "0"
+        type: string
       wrstandardid:
         description: 现货商品ID
         type: integer

+ 35 - 35
models/wrTrade2.go

@@ -4486,39 +4486,39 @@ func (r *WrSpotGroupTradeSumDetail) GetDataEx() (interface{}, error) {
 
 // WrPreSaleInfo 新品发布
 type WrPreSaleInfo struct {
-	PRESALEAPPLYID     int64   `json:"presaleapplyid"  xorm:"PRESALEAPPLYID" form:"presaleapplyid"`    // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
-	SELLUSERID         int64   `json:"selluserid"  xorm:"SELLUSERID" form:"selluserid"`                // 发行方用户ID
-	SELLACCOUNTID      int64   `json:"sellaccountid"  xorm:"SELLACCOUNTID" form:"sellaccountid"`       // 发行方资金账户ID
-	DELIVERYGOODSID    int32   `json:"deliverygoodsid"  xorm:"DELIVERYGOODSID" form:"deliverygoodsid"` // 现货品种ID
-	WAREHOUSEID        int64   `json:"warehouseid"  xorm:"WAREHOUSEID" form:"warehouseid"`             // 仓库ID
-	WRSTANDARDID       int64   `json:"wrstandardid"  xorm:"WRSTANDARDID" form:"wrstandardid"`          // 现货商品ID
-	WRFACTORTYPEID     int64   `json:"wrfactortypeid"  xorm:"WRFACTORTYPEID" form:"wrfactortypeid"`    // 仓单要素类型ID - 根据现货商品\仓库生成
-	WRSTANDARDNAME     string  `json:"wrstandardname"  xorm:"WRSTANDARDNAME"`                          // 现货商品名称
-	UNITID             int32   `json:"unitid"  xorm:"UNITID" form:"unitid"`                            // 单位ID
-	UNITPRICE          float64 `json:"unitprice"  xorm:"UNITPRICE"`                                    // 商品单价
-	PRESALEQTY         float64 `json:"presaleqty"  xorm:"PRESALEQTY"`                                  // 预售总量
-	BASEQTY            float64 `json:"baseqty"  xorm:"BASEQTY"`                                        // 中签基数
-	MAXBUYQTY          float64 `json:"maxbuyqty"  xorm:"MAXBUYQTY"`                                    // 单人最大申购量
-	MAXLUCKYQTY        float64 `json:"maxluckyqty"  xorm:"MAXLUCKYQTY"`                                // 单人最大中签量
-	STARTDATE          string  `json:"startdate"  xorm:"STARTDATE" form:"startdate"`                   // 预售开始日期
-	ENDDATE            string  `json:"enddate"  xorm:"ENDDATE" form:"enddate"`                         // 预售结束日期
-	TAKESTARTDATE      string  `json:"takestartdate"  xorm:"TAKESTARTDATE" form:"takestartdate"`       // 提货开始日期
-	THUMURLS           string  `json:"thumurls"  xorm:"THUMURLS"`                                      // 缩略图片(1:1)(逗号分隔)
-	PICTUREURLS        string  `json:"pictureurls"  xorm:"PICTUREURLS"`                                // 详情图片(逗号分隔)
-	BANNERPICURL       string  `json:"bannerpicurl"  xorm:"BANNERPICURL"`                              // Banner图
-	PRESALESTATUS      int32   `json:"presalestatus"  xorm:"PRESALESTATUS"`                            // 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭
-	LOTTERYFLAG        int32   `json:"lotteryflag"  xorm:"LOTTERYFLAG" form:"lotteryflag"`             // 摇号标识 - 0:未摇号 1:已摇号
-	LOTTERYQTY         float64 `json:"lotteryqty"  xorm:"LOTTERYQTY"`                                  // 摇号总量
-	LUCKYQTY           float64 `json:"luckyqty"  xorm:"LUCKYQTY"`                                      // 已中签量
-	PLACEQTY           float64 `json:"placeqty"  xorm:"PLACEQTY"`                                      // 已配售量
-	MARKETID           int32   `json:"marketid"  xorm:"MARKETID" form:"marketid"`                      // 市场ID
-	SELLWRTRADEORDERID string  `json:"sellwrtradeorderid"  xorm:"SELLWRTRADEORDERID"`                  // 发行方卖委托单ID
-	CREATETIME         string  `json:"createtime"  xorm:"CREATETIME"`                                  // 创建时间
-	TRADEDATE          string  `json:"tradedate"  xorm:"TRADEDATE" form:"tradedate"`                   // 交易日
-	WAREHOUSECODE      string  `json:"warehousecode"  xorm:"'WAREHOUSECODE'"`                          // 仓库代码(仓库简称)
-	WAREHOUSENAME      string  `json:"warehousename"  xorm:"'WAREHOUSENAME'"`                          // 仓库名称
-	USERNAME           string  `json:"username"  xorm:"'USERNAME'"`                                    // 发行方用户名称
-	ENUMDICNAME        string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                              // 单位名称
+	PRESALEAPPLYID     int64   `json:"presaleapplyid,string"  xorm:"PRESALEAPPLYID" form:"presaleapplyid"` // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+	SELLUSERID         int64   `json:"selluserid"  xorm:"SELLUSERID" form:"selluserid"`                    // 发行方用户ID
+	SELLACCOUNTID      int64   `json:"sellaccountid"  xorm:"SELLACCOUNTID" form:"sellaccountid"`           // 发行方资金账户ID
+	DELIVERYGOODSID    int32   `json:"deliverygoodsid"  xorm:"DELIVERYGOODSID" form:"deliverygoodsid"`     // 现货品种ID
+	WAREHOUSEID        int64   `json:"warehouseid"  xorm:"WAREHOUSEID" form:"warehouseid"`                 // 仓库ID
+	WRSTANDARDID       int64   `json:"wrstandardid"  xorm:"WRSTANDARDID" form:"wrstandardid"`              // 现货商品ID
+	WRFACTORTYPEID     int64   `json:"wrfactortypeid,string"  xorm:"WRFACTORTYPEID" form:"wrfactortypeid"` // 仓单要素类型ID - 根据现货商品\仓库生成
+	WRSTANDARDNAME     string  `json:"wrstandardname"  xorm:"WRSTANDARDNAME"`                              // 现货商品名称
+	UNITID             int32   `json:"unitid"  xorm:"UNITID" form:"unitid"`                                // 单位ID
+	UNITPRICE          float64 `json:"unitprice"  xorm:"UNITPRICE"`                                        // 商品单价
+	PRESALEQTY         float64 `json:"presaleqty"  xorm:"PRESALEQTY"`                                      // 预售总量
+	BASEQTY            float64 `json:"baseqty"  xorm:"BASEQTY"`                                            // 中签基数
+	MAXBUYQTY          float64 `json:"maxbuyqty"  xorm:"MAXBUYQTY"`                                        // 单人最大申购量
+	MAXLUCKYQTY        float64 `json:"maxluckyqty"  xorm:"MAXLUCKYQTY"`                                    // 单人最大中签量
+	STARTDATE          string  `json:"startdate"  xorm:"STARTDATE" form:"startdate"`                       // 预售开始日期
+	ENDDATE            string  `json:"enddate"  xorm:"ENDDATE" form:"enddate"`                             // 预售结束日期
+	TAKESTARTDATE      string  `json:"takestartdate"  xorm:"TAKESTARTDATE" form:"takestartdate"`           // 提货开始日期
+	THUMURLS           string  `json:"thumurls"  xorm:"THUMURLS"`                                          // 缩略图片(1:1)(逗号分隔)
+	PICTUREURLS        string  `json:"pictureurls"  xorm:"PICTUREURLS"`                                    // 详情图片(逗号分隔)
+	BANNERPICURL       string  `json:"bannerpicurl"  xorm:"BANNERPICURL"`                                  // Banner图
+	PRESALESTATUS      int32   `json:"presalestatus"  xorm:"PRESALESTATUS"`                                // 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭
+	LOTTERYFLAG        int32   `json:"lotteryflag"  xorm:"LOTTERYFLAG" form:"lotteryflag"`                 // 摇号标识 - 0:未摇号 1:已摇号
+	LOTTERYQTY         float64 `json:"lotteryqty"  xorm:"LOTTERYQTY"`                                      // 摇号总量
+	LUCKYQTY           float64 `json:"luckyqty"  xorm:"LUCKYQTY"`                                          // 已中签量
+	PLACEQTY           float64 `json:"placeqty"  xorm:"PLACEQTY"`                                          // 已配售量
+	MARKETID           int32   `json:"marketid"  xorm:"MARKETID" form:"marketid"`                          // 市场ID
+	SELLWRTRADEORDERID string  `json:"sellwrtradeorderid"  xorm:"SELLWRTRADEORDERID"`                      // 发行方卖委托单ID
+	CREATETIME         string  `json:"createtime"  xorm:"CREATETIME"`                                      // 创建时间
+	TRADEDATE          string  `json:"tradedate"  xorm:"TRADEDATE" form:"tradedate"`                       // 交易日
+	WAREHOUSECODE      string  `json:"warehousecode"  xorm:"'WAREHOUSECODE'"`                              // 仓库代码(仓库简称)
+	WAREHOUSENAME      string  `json:"warehousename"  xorm:"'WAREHOUSENAME'"`                              // 仓库名称
+	USERNAME           string  `json:"username"  xorm:"'USERNAME'"`                                        // 发行方用户名称
+	ENUMDICNAME        string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                                  // 单位名称
 
 	LastNum      int    `json:"-" form:"lastnum"`       // 最近多少条记录
 	FilterStatus string `json:"-" form:"presalestatus"` // 预售状态(逗号隔开,如1,2,3)  1:未开始 2:进行中 3:已结束 4:已关闭
@@ -4530,13 +4530,13 @@ func (r *WrPreSaleInfo) calc() {
 
 func (r *WrPreSaleInfo) buildSql() string {
 	var sqlId utils.SQLVal = `
-SELECT t.PRESALEAPPLYID,
+SELECT to_char(t.PRESALEAPPLYID) PRESALEAPPLYID,
        t.SELLUSERID,
        t.SELLACCOUNTID,
        t.DELIVERYGOODSID,
        t.WAREHOUSEID,
        t.WRSTANDARDID,
-       t.WRFACTORTYPEID,
+       to_char(t.WRFACTORTYPEID) WRFACTORTYPEID,
        t.WRSTANDARDNAME,
        t.UNITID,
        t.UNITPRICE,