Selaa lähdekoodia

1、Presale/QueryPresaleAuctions 接口增加入参;
2、修改BUG。

zhou.xiaoning 2 vuotta sitten
vanhempi
commit
b0d27a785a

+ 6 - 6
config/config.xml

@@ -13,11 +13,11 @@
     <DbAddress value="192.168.31.88"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test202"/>
+    <DbUser value="mtp2_test204"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.31.202"/>
+    <Address value="192.168.31.204"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -25,11 +25,11 @@
     <Pwd value=""/>
   </RedisSetting>
   <MqSetting>
-    <Url value="amqp://guest:guest@192.168.31.202:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.204:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.31.202"/>
+    <HostName value="192.168.31.204"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <Username value="quote_test01"/>
@@ -38,8 +38,8 @@
   <MySQLSetting>
     <Host value="192.168.30.72"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test202"/>
-    <Username value="quote_test202"/>
+    <DBName value="historyquote_test204"/>
+    <Username value="quote_test204"/>
     <Password value="123456"/>
   </MySQLSetting>
 </Configuration>

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 7 - 6
controllers/presale/presale.go

@@ -11,13 +11,14 @@ import (
 // @Summary  查询预售竞拍列表
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    presalemode query    int true  "预售模式 - 1:一口价 2:大宗式竞拍 3:挂牌预售(HSBY)"
-// @Param    page        query    int false "页码"
-// @Param    pagesize    query    int false "每页条数"
-// @Success  200         {array}  models.PresaleAuction
-// @Failure  500         {object} app.Response
+// @Param    presalemode   query    int true  "预售模式 - 1:一口价 2:大宗式竞拍 3:挂牌预售(HSBY)"
+// @Param    presalestatus query    int false "预售状态 - 1:未开始 2:预售中 3:已结束"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
+// @Success  200           {array}  models.PresaleAuction
+// @Failure  500           {object} app.Response
 // @Router   /Presale/QueryPresaleAuctions [get]
-// @Tags     铁合金
+// @Tags     预售
 func QueryPresaleAuctions(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
 	m := models.PresaleAuction{}

+ 7 - 1
docs/docs.go

@@ -14109,7 +14109,7 @@ const docTemplate = `{
                     "application/json"
                 ],
                 "tags": [
-                    "铁合金"
+                    "预售"
                 ],
                 "summary": "查询预售竞拍列表",
                 "parameters": [
@@ -14122,6 +14122,12 @@ const docTemplate = `{
                     },
                     {
                         "type": "integer",
+                        "description": "预售状态 - 1:未开始 2:预售中 3:已结束",
+                        "name": "presalestatus",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "页码",
                         "name": "page",
                         "in": "query"

+ 7 - 1
docs/swagger.json

@@ -14100,7 +14100,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "铁合金"
+                    "预售"
                 ],
                 "summary": "查询预售竞拍列表",
                 "parameters": [
@@ -14113,6 +14113,12 @@
                     },
                     {
                         "type": "integer",
+                        "description": "预售状态 - 1:未开始 2:预售中 3:已结束",
+                        "name": "presalestatus",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "页码",
                         "name": "page",
                         "in": "query"

+ 5 - 1
docs/swagger.yaml

@@ -37376,6 +37376,10 @@ paths:
         name: presalemode
         required: true
         type: integer
+      - description: 预售状态 - 1:未开始 2:预售中 3:已结束
+        in: query
+        name: presalestatus
+        type: integer
       - description: 页码
         in: query
         name: page
@@ -37401,7 +37405,7 @@ paths:
       - ApiKeyAuth: []
       summary: 查询预售竞拍列表
       tags:
-      - 铁合金
+      - 预售
   /Qhj/QueryAccountInOutApply:
     get:
       parameters:

+ 7 - 5
models/presale.go

@@ -33,7 +33,7 @@ type PresaleAuction struct {
 	BUYMAXQTY               int64     `json:"buymaxqty" xorm:"BUYMAXQTY"`                                           // 购买上限 [71] - 0为不限
 	PRESALEDEPOSITALGORITHM int32     `json:"presaledepositalgorithm" xorm:"PRESALEDEPOSITALGORITHM"`               // 预售定金方式(48) - 1:比率  2:固定
 	PRESALEDEPOSITVALUE     float64   `json:"presaledepositvalue" xorm:"PRESALEDEPOSITVALUE"`                       // 预售定金设置值(48)
-	PRESALESTATUS           int32     `json:"presalestatus" xorm:"PRESALESTATUS"`                                   // 预售状态 - 1:未开始 2:预售中 3:已结束
+	PRESALESTATUS           int32     `json:"presalestatus" xorm:"PRESALESTATUS" form:"presalestatus"`              // 预售状态 - 1:未开始 2:预售中 3:已结束
 	PICTUREURLS             string    `json:"pictureurls" xorm:"PICTUREURLS"`                                       // 详情图片(逗号分隔)(宽:1125)
 	BANNERPICURL            string    `json:"bannerpicurl" xorm:"BANNERPICURL"`                                     // Banner图(逗号分隔)(2:1)
 
@@ -83,7 +83,7 @@ func (r *PresaleAuction) buildSql() string {
 		t.PRESALEDEPOSITVALUE,
 		t.PRESALESTATUS,
 		t.PICTUREURLS,
-		t.BANNERPICURL
+		t.BANNERPICURL,
 		g.GOODSCODE,
 		g.GOODSNAME,
 		g.PRESALEPRICE,
@@ -99,11 +99,13 @@ func (r *PresaleAuction) buildSql() string {
 	left join enumdicitem en
 	  on en.enumdiccode = 'presalemode'
 	 and t.PresaleMode = en.enumitemname
-   where t.marketid = 48201 and t.PRESALEMODE = %v
-   order by t.endtime
+   where t.marketid = 48201 
 	`
 
-	sqlId.FormatParam(r.PRESALEMODE)
+	// sqlId.FormatParam(r.PRESALEMODE)
+	sqlId.And("t.PRESALEMODE", r.PRESALEMODE)
+	sqlId.AndEx("t.PRESALESTATUS", r.PRESALESTATUS, r.PRESALESTATUS != 0)
+	sqlId.OrderBy("t.endtime")
 
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()