baishaojie 1 nedēļu atpakaļ
vecāks
revīzija
a1549b5720
8 mainītis faili ar 38 papildinājumiem un 16 dzēšanām
  1. 2 2
      Dockerfile
  2. BIN
      TMRWatchComm
  3. BIN
      TMRWatchComm.zip
  4. 3 3
      conf/app-test.ini
  5. 3 3
      conf/app.ini
  6. 5 5
      http/handle/api/ops.go
  7. 0 1
      http/handle/api/scheduled.go
  8. 25 2
      http/handle/yq/yq.go

+ 2 - 2
Dockerfile

@@ -22,8 +22,8 @@ owner="yiping.xu"
 WORKDIR /app/kpt-tmr
 
 RUN apk update && apk add tzdata
-RUN ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
-&& echo "Asia/Shanghai" > /etc/timezone \
+# RUN ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
+# && echo "Asia/Shanghai" > /etc/timezone \
 
 COPY --from=0 /app/kpt-tmr/conf/ /app/kpt-tmr/bin/conf/
 COPY --from=0  /app/kpt-tmr/bin/kptTmr /app/kpt-tmr/bin/kptTmr

BIN
TMRWatchComm


BIN
TMRWatchComm.zip


+ 3 - 3
conf/app-test.ini

@@ -52,8 +52,8 @@ User = root
 #Password = root
 #Password = kepaiteng!QAZ
 #Host = 8.130.17.8:3306
-#Host = 192.168.1.93:3326
-Host = 127.0.0.1:3316
+Host = 192.168.1.93:3326
+#Host = 127.0.0.1:3316
 Name = root
 Password = root
 #Password = root
@@ -77,7 +77,7 @@ Password = root
 #Name = tmrgo
 #Password = kepaiteng!QAZ
 #Host = 222.73.129.15:31306
-Name = tmrwatch2
+Name = yq2
 TablePrefix =
 
 ShowXormlog = false

+ 3 - 3
conf/app.ini

@@ -52,8 +52,8 @@ User = root
 #Password = root
 #Password = kepaiteng!QAZ
 #Host = 8.130.17.8:3306
-#Host = 192.168.1.93:3326
-Host = 127.0.0.1:3316
+Host = 192.168.1.93:3326
+#Host = 127.0.0.1:3316
 Name = root
 Password = root
 #Password = root
@@ -77,7 +77,7 @@ Password = root
 #Name = tmrgo
 #Password = kepaiteng!QAZ
 #Host = 222.73.129.15:31306
-Name = tmrwatch2
+Name = yq2
 TablePrefix =
 
 ShowXormlog = false

+ 5 - 5
http/handle/api/ops.go

@@ -4447,12 +4447,12 @@ func FpdImportExcel(c *gin.Context) {
 					if _, ok := outentry["栏舍名称"]; ok {
 						dataexcel["barname"] = outentry["栏舍名称"]
 					}
-					if _, ok := outentry["实际牛头数"]; ok {
-						dataexcel["ccount"] = outentry["实际牛头数"]
-					}
-					// if _, ok := outentry["实际羊只数"]; ok {
-					// 	dataexcel["ccount"] = outentry["实际羊只数"]
+					// if _, ok := outentry["实际牛头数"]; ok {
+					// 	dataexcel["ccount"] = outentry["实际牛头数"]
 					// }
+					if _, ok := outentry["实际羊只数"]; ok {
+						dataexcel["ccount"] = outentry["实际羊只数"]
+					}
 					if _, ok := outentry["系数(%)"]; ok {
 						dataexcel["ratio"] = outentry["系数(%)"]
 					}

+ 0 - 1
http/handle/api/scheduled.go

@@ -166,7 +166,6 @@ func CronScheduled(ctx context.Context) {
 		yq.YqCron()
 	}
 
-
 	// err = xdmy.AddFunc("0 05 7 * * *", func() {
 	// 	// 	// 	// 	//现代牧业sap同步
 	// sap.SyncMaterialOutbound()

+ 25 - 2
http/handle/yq/yq.go

@@ -50,9 +50,8 @@ where pid in (select id from downloadedplan  where mydate = ?  and havebutton =
   tx.Exec(`update downloadplandtl1_exec set 
 actualweightminus = lweight ,lastactualweight =lweight ,actualweight = lweight 
 where pid in (select id from downloadedplan  where mydate = ?  and havebutton = 0)`,date)
+tx.Exec(`update downloadedplan set havebutton = 1 ,iscompleted = 1 ,completedtime = concat(?,' 23:00:00'),intime= concat(?,' 23:00:00')   where mydate = ? and havebutton = 0`,date,date,date)
 
-   tx.Exec(`update downloadedplan set havebutton = 1 ,iscompleted = 1 ,completedtime =mydate ,intime= mydate   where mydate = ? and havebutton = 0`,date)
-   
 	// token := getToken()
 	// syncBar(token, pastureinfo.Pastureid, pastureinfo.Werks)
 	c := cron.New()
@@ -68,9 +67,33 @@ where pid in (select id from downloadedplan  where mydate = ?  and havebutton =
 		syncBar(token, pastureinfo.Pastureid, pastureinfo.Werks)
 
 
+		date := time.Now().AddDate(0,0,-1).Format("2006-01-02")
+		tx.Exec(`update downloadplandtl2 set 
+	actualweightminus = lweight ,lastactualweight =lweight ,actualweight = lweight 
+	where pid in(select id from downloadedplan  where mydate =?  and havebutton = 0)`,date)
+	
+	tx.Exec(`update downloadplandtl1 set 
+	actualweightminus = lweight ,lastactualweight =lweight ,actualweight = lweight 
+	where pid in (select id from downloadedplan  where mydate = ?  and havebutton = 0)`,date)
+	
+	  tx.Exec(`update downloadplandtl1_exec set 
+	actualweightminus = lweight ,lastactualweight =lweight ,actualweight = lweight 
+	where pid in (select id from downloadedplan  where mydate = ?  and havebutton = 0)`,date)
 
+	tx.Exec(`update downloadedplan set havebutton = 1 ,iscompleted = 1 ,completedtime = concat(?,' 23:00:00'),intime= concat(?,' 23:00:00')   where mydate = ? and havebutton = 0`,date,date,date)
 	})
 
+	// token := getToken()
+	// fmt.Println(token)
+	// now := "2025-10-11"
+	// YcFeedtempletPush(pastureinfo.Pastureid, pastureinfo.Werks, now, token)
+	// YcFeedPush(pastureinfo.Pastureid, pastureinfo.Werks, token)
+	// YcPlanPush(pastureinfo.Pastureid, pastureinfo.Werks, now, token)
+	// YcUtirPush(pastureinfo.Pastureid, pastureinfo.Werks, now, token)
+	// YcMaterialIssuePush(pastureinfo.Pastureid, pastureinfo.Werks, now, token)
+	// YcBarFeedRemainPush(pastureinfo.Pastureid, pastureinfo.Werks, now, token)
+	// syncBar(token, pastureinfo.Pastureid, pastureinfo.Werks)
+
 	c.AddFunc("0 0 6 * * *", func() {
 		token := getToken()
 		now := time.Now().Format("2006-01-02")