|
|
@@ -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)
|
|
|
+}
|