|
@@ -67,6 +67,30 @@ func CancelDistributeFeedFormula(c *gin.Context) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// EditRecodeFeedFormula 饲料配方修改记录
|
|
|
+func EditRecodeFeedFormula(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+ var req models.CancelDistributeFeedFormulaRequest
|
|
|
+ if err := c.BindJSON(&req); err != nil {
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if len(req.PastureDataId) <= 0 {
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if err := group.CancelDistributeFeedFormulaService(&req); err != nil {
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR_ADD_FAIL, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, map[string]bool{
|
|
|
+ "success": true,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
func FeedFormulaIsModify(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
var req models.PastureFeedFormulaIsModifyRequest
|
|
@@ -90,9 +114,10 @@ func FeedFormulaIsModify(c *gin.Context) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-func FeedFormulaList(c *gin.Context) {
|
|
|
+// FeedFormulaAsyncList 获取配方列表
|
|
|
+func FeedFormulaAsyncList(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
- var req models.FeedFormulaListRequest
|
|
|
+ var req models.FeedListRequest
|
|
|
if err := c.BindJSON(&req); err != nil {
|
|
|
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
return
|
|
@@ -119,6 +144,36 @@ func FeedFormulaList(c *gin.Context) {
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, data)
|
|
|
}
|
|
|
|
|
|
+// FeedAsyncList 获取饲料
|
|
|
+func FeedAsyncList(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+ var req models.FeedListRequest
|
|
|
+ if err := c.BindJSON(&req); err != nil {
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.PastureId <= 0 {
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.Page <= 0 {
|
|
|
+ req.Page = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.PageSize <= 0 {
|
|
|
+ req.PageSize = 50
|
|
|
+ }
|
|
|
+
|
|
|
+ data, err := group.FeedList(&req)
|
|
|
+ if err != nil {
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR_ADD_FAIL, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, data)
|
|
|
+}
|
|
|
+
|
|
|
// AnalysisAccuracy 准确性分析
|
|
|
func AnalysisAccuracy(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|