38 lines
992 B
Go
38 lines
992 B
Go
package decision
|
||
|
||
import (
|
||
"errors"
|
||
"github.com/gin-gonic/gin"
|
||
model "go-admin/app/admin/models"
|
||
"go-admin/logger"
|
||
"go-admin/tools/app"
|
||
"net/http"
|
||
)
|
||
|
||
// ErpDecisionReport 进销存报表
|
||
// @Summary 进销存报表
|
||
// @Tags 决策中心,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.ErpDecisionReportReq true "进销存报表模型"
|
||
// @Success 200 {object} models.ErpDecisionReportResp
|
||
// @Router /api/v1/decision/report [post]
|
||
func ErpDecisionReport(c *gin.Context) {
|
||
req := new(model.ErpDecisionReportReq)
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
logger.Error("ShouldBindJSON err:", logger.Field("err", err))
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误"+err.Error())
|
||
return
|
||
}
|
||
|
||
resp, err := req.DecisionReportList(c)
|
||
if err != nil {
|
||
//logger.Error("erp commodity list err:", err)
|
||
app.Error(c, http.StatusInternalServerError, err, "查询失败:"+err.Error())
|
||
return
|
||
}
|
||
|
||
app.OK(c, resp, "OK")
|
||
return
|
||
}
|