Browse Source

圣牧模板文件上传

baishaojie 1 year ago
parent
commit
20a9071dd1
4 changed files with 12 additions and 12 deletions
  1. BIN
      TMRWatchComm
  2. BIN
      TMRWatchComm.zip
  3. 10 11
      http/handle/api/scheduled.go
  4. 2 1
      http/handle/gm/udservice.go

BIN
TMRWatchComm


BIN
TMRWatchComm.zip


+ 10 - 11
http/handle/api/scheduled.go

@@ -15,7 +15,6 @@ import (
 	"time"
 
 	"tmr-watch/conf/setting"
-	"tmr-watch/http/handle/gm"
 	"tmr-watch/http/handle/restful"
 	"tmr-watch/pkg/app"
 	"tmr-watch/pkg/e"
@@ -134,18 +133,18 @@ func CronScheduled(ctx context.Context) {
 	// gm.GmUdSync(pastureinfo.Pastureid, pastureinfo.Werks)
 	//
 	// //圣牧自动同步前天有进行中的任务
-	// manualUdData(pastureinfo)
+	manualUdData(pastureinfo)
 	// gm.GmUdSync(pastureinfo.Pastureid, pastureinfo.Werks)
 
-	xdmy := cron.New()
-	err = xdmy.AddFunc("0 10 4 * * *", func() {
-		//现代牧业sap同步
-		// sap.SyncMaterialOutbound()
-		// 光明ud同步
-		fmt.Println(time.Now())
-		gm.GmUdSync(pastureinfo.Pastureid, pastureinfo.Werks)
-	})
-	xdmy.Start()
+	// xdmy := cron.New()
+	// err = xdmy.AddFunc("0 10 4 * * *", func() {
+	// 	//现代牧业sap同步
+	// 	// sap.SyncMaterialOutbound()
+	// 	// 光明ud同步
+	// 	fmt.Println(time.Now())
+	// 	gm.GmUdSync(pastureinfo.Pastureid, pastureinfo.Werks)
+	// })
+	// xdmy.Start()
 
 }
 

+ 2 - 1
http/handle/gm/udservice.go

@@ -163,7 +163,8 @@ func UdUtirPush(pastureId, farmId, date string) error {
 		now = time.Now().AddDate(0, 0, -1).Format("2006-01-02")
 	}
 
-	dataList, err := tx.SQL(`select date_format(d1.date,'%Y-%m-%d')  loadDate,d.times loadShift,d.datacaptureno  tmrNo,ft.id recipeId,ft.ccname recipeName,ifnull(f.id,ftd.fid) ingId,d1.fname ingName,ifnull(fc.fcname,(select fcname from feedclass fc1 join feed f1 on f1.fclassid = fc1.id where f1.id =ftd.fid )) ingType,
+	dataList, err := tx.SQL(`select date_format(d1.date,'%Y-%m-%d')  loadDate,d.times loadShift,d.datacaptureno  tmrNo,ft.id recipeId,ft.ccname recipeName,ifnull(ifnull(f.id,ftd.fid),0) ingId,d1.fname ingName,
+	ifnull(ifnull(fc.fcname,(select fcname from feedclass fc1 join feed f1 on f1.fclassid = fc1.id where f1.id =ftd.fid )),'饲料') ingType,
 	ifnull(f.dry * d1.actualweightminus,0)  dmPct,d1.sort mixNo,ifnull(d1.feedallowratio,0) allowableError ,d1.lweight expWeight,d1.actualweightminus actualWeight,
 	DATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1 d2 
 WHERE  d1.pid=d2.pid AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)