qryAreaStock.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/3/10 15:30
  4. * @Modify : 2021/3/10 15:30
  5. */
  6. package ermcp
  7. import (
  8. "github.com/gin-gonic/gin"
  9. "mtp2_if/global/app"
  10. "mtp2_if/models"
  11. )
  12. // QryAreaStockApplyReq 查询库存申请请求
  13. type QryAreaStockApplyReq struct {
  14. USERID string `form:"userid" binding:"required"` // 用户id
  15. INOUTTYPE string `form:"inouttype"` // 出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
  16. SPOTCONTRACTID string `form:"spotcontractid"` // 合同ID
  17. WRSTANDARDID string `form:"wrstandardid"` // 现货商品ID
  18. SPOTGOODSBRANDID int32 `form:"spotgoodsbrandid"` // 品牌ID
  19. SPOTGOODSMODELID int32 `form:"spotgoodsmodelid"` // 型号ID
  20. WAREHOUSEINFOID string `form:"warehouseinfoid"` // 仓库ID
  21. APPLYSTATUS string `form:"applystatus"` // 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
  22. }
  23. // QryAreaStockApplyRsp 查询库存申请响应
  24. type QryAreaStockApplyRsp models.ErmcpAreaStockApply
  25. // QueryAreaStockApply
  26. // @Summary 查询库存申请(出入库记录|库存审核)
  27. // @Produce json
  28. // @Security ApiKeyAuth
  29. // @Param userid query int true "用户ID"
  30. // @Param inouttype query string false "出入库类型(可多项,逗号隔开) 1:采购入库 2:销售出库 3:生产入库 4:生产出库"
  31. // @Param spotcontractid query int false "合同ID"
  32. // @Param wrstandardid query int false "现货商品ID"
  33. // @Param spotgoodsbrandid query int false "品牌ID"
  34. // @Param spotgoodsmodelid query int false "型号ID"
  35. // @Param warehouseinfoid query int false "仓库ID"
  36. // @Param applystatus query string false "申请状态(可多项,逗号隔开)1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
  37. // @Success 200 {array} QryAreaStockApplyRsp
  38. // @Failure 500 {object} app.Response
  39. // @Router /Ermcp/QueryAreaStockApply [get]
  40. // @Tags 企业风险管理(app)
  41. func QueryAreaStockApply(c *gin.Context) {
  42. a := app.NewGinUtils(c)
  43. req := QryAreaStockApplyReq{}
  44. a.DoBindReq(&req)
  45. m := models.ErmcpAreaStockApply{
  46. USERID: req.USERID,
  47. FilterType: req.INOUTTYPE,
  48. SPOTCONTRACTID: req.SPOTCONTRACTID,
  49. WRSTANDARDID: req.WRSTANDARDID,
  50. SPOTGOODSBRANDID: req.SPOTGOODSBRANDID,
  51. SPOTGOODSMODELID: req.SPOTGOODSMODELID,
  52. WAREHOUSEINFOID: req.WAREHOUSEINFOID,
  53. FilterStatus: req.APPLYSTATUS,
  54. }
  55. a.DoGetDataEx(&m)
  56. }
  57. // QueryAreaStockApplySum 出入库汇总请求
  58. type QueryAreaStockApplySumReq struct {
  59. SPOTCONTRACTID string `form:"spotcontractid"` // 合同ID
  60. }
  61. // QueryAreaStockApplySumRsp 出入库汇总响应
  62. type QueryAreaStockApplySumRsp models.ErmcpAreaStockApplySum
  63. // QueryAreaStockApplySum
  64. // @Summary 查询已登记出入库信息(入库登记/已入库信息 | 出库登记/已出库信息)
  65. // @Produce json
  66. // @Security ApiKeyAuth
  67. // @Param spotcontractid query int false "合同ID"
  68. // @Success 200 {array} QueryAreaStockApplySumRsp
  69. // @Failure 500 {object} app.Response
  70. // @Router /Ermcp/QueryAreaStockApplySum [get]
  71. // @Tags 企业风险管理(app)
  72. func QueryAreaStockApplySum(c *gin.Context) {
  73. a := app.GinUtils{Gin: app.Gin{C: c}}
  74. req := QueryAreaStockApplySumReq{}
  75. a.DoBindReq(&req)
  76. m := models.ErmcpAreaStockApplySum{SPOTCONTRACTID: req.SPOTCONTRACTID}
  77. a.DoGetDataEx(&m)
  78. }
  79. // QueryAreaStockReq 查询库存量请求
  80. type QueryAreaStockReq struct {
  81. USERID int64 `form:"userid" binding:"required"` // 用户id
  82. }
  83. // QueryAreaStock
  84. // @Summary 查询机构库存(库存管理/当前库存)
  85. // @Produce json
  86. // @Security ApiKeyAuth
  87. // @Param userid query int true "用户ID"
  88. // @Success 200 {array} models.ErmcpAreaStock
  89. // @Failure 500 {object} app.Response
  90. // @Router /Ermcp/QueryAreaStock [get]
  91. // @Tags 企业风险管理(app)
  92. func QueryAreaStock(c *gin.Context) {
  93. a := app.GinUtils{Gin: app.Gin{C: c}}
  94. req := QueryAreaStockReq{}
  95. a.DoBindReq(&req)
  96. m := models.ErmcpAreaStock{USERID: req.USERID}
  97. a.DoGetDataEx(&m)
  98. }