|
|
@@ -230,6 +230,7 @@ func GetDataByName(c *gin.Context) {
|
|
|
_ = xlsxfile.Write(c.Writer)
|
|
|
|
|
|
} else {
|
|
|
+ fmt.Println(time.Now())
|
|
|
if sqlnamestr == "getHomepageStr" {
|
|
|
parammaps := fsion.Get("parammaps")
|
|
|
pastureid := parammaps.Get("pastureid").ValueStr()
|
|
|
@@ -243,31 +244,37 @@ 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
|
|
|
}
|
|
|
+ // if sqlnamestr == "getHomepageStr" {
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
queryData, err := getDataBySqlT(sql, offset, pagecount, returntype, s_params, tx)
|
|
|
if err != nil {
|
|
|
logging.Error("GetDataByName err: ", err)
|
|
|
@@ -2156,7 +2163,6 @@ func getDataBySqlT(sqlstr string, offset, pagecount int, returntype string, para
|
|
|
queryData, err := restful.QueryByListListT(sqlstr, offset, pagecount, params, tx)
|
|
|
return queryData, err
|
|
|
} else {
|
|
|
- fmt.Println(params)
|
|
|
queryData, err := restful.QueryByMapT(sqlstr, offset, pagecount, params, tx)
|
|
|
return queryData, err
|
|
|
}
|
|
|
@@ -4455,12 +4461,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["系数(%)"]
|
|
|
}
|
|
|
@@ -9037,7 +9043,7 @@ func FpdBatchEdit(c *gin.Context) {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
+ // /*
|
|
|
_, err = tx.SQL(` update lpplandtl1 set lweight = 0 where pastureid = ? and lppid in(select id from lpplan where pastureid = ? )
|
|
|
and find_in_set(barid,(select barid from feedp where barname = ? )) `, pastureid, pastureid, dataexcel["barname"]).Execute()
|
|
|
if err != nil {
|
|
|
@@ -9052,7 +9058,7 @@ func FpdBatchEdit(c *gin.Context) {
|
|
|
appG.Response(http.StatusInternalServerError, e.ERROR, err)
|
|
|
return
|
|
|
}
|
|
|
- */
|
|
|
+ // */
|
|
|
|
|
|
dataexcel["1"] = barFsions.Get("times1").ValueStr()
|
|
|
dataexcel["2"] = barFsions.Get("times2").ValueStr()
|
|
|
@@ -10670,7 +10676,7 @@ func FpdBatchEditGrfd(pastureid string, barList []map[string]string) {
|
|
|
// dataexcel["5"] = barFsions.Get("times5").ValueStr()
|
|
|
// dataexcel["6"] = barFsions.Get("times6").ValueStr()
|
|
|
|
|
|
- /*
|
|
|
+ // /*
|
|
|
|
|
|
tx.SQL(` update lpplandtl1 set lweight = 0 where barid = (select id from bar where bname = ? ) and pastureid = ? `, dataexcel["barname"], pastureid).Exist()
|
|
|
if err != nil {
|
|
|
@@ -10683,7 +10689,7 @@ func FpdBatchEditGrfd(pastureid string, barList []map[string]string) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
+ // */
|
|
|
|
|
|
exist, err := tx.SQL(` select id from feedp where barid = (select id from bar where bname = ? ) and pastureid = ? `, dataexcel["barname"], pastureid).Exist()
|
|
|
if err != nil {
|