shawei_zz 2 years ago
parent
commit
947fa227a9
8 changed files with 85 additions and 131 deletions
  1. BIN
      __debug_bin.exe
  2. 2 0
      pkg/e/code.go
  3. 1 0
      pkg/e/msg.go
  4. 32 27
      routers/api/material.go
  5. 45 100
      routers/api/sap/sap.go
  6. 5 4
      routers/router.go
  7. BIN
      tmrgo
  8. BIN
      tmrgo.zip

BIN
__debug_bin.exe


+ 2 - 0
pkg/e/code.go

@@ -20,4 +20,6 @@ const (
 	ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002
 	ERROR_AUTH_TOKEN               = 20003
 	ERROR_AUTH                     = 20004
+
+	THROUGHOUt_THE_DAY_TO_END = 30001
 )

+ 1 - 0
pkg/e/msg.go

@@ -20,6 +20,7 @@ var MsgFlags = map[int]string{
 	ERROR_AUTH_CHECK_TOKEN_TIMEOUT: "Token已超时",
 	ERROR_AUTH_TOKEN:               "Token生成失败",
 	ERROR_AUTH:                     "Token错误",
+	THROUGHOUt_THE_DAY_TO_END:      "全天结束",
 }
 
 func GetMsg(code int) string {

+ 32 - 27
routers/api/material.go

@@ -75,7 +75,7 @@ func GetDownloadedplanMaterial1(c *gin.Context) {
 	}
 
 	if downloadedplanInfo.Id == 0 {
-		appG.Response(http.StatusOK, e.SUCCESS, "全天结束")
+		appG.Response(http.StatusOK, e.THROUGHOUt_THE_DAY_TO_END, nil)
 		return
 	}
 
@@ -106,7 +106,7 @@ func GetSubPlan(c *gin.Context) {
 	tx := restful.Engine.NewSession()
 	defer tx.Close()
 
-	downloadplandtl1List, err := tx.SQL(` select f.id as feedid,d1.fname,d1.feedcode,f.autosecond,f.autozone,d1.lweight,d1.sort,d1.buttontype from  downloadplandtl1 d1
+	downloadplandtl1List, err := tx.SQL(` select DATE_FORMAT(d1.begintime, '%Y-%m-%d %H:%i:%S') as begintime, DATE_FORMAT(d1.intime, '%Y-%m-%d %H:%i:%S') as intime ,f.id as feedid,d1.fname,d1.feedcode,f.autosecond,f.autozone,d1.lweight,d1.sort,d1.buttontype,d1.actualweightminus from  downloadplandtl1 d1
 	 left join feed f 
 	on f.feedcode = d1.feedcode and f.pastureid = d1.pastureid  where d1.pid = ? and d1.pastureid = ? `, pid, pastureid).Query().List()
 	if err != nil {
@@ -114,19 +114,13 @@ func GetSubPlan(c *gin.Context) {
 		appG.Response(http.StatusInternalServerError, e.ERROR, err)
 		return
 	}
-	downloadplandtl2List, err := tx.SQL(` select  d2.id,d2.pid,d2.fbarid,d2.fname as fbarname,d2.lweight,d.lpplantype from  downloadplandtl2 d2 join downloadedplan d on d.id = d2.pid where d2.pid = ? and d2.pastureid = ? `, pid, pastureid).Query().List()
+	downloadplandtl2List, err := tx.SQL(` select  DATE_FORMAT(d2.begintime, '%Y-%m-%d %H:%i:%S') as begintime ,DATE_FORMAT(d2.intime, '%Y-%m-%d %H:%i:%S')  as intime  ,d2.id,d2.pid,d2.fbarid,d2.fname as fbarname,d2.lweight,d.lpplantype,d2.actualweightminus from  downloadplandtl2 d2 join downloadedplan d on d.id = d2.pid where d2.pid = ? and d2.pastureid = ? `, pid, pastureid).Query().List()
 	if err != nil {
 		logs.Error(err)
 		appG.Response(http.StatusInternalServerError, e.ERROR, err)
 		return
 	}
 
-	// dataList := make([]map[string]interface{}, 0)
-	// var d2lweight float64
-	// for _, item := range downloadplandtl2List {
-	// 	lweight, _ := strconv.ParseFloat(item["lweight"].(string), 64)
-	// 	d2lweight += lweight
-	// }
 	d1List := make([]map[string]interface{}, 0)
 	d2List := make([]map[string]interface{}, 0)
 	for _, d2item := range downloadplandtl2List {
@@ -135,6 +129,10 @@ func GetSubPlan(c *gin.Context) {
 		data["fbarname"] = d2item["fbarname"]
 		data["lweight"] = d2item["lweight"]
 		data["lpplantype"] = d2item["lpplantype"]
+		data["id"] = d2item["id"]
+		data["actualweightminus"] = d2item["actualweightminus"]
+		data["intime"] = d2item["intime"]
+		data["begintime"] = d2item["begintime"]
 		// flweight, _ := strconv.ParseFloat(d2item["lweight"].(string), 64)
 		// flweight = flweight / d2lweight
 		d2List = append(d2List, data)
@@ -150,8 +148,10 @@ func GetSubPlan(c *gin.Context) {
 		d1["sort"] = d1item["sort"]
 		d1["buttontype"] = d1item["buttontype"]
 		d1["feedid"] = d1item["feedid"]
-		// d1["lweight"] = lweight * flweight
 		d1["lweight"] = d1item["lweight"]
+		d1["intime"] = d1item["intime"]
+		d1["begintime"] = d1item["begintime"]
+		d1["actualweightminus"] = d1item["actualweightminus"]
 		d1List = append(d1List, d1)
 	}
 
@@ -181,6 +181,10 @@ func CompletePlan(c *gin.Context) {
 	pastureid := parammaps.Get("pastureid").ValueStr()
 	tx := restful.Engine.NewSession()
 	defer tx.Close()
+	// begintime := ""
+	// if begintimestr != "" {
+	// 	begintime = strings.ReplaceAll("2022-08-11T13:43:34+08:00", "T", " ")[:len("2006-01-02 15:04:05")]
+	// }
 
 	if lpplantype == 0 {
 
@@ -232,7 +236,8 @@ func CompletePlan(c *gin.Context) {
 			actualweight := lweight / sumlweight * actualweightminus
 			last := lweight / sumlweight * lastactualweight
 			_, err := tx.SQL(` update downloadplandtl2 set actualweightminus = ifnull(actualweightminus,0)+?, actualweight = ?,
-			lastactualweight = ? , intime = now() ,havebuttom = 1,buttontype = ? where id = ? `, actualweight, actualweight, last, buttontype, d2["id"]).Execute()
+			lastactualweight = ? , intime = ?,begintime = ? ,havebuttom = 1,buttontype = ? where id = ? `, actualweight,
+				actualweight, last, intime, begintime, buttontype, d2["id"]).Execute()
 			if err != nil {
 				logs.Error(err)
 				appG.Response(http.StatusInternalServerError, e.ERROR, err)
@@ -249,7 +254,7 @@ func CompletePlan(c *gin.Context) {
 			}
 		}
 
-		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort form downloadplandtl1  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
+		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort from downloadplandtl1  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
 			pid, intime, pid, tmrid, pastureid).Execute()
 		if err != nil {
 			logs.Error(err)
@@ -260,8 +265,8 @@ func CompletePlan(c *gin.Context) {
 	} else if lpplantype == 1 {
 
 		_, err := tx.SQL(` update downloadplandtl2 set actualweightminus =ifnull(actualweightminus,0)+?, actualweight = ?,
-		lastactualweight = ? , intime = ? ,havebuttom = 1,buttontype = ? where id = ? `,
-			actualweightminus, actualweightminus, lastactualweight, intime, buttontype, d2id).Execute()
+		lastactualweight = ? , intime = ? ,begintime = ?,havebuttom = 1,buttontype = ? where id = ? `,
+			actualweightminus, actualweightminus, lastactualweight, intime, begintime, buttontype, d2id).Execute()
 		if err != nil {
 			logs.Error(err)
 			appG.Response(http.StatusInternalServerError, e.ERROR, err)
@@ -269,8 +274,8 @@ func CompletePlan(c *gin.Context) {
 		}
 
 		_, err = tx.SQL(` update downloadplandtl1_exec set  actualweightminus =ifnull(actualweightminus,0)+?, actualweight = ?,
-		lastactualweight = ? , intime = ? ,havebuttom = 1,buttontype= ?  where pid = ? `,
-			actualweightminus, actualweightminus, lastactualweight, intime, buttontype, pid).Execute()
+		lastactualweight = ? , intime = ?,begintime= ? ,havebuttom = 1,buttontype= ?  where pid = ? `,
+			actualweightminus, actualweightminus, lastactualweight, intime, begintime, buttontype, pid).Execute()
 		if err != nil {
 			logs.Error(err)
 			appG.Response(http.StatusInternalServerError, e.ERROR, err)
@@ -278,8 +283,8 @@ func CompletePlan(c *gin.Context) {
 		}
 
 		_, err = tx.SQL(` update downloadplandtl1 set  actualweightminus =ifnull(actualweightminus,0)+?, actualweight = ?,
-		lastactualweight = ? , intime = ? ,havebuttom = 1,buttontype = ?  where pid = ? `,
-			actualweightminus, actualweightminus, lastactualweight, intime, buttontype, pid).Execute()
+		lastactualweight = ? , intime = ?,begintime=? ,havebuttom = 1,buttontype = ?  where pid = ? `,
+			actualweightminus, actualweightminus, lastactualweight, intime, begintime, buttontype, pid).Execute()
 		if err != nil {
 			logs.Error(err)
 			appG.Response(http.StatusInternalServerError, e.ERROR, err)
@@ -302,7 +307,7 @@ func CompletePlan(c *gin.Context) {
 			}
 		}
 
-		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort form downloadplandtl2  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
+		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort from downloadplandtl2  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
 			pid, intime, pid, tmrid, pastureid).Execute()
 		if err != nil {
 			logs.Error(err)
@@ -312,9 +317,9 @@ func CompletePlan(c *gin.Context) {
 
 	} else if lpplantype == 2 {
 		_, err := tx.SQL(` update downloadplandtl1 set  begintime = ? , actualweightminus =ifnull(actualweightminus,0)+ ? ,
-		intime = ? ,actualweight = ? ,optdevice = ?,buttontype = ?,havebuttom = 1,lastactualweight = ?  where pid = ?
+		intime = ? ,actualweight = ? ,optdevice = ?,buttontype = ?,havebuttom = 1,lastactualweight = ?,begintime = ?  where pid = ?
 		and sort = ? and feedcode = (select feedcode from feed where id = ? )`,
-			begintime, actualweightminus, intime, actualweightminus, tmrid, buttontype, lastactualweight, pid, sort, feedid).Execute()
+			begintime, actualweightminus, intime, actualweightminus, tmrid, buttontype, lastactualweight, begintime, pid, sort, feedid).Execute()
 		if err != nil {
 			logs.Error(err)
 			appG.Response(http.StatusInternalServerError, e.ERROR, err)
@@ -322,16 +327,16 @@ func CompletePlan(c *gin.Context) {
 		}
 
 		_, err = tx.SQL(` update downloadplandtl1_exec set begintime = ? ,actualweightminus =ifnull(actualweightminus,0)+ ? ,
-		intime = ? ,actualweight = ? ,optdevice = ?,buttontype = ?,havebuttom = 1,lastactualweight = ?  where pid = ?
+		intime = ? ,actualweight = ? ,optdevice = ?,buttontype = ?,havebuttom = 1,lastactualweight = ?,begintime = ?  where pid = ?
 		and sort = ? `,
-			begintime, actualweightminus, intime, actualweightminus, tmrid, buttontype, lastactualweight, pid, sort).Execute()
+			begintime, actualweightminus, intime, actualweightminus, tmrid, buttontype, lastactualweight, begintime, pid, sort).Execute()
 		if err != nil {
 			logs.Error(err)
 			appG.Response(http.StatusInternalServerError, e.ERROR, err)
 			return
 		}
 
-		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort form downloadplandtl1  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
+		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort from downloadplandtl1  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
 			pid, intime, pid, tmrid, pastureid).Execute()
 		if err != nil {
 			logs.Error(err)
@@ -341,8 +346,8 @@ func CompletePlan(c *gin.Context) {
 
 	} else {
 		_, err := tx.SQL(` update downloadplandtl2 set actualweightminus =ifnull(actualweightminus,0)+?, actualweight = ?,
-		lastactualweight = ? , intime = ? ,havebuttom = 1,buttontype = ? where id = ? `,
-			actualweightminus, actualweightminus, lastactualweight, intime, buttontype, d2id).Execute()
+		lastactualweight = ? , intime = ? ,havebuttom = 1,buttontype = ?,begintime where id = ? `,
+			actualweightminus, actualweightminus, lastactualweight, intime, buttontype, begintime, d2id).Execute()
 		if err != nil {
 			logs.Error(err)
 			appG.Response(http.StatusInternalServerError, e.ERROR, err)
@@ -364,7 +369,7 @@ func CompletePlan(c *gin.Context) {
 				return
 			}
 		}
-		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort form downloadplandtl2  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
+		_, err = tx.SQL(` update tmr set projid = ? ,lastbuttontime =? , nextsort = (select sort from downloadplandtl2  where pid = ? and intime is  null  order by sort limit 0,1 )  where id = ?  and pastureid = ? `,
 			pid, intime, pid, tmrid, pastureid).Execute()
 		if err != nil {
 			logs.Error(err)

+ 45 - 100
routers/api/sap/sap.go

@@ -12,7 +12,6 @@ import (
 	"../../../pkg/setting"
 	"../../../routers/restful"
 	"github.com/astaxie/beego/logs"
-	"github.com/kptyun/KPTCOMM/pkg/logging"
 )
 
 func SyncSapBar(ctx context.Context) {
@@ -24,7 +23,7 @@ func SyncSapBar(ctx context.Context) {
 	data := `{
 		"DEST": {
 		  "DEST_ID": "TMRWATCH",
-		  "BUSS_TP": "%s"
+		  "BUSS_TP": "CO005"
 		},
 		"DATA": {
 		  "DIDAT": "%d0101",
@@ -35,9 +34,9 @@ func SyncSapBar(ctx context.Context) {
 		  "TCHSTY": [ ]
 		}
 	}`
-	url := "https://app.modernfarming.cn:7443/sap/Feed/%s/QueryCowsheds"
-	data = fmt.Sprintf(data, "CO005", year, year)
-	url = fmt.Sprintf(url, "CO005")
+	url := "https://app.modernfarming.cn:7443/sap/Feed/CO005/QueryCowsheds"
+	data = fmt.Sprintf(data, year, year)
+	// url = fmt.Sprintf(url, "CO005")
 	// fmt.Println(url, data)
 	respmap := postPush(url, data)
 
@@ -48,9 +47,9 @@ func SyncSapBar(ctx context.Context) {
 				barMap := item.(map[string]interface{})
 				fmt.Println(barMap)
 				_, err := tx.SQL(` insert into bar(pastureid,bcode,bname,sort,sapid,class,classid,scopeherd,scopeherdid)
-				values(?,?,?,(select max(sort)+1 from bar where pastureid = ? ),?,?,( select id from barclass where pastureid = ? and code = ?),?,
-				(select id from scopeherd where financial = ? ))
-				ON DUPLICATE KEY UPDATE bname = ? ,bcode = ? `, 1, barMap["CHSTX"], barMap["CHSTX"], 1, barMap["CHSNO"], barMap["CHSTY"], 1, barMap["CHSTY"],
+				values(?,?,?,(select max(sort)+1  from bar b where b.pastureid = ? ),?,( select name from barclass where pastureid = ? and code = ?),( select id from barclass where pastureid = ? and code = ?),(select name from scopeherd where code = ? ),
+				(select id from scopeherd where code = ? ))
+				ON DUPLICATE KEY UPDATE bname = ? ,bcode = ? `, 1, barMap["CHSTX"], barMap["CHSTX"], 1, barMap["CHSNO"], 1, barMap["CHSTX"], 1, barMap["CHSTX"],
 					barMap["FCWTS"], barMap["FCWTS"], barMap["CHSTX"], barMap["CHSTX"]).Execute()
 				if err != nil {
 					logs.Error(err)
@@ -62,112 +61,58 @@ func SyncSapBar(ctx context.Context) {
 	// appG.Response(http.StatusOK, e.SUCCESS, true)
 }
 
-// WERKS	1					牧场	编码同SAP工厂编码,见数据字典约定
-// CHSNO	1					牛舍ID	外围系统字段长度暂未知
-// CHSTX	1					牛舍名称
-// FCWTS	1					牛群类别	指牛群类别对应中的F列
-// CHSTY	1					牛舍类型	见数据字典约定
-// LOEVM	1					牛舍状态	"禁用X,
-// 正在使用:空"
-// UPDAT	1					最后修改日期	YYYYMMDD
-// UPTIM	1					最后修改时间	HHMMSS
-
 type udPastureInfo struct {
 	Token     string `xorm:"token"`
 	Pastureid string `xorm:"pastureid"`
 }
 
-func SyncSapFeed(ctx context.Context) {
+func MaterialOutbound(ctx context.Context) {
+
 	tx := restful.Engine.NewSession()
 	defer tx.Close()
 
-	// pastureinfo := new(udPastureInfo)
-	// err := tx.SQL(`select column_default  as pastureid   from    information_schema.COLUMNS
-	// WHERE table_name = 'recweight' AND table_schema = ? AND column_name = 'pastureid'`, setting.DatabaseSetting.Name).GetFirst(pastureinfo).Error
-	// if err != nil {
-	// 	logs.Error(err)
-	// 	return
-	// }
-	pastureid := 1
-	year := time.Now().Year()
+	pastureinfo := new(udPastureInfo)
+	err := tx.SQL(`select column_default  as pastureid   from    information_schema.COLUMNS
+	WHERE table_name = 'recweight' AND table_schema = ? AND column_name = 'pastureid'`, setting.DatabaseSetting.Name).GetFirst(pastureinfo).Error
+	if err != nil {
+		logs.Error(err)
+		return
+	}
+
+	dataList, err := tx.SQL(`	select d1.fname as MAKTX,d2.fname as CHSTX, round( d1.actualweightminus * (d2.lweight / (select sum(lweight) from  downloadplandtl2  where pid = d2.pid )),2) as MENGE,b.sapid 	
+	,bc.code as FCWTS
+	from  downloadedplan d  
+ JOIN downloadplandtl2 d2 on d2.pid in ( select id from downloadedplan where pid = d.pid and mydate = d.mydate) and d2.type = 0    
+	join downloadplandtl1 d1 on  d1.pid = d.id  
+	
+-- 	join feed  f on f.feedcode = d1.feedcode and f.pastureid = d.pastureid
+join bar  b on b.id = d2.fbarid  and b.pastureid = d.pastureid
+left join barclass bc on bc.id = b.classid 
+	where d.mydate = ? and d.lpplantype <> 2 	 and d.pastureid = ?
+ order by d.id `, "2022-06-24", pastureinfo.Pastureid).Query().List()
+	if err != nil {
+		logs.Error(err)
+		return
+	}
+
 	data := `{
 		"DEST": {
-		 "DEST_ID": "DFEED",
-		 "BUSS_TP": "%s"
+		  "DEST_ID": "DFEED",
+		  "BUSS_TP": "MM016"
 		},
 		"DATA": {
-		 "BUDAT_B": "%d0101",
-		 "BUDAT_E": "%d1201",
-		 "TMATNR": [],
-		 "TMTART": [],
-		 "TMATKL": []
+		  "BUDAT": "%s",
+		  "WERKS": "%s",
+		  "ITEMS": %s
 		}
-	   } `
-	url := "https://app.modernfarming.cn:7443/sap/Common/%s/QueryMaterial/"
-	data = fmt.Sprintf(data, "MM002", year, year)
-	url = fmt.Sprintf(url, "MM002")
-	// fmt.Println(url, data)
-	respmap := postPush(url, data)
-
-	if respmap != nil {
-		// fmt.Println(respmap)
-		if _, ok := respmap.(map[string]interface{})["TMARA"]; ok {
-			for _, item := range respmap.(map[string]interface{})["TMARA"].([]interface{}) {
-				feedMap := item.(map[string]interface{})
-				fmt.Println(feedMap)
-
-				// var fclassid interface{}
-				fclass := feedMap["MTART"]
-				fclassExist, err := tx.SQL(" select id from feedclass where pastureid = ? and fcname = ?", pastureid, fclass).Exist()
-				if err != nil {
-					tx.Rollback()
-					logs.Error("syncFeed-error-2:", err)
-					return
-				}
-				if !fclassExist {
-					ids, err := setting.SnowIds.NextId()
-					if err != nil {
-						ids = time.Now().UnixNano()
-						logging.Info("create SnowIds err", err)
-					}
-					_, err = tx.SQL("insert into feedclass(id,pastureid,fccode,fcname,bigfeedclassname,bigfeedclassid,sort)VALUES(?,?,?,?,?,?,(select ifnull(max(f.sort),0) +1 from feedclass f  where f.pastureid =? ))",
-						ids, pastureid, fclass, fclass, fclass, ids, pastureid).Execute()
-					if err != nil {
-						tx.Rollback()
-						logs.Error("syncFeed-error-4:", err)
-						return
-					}
-				}
-				if _, ok := feedMap["MATKL"]; ok {
-					_, err = tx.SQL("replace into feedgroup(name,pastureid)VALUES(?,?)", feedMap["MATKL"], pastureid).Execute()
-
-					if err != nil {
-						tx.Rollback()
-						logs.Error("syncFeed-error-4:", err)
-						return
-					}
-				}
-
-			}
-		}
-	}
-	// appG.Response(http.StatusOK, e.SUCCESS, true)
+	  }`
+	databyte, _ := json.Marshal(dataList)
+	data = fmt.Sprintf(data, time.Now().Format("20060102"), "0001", string(databyte))
+	fmt.Println(data)
+	url := "https://app.modernfarming.cn:7443/sap/Feed/MM016/StockOut"
+	postPush(url, data)
 }
 
-// MATNR	1					物料号
-// MTART	1					物料类型
-// MATKL	1					物料组
-// MAKTX	1					物料描述
-// MEINS	1					基本计量单位
-// UMREZ	1					基本计量单位数量
-// MEINH	1					转换单位
-// UMREN	1					转换单位数量
-// ZMINC	1					物料名称
-// ZGUIG	1					规格型号
-
-// LVORM	1					物料删除标记
-// LAEDA	1					修改日期
-
 func postPush(url, data string) interface{} {
 
 	var jsonStr = []byte(data)
@@ -195,7 +140,7 @@ func postPush(url, data string) interface{} {
 		logs.Error(err)
 		return nil
 	}
-
+	fmt.Println(string(body))
 	if _, ok := respData["DATA"]; ok {
 		return respData["DATA"]
 	} else {

+ 5 - 4
routers/router.go

@@ -1,7 +1,6 @@
 package routers
 
 import (
-	"context"
 	"fmt"
 
 	"../comm"
@@ -15,7 +14,8 @@ import (
 
 	"../pkg/setting"
 	"../routers/api"
-	"../routers/api/sap"
+
+	// "../routers/api/sap"
 	ginSwagger "github.com/swaggo/gin-swagger"
 	"github.com/swaggo/gin-swagger/swaggerFiles"
 )
@@ -23,12 +23,13 @@ import (
 func InitRouter() *gin.Engine {
 	r := gin.New()
 	// go api.UDSync()
-	go api.CronScheduled(context.TODO())
-	go sap.SyncSapFeed(context.TODO())
+	// go api.CronScheduled(context.TODO())
+	// go sap.SyncSapBar(context.TODO())
 
 	r.Use(func(c *gin.Context) {
 		fmt.Println(c.Request.URL)
 	})
+
 	//	ginpprof.Wrap(r)
 	r.Use(gin.LoggerWithFormatter(func(param gin.LogFormatterParams) string {
 		// 你的自定义格式

BIN
tmrgo


BIN
tmrgo.zip