2024-04-02 10:21:20 +00:00
|
|
|
|
package inventorymanage
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"go-admin/app/admin/models"
|
|
|
|
|
"go-admin/tools/app"
|
|
|
|
|
"net/http"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 库存变动相关代码
|
|
|
|
|
|
|
|
|
|
// InventoryChangeAdd 新增
|
|
|
|
|
// @Summary 新增
|
|
|
|
|
// @Tags 库存变动,V1.4.0
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Accept json
|
|
|
|
|
// @Param request body models.InventoryChangeAddReq true "新增模型"
|
2024-04-10 06:17:19 +00:00
|
|
|
|
// @Success 200 {object} models.ErpInventoryChangeOrder
|
2024-04-02 10:21:20 +00:00
|
|
|
|
// @Router /api/v1/inventory/change/add [post]
|
|
|
|
|
func InventoryChangeAdd(c *gin.Context) {
|
2024-04-10 06:17:19 +00:00
|
|
|
|
req := &models.InventoryChangeAddReq{}
|
2024-04-02 10:21:20 +00:00
|
|
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
|
|
|
//logger.Error(err)
|
|
|
|
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.OK(c, "", "OK")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InventoryChangeEdit 编辑
|
|
|
|
|
// @Summary 编辑
|
|
|
|
|
// @Tags 库存变动,V1.4.0
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Accept json
|
|
|
|
|
// @Param request body models.InventoryChangeEditReq true "编辑模型"
|
2024-04-10 06:17:19 +00:00
|
|
|
|
// @Success 200 {object} models.ErpInventoryChangeOrder
|
2024-04-02 10:21:20 +00:00
|
|
|
|
// @Router /api/v1/inventory/change/edit [post]
|
|
|
|
|
func InventoryChangeEdit(c *gin.Context) {
|
2024-04-10 06:17:19 +00:00
|
|
|
|
req := &models.InventoryChangeEditReq{}
|
2024-04-02 10:21:20 +00:00
|
|
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
|
|
|
//logger.Error(err)
|
|
|
|
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.OK(c, "", "OK")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InventoryChangeAudit 审核
|
|
|
|
|
// @Summary 审核
|
|
|
|
|
// @Tags 库存变动,V1.4.0
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Accept json
|
|
|
|
|
// @Param request body models.InventoryChangeAuditReq true "审核模型"
|
|
|
|
|
// @Success 200 {object} app.Response
|
|
|
|
|
// @Router /api/v1/inventory/change/audit [post]
|
|
|
|
|
func InventoryChangeAudit(c *gin.Context) {
|
2024-04-10 06:17:19 +00:00
|
|
|
|
req := &models.InventoryChangeAuditReq{}
|
2024-04-02 10:21:20 +00:00
|
|
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
|
|
|
//logger.Error(err)
|
|
|
|
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.OK(c, "", "OK")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InventoryChangeDelete 删除
|
|
|
|
|
// @Summary 删除
|
|
|
|
|
// @Tags 库存变动,V1.4.0
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Accept json
|
|
|
|
|
// @Param request body models.InventoryChangeDeleteReq true "删除模型"
|
|
|
|
|
// @Success 200 {object} app.Response
|
|
|
|
|
// @Router /api/v1/inventory/change/delete [post]
|
|
|
|
|
func InventoryChangeDelete(c *gin.Context) {
|
2024-04-10 06:17:19 +00:00
|
|
|
|
req := &models.InventoryChangeDeleteReq{}
|
2024-04-02 10:21:20 +00:00
|
|
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
|
|
|
//logger.Error(err)
|
|
|
|
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.OK(c, "", "OK")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InventoryChangeList 库存变动列表
|
|
|
|
|
// @Summary 库存变动列表
|
|
|
|
|
// @Tags 库存变动,V1.4.0
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Accept json
|
|
|
|
|
// @Param request body models.InventoryChangeListReq true "库存变动列表模型"
|
|
|
|
|
// @Success 200 {object} models.InventoryChangeListResp
|
|
|
|
|
// @Router /api/v1/inventory/change/list [post]
|
|
|
|
|
func InventoryChangeList(c *gin.Context) {
|
2024-04-10 06:17:19 +00:00
|
|
|
|
req := &models.InventoryChangeListReq{}
|
2024-04-02 10:21:20 +00:00
|
|
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
|
|
|
//logger.Error(err)
|
|
|
|
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.OK(c, "", "OK")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InventoryChangeDetail 库存变动详情
|
|
|
|
|
// @Summary 库存变动详情
|
|
|
|
|
// @Tags 库存变动,V1.4.0
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Accept json
|
|
|
|
|
// @Param request body models.InventoryChangeDetailReq true "库存变动详情模型"
|
2024-04-10 06:17:19 +00:00
|
|
|
|
// @Success 200 {object} models.ErpInventoryChangeOrder
|
2024-04-02 10:21:20 +00:00
|
|
|
|
// @Router /api/v1/inventory/change/detail [post]
|
|
|
|
|
func InventoryChangeDetail(c *gin.Context) {
|
2024-04-10 06:17:19 +00:00
|
|
|
|
req := &models.InventoryChangeDetailReq{}
|
2024-04-02 10:21:20 +00:00
|
|
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
|
|
|
//logger.Error(err)
|
|
|
|
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.OK(c, "", "OK")
|
|
|
|
|
return
|
|
|
|
|
}
|