瀏覽代碼

增加“交易系统转换流水查询”接口

Simon Zhou 5 年之前
父節點
當前提交
0676b6a5a4
共有 5 個文件被更改,包括 502 次插入0 次删除
  1. 59 0
      controllers/szdz/szdz.go
  2. 163 0
      docs/docs.go
  3. 163 0
      docs/swagger.json
  4. 115 0
      docs/swagger.yaml
  5. 2 0
      routers/router.go

+ 59 - 0
controllers/szdz/szdz.go

@@ -161,3 +161,62 @@ func QueryGoodsPickup(c *gin.Context) {
 	logger.GetLogger().Infof("QueryGoodsPickup successed: %v", datas)
 	appG.Response(http.StatusOK, e.SUCCESS, datas)
 }
+
+// QueryConvertLogReq 交易系统转换流水查询请求参数
+type QueryConvertLogReq struct {
+	AccountID string `form:"accountID" binding:"required"`
+	StartDate string `form:"startDate"`
+	EndDate   string `form:"endDate"`
+}
+
+// QueryConvertLogRsp 交易系统转换流水查询返回模型
+type QueryConvertLogRsp struct {
+	models.Szdz3convertlog `xorm:"extends"`
+	Goodscode              string `json:"goodscode"  xorm:"'GOODSCODE'"` // 商品代码
+	Goodsname              string `json:"goodsname"  xorm:"'GOODSNAME'"` // 商品名称
+}
+
+// QueryConvertLog 交易系统转换流水查询
+// @Summary 交易系统转换流水查询
+// @Produce json
+// @Security ApiKeyAuth
+// @Param accountID query string true "资金账户 - 格式:1,2,3"
+// @Param StartDate query string false "开始时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss"
+// @Param EndDate query string false "结束时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss"
+// @Success 200 {object} QueryConvertLogRsp
+// @Failure 500 {object} app.Response
+// @Router /SZDZ/QueryConvertLog [get]
+// @Tags 尚志大宗
+func QueryConvertLog(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req QueryConvertLogReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("QueryConvertLog failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	datas := make([]QueryConvertLogRsp, 0)
+	engine := db.GetEngine()
+	s := engine.Join("INNER", "GOODS", "GOODS.GOODSID = SZDZ3_CONVERTLOG.INNERGOODSID").
+		Select("SZDZ3_CONVERTLOG.*, GOODS.GOODSCODE, GOODS.GOODSNAME").
+		Where(fmt.Sprintf(`SZDZ3_CONVERTLOG.HandleStatus = 1 and SZDZ3_CONVERTLOG.ACCOUNTID in (%s)`, req.AccountID))
+	if len(req.StartDate) > 0 {
+		s = s.And(fmt.Sprintf(`SZDZ3_CONVERTLOG.CREATETIME >= to_date(%s,'yyyy-MM-dd hh24:mi:ss'`, req.StartDate))
+	}
+	if len(req.EndDate) > 0 {
+		s = s.And(fmt.Sprintf(`SZDZ3_CONVERTLOG.CREATETIME <= to_date(%s,'yyyy-MM-dd hh24:mi:ss'`, req.EndDate))
+	}
+	if err := s.Find(&datas); err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("QueryConvertLog failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功返回
+	logger.GetLogger().Infof("QueryConvertLog successed: %v", datas)
+	appG.Response(http.StatusOK, e.SUCCESS, datas)
+}

+ 163 - 0
docs/docs.go

@@ -717,6 +717,57 @@ var doc = `{
                 }
             }
         },
+        "/SZDZ/QueryConvertLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "尚志大宗"
+                ],
+                "summary": "交易系统转换流水查询",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资金账户 - 格式:1,2,3",
+                        "name": "accountID",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss",
+                        "name": "StartDate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss",
+                        "name": "EndDate",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/szdz.QueryConvertLogRsp"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/SZDZ/QueryGoodsPickup": {
             "get": {
                 "security": [
@@ -2858,6 +2909,118 @@ var doc = `{
                 }
             }
         },
