baishaojie пре 1 година
родитељ
комит
80f5b9025d
3 измењених фајлова са 8 додато и 23 уклоњено
  1. 4 3
      conf/app.ini
  2. 4 19
      http/handle/api/ops.go
  3. 0 1
      http/handle/api/scheduled.go

+ 4 - 3
conf/app.ini

@@ -47,8 +47,8 @@ Type = mysql
 User = root
 Password = root
 #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 = haiyuan
 #Password = root
 #Password = root
@@ -72,7 +72,7 @@ Host = 127.0.0.1:3316
 #Name = tmrgo
 #Password = kepaiteng!QAZ
 #Host = 222.73.129.15:31306
-Name = tmrwatch2
+Name = tmrwatch5
 TablePrefix =
 
 ShowXormlog = false
@@ -109,3 +109,4 @@ MinimumReadSize = 0
 
 
 
+

+ 4 - 19
http/handle/api/ops.go

@@ -3151,11 +3151,11 @@ func UpdateFTdetail(c *gin.Context) {
 				WHERE fp.pastureid = ? AND fp.ptsfid =?`, parammaps["pastureid"], parammaps["ftid"]).Execute()
 		}
 
-		fpdDataList, err = tx.SQL(`select * from (SELECT TRIM(id) id,times,tratio,ifnull(ROUND(ptsrate*weight,2)-ptsuse,0) weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,
+		fpdDataList, err = tx.SQL(`select * from (SELECT TRIM(id) id,times,tratio,ifnull(ROUND(ptsrate*weight,2)-ptsuse,0) weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM((select ftid from feedp where barid =fpdetail.barid)) ptid,TRIM(ptsid ) ptsid ,
 		(select bname  from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname,0 AS fttype,cowcount,ccountradio,1 isfill  FROM fpdetail
 		WHERE fpdetail.pastureid = ?    and (ptid = ? or ptsid = ?)
 		UNION
-		SELECT TRIM(id) id,times,tratio,ifnull(ROUND((1-ptsrate)*weight,2)-ptuse,0) weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,
+		SELECT TRIM(id) id,times,tratio,ifnull(ROUND((1-ptsrate)*weight,2)-ptuse,0) weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM((select ftid from feedp where barid =fpdetail.barid)) ptid,TRIM(ptsid ) ptsid ,
 		(select bname  from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname,1 AS fttype,cowcount,ccountradio,0 isfill  FROM fpdetail
 		WHERE fpdetail.pastureid = ?  and (ptid = ? or ptsid = ?)) t
 		order by t.barname,t.times`, parammaps["pastureid"], parammaps["ftid"], parammaps["ftid"], parammaps["pastureid"], parammaps["ftid"], parammaps["ftid"]).Query().List()
@@ -3523,11 +3523,11 @@ func UpdateFpdetailBar(c *gin.Context) {
 		ftmap["ptsid"] = list.Get("ptsid").ValueStr()
 		// fmt.Println(ftmap)
 
-		fpdDataList, err := tx.SQL(`select * from (SELECT TRIM(id) id,times,tratio,ifnull(ROUND(ptsrate*weight,2)-ptsuse,"") weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(-1 ) ptsid ,
+		fpdDataList, err := tx.SQL(`select * from (SELECT TRIM(id) id,times,tratio,ifnull(ROUND(ptsrate*weight,2)-ptsuse,"") weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM((select ftid from feedp where barid =fpdetail.barid)) ptid,TRIM(-1 ) ptsid ,
 			(select bname  from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname,0 AS fttype,cowcount,ccountradio,1 isfill  FROM fpdetail
 			WHERE fpdetail.pastureid = ?   and barid =(select barid from feedp where id = ? )  and  times = ?
 			UNION
-			SELECT TRIM(id) id,times,tratio,ifnull(ROUND((1-ptsrate)*weight,2)-ptuse,"") weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,
+			SELECT TRIM(id) id,times,tratio,ifnull(ROUND((1-ptsrate)*weight,2)-ptuse,"") weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM((select ftid from feedp where barid =fpdetail.barid)) ptid,TRIM(ifnull(ptsid,-1) ) ptsid ,
 			(select bname  from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname,1 AS fttype,cowcount,ccountradio,0 isfill  FROM fpdetail
 			WHERE fpdetail.pastureid = ?  and barid = (select barid from feedp where id = ? )  and  times = ? ) t
 			order by t.barname,t.times`, pastureid, id, ftmap["times"], pastureid, id, ftmap["times"]).Query().List()
@@ -3641,7 +3641,6 @@ func UpdateFpdetailBar(c *gin.Context) {
 
 		}
 	}
-	fmt.Println("33333333333333")
 	tx.Commit()
 
 	now := time.Now()
@@ -3652,20 +3651,6 @@ func UpdateFpdetailBar(c *gin.Context) {
 		return
 	}
 
-	// newFpdDataList, err := tx.SQL(` select *  from fpdetail where barid = ? and pastureid = ? `, id, pastureid).Query().List()
-	// if err != nil {
-	// 	logs.Error(err)
-	// 	appG.Response(http.StatusOK, e.ERROR, false)
-	// 	return
-	// }
-
-	// newFeedpList, err := tx.SQL(` select *  from feedp    where barid = ? and pastureid = ?`, id, pastureid).Query().List()
-	// if err != nil {
-	// 	logs.Error(err)
-	// 	appG.Response(http.StatusOK, e.ERROR, false)
-	// 	return
-	// }
-
 	for _, newLpplandtl1 := range newLpplandtl1List {
 		_, err := tx.SQL(` insert into lpplandtl1history(pastureid,lppid,barid,barname,fpdid,fttype,lweight,sort,tmrid,tmrname,
 						background,cowcount,ccountradio,lweighthis,createdate,userId)

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

@@ -104,7 +104,6 @@ func CronScheduled(ctx context.Context) {
 					plansToComplete(openIdList, pastureinfo.Pastureid, data["id"].(int64))
 				}
 			}
-
 		}
 	})
 	downloadplandtl1.Start()