|
|
@@ -244,30 +244,25 @@ func GetDataByName(c *gin.Context) {
|
|
|
nowstr := now.AddDate(0, 0, -i).Format("2006-01-02")
|
|
|
go func(nowstr string) {
|
|
|
defer wg.Done()
|
|
|
- fmt.Println(nowstr)
|
|
|
sqlstr := `select ifnull( getSLtimeDiffSINGEL ( ?, ? ), 0.0 ) as montime`
|
|
|
slTimeList, _ := restful.QueryByMap(sqlstr, 0, 0, []interface{}{pastureid, nowstr})
|
|
|
- fmt.Println(nowstr)
|
|
|
if len(slTimeList.(map[string]interface{})["list"].([]map[string]interface{})) > 0 {
|
|
|
m, _ := strconv.ParseFloat(slTimeList.(map[string]interface{})["list"].([]map[string]interface{})[0]["montime"].(string), 64)
|
|
|
montimeList = append(montimeList, m)
|
|
|
}
|
|
|
}(nowstr)
|
|
|
}
|
|
|
- fmt.Println(time.Now())
|
|
|
queryData, err := getDataBySqlT(sql, offset, pagecount, returntype, s_params, tx)
|
|
|
if err != nil {
|
|
|
logging.Error("GetDataByName err: ", err)
|
|
|
msg := geterrmsg(err.Error())
|
|
|
appG.Response(http.StatusOK, e.ERROR, msg)
|
|
|
}
|
|
|
- fmt.Println(time.Now())
|
|
|
wg.Wait()
|
|
|
for _, m := range montimeList {
|
|
|
montime += m
|
|
|
}
|
|
|
queryData.(map[string]interface{})["list"].([]map[string]interface{})[0]["montime"] = Decimal(montime / 30)
|
|
|
- fmt.Println(time.Now())
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, queryData)
|
|
|
return
|
|
|
}
|
|
|
@@ -3655,7 +3650,7 @@ func UpdateFpdetailBar(c *gin.Context) {
|
|
|
ftmap["ptid"] = list.Get("ptid").ValueStr()
|
|
|
ftmap["ptsid"] = list.Get("ptsid").ValueStr()
|
|
|
// fmt.Println(ftmap)
|
|
|
- /*
|
|
|
+ // /*
|
|
|
count, err := tx.SQL(` select count(1) from lpplandtl1 where pastureid = ? and lppid in(select id from lpplan where pastureid = ? and times = ? )
|
|
|
and find_in_set(barid,(select barid from feedp where id = ? )) and lweight > 0 `, pastureid, pastureid, ftmap["times"], id).Count()
|
|
|
if count == 1 {
|
|
|
@@ -3676,7 +3671,7 @@ func UpdateFpdetailBar(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- */
|
|
|
+ // */
|
|
|
|
|
|
fpdDataList, err := tx.SQL(`
|
|
|
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 ,
|
|
|
@@ -5210,6 +5205,7 @@ func FpdImportExcel(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
// */
|
|
|
+
|
|
|
updateFpdetailByBar(pastureid, barname, v)
|
|
|
}
|
|
|
} else {
|
|
|
@@ -12667,3 +12663,6 @@ func GetLyUdData(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|