Kaynağa Gözat

/Digital/QueryTaaccountDigitalLogs:获取用户现货账户流水表

deng.yinping 2 ay önce
ebeveyn
işleme
6edf09c354

+ 19 - 0
controllers/digital/queryDigital.go

@@ -44,3 +44,22 @@ func QueryTaaccountDigitalChangeApplys(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryTaaccountDigitalLogs
+// @Summary 获取用户现货账户流水表
+// @Produce  json
+// @accept   application/json
+// @Security ApiKeyAuth
+// @Param   digitalaccountid 	query    string true 	"数字账户ID"
+// @Param   tradedate 			query    string false 	"交易日(yyyyMMdd)"
+// @Param   businesscodes 		query    string false 	"业务类型(多个逗号分隔) - 枚举digitalbusinesscode(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)"
+// @Success 200    {array}  models.Taaccountdigitallog
+// @Failure 500    {object} app.Response
+// @Router  /Digital/QueryTaaccountDigitalLogs [post]
+// @Tags    数字现货账户
+func QueryTaaccountDigitalLogs(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Taaccountdigitallog{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 110 - 0
docs/docs.go

@@ -2492,6 +2492,63 @@ const docTemplate = `{
                 }
             }
         },
+        "/Digital/QueryTaaccountDigitalLogs": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "数字现货账户"
+                ],
+                "summary": "获取用户现货账户流水表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "数字账户ID",
+                        "name": "digitalaccountid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "交易日(yyyyMMdd)",
+                        "name": "tradedate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "业务类型(多个逗号分隔) - 枚举digitalbusinesscode(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)",
+                        "name": "businesscodes",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Taaccountdigitallog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Digital/QueryTaaccountDigitals": {
             "post": {
                 "security": [
@@ -57178,6 +57235,59 @@ const docTemplate = `{
                 }
             }
         },
+        "models.Taaccountdigitallog": {
+            "type": "object",
+            "properties": {
+                "aftervalue": {
+                    "description": "变更后",
+                    "type": "number"
+                },
+                "beforevalue": {
+                    "description": "变更前",
+                    "type": "number"
+                },
+                "changevalue": {
+                    "description": "变更值",
+                    "type": "number"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "currencyid": {
+                    "description": "货币ID - 枚举\"digitalcurrency\"",
+                    "type": "integer"
+                },
+                "digitalaccountid": {
+                    "description": "数字账户ID",
+                    "type": "string"
+                },
+                "digitalbusinesscode": {
+                    "description": "业务编号 - 枚举\"digitalbusinesscode\"(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)",
+                    "type": "integer"
+                },
+                "digitaloperatetype": {
+                    "description": "操作类型 - 枚举\"digitaloperatetype\"(1.冻结 2:解冻 3:增加 4:减少 5:最大冻结)",
+                    "type": "integer"
+                },
+                "logid": {
+                    "description": "流水ID(402+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "创建交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Tablecolumnconfig": {
             "type": "object",
             "required": [

+ 110 - 0
docs/swagger.json

@@ -2484,6 +2484,63 @@
                 }
             }
         },
+        "/Digital/QueryTaaccountDigitalLogs": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "数字现货账户"
+                ],
+                "summary": "获取用户现货账户流水表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "数字账户ID",
+                        "name": "digitalaccountid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "交易日(yyyyMMdd)",
+                        "name": "tradedate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "业务类型(多个逗号分隔) - 枚举digitalbusinesscode(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)",
+                        "name": "businesscodes",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Taaccountdigitallog"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Digital/QueryTaaccountDigitals": {
             "post": {
                 "security": [
@@ -57170,6 +57227,59 @@
                 }
             }
         },
+        "models.Taaccountdigitallog": {
+            "type": "object",
+            "properties": {
+                "aftervalue": {
+                    "description": "变更后",
+                    "type": "number"
+                },
+                "beforevalue": {
+                    "description": "变更前",
+                    "type": "number"
+                },
+                "changevalue": {
+                    "description": "变更值",
+                    "type": "number"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "currencyid": {
+                    "description": "货币ID - 枚举\"digitalcurrency\"",
+                    "type": "integer"
+                },
+                "digitalaccountid": {
+                    "description": "数字账户ID",
+                    "type": "string"
+                },
+                "digitalbusinesscode": {
+                    "description": "业务编号 - 枚举\"digitalbusinesscode\"(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)",
+                    "type": "integer"
+                },
+                "digitaloperatetype": {
+                    "description": "操作类型 - 枚举\"digitaloperatetype\"(1.冻结 2:解冻 3:增加 4:减少 5:最大冻结)",
+                    "type": "integer"
+                },
+                "logid": {
+                    "description": "流水ID(402+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "创建交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Tablecolumnconfig": {
             "type": "object",
             "required": [

+ 77 - 0
docs/swagger.yaml

@@ -24306,6 +24306,46 @@ definitions:
     required:
     - digitalaccountid
     type: object
+  models.Taaccountdigitallog:
+    properties:
+      aftervalue:
+        description: 变更后
+        type: number
+      beforevalue:
+        description: 变更前
+        type: number
+      changevalue:
+        description: 变更值
+        type: number
+      createtime:
+        description: 创建时间
+        type: string
+      currencyid:
+        description: 货币ID - 枚举"digitalcurrency"
+        type: integer
+      digitalaccountid:
+        description: 数字账户ID
+        type: string
+      digitalbusinesscode:
+        description: 业务编号 - 枚举"digitalbusinesscode"(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费
+          7:提现手续费...)
+        type: integer
+      digitaloperatetype:
+        description: 操作类型 - 枚举"digitaloperatetype"(1.冻结 2:解冻 3:增加 4:减少 5:最大冻结)
+        type: integer
+      logid:
+        description: 流水ID(402+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      remark:
+        description: 备注
+        type: string
+      tradedate:
+        description: 创建交易日(yyyyMMdd)
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+    type: object
   models.Tablecolumnconfig:
     properties:
       aligntype:
@@ -34168,6 +34208,43 @@ paths:
       summary: 获取数字账户变更申请表
       tags:
       - 数字现货账户
+  /Digital/QueryTaaccountDigitalLogs:
+    post:
+      consumes:
+      - application/json
+      parameters:
+      - description: 数字账户ID
+        in: query
+        name: digitalaccountid
+        required: true
+        type: string
+      - description: 交易日(yyyyMMdd)
+        in: query
+        name: tradedate
+        type: string
+      - description: 业务类型(多个逗号分隔) - 枚举digitalbusinesscode(1:充值 2:提现 3:转入 4:转出 5:现货交易
+          6:现货交易手续费 7:提现手续费...)
+        in: query
+        name: businesscodes
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Taaccountdigitallog'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 获取用户现货账户流水表
+      tags:
+      - 数字现货账户
   /Digital/QueryTaaccountDigitals:
     post:
       consumes:

+ 48 - 0
models/taaccountdigital.go

@@ -149,3 +149,51 @@ func (r *Taaccountdigitalchangeapply) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// Taaccountdigitallog  数字账户流水表
+type Taaccountdigitallog struct {
+	LOGID               string    `json:"logid" xorm:"LOGID"`                                                                 // 流水ID(402+Unix秒时间戳(10位)+xxxxxx)
+	DIGITALACCOUNTID    string    `json:"digitalaccountid" xorm:"DIGITALACCOUNTID" form:"digitalaccountid" binding:"required` // 数字账户ID
+	USERID              uint64    `json:"userid" xorm:"USERID"`                                                               // 用户ID
+	CURRENCYID          uint32    `json:"currencyid" xorm:"CURRENCYID"`                                                       // 货币ID - 枚举"digitalcurrency"
+	CHANGEVALUE         float64   `json:"changevalue" xorm:"CHANGEVALUE"`                                                     // 变更值
+	BEFOREVALUE         float64   `json:"beforevalue" xorm:"BEFOREVALUE"`                                                     // 变更前
+	AFTERVALUE          float64   `json:"aftervalue" xorm:"AFTERVALUE"`                                                       // 变更后
+	DIGITALOPERATETYPE  uint32    `json:"digitaloperatetype" xorm:"DIGITALOPERATETYPE"`                                       // 操作类型 - 枚举"digitaloperatetype"(1.冻结 2:解冻 3:增加 4:减少 5:最大冻结)
+	DIGITALBUSINESSCODE uint32    `json:"digitalbusinesscode" xorm:"DIGITALBUSINESSCODE"`                                     // 业务编号 - 枚举"digitalbusinesscode"(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)
+	MONEYTICKET         string    `json:"-" xorm:"MONEYTICKET"`                                                               // 资金流水号:银行端流水号
+	RELATEORDERID       string    `json:"-" xorm:"RELATEORDERID"`                                                             // 关联单号
+	CREATETIME          time.Time `json:"createtime" xorm:"CREATETIME"`                                                       // 创建时间
+	TRADEDATE           string    `json:"tradedate" xorm:"TRADEDATE" form:"tradedate"`                                        // 创建交易日(yyyyMMdd)
+	REMARK              string    `json:"remark" xorm:"REMARK"`                                                               // 备注
+
+	BUSINESSCODES string `json:"-" xorm:"-" form:"businesscodes"` // 业务类型(多个逗号分隔) - 枚举digitalbusinesscode(1:充值 2:提现 3:转入 4:转出 5:现货交易 6:现货交易手续费 7:提现手续费...)
+}
+
+func (r *Taaccountdigitallog) calc() {
+
+}
+
+func (r *Taaccountdigitallog) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select t.* from taaccountdigitallog t
+	where t.digitalaccountid = %v
+	`
+	sqlId.AndEx("t.tradedate", r.TRADEDATE, strings.TrimSpace(r.TRADEDATE) != "")
+	if len(strings.TrimSpace(r.BUSINESSCODES)) > 0 {
+		sqlId.Join(fmt.Sprintf(" AND t.digitalbusinesscode IN (%v)", strings.TrimSpace(r.BUSINESSCODES)))
+	}
+	sqlId.FormatParam(r.DIGITALACCOUNTID)
+	sqlId.Join(" ORDER BY t.CREATETIME DESC")
+	return sqlId.String()
+}
+
+// GetDataEx 从数据库中查询数据
+func (r *Taaccountdigitallog) GetDataEx() (interface{}, error) {
+	sData := make([]Taaccountdigitallog, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -936,6 +936,7 @@ func InitRouter() *gin.Engine {
 	{
 		digitalR.Use(token.Auth()).POST("QueryTaaccountDigitals", digital.QueryTaaccountDigitals)
 		digitalR.Use(token.Auth()).POST("QueryTaaccountDigitalChangeApplys", digital.QueryTaaccountDigitalChangeApplys)
+		digitalR.Use(token.Auth()).POST("QueryTaaccountDigitalLogs", digital.QueryTaaccountDigitalLogs)
 	}
 
 	return r