/** * @Author: zou.yingbin * @Create : 2021/4/15 10:35 * @Modify : 2021/4/15 10:35 */ package ermcp3 import ( "github.com/gin-gonic/gin" "mtp2_if/global/app" "mtp2_if/models" ) // QueryDeliveryGoods // @Summary 查询现货商品 // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构id" // @Param excludecfg query int false "排除已配置的现货商品 1-排除" // @Success 200 {array} models.ErmcpDeliveryGoods // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryDeliveryGoods [get] // @Tags 企业风险管理v3(app) func QueryDeliveryGoods(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AreaUserId int64 `form:"areauserid" binding:"required"` // 所属机构id ExcludeCfg int32 `form:"excludecfg"` // 排除已配置的商品 }{} a.DoBindReq(&req) m := models.ErmcpDeliveryGoods{AREAUSERID: req.AreaUserId, ExcludeCfg: req.ExcludeCfg} a.DoGetDataI(&m) } // QueryDeliveryGoodsDetail // @Summary 查询现货商品详情 // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构id" // @Param deliverygoodsid query int false "现货商品id" // @Param qrytradegoods query int false "是否查询关联交易商品 1-查询" // @Success 200 {array} models.ErmcpDeliveryGoodsDetail // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryDeliveryGoodsDetail [get] // @Tags 企业风险管理v3(app) func QueryDeliveryGoodsDetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AreaUserId int64 `form:"areauserid" binding:"required"` // 所属机构id DeliveryGoodsId int32 `form:"deliverygoodsid"` // 排除已配置的商品 QryTradeGoods int32 `form:"qrytradegoods"` // 查询关联交易商品 }{} a.DoBindReq(&req) m := models.ErmcpDeliveryGoodsDetail{ Data: models.ErmcpDeliveryGoods{AREAUSERID: req.AreaUserId, DELIVERYGOODSID: req.DeliveryGoodsId}, QryTradeGoods: req.QryTradeGoods} a.DoGetDataI(&m) } // QryContractReq 查询合同请求 type QryContractReq struct { AreadUserId int64 `form:"areauserid" binding:"required"` // 所属机构Id CONTRACTTYPE int32 `form:"contracttype"` // 合同类型 1-采购, -1-销售 QUERYTYPE int32 `form:"querytype" binding:"required"` // 查询类型 1-全部 2-待点价 3-履约结算 4-已完成 USERID int64 `form:"userid"` // 用户Id USERTYPE int32 `form:"usertype"` // 用户类型 CONTRACTID string `form:"contractid"` // 合同ID(SpotContractId) } // QuerySpotContract // @Summary 查询现货合同 // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构ID" // @Param querytype query int true "查询类型 1-全部 2-待点价 3-履约结算 4-已完成" // @Param userid query int false "用户ID" // @Param usertype query int false "用户类型 2-机构 7-企业成员" // @Param contractid query string false "合同ID(SpotContractId)" // @Success 200 {array} models.Ermcp3Contract // @Failure 500 {object} app.Response // @Router /Ermcp3/QuerySpotContract [get] // @Tags 企业风险管理v3(app) func QuerySpotContract(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryContractReq{} a.DoBindReq(&req) m := models.Ermcp3Contract{USERID: req.AreadUserId, QryType: req.QUERYTYPE, OwnUserId: req.USERID, UserType: req.USERTYPE, SPOTCONTRACTID: req.CONTRACTID} a.DoGetDataI(&m) } // QuerySpotContractBS // @Summary 查询合同(采购/销售) // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构ID" // @Param contracttype query int true "合同类型 1-采购, -1-销售" // @Param querytype query int true "查询类型 1-全部 2-待点价 3-履约结算 4-已完成" // @Param userid query int false "用户ID" // @Param usertype query int false "用户类型 2-机构 7-企业成员" // @Param contractid query string false "合同ID(SpotContractId)" // @Success 200 {array} models.Ermcp3SellBuyContract // @Failure 500 {object} app.Response // @Router /Ermcp3/QuerySpotContractBS [get] // @Tags 企业风险管理v3(app) func QuerySpotContractBS(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := QryContractReq{} a.DoBindReq(&req) m := models.Ermcp3SellBuyContract{UserID: req.AreadUserId, Contracttype: req.CONTRACTTYPE, OwnUserId: req.USERID, UserType: req.USERTYPE, SpotContractId: req.CONTRACTID, QryType: req.QUERYTYPE} a.DoGetDataI(&m) } // QueryExposureDetail // @Summary 查询敞口现货明细 // @Produce json // @Security ApiKeyAuth // @Param areaUserId query int true "所属机构ID" // @Param middleGoodsId query int true "套保商品" // @Success 200 {array} models.Ermcp3ExposureDetail // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryExposureDetail [get] // @Tags 企业风险管理v3(app) func QueryExposureDetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AREAUSERID int64 `form:"areauserid" binding:"required"` // 所属机构id MIDDLEGOODSID int32 `form:"middlegoodsid" binding:"required"` // 套保商品id }{} a.DoBindReq(&req) m := models.Ermcp3ExposureDetail{Areauserid: req.AREAUSERID, MiddlegoodsId: req.MIDDLEGOODSID} a.DoGetDataI(&m) } // QueryExposureSpot // @Summary 查询敞口现货头寸(敞口/现货头寸) // @Produce json // @Security ApiKeyAuth // @Param areaUserId query int true "所属机构ID" // @Success 200 {array} models.Ermcp3AreaSpot // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryExposureSpot [get] // @Tags 企业风险管理v3(app) func QueryExposureSpot(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AREAUSERID int64 `form:"areauserid" binding:"required"` // 所属机构id }{} a.DoBindReq(&req) m := models.Ermcp3AreaSpot{AREAUSERID: req.AREAUSERID} a.DoGetDataI(&m) } // QueryExposureSpotDetail // @Summary 查询敞口现货头寸明细(敞口/现货头寸/现货明细) // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构ID" // @Param deliverygoodsid query int true "现货品种ID" // @Success 200 {array} models.Ermcp3AreaSpotDetail // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryExposureSpotDetail [get] // @Tags 企业风险管理v3(app) func QueryExposureSpotDetail(c *gin.Context) { appG := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AREAUSERID int `form:"areauserid" binding:"required"` // 所属机构id DELIVERYGOODSID int32 `form:"deliverygoodsid" binding:"required"` // 现货商品id }{} appG.DoBindReq(&req) m := models.Ermcp3AreaSpotDetail{UserId: req.AREAUSERID, DELIVERYGOODSID: req.DELIVERYGOODSID} appG.DoGetDataI(&m) } // QueryDGFactoryItem // @Summary 查询品种要素定义项 // @Produce json // @Security ApiKeyAuth // @Param areauserid query int false "所属机构ID" // @Param dgfactoryitemid query int false "选择项ID(SEQ_DGFACTORYITEM)" // @Param deliverygoodsid query int false "现货品种ID" // @Param dgfactoryitemtypeid query int false "要素项类型" // @Param orderindex query int false "顺序" // @Success 200 {array} models.ErmcpDGFactoryItem // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryDGFactoryItem [get] // @Tags 企业风险管理v3(app) func QueryDGFactoryItem(c *gin.Context) { appG := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AREAUSERID int64 `form:"areauserid"` // 用户id DGFACTORYITEMID int64 `form:"dgfactoryitemid"` // 选择项ID(SEQ_DGFACTORYITEM) DELIVERYGOODSID int32 `form:"deliverygoodsid"` // 现货品种ID DGFACTORYITEMTYPEID int64 `form:"dgfactoryitemtypeid"` // 要素项类型 ORDERINDEX int32 `form:"orderindex"` // 顺序 }{} appG.DoBindReq(&req) m := models.ErmcpDGFactoryItem{ AREAUSERID: req.AREAUSERID, DGFACTORYITEMID: req.DGFACTORYITEMID, DELIVERYGOODSID: req.DELIVERYGOODSID, DGFACTORYITEMTYPEID: req.DGFACTORYITEMTYPEID, ORDERINDEX: req.ORDERINDEX, } appG.DoGetDataI(&m) } // QueryGoodsbrand // @Summary 查询商品品牌 // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构ID" // @Success 200 {array} models.Ermcp3Brand // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryGoodsbrand [get] // @Tags 企业风险管理v3(app) func QueryGoodsbrand(c *gin.Context) { appG := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AREAUSERID int64 `form:"areauserid"` // 用户id DELIVERYGOODSID int32 `form:"deliverygoodsid"` // 现货品种ID }{} appG.DoBindReq(&req) m := models.Ermcp3Brand{ AREAUSERID: req.AREAUSERID, DELIVERYGOODSID: req.DELIVERYGOODSID, } appG.DoGetDataI(&m) } // QueryGoodsWrstandard // @Summary 查询商品品类 // @Produce json // @Security ApiKeyAuth // @Param areauserid query int true "所属机构ID" // @Param deliverygoodsid query int false "现货商品id" // @Success 200 {array} models.Ermcp3Wrstandard // @Failure 500 {object} app.Response // @Router /Ermcp3/QueryGoodsWrstandard [get] // @Tags 企业风险管理v3(app) func QueryGoodsWrstandard(c *gin.Context) { appG := app.GinUtils{Gin: app.Gin{C: c}} req := struct { AREAUSERID int `form:"areauserid" binding:"required"` // 所属机构id DELIVERYGOODSID int32 `form:"deliverygoodsid"` // 现货商品id }{} appG.DoBindReq(&req) m := models.Ermcp3Wrstandard{AREAUSERID: req.AREAUSERID, DELIVERYGOODSID: req.DELIVERYGOODSID} appG.DoGetDataI(&m) }