qryErmcp3.go 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/4/15 10:35
  4. * @Modify : 2021/4/15 10:35
  5. */
  6. package ermcp3
  7. import (
  8. "github.com/gin-gonic/gin"
  9. "mtp2_if/global/app"
  10. "mtp2_if/models"
  11. )
  12. // QueryDeliveryGoods
  13. // @Summary 查询现货商品
  14. // @Produce json
  15. // @Security ApiKeyAuth
  16. // @Param areauserid query int true "所属机构id"
  17. // @Param excludecfg query int false "排除已配置的现货商品 1-排除"
  18. // @Success 200 {array} models.ErmcpDeliveryGoods
  19. // @Failure 500 {object} app.Response
  20. // @Router /Ermcp3/QueryDeliveryGoods [get]
  21. // @Tags 企业风险管理v3(app)
  22. func QueryDeliveryGoods(c *gin.Context) {
  23. a := app.GinUtils{Gin: app.Gin{C: c}}
  24. req := struct {
  25. AreaUserId int64 `form:"areauserid" binding:"required"` // 所属机构id
  26. ExcludeCfg int32 `form:"excludecfg"` // 排除已配置的商品
  27. }{}
  28. a.DoBindReq(&req)
  29. m := models.ErmcpDeliveryGoods{AREAUSERID: req.AreaUserId, ExcludeCfg: req.ExcludeCfg}
  30. a.DoGetDataI(&m)
  31. }
  32. // QueryDeliveryGoodsDetail
  33. // @Summary 查询现货商品详情
  34. // @Produce json
  35. // @Security ApiKeyAuth
  36. // @Param areauserid query int true "所属机构id"
  37. // @Param deliverygoodsid query int false "现货商品id"
  38. // @Param qrytradegoods query int false "是否查询关联交易商品 1-查询"
  39. // @Success 200 {array} models.ErmcpDeliveryGoodsDetail
  40. // @Failure 500 {object} app.Response
  41. // @Router /Ermcp3/QueryDeliveryGoodsDetail [get]
  42. // @Tags 企业风险管理v3(app)
  43. func QueryDeliveryGoodsDetail(c *gin.Context) {
  44. a := app.GinUtils{Gin: app.Gin{C: c}}
  45. req := struct {
  46. AreaUserId int64 `form:"areauserid" binding:"required"` // 所属机构id
  47. DeliveryGoodsId int32 `form:"deliverygoodsid"` // 排除已配置的商品
  48. QryTradeGoods int32 `form:"qrytradegoods"` // 查询关联交易商品
  49. }{}
  50. a.DoBindReq(&req)
  51. m := models.ErmcpDeliveryGoodsDetail{
  52. Data: models.ErmcpDeliveryGoods{AREAUSERID: req.AreaUserId, DELIVERYGOODSID: req.DeliveryGoodsId},
  53. QryTradeGoods: req.QryTradeGoods}
  54. a.DoGetDataI(&m)
  55. }
  56. // QryContractReq 查询合同请求
  57. type QryContractReq struct {
  58. AreadUserId int64 `form:"areauserid" binding:"required"` // 所属机构Id
  59. CONTRACTTYPE int32 `form:"contracttype" binding:"required"` // 合同类型 1-采购, -1-销售
  60. QUERYTYPE int64 `form:"querytype" binding:"required"` // 查询类型 1-全部 2-待点价 3-履约结算 4-已完成
  61. USERID int64 `form:"userid"` // 用户Id
  62. USERTYPE int32 `form:"usertype"` // 用户类型
  63. CONTRACTID string `form:"contractid"` // 合同ID(SpotContractId)
  64. }
  65. // QuerySpotContract
  66. // @Summary 查询现货合同
  67. // @Produce json
  68. // @Security ApiKeyAuth
  69. // @Param areauserid query int true "所属机构ID"
  70. // @Param contracttype query int true "合同类型 1-采购, -1-销售"
  71. // @Param querytype query int true "查询类型 1-全部 2-待点价 3-履约结算 4-已完成"
  72. // @Param userid query int false "用户ID"
  73. // @Param usertype query int false "用户类型 2-机构 7-企业成员"
  74. // @Param contractid query string false "合同ID(SpotContractId)"
  75. // @Success 200 {array} models.Ermcp3Contract
  76. // @Failure 500 {object} app.Response
  77. // @Router /Ermcp3/QuerySpotContract [get]
  78. // @Tags 企业风险管理v3(app)
  79. func QuerySpotContract(c *gin.Context) {
  80. a := app.GinUtils{Gin: app.Gin{C: c}}
  81. req := QryContractReq{}
  82. a.DoBindReq(&req)
  83. m := models.Ermcp3Contract{USERID: req.AreadUserId, CONTRACTTYPE: req.CONTRACTTYPE,
  84. OwnUserId: req.USERID, UserType: req.USERTYPE, SPOTCONTRACTID: req.CONTRACTID}
  85. a.DoGetDataI(&m)
  86. }
  87. // QuerySpotContractBS
  88. // @Summary 查询合同(采购/销售)
  89. // @Produce json
  90. // @Security ApiKeyAuth
  91. // @Param areauserid query int true "所属机构ID"
  92. // @Param contracttype query int true "合同类型 1-采购, -1-销售"
  93. // @Param querytype query int true "查询类型 1-全部 2-待点价 3-履约结算 4-已完成"
  94. // @Param userid query int false "用户ID"
  95. // @Param usertype query int false "用户类型 2-机构 7-企业成员"
  96. // @Param contractid query string false "合同ID(SpotContractId)"
  97. // @Success 200 {array} models.Ermcp3SellBuyContract
  98. // @Failure 500 {object} app.Response
  99. // @Router /Ermcp3/QuerySpotContractBS [get]
  100. // @Tags 企业风险管理v3(app)
  101. func QuerySpotContractBS(c *gin.Context) {
  102. a := app.GinUtils{Gin: app.Gin{C: c}}
  103. req := QryContractReq{}
  104. a.DoBindReq(&req)
  105. m := models.Ermcp3SellBuyContract{UserID: req.AreadUserId, Contracttype: req.CONTRACTTYPE,
  106. OwnUserId: req.USERID, UserType: req.USERTYPE, SpotContractId: req.CONTRACTID}
  107. a.DoGetDataI(&m)
  108. }