소스 검색

增加“资金流水查询(历史)”接口

Simon Zhou 5 년 전
부모
커밋
7492440cc7
7개의 변경된 파일727개의 추가작업 그리고 3개의 파일을 삭제
  1. 107 3
      controllers/taaccount/taaccount.go
  2. 189 0
      docs/docs.go
  3. 189 0
      docs/swagger.json
  4. 135 0
      docs/swagger.yaml
  5. 26 0
      models/accountModels.go
  6. 79 0
      models/actionModels.go
  7. 2 0
      routers/router.go

+ 107 - 3
controllers/taaccount/taaccount.go

@@ -46,7 +46,7 @@ type QueryAmountLogRsp struct {
 // @Failure 500 {object} app.Response
 // @Router /TaAccount/QueryAmountLog [get]
 // @Tags 资金账户
-// 参通用查询:QueryClientAmountLog
+// 参通用查询:QueryClientAmountLog
 func QueryAmountLog(c *gin.Context) {
 	appG := app.Gin{C: c}
 
@@ -103,11 +103,115 @@ func QueryAmountLog(c *gin.Context) {
 			rst = datas[0:0]
 		}
 
-		logger.GetLogger().Infof("QueryRecieptOrder successed: %v", rst)
+		logger.GetLogger().Infof("QueryAmountLog successed: %v", rst)
 		appG.ResponseByPage(http.StatusOK, e.SUCCESS, rst, app.PageInfo{Page: req.Page, PageSize: req.PageSize, Total: len(datas)})
 	} else {
 		// 不分页
-		logger.GetLogger().Infof("QueryRecieptOrder successed: %v", datas)
+		logger.GetLogger().Infof("QueryAmountLog successed: %v", datas)
+		appG.Response(http.StatusOK, e.SUCCESS, datas)
+	}
+}
+
+// QueryHisAmountLogReq 资金流水查询(历史)请求参数
+type QueryHisAmountLogReq struct {
+	app.PageInfo
+	AccountID   string `form:"accountID"`   // 资金账户
+	OperateType string `form:"operateType"` // 资金操作类型
+	StartDate   string `form:"startDate"`   // 开始时间
+	EndDate     string `form:"endDate"`     // 结束时间
+}
+
+// QueryHisAmountLogRsp 资金流水查询(历史)返回模型
+type QueryHisAmountLogRsp struct {
+	models.Histaaccountlog `xorm:"extends"`
+
+	MarketName      string `json:"marketname"  xorm:"'MARKETNAME'"`        // 市场名称
+	TradeMode       uint32 `json:"trademode"  xorm:"'TRADEMODE'"`          // 交易模式
+	GoodsCode       string `json:"goodscode"  xorm:"'GOODSCODE'"`          // 商品代码
+	GoodsName       string `json:"goodsname"  xorm:"'GOODSNAME'"`          // 商品名称
+	AGoodsCode      string `json:"agoodscode"  xorm:"'AGOODSCODE'"`        // 竞拍商品代码
+	AGoodsName      string `json:"agoodsname"  xorm:"'GOODSNAME'"`         // 竞拍商品名称
+	DGoodsCode      string `json:"dgoodscode"  xorm:"'DGOODSCODE'"`        // 交割商品代码
+	DGoodsName      string `json:"dgoodsname"  xorm:"'DGOODSNAME'"`        // 交割商品名称
+	OperateTypeName string `json:"OPERATETYPENAME" xorm:"OPERATETYPENAME"` // 资金操作类型名称
+}
+
+// QueryHisAmountLog 资金流水查询(历史)
+// @Summary 资金流水查询(历史)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param pagesize query int false "每页条数"
+// @Param accountID query string true "资金账户 - 格式:1,2,3"
+// @Param OperateType query string false "资金操作类型 - 格式:1,2,3"
+// @Param startDate query string false "开始时间 - 闭区间,格式:yyyy-MM-dd"
+// @Param endDate query string false "结束时间 - 闭区间,格式:yyyy-MM-dd"
+// @Success 200 {object} QueryHisAmountLogRsp
+// @Failure 500 {object} app.Response
+// @Router /TaAccount/QueryHisAmountLog [get]
+// @Tags 资金账户
+// 参考通用查询:Client_QueryHis_taaccountlog
+func QueryHisAmountLog(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req QueryHisAmountLogReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("QueryHisAmountLog failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	// 查询数据
+	datas := make([]QueryHisAmountLogRsp, 0)
+	engine := db.GetEngine()
+	s := engine.Table("HIS_TAACCOUNTLOG").
+		Join("LEFT", "ENUMDICITEM", "ENUMDICITEM.ENUMITEMSTATUS = 1 and ENUMDICITEM.ENUMDICID = 39 and ENUMDICITEM.ENUMITEMNAME = HIS_TAACCOUNTLOG.OPERATETYPE").
+		Join("LEFT", "MARKET", "MARKET.MARKETID = HIS_TAACCOUNTLOG.MARKETID").
+		Join("LEFT", "GOODS", "GOODS.GOODSID = HIS_TAACCOUNTLOG.GOODSID").
+		Join("LEFT", "HIS_AUCTION_ORDERINFO", "HIS_AUCTION_ORDERINFO.GOODSID = HIS_TAACCOUNTLOG.GOODSID and HIS_AUCTION_ORDERINFO.ISVALIDDATA = 1").
+		Join("LEFT", "DELIVERYGOODS", "DELIVERYGOODS.DELIVERYGOODSID = HIS_TAACCOUNTLOG.GOODSID").
+		Select(`to_char(HIS_TAACCOUNTLOG.RELATIONORDERID) as RELATIONORDERID, HIS_TAACCOUNTLOG.*, 
+				MARKET.MARKETNAME, MARKET.TRADEMODE, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, 
+				HIS_AUCTION_ORDERINFO.GOODSCODE AS AGOODSCODE, HIS_AUCTION_ORDERINFO.GOODSNAME AS AGOODSNAME, 
+				DELIVERYGOODS.DELIVERYGOODSCODE AS DGOODSCODE, DELIVERYGOODS.DELIVERYGOODSNAME AS DGOODSNAME, 
+				ENUMDICITEM.ENUMDICNAME AS OPERATETYPENAME`).
+		Where(fmt.Sprintf(`HIS_TAACCOUNTLOG.ISVALIDDATA = 1 and HIS_TAACCOUNTLOG.ACCOUNTID in (%s)`, req.AccountID)).Desc("HIS_TAACCOUNTLOG.AUTOID")
+	if len(req.OperateType) > 0 {
+		s = s.And(fmt.Sprintf("HIS_TAACCOUNTLOG.OPERATETYPE in (%s)", req.OperateType))
+	}
+	if err := s.Find(&datas); err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("QueryHisAmountLog failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功返回
+	if req.PageSize > 0 {
+		// 分页
+		rst := make([]QueryHisAmountLogRsp, 0)
+		// 开始上标
+		start := req.Page * req.PageSize
+		// 结束下标
+		end := start + req.PageSize
+
+		if start <= len(datas) {
+			// 判断结束下标是否越界
+			if end > len(datas) {
+				end = len(datas)
+			}
+			rst = datas[start:end]
+		} else {
+			rst = datas[0:0]
+		}
+
+		logger.GetLogger().Infof("QueryHisAmountLog successed: %v", rst)
+		appG.ResponseByPage(http.StatusOK, e.SUCCESS, rst, app.PageInfo{Page: req.Page, PageSize: req.PageSize, Total: len(datas)})
+	} else {
+		// 不分页
+		logger.GetLogger().Infof("QueryHisAmountLog successed: %v", datas)
 		appG.Response(http.StatusOK, e.SUCCESS, datas)
 	}
 }

+ 189 - 0
docs/docs.go

@@ -1248,6 +1248,75 @@ var doc = `{
                 }
             }
         },
+        "/TaAccount/QueryHisAmountLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "资金账户"
+                ],
+                "summary": "资金流水查询(历史)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金账户 - 格式:1,2,3",
+                        "name": "accountID",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金操作类型 - 格式:1,2,3",
+                        "name": "OperateType",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始时间 - 闭区间,格式:yyyy-MM-dd",
+                        "name": "startDate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束时间 - 闭区间,格式:yyyy-MM-dd",
+                        "name": "endDate",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/taaccount.QueryHisAmountLogRsp"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/User/GetLoginID": {
             "get": {
                 "produces": [
@@ -4743,6 +4812,126 @@ var doc = `{
                     "type": "integer"
                 }
             }
+        },
+        "taaccount.QueryHisAmountLogRsp": {
+            "type": "object",
+            "required": [
+                "accountid",
+                "amount",
+                "amountadjusttype",
+                "autoid",
+                "balance",
+                "createtime",
+                "currentbalance",
+                "histradedate",
+                "operatetype"
+            ],
+            "properties": {
+                "OPERATETYPENAME": {
+                    "description": "资金操作类型名称",
+                    "type": "string"
+                },
+                "accountid": {
+                    "description": "资金账户ID",
+                    "type": "integer"
+                },
+                "agoodscode": {
+                    "description": "竞拍商品代码",
+                    "type": "string"
+                },
+                "agoodsname": {
+                    "description": "竞拍商品名称",
+                    "type": "string"
+                },
+                "amount": {
+                    "description": "资金金额",
+                    "type": "number"
+                },
+                "amountadjusttype": {
+                    "description": "资金调整类型(默认值为0) -  0:系统 1:单边账调整  2:人工调整",
+                    "type": "integer"
+                },
+                "autoid": {
+                    "description": "流水ID(220+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "balance": {
+                    "description": "期初余额",
+                    "type": "number"
+                },
+                "businesscode": {
+                    "description": "业务编号",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "发生时间",
+                    "type": "string"
+                },
+                "currencyid": {
+                    "description": "币种ID",
+                    "type": "integer"
+                },
+                "currentbalance": {
+                    "description": "期末余额(变动后金额)",
+                    "type": "number"
+                },
+                "dgoodscode": {
+                    "description": "交割商品代码",
+                    "type": "string"
+                },
+                "dgoodsname": {
+                    "description": "交割商品名称",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "histradedate": {
+                    "description": "历史交易日",
+                    "type": "string"
+                },
+                "isvaliddata": {
+                    "description": "是否有效 - 0:无效 1:有效",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "marketname": {
+                    "description": "市场名称",
+                    "type": "string"
+                },
+                "moneyticket": {
+                    "description": "资金流水号:银行端流水号",
+                    "type": "integer"
+                },
+                "operatetype": {
+                    "description": "资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻 106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结 206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结 305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加 502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结 603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结 702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款 801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款 904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费 1007:期权盈亏 1101:营销扣款 1102:营销收款",
+                    "type": "integer"
+                },
+                "relationorderid": {
+                    "description": "关联单号",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "trademode": {
+                    "description": "交易模式",
+                    "type": "integer"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 189 - 0
docs/swagger.json

@@ -1232,6 +1232,75 @@
                 }
             }
         },
+        "/TaAccount/QueryHisAmountLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "资金账户"
+                ],
+                "summary": "资金流水查询(历史)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金账户 - 格式:1,2,3",
+                        "name": "accountID",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金操作类型 - 格式:1,2,3",
+                        "name": "OperateType",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始时间 - 闭区间,格式:yyyy-MM-dd",
+                        "name": "startDate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束时间 - 闭区间,格式:yyyy-MM-dd",
+                        "name": "endDate",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/taaccount.QueryHisAmountLogRsp"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/User/GetLoginID": {
             "get": {
                 "produces": [
@@ -4727,6 +4796,126 @@
                     "type": "integer"
                 }
             }
+        },
+        "taaccount.QueryHisAmountLogRsp": {
+            "type": "object",
+            "required": [
+                "accountid",
+                "amount",
+                "amountadjusttype",
+                "autoid",
+                "balance",
+                "createtime",
+                "currentbalance",
+                "histradedate",
+                "operatetype"
+            ],
+            "properties": {
+                "OPERATETYPENAME": {
+                    "description": "资金操作类型名称",
+                    "type": "string"
+                },
+                "accountid": {
+                    "description": "资金账户ID",
+                    "type": "integer"
+                },
+                "agoodscode": {
+                    "description": "竞拍商品代码",
+                    "type": "string"
+                },
+                "agoodsname": {
+                    "description": "竞拍商品名称",
+                    "type": "string"
+                },
+                "amount": {
+                    "description": "资金金额",
+                    "type": "number"
+                },
+                "amountadjusttype": {
+                    "description": "资金调整类型(默认值为0) -  0:系统 1:单边账调整  2:人工调整",
+                    "type": "integer"
+                },
+                "autoid": {
+                    "description": "流水ID(220+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "balance": {
+                    "description": "期初余额",
+                    "type": "number"
+                },
+                "businesscode": {
+                    "description": "业务编号",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "发生时间",
+                    "type": "string"
+                },
+                "currencyid": {
+                    "description": "币种ID",
+                    "type": "integer"
+                },
+                "currentbalance": {
+                    "description": "期末余额(变动后金额)",
+                    "type": "number"
+                },
+                "dgoodscode": {
+                    "description": "交割商品代码",
+                    "type": "string"
+                },
+                "dgoodsname": {
+                    "description": "交割商品名称",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "histradedate": {
+                    "description": "历史交易日",
+                    "type": "string"
+                },
+                "isvaliddata": {
+                    "description": "是否有效 - 0:无效 1:有效",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "marketname": {
+                    "description": "市场名称",
+                    "type": "string"
+                },
+                "moneyticket": {
+                    "description": "资金流水号:银行端流水号",
+                    "type": "integer"
+                },
+                "operatetype": {
+                    "description": "资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻 106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结 206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结 305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加 502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结 603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结 702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款 801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款 904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费 1007:期权盈亏 1101:营销扣款 1102:营销收款",
+                    "type": "integer"
+                },
+                "relationorderid": {
+                    "description": "关联单号",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "trademode": {
+                    "description": "交易模式",
+                    "type": "integer"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 135 - 0
docs/swagger.yaml

@@ -2509,6 +2509,97 @@ definitions:
     - currentbalance
     - operatetype
     type: object
+  taaccount.QueryHisAmountLogRsp:
+    properties:
+      OPERATETYPENAME:
+        description: 资金操作类型名称
+        type: string
+      accountid:
+        description: 资金账户ID
+        type: integer
+      agoodscode:
+        description: 竞拍商品代码
+        type: string
+      agoodsname:
+        description: 竞拍商品名称
+        type: string
+      amount:
+        description: 资金金额
+        type: number
+      amountadjusttype:
+        description: 资金调整类型(默认值为0) -  0:系统 1:单边账调整  2:人工调整
+        type: integer
+      autoid:
+        description: 流水ID(220+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      balance:
+        description: 期初余额
+        type: number
+      businesscode:
+        description: 业务编号
+        type: integer
+      createtime:
+        description: 发生时间
+        type: string
+      currencyid:
+        description: 币种ID
+        type: integer
+      currentbalance:
+        description: 期末余额(变动后金额)
+        type: number
+      dgoodscode:
+        description: 交割商品代码
+        type: string
+      dgoodsname:
+        description: 交割商品名称
+        type: string
+      goodscode:
+        description: 商品代码
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      histradedate:
+        description: 历史交易日
+        type: string
+      isvaliddata:
+        description: 是否有效 - 0:无效 1:有效
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      marketname:
+        description: 市场名称
+        type: string
+      moneyticket:
+        description: 资金流水号:银行端流水号
+        type: integer
+      operatetype:
+        description: 资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻 106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结 206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结 305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加 502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结 603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结 702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款 801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款 904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费 1007:期权盈亏 1101:营销扣款 1102:营销收款
+        type: integer
+      relationorderid:
+        description: 关联单号
+        type: string
+      remark:
+        description: 备注
+        type: string
+      trademode:
+        description: 交易模式
+        type: integer
+    required:
+    - accountid
+    - amount
+    - amountadjusttype
+    - autoid
+    - balance
+    - createtime
+    - currentbalance
+    - histradedate
+    - operatetype
+    type: object
 info:
   contact: {}
   description: 新的查询服务,替代原通用查询服务。
@@ -3285,6 +3376,50 @@ paths:
       summary: 资金流水查询(当前)
       tags:
       - 资金账户
+  /TaAccount/QueryHisAmountLog:
+    get:
+      parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      - description: 资金账户 - 格式:1,2,3
+        in: query
+        name: accountID
+        required: true
+        type: string
+      - description: 资金操作类型 - 格式:1,2,3
+        in: query
+        name: OperateType
+        type: string
+      - description: 开始时间 - 闭区间,格式:yyyy-MM-dd
+        in: query
+        name: startDate
+        type: string
+      - description: 结束时间 - 闭区间,格式:yyyy-MM-dd
+        in: query
+        name: endDate
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/taaccount.QueryHisAmountLogRsp'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 资金流水查询(历史)
+      tags:
+      - 资金账户
   /User/GetLoginID:
     get:
       parameters:

+ 26 - 0
models/accountModels.go

@@ -293,3 +293,29 @@ type Taaccountlog struct {
 func (Taaccountlog) TableName() string {
 	return "TAACCOUNTLOG"
 }
+
+// Histaaccountlog 历史资金账户记账流水表
+type Histaaccountlog struct {
+	Autoid           int64     `json:"autoid"  xorm:"'AUTOID'" binding:"required"`                     // 流水ID(220+Unix秒时间戳(10位)+xxxxxx)
+	Accountid        int64     `json:"accountid"  xorm:"'ACCOUNTID'" binding:"required"`               // 资金账户ID
+	Relationorderid  string    `json:"relationorderid"  xorm:"'RELATIONORDERID'"`                      // 关联单号
+	Marketid         int32     `json:"marketid"  xorm:"'MARKETID'"`                                    // 市场ID
+	Goodsid          int32     `json:"goodsid"  xorm:"'GOODSID'"`                                      // 商品ID
+	Currencyid       int64     `json:"currencyid"  xorm:"'CURRENCYID'"`                                // 币种ID
+	Amount           float64   `json:"amount"  xorm:"'AMOUNT'" binding:"required"`                     // 资金金额
+	Amountadjusttype int32     `json:"amountadjusttype"  xorm:"'AMOUNTADJUSTTYPE'" binding:"required"` // 资金调整类型(默认值为0) -  0:系统 1:单边账调整  2:人工调整
+	Balance          float64   `json:"balance"  xorm:"'BALANCE'" binding:"required"`                   // 期初余额
+	Currentbalance   float64   `json:"currentbalance"  xorm:"'CURRENTBALANCE'" binding:"required"`     // 期末余额(变动后金额)
+	Createtime       time.Time `json:"createtime"  xorm:"'CREATETIME'" binding:"required"`             // 发生时间
+	Operatetype      int32     `json:"operatetype"  xorm:"'OPERATETYPE'" binding:"required"`           // 资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻 106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结 206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结 305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加 502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结 603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结 702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款 801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款 904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费 1007:期权盈亏 1101:营销扣款 1102:营销收款
+	Moneyticket      int64     `json:"moneyticket"  xorm:"'MONEYTICKET'"`                              // 资金流水号:银行端流水号
+	Remark           string    `json:"remark"  xorm:"'REMARK'"`                                        // 备注
+	Businesscode     int32     `json:"businesscode"  xorm:"'BUSINESSCODE'"`                            // 业务编号
+	Histradedate     string    `json:"histradedate"  xorm:"'HISTRADEDATE'" binding:"required"`         // 历史交易日
+	Isvaliddata      int32     `json:"isvaliddata"  xorm:"'ISVALIDDATA'"`                              // 是否有效 - 0:无效 1:有效
+}
+
+// TableName is HIS_TAACCOUNTLOG
+func (Histaaccountlog) TableName() string {
+	return "HIS_TAACCOUNTLOG"
+}

+ 79 - 0
models/actionModels.go

@@ -80,3 +80,82 @@ type Auctionorderinfo struct {
 func (Auctionorderinfo) TableName() string {
 	return "AUCTION_ORDERINFO"
 }
+
+// Hisauctionorderinfo 导历史竞拍信息表
+type Hisauctionorderinfo struct {
+	Goodsid                 int64     `json:"goodsid"  xorm:"'GOODSID'" binding:"required"`              // 拍品ID - 自增 SEQ_GOODS 确保不重复
+	Goodscode               string    `json:"goodscode"  xorm:"'GOODSCODE'"`                             // 拍品代码 - 系统自动生成  [#A(2位) + GoodsID十六进制(6位) ]
+	Goodsname               string    `json:"goodsname"  xorm:"'GOODSNAME'"`                             // 拍品名称
+	Applyid                 int64     `json:"applyid"  xorm:"'APPLYID'"`                                 // 申请ID
+	Wruserid                int64     `json:"wruserid"  xorm:"'WRUSERID'"`                               // 申请人用户ID
+	Wraccountid             int64     `json:"wraccountid"  xorm:"'WRACCOUNTID'"`                         // 资金账号ID
+	Marketid                int32     `json:"marketid"  xorm:"'MARKETID'"`                               // 市场ID
+	Buyorsell               int32     `json:"buyorsell"  xorm:"'BUYORSELL'"`                             // 买卖 - 0:买 1:卖
+	Wrfactortypeid          int64     `json:"wrfactortypeid"  xorm:"'WRFACTORTYPEID'"`                   // 仓单要素类型ID
+	Deliverygoodsid         int32     `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`                 // 交割商品ID
+	Brandid                 int64     `json:"brandid"  xorm:"'BRANDID'"`                                 // 品牌ID(1交割品种升贴水参数表 AutoID)
+	Qualityid               int64     `json:"qualityid"  xorm:"'QUALITYID'"`                             // 品质ID(1交割品种升贴水参数表 AutoID)
+	Specid                  int64     `json:"specid"  xorm:"'SPECID'"`                                   // 规格ID(1交割品种升贴水参数表 AutoID)
+	Warehouseid             int64     `json:"warehouseid"  xorm:"'WAREHOUSEID'"`                         // 仓库ID(1交割品种升贴水参数表 AutoID)
+	Deliverymonthid         int64     `json:"deliverymonthid"  xorm:"'DELIVERYMONTHID'"`                 // 月份ID(1交割品种升贴水参数表 AutoID)
+	Applyqty                int64     `json:"applyqty"  xorm:"'APPLYQTY'"`                               // 申请数量
+	Acutionstatus           int32     `json:"acutionstatus"  xorm:"'ACUTIONSTATUS'"`                     // 竞拍状态 - 1:竞拍中 2:未开始 3:竞拍结束(成交) 4:竞拍结束(流拍) 5:竞拍结束(履约) 6:-- 7:已注销 9:人工流拍[荷兰式]
+	Startprice              float64   `json:"startprice"  xorm:"'STARTPRICE'"`                           // 起拍价
+	Floorprice              float64   `json:"floorprice"  xorm:"'FLOORPRICE'"`                           // 底价
+	Starttradedate          string    `json:"starttradedate"  xorm:"'STARTTRADEDATE'"`                   // 起拍交易日
+	Starttime               time.Time `json:"starttime"  xorm:"'STARTTIME'"`                             // 开始时间
+	Endtime                 time.Time `json:"endtime"  xorm:"'ENDTIME'"`                                 // 结束时间
+	Margin                  float64   `json:"margin"  xorm:"'MARGIN'"`                                   // 买方保证金设置值
+	Cutinterval             int64     `json:"cutinterval"  xorm:"'CUTINTERVAL'"`                         // 降价周期 - [降价式] ;  [荷兰式]:大钟转一圈的时间
+	Pricestep               float64   `json:"pricestep"  xorm:"'PRICESTEP'"`                             // 价格幅度[降价式、竞价式]; [荷兰式]:大钟转一圈的价格,10的幂次方
+	Tradeprice              float64   `json:"tradeprice"  xorm:"'TRADEPRICE'"`                           // 成交价[结束时更新]
+	Tradeqty                int64     `json:"tradeqty"  xorm:"'TRADEQTY'"`                               // 成交数量
+	Quotenum                int64     `json:"quotenum"  xorm:"'QUOTENUM'"`                               // 出价次数[结束时更新]
+	Createtime              time.Time `json:"createtime"  xorm:"'CREATETIME'"`                           // 创建时间
+	Updatetime              time.Time `json:"updatetime"  xorm:"'UPDATETIME'"`                           // 更新时间
+	Decimalplace            int32     `json:"decimalplace"  xorm:"'DECIMALPLACE'"`                       // 报价小数位
+	Feealgorithm            int32     `json:"feealgorithm"  xorm:"'FEEALGORITHM'"`                       // 买方手续费收取方式  1:比率  2:固定
+	Exchagechargevalue      float64   `json:"exchagechargevalue"  xorm:"'EXCHAGECHARGEVALUE'"`           // 买方手续费设置值(交易所部分)
+	Feealgorithm2           int32     `json:"feealgorithm2"  xorm:"'FEEALGORITHM2'"`                     // 卖方手续费收取方式  1:比率  2:固定
+	Exchagechargevalue2     float64   `json:"exchagechargevalue2"  xorm:"'EXCHAGECHARGEVALUE2'"`         // 卖方手续费设置值(交易所部分)
+	Feealgorithm3           int32     `json:"feealgorithm3"  xorm:"'FEEALGORITHM3'"`                     // 流拍手续费收取方式  1:比率  2:固定
+	Exchagechargevalue3     float64   `json:"exchagechargevalue3"  xorm:"'EXCHAGECHARGEVALUE3'"`         // 流拍手续费设置值[收卖方,比例时按底价计算](交易所部分)
+	Failcharge              float64   `json:"failcharge"  xorm:"'FAILCHARGE'"`                           // 流拍手续费
+	Unit                    string    `json:"unit"  xorm:"'UNIT'"`                                       // 单位
+	Goodspicurl             string    `json:"goodspicurl"  xorm:"'GOODSPICURL'"`                         // 商品介绍图片(按顺序逗号分隔)
+	Buymarginalgorithm      int32     `json:"buymarginalgorithm"  xorm:"'BUYMARGINALGORITHM'"`           // 买方保证金方式 - 1:比率  2:固定
+	Sellmarginalgorithm     int32     `json:"sellmarginalgorithm"  xorm:"'SELLMARGINALGORITHM'"`         // 卖方保证金方式 - 1:比率  2:固定
+	Sellmarginvalue         float64   `json:"sellmarginvalue"  xorm:"'SELLMARGINVALUE'"`                 // 卖方保证金设置值
+	Performancemode         int32     `json:"performancemode"  xorm:"'PERFORMANCEMODE'"`                 // 履约方式 - 1:立即执行 2:履约模板执行
+	Performancetemplateid   int64     `json:"performancetemplateid"  xorm:"'PERFORMANCETEMPLATEID'"`     // 履约计划模板ID(方式为1时填-1, 为2时选择模板)
+	Sellerfreezemargin      float64   `json:"sellerfreezemargin"  xorm:"'SELLERFREEZEMARGIN'"`           // 冻结保证金-作废
+	Sellerfreezecharge      float64   `json:"sellerfreezecharge"  xorm:"'SELLERFREEZECHARGE'"`           // 冻结手续费-作废
+	Buyfirstmarginalgorithm int32     `json:"buyfirstmarginalgorithm"  xorm:"'BUYFIRSTMARGINALGORITHM'"` // 出价保证金方式 - 1:比率  2:固定
+	Buyfirstmarginvalue     float64   `json:"buyfirstmarginvalue"  xorm:"'BUYFIRSTMARGINVALUE'"`         // 出价保证金设置值
+	Auctiondesc             string    `json:"auctiondesc"  xorm:"'AUCTIONDESC'"`                         //
+	Pricemode               int32     `json:"pricemode"  xorm:"'PRICEMODE'"`                             // 价格类型 - 1:单价 2:总价 [荷兰式-单价则起拍价为单价, 总价为总价]
+	Haswr                   int32     `json:"haswr"  xorm:"'HASWR'"`                                     // 是否有仓单[荷兰式\竞价式]
+	Highestprice            float64   `json:"highestprice"  xorm:"'HIGHESTPRICE'"`                       // 最高价[竞价式]
+	Rebateratio             float64   `json:"rebateratio"  xorm:"'REBATERATIO'"`                         // 返利比率
+	Appraisal               string    `json:"appraisal"  xorm:"'APPRAISAL'"`                             //
+	Memberchargevalue       float64   `json:"memberchargevalue"  xorm:"'MEMBERCHARGEVALUE'"`             // 买方手续费设置值(会员部分)
+	Memberchargevalue2      float64   `json:"memberchargevalue2"  xorm:"'MEMBERCHARGEVALUE2'"`           // 卖方手续费设置值(会员部分)
+	Memberchargevalue3      float64   `json:"memberchargevalue3"  xorm:"'MEMBERCHARGEVALUE3'"`           // 流拍卖方手续费设置值(会员部分)
+	Performanceway          int32     `json:"performanceway"  xorm:"'PERFORMANCEWAY'"`                   // 交货模式 - 2:分步履约 3:分步提货
+	Buyreleaseratio         float64   `json:"buyreleaseratio"  xorm:"'BUYRELEASERATIO'"`                 // 买方释放比率[2:分步履约]
+	Sellreleaseratio        float64   `json:"sellreleaseratio"  xorm:"'SELLRELEASERATIO'"`               // 卖方释放比率[2:分步履约]
+	Executemode             int32     `json:"executemode"  xorm:"'EXECUTEMODE'"`                         // 执行方式[2:分步履约] - 1:顺序执行 2:交叉执行
+	Executeside             int32     `json:"executeside"  xorm:"'EXECUTESIDE'"`                         // 执行方[2:分步履约] - 1:买方 2:卖方
+	Minqty                  int32     `json:"minqty"  xorm:"'MINQTY'"`                                   // 最小执行量[2:分步履约]
+	Holddays                int32     `json:"holddays"  xorm:"'HOLDDAYS'"`                               // 合同期限[2:分步履约]
+	Marketprice             float64   `json:"marketprice"  xorm:"'MARKETPRICE'"`                         // 市场价
+	Categoryid              int32     `json:"categoryid"  xorm:"'CATEGORYID'"`                           // 类别ID(SEQ_WHZG_DGCATEGORY)
+	Shopid                  int32     `json:"shopid"  xorm:"'SHOPID'"`                                   // 店铺ID(SEQ_SZDZ2_AUCTIONSHOP)
+	Histradedate            string    `json:"histradedate"  xorm:"'HISTRADEDATE'" binding:"required"`    // 历史交易日
+	Isvaliddata             int32     `json:"isvaliddata"  xorm:"'ISVALIDDATA'"`                         // 是否有效 - 0:无效 1:有效
+}
+
+// TableName is HIS_AUCTION_ORDERINFO
+func (Hisauctionorderinfo) TableName() string {
+	return "HIS_AUCTION_ORDERINFO"
+}

+ 2 - 0
routers/router.go

@@ -59,6 +59,8 @@ func InitRouter() *gin.Engine {
 	{
 		// 资金流水查询(当前)
 		taAccountR.GET("/QueryAmountLog", taaccount.QueryAmountLog)
+		// 资金流水查询(历史)
+		taAccountR.GET("/QueryHisAmountLog", taaccount.QueryHisAmountLog)
 	}
 	// ************************ 通用服务 ************************
 	commonR := apiR.Group("Common")