+        "szdz.QueryConvertLogRsp": {
+            "type": "object",
+            "required": [
+                "logid"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "资金账户ID",
+                    "type": "integer"
+                },
+                "clientticket": {
+                    "description": "客户端流水号",
+                    "type": "string"
+                },
+                "converttype": {
+                    "description": "转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞 4:交易转金点拍",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "记账时间",
+                    "type": "string"
+                },
+                "daymaxvalue": {
+                    "description": "配置当日最大转入限制",
+                    "type": "number"
+                },
+                "daymaxvalue2": {
+                    "description": "配置当日最大转入限制(转入)",
+                    "type": "number"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "handlestatus": {
+                    "description": "处理状态",
+                    "type": "integer"
+                },
+                "innergoodsid": {
+                    "description": "内部商品ID",
+                    "type": "integer"
+                },
+                "inratio": {
+                    "description": "配置转入比值",
+                    "type": "integer"
+                },
+                "invalue": {
+                    "description": "目标值",
+                    "type": "number"
+                },
+                "logid": {
+                    "description": "LogID(901+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "mobile": {
+                    "description": "手机号码(加密存储)",
+                    "type": "string"
+                },
+                "outergoodscode": {
+                    "description": "外部商品代码[JD\\PD]",
+                    "type": "string"
+                },
+                "outratio": {
+                    "description": "配置转出比值",
+                    "type": "integer"
+                },
+                "outvalue": {
+                    "description": "源值",
+                    "type": "number"
+                },
+                "pddecimalplace": {
+                    "description": "PD小数位",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "sessionid": {
+                    "description": "会话ID",
+                    "type": "integer"
+                },
+                "timemaxvalue": {
+                    "description": "配置单次最大转入限制",
+                    "type": "number"
+                },
+                "timemaxvalue2": {
+                    "description": "配置单次最大转入限制(转入)",
+                    "type": "number"
+                },
+                "timeminvalue": {
+                    "description": "配置单次最小数量限制",
+                    "type": "number"
+                },
+                "timeminvalue2": {
+                    "description": "配置单次最小数量限制(转入)",
+                    "type": "number"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "szdz.QueryGoodsPickupRsp": {
             "type": "object",
             "required": [

+ 163 - 0
docs/swagger.json

@@ -701,6 +701,57 @@
                 }
             }
         },
+        "/SZDZ/QueryConvertLog": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "尚志大宗"
+                ],
+                "summary": "交易系统转换流水查询",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资金账户 - 格式:1,2,3",
+                        "name": "accountID",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss",
+                        "name": "StartDate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss",
+                        "name": "EndDate",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/szdz.QueryConvertLogRsp"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/SZDZ/QueryGoodsPickup": {
             "get": {
                 "security": [
@@ -2842,6 +2893,118 @@
                 }
             }
         },
+        "szdz.QueryConvertLogRsp": {
+            "type": "object",
+            "required": [
+                "logid"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "资金账户ID",
+                    "type": "integer"
+                },
+                "clientticket": {
+                    "description": "客户端流水号",
+                    "type": "string"
+                },
+                "converttype": {
+                    "description": "转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞 4:交易转金点拍",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "记账时间",
+                    "type": "string"
+                },
+                "daymaxvalue": {
+                    "description": "配置当日最大转入限制",
+                    "type": "number"
+                },
+                "daymaxvalue2": {
+                    "description": "配置当日最大转入限制(转入)",
+                    "type": "number"
+                },
+                "goodscode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "handlestatus": {
+                    "description": "处理状态",
+                    "type": "integer"
+                },
+                "innergoodsid": {
+                    "description": "内部商品ID",
+                    "type": "integer"
+                },
+                "inratio": {
+                    "description": "配置转入比值",
+                    "type": "integer"
+                },
+                "invalue": {
+                    "description": "目标值",
+                    "type": "number"
+                },
+                "logid": {
+                    "description": "LogID(901+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "mobile": {
+                    "description": "手机号码(加密存储)",
+                    "type": "string"
+                },
+                "outergoodscode": {
+                    "description": "外部商品代码[JD\\PD]",
+                    "type": "string"
+                },
+                "outratio": {
+                    "description": "配置转出比值",
+                    "type": "integer"
+                },
+                "outvalue": {
+                    "description": "源值",
+                    "type": "number"
+                },
+                "pddecimalplace": {
+                    "description": "PD小数位",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "sessionid": {
+                    "description": "会话ID",
+                    "type": "integer"
+                },
+                "timemaxvalue": {
+                    "description": "配置单次最大转入限制",
+                    "type": "number"
+                },
+                "timemaxvalue2": {
+                    "description": "配置单次最大转入限制(转入)",
+                    "type": "number"
+                },
+                "timeminvalue": {
+                    "description": "配置单次最小数量限制",
+                    "type": "number"
+                },
+                "timeminvalue2": {
+                    "description": "配置单次最小数量限制(转入)",
+                    "type": "number"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "szdz.QueryGoodsPickupRsp": {
             "type": "object",
             "required": [

+ 115 - 0
docs/swagger.yaml

@@ -1449,6 +1449,89 @@ definitions:
         description: 交易模式
         type: integer
     type: object
+  szdz.QueryConvertLogRsp:
+    properties:
+      accountid:
+        description: 资金账户ID
+        type: integer
+      clientticket:
+        description: 客户端流水号
+        type: string
+      converttype:
+        description: 转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞 4:交易转金点拍
+        type: integer
+      createtime:
+        description: 记账时间
+        type: string
+      daymaxvalue:
+        description: 配置当日最大转入限制
+        type: number
+      daymaxvalue2:
+        description: 配置当日最大转入限制(转入)
+        type: number
+      goodscode:
+        description: 商品代码
+        type: string
+      goodsname:
+        description: 商品名称
+        type: string
+      handlestatus:
+        description: 处理状态
+        type: integer
+      innergoodsid:
+        description: 内部商品ID
+        type: integer
+      inratio:
+        description: 配置转入比值
+        type: integer
+      invalue:
+        description: 目标值
+        type: number
+      logid:
+        description: LogID(901+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        type: integer
+      mobile:
+        description: 手机号码(加密存储)
+        type: string
+      outergoodscode:
+        description: 外部商品代码[JD\PD]
+        type: string
+      outratio:
+        description: 配置转出比值
+        type: integer
+      outvalue:
+        description: 源值
+        type: number
+      pddecimalplace:
+        description: PD小数位
+        type: integer
+      remark:
+        description: 备注
+        type: string
+      sessionid:
+        description: 会话ID
+        type: integer
+      timemaxvalue:
+        description: 配置单次最大转入限制
+        type: number
+      timemaxvalue2:
+        description: 配置单次最大转入限制(转入)
+        type: number
+      timeminvalue:
+        description: 配置单次最小数量限制
+        type: number
+      timeminvalue2:
+        description: 配置单次最小数量限制(转入)
+        type: number
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+    required:
+    - logid
+    type: object
   szdz.QueryGoodsPickupRsp:
     properties:
       accountid:
@@ -1990,6 +2073,38 @@ paths:
       summary: 持仓汇总查询(合约市场)
       tags:
       - 通用单据
+  /SZDZ/QueryConvertLog:
+    get:
+      parameters:
+      - description: 资金账户 - 格式:1,2,3
+        in: query
+        name: accountID
+        required: true
+        type: string
+      - description: 开始时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss
+        in: query
+        name: StartDate
+        type: string
+      - description: 结束时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss
+        in: query
+        name: EndDate
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/szdz.QueryConvertLogRsp'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 交易系统转换流水查询
+      tags:
+      - 尚志大宗
   /SZDZ/QueryGoodsPickup:
     get:
       parameters:

+ 2 - 0
routers/router.go

@@ -119,6 +119,8 @@ func InitRouter() *gin.Engine {
 		szdzR.GET("/QueryRecieptOrder", szdz.QueryRecieptOrder)
 		// 商品提货单查询
 		szdzR.GET("/QueryGoodsPickup", szdz.QueryGoodsPickup)
+		// 交易系统转换流水查询
+		szdzR.GET("/QueryConvertLog", szdz.QueryConvertLog)
 	}
 
 	return r