| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- /**
- * @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" binding:"required"` // 合同类型 1-采购, -1-销售
- QUERYTYPE int64 `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 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.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, CONTRACTTYPE: req.CONTRACTTYPE,
- 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}
- a.DoGetDataI(&m)
- }
|