qryAreaStock.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. }