/** * @Author: zou.yingbin * @Create : 2021/2/4 11:27 * @Modify : 2021/2/4 11:27 */ package ermcp import ( "github.com/gin-gonic/gin" "mtp2_if/global/app" "mtp2_if/global/e" "mtp2_if/models" "net/http" ) // 财务日报表请求 type QryReportDayReq struct { UserId int64 `form:"userid" binding:"required"` //用户ID TradeDate string `form:"tradedate" binding:"required"` // 交易日 } type QryReportFinanceDayRsp models.ErmcpReportDayFR // @Summary 查询财务日报表(菜单:报表查询/财务报表/日报表) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param tradedate query string true "交易日(格式:yyyyMMdd)" // @Success 200 {array} QryReportFinanceDayRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportDayFinance [get] // @Tags 企业风险管理(app) func QryReportDayFinance(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportDayReq{} a.DoBindReq(&req) m := models.ErmcpReportDayFR{AREAUSERID: req.UserId, RECKONDATE: req.TradeDate} a.DoGetDataEx(&m) } // 财务日报表款项明细 type QryReportFinanceKxRsp models.ErmcpReportOPLog // @Summary 查询财务日报表款项(菜单:报表查询/财务报表/日报表/款项) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param tradedate query string true "交易日(格式:yyyyMMdd)" // @Success 200 {array} QryReportFinanceKxRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportDayFinanceKx [get] // @Tags 企业风险管理(app) func QryReportDayFinanceKx(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportDayReq{} a.DoBindReq(&req) m := models.ErmcpReportDayFRKx{USERID: req.UserId, TRADEDATE: req.TradeDate} a.DoGetDataEx(&m) } // 财务日报表发票明细 type QryReportFinanceFpRsp models.ErmcpReportOPLog // @Summary 查询财务日报表发票(菜单:报表查询/财务报表/日报表/发票) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param tradedate query string true "交易日(格式:yyyyMMdd)" // @Success 200 {array} QryReportFinanceKxRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportDayFinanceFp [get] // @Tags 企业风险管理(app) func QryReportDayFinanceFp(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportDayReq{} a.DoBindReq(&req) m := models.ErmcpReportOPLog{USERID: req.UserId, TRADEDATE: req.TradeDate, LogTypeFilter: "11, 12"} a.DoGetDataEx(&m) } // 财务月报表请求 type QryReportMonthReq struct { UserId int64 `form:"userid" binding:"required"` //用户ID CycleTime string `form:"cycletime" binding:"required"` // 周期时间:月(格式:yyyyMM) } // 财务月报表应答 type QryReportFinanceMonRsp models.ErmcpReportMonthFR // @Summary 查询财务月报表(菜单:报表查询/财务报表/月报表) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param cycletime query string true "周期时间:月(格式:yyyyMM)" // @Success 200 {array} QryReportFinanceMonRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportMonthFinance [get] // @Tags 企业风险管理(app) func QryReportMonthFinance(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportMonthReq{} a.DoBindReq(&req) m := models.ErmcpReportMonthFR{AREAUSERID: req.UserId, CYCLETIME: req.CycleTime} a.DoGetDataEx(&m) } // 敞口日报表 type QryReportExposureDayRsp models.ErmcpReportDayExposure // @Summary 查询敞口日报表(菜单:报表查询/敞口报表/敞口日报表) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param tradedate query string true "交易日(格式:yyyyMMdd)" // @Success 200 {array} QryReportExposureDayRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportDayExposure [get] // @Tags 企业风险管理(app) func QryReportDayExposure(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportDayReq{} a.DoBindReq(&req) m := models.ErmcpReportDayExposure{AREAUSERID: req.UserId, RECKONDATE: req.TradeDate} a.DoGetDataEx(&m) } // 现货日报表 type QryReportSpotDayRsp models.ErmcpReportDaySpot // @Summary 查询现货日报表(菜单:报表查询/现货报表/现货日报表) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param tradedate query string true "交易日(格式:yyyyMMdd)" // @Success 200 {array} QryReportSpotDayRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportDaySpot [get] // @Tags 企业风险管理(app) func QryReportDaySpot(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportDayReq{} a.DoBindReq(&req) m := models.ErmcpReportDaySpot{AREAUSERID: req.UserId, RECKONDATE: req.TradeDate} a.DoGetDataEx(&m) } // 现货日报表明细请求 type QryReportDaySpotDetailReq struct { UserId int64 `form:"userid" binding:"required"` //用户ID Wrstandardid int64 `form:"wrstandardid" binding:"required"` // 现货商品id TradeDate string `form:"tradedate" binding:"required"` // 交易日 } // 现货日报表明细应答 type QryReportDaySpotDetailRsp models.ErmcpReportOPLog // @Summary 查询现货日报表详情(菜单:报表查询/现货报表/现货日报表详情) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param wrstandardid query int true "现货商品id" // @Param tradedate query string true "交易日(格式:yyyyMMdd)" // @Success 200 {array} QryReportDaySpotDetailRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportDaySpotDetail [get] // @Tags 企业风险管理(app) func QryReportDaySpotDetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportDaySpotDetailReq{} a.DoBindReq(&req) m := models.ErmcpReportOPLog{USERID: req.UserId, WRSTANDARDID: req.Wrstandardid, TRADEDATE: req.TradeDate, LogTypeFilter: "2,3"} a.DoGetDataEx(&m) } // 现货月报表应答 type QryReportSpotMonRsp models.ErmcpReportMonSpot // @Summary 查询现货月报表(菜单:报表查询/现货报表/现货月报表) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param cycletime query string true "周期时间:月(格式:yyyyMM)" // @Success 200 {array} QryReportSpotMonRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportMonthSpot [get] // @Tags 企业风险管理(app) func QryReportMonthSpot(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportMonthReq{} a.DoBindReq(&req) m := models.ErmcpReportMonSpot{AREAUSERID: req.UserId, CYCLETIME: req.CycleTime} a.DoGetDataEx(&m) } // 现货月报表详情请求 type QryReportSpotMonthDetailReq struct { UserId int64 `form:"userid" binding:"required"` //用户ID Wrstandardid int64 `form:"wrstandardid" binding:"required"` // 现货商品id CycleTime string `form:"cycletime" binding:"required"` // 周期时间:月(格式:yyyyMM) } // 现货月报表详情应答 type QryReportSpotMonthDetailRsp models.ErmcpReportDaySpot // @Summary 查询现货月报表详情(菜单:报表查询/现货月报表/现货月报表详情) // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param wrstandardid query int true "现货商品id" // @Param cycletime query string true "周期时间:月(格式:yyyyMM)" // @Success 200 {array} QryReportSpotMonthDetailRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QryReportMonthSpotDetail [get] // @Tags 企业风险管理(app) func QryReportMonthSpotDetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryReportSpotMonthDetailReq{} a.DoBindReq(&req) if len(req.CycleTime) != 6 { // 月报表的日期应是6位,如 202101 a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil) return } t1 := req.CycleTime + "01" t2 := req.CycleTime + "31" m := models.ErmcpReportDaySpot{AREAUSERID: req.UserId, WRSTANDARDID: req.Wrstandardid, BeginDate: t1, EndDate: t2} a.DoGetDataEx(&m) }