Explorar o código

剩料日期上传

baishaojie hai 3 días
pai
achega
1b9c7938e5
Modificáronse 5 ficheiros con 5 adicións e 3 borrados
  1. BIN=BIN
      TMRWatchComm
  2. BIN=BIN
      TMRWatchComm.zip
  3. 2 0
      http/handle/api/scheduled.go
  4. 3 3
      http/handle/ymy/ymy.go
  5. BIN=BIN
      tmr-watch.exe

BIN=BIN
TMRWatchComm


BIN=BIN
TMRWatchComm.zip


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

@@ -547,6 +547,8 @@ func UpdatePush(ctx context.Context, tx *xorm.Session, auto bool, idList []strin
 					} else if targetdata == "idlist" {
 						// args = append(args, strings.Join(idList, ","))
 						item.Datasql = strings.ReplaceAll(item.Datasql, "idlist", strings.Join(idList, ","))
+					} else if targetdata == "date" {
+						args = append(args, date)
 					}
 				}
 

+ 3 - 3
http/handle/ymy/ymy.go

@@ -233,8 +233,8 @@ func YmyFeedtempletPush(pastureId, farmId, date string) error {
 	dataList, err := tx.SQL(`SELECT
 	ft.tcode AS recipeId,
 	ft.TNAME AS recipeName,
-	f.feedcode   AS ingId,
-		f.feedcode   AS feedCode,
+	ifnull(f.feedcode,f.id)   AS ingId,
+		''   AS feedCode,
 	ifnull(f.udname,f.fname) AS ingName,
 	round( fn.dry * ftd.FWEIGHT, 2 ) AS dmQty,
 	ftd.FWEIGHT AS afQty,
@@ -286,7 +286,7 @@ func YmyUtirPush(pastureId, farmId, date string) error {
 		now = time.Now().AddDate(0, 0, -1).Format("2006-01-02")
 	}
 
-	dataList, err := tx.SQL(`select  MD5(CONCAT(d.pid, d.mydate)) loadId , date_format(d1.date,'%Y-%m-%d')  dropDate,date_format(d1.date,'%Y-%m-%d')  loadDate,d.times loadShift,d.id  tmrNo,ft.tcode recipeId,ft.ccname recipeName,'' ingId,'' feedCode ,ifnull(f.fname,ftd.fname)  ingName,
+	dataList, err := tx.SQL(`select  MD5(CONCAT(d.pid, d.mydate)) loadId , date_format(d1.date,'%Y-%m-%d')  dropDate,date_format(d1.date,'%Y-%m-%d')  loadDate,d.times loadShift,d.id  tmrNo,ft.tcode recipeId,ft.ccname recipeName,ifnull(f.feedcode,d1.fid) ingId,'' feedCode ,ifnull(f.fname,ftd.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 , if(f.fname is not null, ifnull(d1.lweight,''),	ifnull(ftd.fweight / (select sum(fweight)  from ftdetaildate  where  date =  d1.date and ftid = d1.fid ) *  d1.lweight,"") )  expWeight,
 	

BIN=BIN
tmr-watch.exe