Browse Source

撒料顺序调整 bug修复

baishaojie 1 year ago
parent
commit
2f8ac1f038

BIN
TMRWatchComm


+ 4 - 4
conf/app.ini

@@ -82,10 +82,10 @@ CacheApiSql = false
 [sqlserver]
 #Host = "sqlserver://sa:Password@@localhost?database=SysData&connection+timeout=30"
 ##张北乐源
-Host = 127.0.0.1
-User = sa
-Password = P@ssword123
-Name = SysData
+Host = 
+User = 
+Password = 
+Name = 
 
 
 [yyn]

BIN
dist-TMR-测试地址-20230322-1.zip


BIN
dist-TMR-测试地址-20230322-2.zip


BIN
dist.zip


File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.6c153771.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-elementUI.7091c052.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-elementUI.f92cd1c5.css


+ 0 - 0
dist/static/img/iconfont.7d9f8392.svg → dist/static/img/iconfont.0ddaba12.svg


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.88c11883.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.9e5f3a66.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-154544ae.8c1aa97f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-52ecc0ac.59b0b1d3.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5c4dc4a9.a119f214.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5c4dc4a9.bdf55ee3.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-7085d3cc.df62b750.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-b702d234.66ccaac4.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-b702d234.d2881290.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-elementUI.60d920b6.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-elementUI.d418bfd2.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-libs.ff9ff173.js


+ 26 - 26
routers/api/scheduled.go

@@ -39,31 +39,31 @@ func CronScheduled(ctx context.Context) {
 		return
 	}
 
-	duetimecst, _ := time.ParseInLocation("15:04:05", "00:10:00", time.Local)
-	duetimecst1, _ := time.ParseInLocation("15:04:05", "00:00:00", time.Local)
-	spec := fmt.Sprintf("@every %v", duetimecst.Sub(duetimecst1))
-
-	c := cron.New()
-	c.AddFunc(spec, func() {
-		tx1 := restful.Engine.NewSession()
-		defer tx1.Close()
-		exist, err := tx1.Table("notice").Where("status = 1").And("content = ? ", "downloadedplan_log").Exist()
-		if err != nil {
-			logs.Error("CronScheduled-error-1:", err)
-			return
-		}
-
-		if exist {
-			_, err := tx.SQL(`update notice set status = 0  where content =  ? `, "downloadedplan_log").Execute()
-			if err != nil {
-				logs.Error("CronScheduled-error-2:", err)
-				return
-			}
-			Scheduled(ctx, tx1, pastureinfo)
-		}
-
-	})
-	c.Start()
+	// duetimecst, _ := time.ParseInLocation("15:04:05", "00:10:00", time.Local)
+	// duetimecst1, _ := time.ParseInLocation("15:04:05", "00:00:00", time.Local)
+	// spec := fmt.Sprintf("@every %v", duetimecst.Sub(duetimecst1))
+
+	// c := cron.New()
+	// c.AddFunc(spec, func() {
+	// 	tx1 := restful.Engine.NewSession()
+	// 	defer tx1.Close()
+	// 	exist, err := tx1.Table("notice").Where("status = 1").And("content = ? ", "downloadedplan_log").Exist()
+	// 	if err != nil {
+	// 		logs.Error("CronScheduled-error-1:", err)
+	// 		return
+	// 	}
+
+	// 	if exist {
+	// 		_, err := tx.SQL(`update notice set status = 0  where content =  ? `, "downloadedplan_log").Execute()
+	// 		if err != nil {
+	// 			logs.Error("CronScheduled-error-2:", err)
+	// 			return
+	// 		}
+	// 		Scheduled(ctx, tx1, pastureinfo)
+	// 	}
+
+	// })
+	// c.Start()
 
 	//消息提醒
 	duetimecst2, _ := time.ParseInLocation("15:04:05", "00:01:00", time.Local)
@@ -128,7 +128,7 @@ func CronScheduled(ctx context.Context) {
 	dayCron.Start()
 
 	// //圣牧自动同步前天有进行中的任务
-	// manualUdData(pastureinfo)
+	manualUdData(pastureinfo)
 }
 
 type ScheduledInfo struct {

+ 7 - 1
routers/api/spillage.go

@@ -1712,7 +1712,12 @@ func AddLpplandtl(c *gin.Context) {
 	tmrid := parammaps.Get("tmrid").ValueInt64()
 	if !exist {
 		var sort int64 = -1
+		var maxsort int64
+
 		for _, lppand := range lpplandList {
+			if maxsort <= lppand.Sort {
+				maxsort = lppand.Sort
+			}
 			if lppand.Barid == parammaps.Get("barid").ValueInt64() {
 				_, err := tx.SQL(" update lpplandtl1 set lweight =lweight +  ?  where id = ?  and pastureid = ? ", parammaps.Get("lweight").ValueStr(), lppand.Id, parammaps.Get("pastureid").ValueStr()).Execute()
 				if err != nil {
@@ -1724,6 +1729,7 @@ func AddLpplandtl(c *gin.Context) {
 				return
 			}
 		}
+
 		for i, lppand := range lpplandList {
 			lppand.Sort = int64(i) + 1
 		}
@@ -1752,7 +1758,7 @@ func AddLpplandtl(c *gin.Context) {
 		}
 
 		if sort < 0 && len(lpplandList) > 0 {
-			sort = int64(len(lpplandList) + 2)
+			sort = maxsort + 1
 		} else if len(lpplandList) == 0 {
 			sort = 1
 		}

+ 1 - 0
routers/router.go

@@ -279,3 +279,4 @@ func Cors() gin.HandlerFunc {
 		// 处理请求
 		c.Next() //  处理请求
 	}
+}

Some files were not shown because too many files changed in this diff