zhou.xiaoning před 2 roky
rodič
revize
a5abea070f

+ 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 - 7
controllers/report/report.go

@@ -11,7 +11,7 @@ import (
 // @Summary  报表 - 交易商结算单 - 资金信息(日)
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    accountid  query    int    true  "资金账户"
+// @Param    accountid query    int    true "资金账户"
 // @Param    reckondate query    string true "日照日期(yyyyMMdd)"
 // @Success  200        {array}  models.ReportReckondaytaaccount
 // @Failure  500          {object} app.Response
@@ -34,7 +34,7 @@ func QueryReportReckonDayTaaccount(c *gin.Context) {
 // @Param    page       query    int    false "页码"
 // @Param    pagesize   query    int    false "每页条数"
 // @Success  200        {array}  models.ReportBankAccountOutInLog
-// @Failure  500        {object} app.Response
+// @Failure  500       {object} app.Response
 // @Router   /Report/QueryReportBankAccountOutInLog [get]
 // @Tags     报表
 func QueryReportBankAccountOutInLog(c *gin.Context) {
@@ -48,8 +48,8 @@ func QueryReportBankAccountOutInLog(c *gin.Context) {
 // @Summary  报表 - 交易商结算单 - 持仓汇总
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    accountid    query    int    true  "资金账户"
-// @Param    tradedate  query    string true  "查询日期 日报表-yyyyMMdd 月报表-yyyyMM"
+// @Param    accountid  query    int    true  "资金账户"
+// @Param    reckondate query    string true  "查询日期 日报表-yyyyMMdd 月报表-yyyyMM"
 // @Param    reporttype query    int    true  "报表类型 日报表-1 月报表-2"
 // @Param    page       query    int    false "页码"
 // @Param    pagesize   query    int    false "每页条数"
@@ -68,7 +68,7 @@ func QueryReportReckonDayPosition(c *gin.Context) {
 // @Summary  报表 - 交易商结算单 - 成交明细
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    accountid  query    int    true "资金账户"
+// @Param    accountid    query    int    true  "资金账户"
 // @Param    histradedate query    string true  "查询日期 日报表-yyyyMMdd 月报表-yyyyMM"
 // @Param    reporttype   query    int    true  "报表类型 日报表-1 月报表-2"
 // @Param    page         query    int    false "页码"
@@ -89,8 +89,8 @@ func QueryReportTradeDetail(c *gin.Context) {
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param    accountid  query    int    true "资金账户"
-// @Param    reckondate query    string true "月份(yyyyMM)"
-// @Success  200        {array}  models.Reporttaaccount
+// @Param    cycletime query    string true "月份(yyyyMM)"
+// @Success  200       {array}  models.Reporttaaccount
 // @Failure  500        {object} app.Response
 // @Router   /Report/QueryReportMonthTaaccount [get]
 // @Tags     报表

+ 3 - 2
docs/docs.go

@@ -17175,7 +17175,7 @@ const docTemplate = `{
                     {
                         "type": "string",
                         "description": "月份(yyyyMM)",
-                        "name": "reckondate",
+                        "name": "cycletime",
                         "in": "query",
                         "required": true
                     }
@@ -17224,7 +17224,7 @@ const docTemplate = `{
                     {
                         "type": "string",
                         "description": "查询日期 日报表-yyyyMMdd 月报表-yyyyMM",
-                        "name": "tradedate",
+                        "name": "reckondate",
                         "in": "query",
                         "required": true
                     },
@@ -49615,6 +49615,7 @@ const docTemplate = `{
         "models.ReportTradeDetail": {
             "type": "object",
             "required": [
+                "accountid",
                 "histradedate",
                 "reportType"
             ],

+ 3 - 2
docs/swagger.json

@@ -17166,7 +17166,7 @@
                     {
                         "type": "string",
                         "description": "月份(yyyyMM)",
-                        "name": "reckondate",
+                        "name": "cycletime",
                         "in": "query",
                         "required": true
                     }
@@ -17215,7 +17215,7 @@
                     {
                         "type": "string",
                         "description": "查询日期 日报表-yyyyMMdd 月报表-yyyyMM",
-                        "name": "tradedate",
+                        "name": "reckondate",
                         "in": "query",
                         "required": true
                     },
@@ -49606,6 +49606,7 @@
         "models.ReportTradeDetail": {
             "type": "object",
             "required": [
+                "accountid",
                 "histradedate",
                 "reportType"
             ],

+ 3 - 2
docs/swagger.yaml

@@ -20664,6 +20664,7 @@ definitions:
         description: 时间
         type: string
     required:
+    - accountid
     - histradedate
     - reportType
     type: object
@@ -40587,7 +40588,7 @@ paths:
         type: integer
       - description: 月份(yyyyMM)
         in: query
-        name: reckondate
+        name: cycletime
         required: true
         type: string
       produces:
@@ -40618,7 +40619,7 @@ paths:
         type: integer
       - description: 查询日期 日报表-yyyyMMdd 月报表-yyyyMM
         in: query
-        name: tradedate
+        name: reckondate
         required: true
         type: string
       - description: 报表类型 日报表-1 月报表-2

+ 17 - 17
models/report.go

@@ -299,7 +299,7 @@ func (r *ReportReckonDayPosition) buildSql() string {
          where t.buycurpositionqty > 0
            and m.trademode not in (40, 41, 48, 51)
            and t.accountid = %v              
-           and t.reckondate = %v 
+           and t.reckondate = '%v' 
 union        
         select 1 buyorsell,
                t.sellcurpositionqty curpositionqty,               
@@ -318,7 +318,7 @@ union
          where t.sellcurpositionqty > 0
            and m.trademode not in (40, 41, 48, 51)
            and t.accountid = %v               
-           and t.reckondate = %v ) p
+           and t.reckondate = '%v' ) p
   left join goods g
     on g.goodsid = p.goodsid
   left join market m
@@ -357,7 +357,7 @@ func (r *ReportReckonDayPosition) buildSql_m() string {
          where t.buycurpositionqty > 0
            and m.trademode not in (40, 41, 48, 51)              
            and t.cycletype = 1
-           and t.cycletime = %v 
+           and t.cycletime = '%v' 
            and t.accountid = %v         
 union        
         select 1 buyorsell,
@@ -378,7 +378,7 @@ union
          where t.sellcurpositionqty > 0
            and m.trademode not in (40, 41, 48, 51)              
            and t.cycletype = 1
-           and t.cycletime = %v 
+           and t.cycletime = '%v' 
            and t.accountid = %v) p
   left join goods g
     on g.goodsid = p.goodsid
@@ -411,18 +411,18 @@ func (r *ReportReckonDayPosition) GetDataByPage() (interface{}, error, int, int,
 }
 
 type ReportTradeDetail struct {
-	TRADETIME        string  `json:"tradetime" xorm:"TRADETIME"`                          // 时间
-	GOODSDISPLAY     string  `json:"goodsdisplay" xorm:"GOODSDISPLAY"`                    // 商品
-	BUYORSELLDISPLAY string  `json:"buyorselldisplay" xorm:"BUYORSELLDISPLAY"`            // 类型/方向
-	TRADEQTY         int64   `json:"tradeqty" xorm:"TRADEQTY"`                            // 数量
-	TRADEPRICE       float64 `json:"tradeprice" xorm:"TRADEPRICE"`                        // 价格
-	TRADEAMOUNT      float64 `json:"tradeamount" xorm:"TRADEAMOUNT"`                      // 成交金额
-	CHARGE           float64 `json:"charge" xorm:"CHARGE"`                                // 服务费
-	TRADEID          string  `json:"tradeid" xorm:"TRADEID"`                              // 成交单号
-	ACCOUNTID        int64   `json:"accountid" xorm:"ACCOUNTID"`                          // 资金账户
-	GOODSID          int32   `json:"goodsid" xorm:"GOODSID"`                              // 期货合约ID(自增ID SEQ_GOODS)
-	DECIMALPLACE     int32   `json:"decimalplace" xorm:"DECIMALPLACE"`                    // 报价小数位
-	HISTRADEDATE     string  `json:"histradedate" xorm:"HISTRADEDATE" binding:"required"` // 查询日期 日报表-yyyyMMdd 月报表-yyyyMM
+	TRADETIME        string  `json:"tradetime" xorm:"TRADETIME"`                                              // 时间
+	GOODSDISPLAY     string  `json:"goodsdisplay" xorm:"GOODSDISPLAY"`                                        // 商品
+	BUYORSELLDISPLAY string  `json:"buyorselldisplay" xorm:"BUYORSELLDISPLAY"`                                // 类型/方向
+	TRADEQTY         int64   `json:"tradeqty" xorm:"TRADEQTY"`                                                // 数量
+	TRADEPRICE       float64 `json:"tradeprice" xorm:"TRADEPRICE"`                                            // 价格
+	TRADEAMOUNT      float64 `json:"tradeamount" xorm:"TRADEAMOUNT"`                                          // 成交金额
+	CHARGE           float64 `json:"charge" xorm:"CHARGE"`                                                    // 服务费
+	TRADEID          string  `json:"tradeid" xorm:"TRADEID"`                                                  // 成交单号
+	ACCOUNTID        int64   `json:"accountid" xorm:"ACCOUNTID" form:"accountid" binding:"required"`          // 资金账户
+	GOODSID          int32   `json:"goodsid" xorm:"GOODSID"`                                                  // 期货合约ID(自增ID SEQ_GOODS)
+	DECIMALPLACE     int32   `json:"decimalplace" xorm:"DECIMALPLACE"`                                        // 报价小数位
+	HISTRADEDATE     string  `json:"histradedate" xorm:"HISTRADEDATE" form:"histradedate" binding:"required"` // 查询日期 日报表-yyyyMMdd 月报表-yyyyMM
 
 	ReportType int `form:"reporttype" binding:"required"` // 报表类型 日报表-1 月报表-2
 
@@ -643,7 +643,7 @@ func (r *Reporttaaccount) buildSql() string {
 		t.floatnetvalue,
 		t.riskrate
 	from report_taaccount t
-	where t.cycletype = 1 and t.cycletime = %v and t.accountid = %v 
+	where t.cycletype = 1 and t.cycletime = '%v' and t.accountid = %v 
 	`
 	sqlId.FormatParam(r.CYCLETIME, r.ACCOUNTID)