Преглед изворни кода

Merge branch 'fix/2022-11-18' into debug

Roc пре 2 година
родитељ
комит
dda86e6215
2 измењених фајлова са 8 додато и 4 уклоњено
  1. 1 0
      controllers/base_from_calculate.go
  2. 7 4
      models/edb_data_calculate_nszydbpjjs.go

+ 1 - 0
controllers/base_from_calculate.go

@@ -1226,6 +1226,7 @@ func (this *CalculateController) Refresh() {
 		}
 		//startDate = edbInfo.StartDate
 		endDate = time.Now().Format(utils.FormatDate)
+		startDate = `` //只要填写日期,就会出现问题,还是把日期给去掉吧
 		err = models.RefreshAllCalculateLjzzy(edbInfoId, source, fromEdbInfo, calculateLjzzy.EdbCode, startDate, endDate)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			errMsg = "RefreshAllCalculateLjzzy Err:" + err.Error()

+ 7 - 4
models/edb_data_calculate_nszydbpjjs.go

@@ -198,7 +198,8 @@ func RefreshAllCalculateNszydpjjs(edbInfoId, source, formulaInt int, fromEdbInfo
 // refreshAllCalculateNszydpjjs 更新全部N数值移动平均计算
 func refreshAllCalculateNszydpjjs(to orm.TxOrmer, edbInfoId, source, formulaInt int, fromEdbInfo *EdbInfo, edbCode, startDate string) (err error) {
 	edbInfoIdStr := strconv.Itoa(edbInfoId)
-	fmt.Println(edbInfoIdStr)
+	//fmt.Println(edbInfoIdStr)
+	//fmt.Println("refreshAllCalculateNszydpjjs startDate:", startDate)
 	//计算数据
 	var condition string
 	var pars []interface{}
@@ -221,10 +222,12 @@ func refreshAllCalculateNszydpjjs(to orm.TxOrmer, edbInfoId, source, formulaInt
 	var fromPars []interface{}
 	fromCondition += " AND edb_info_id=? "
 	fromPars = append(fromPars, fromEdbInfo.EdbInfoId)
-	fromCondition += " AND data_time>=? "
-	fromPars = append(fromPars, startDate)
+	if startDate != `` {
+		fromCondition += " AND data_time>=? "
+		fromPars = append(fromPars, startDate)
+	}
 
-	fmt.Println("fromPars:", fromPars)
+	//fmt.Println("fromPars:", fromPars)
 	fromDataList, err := GetEdbDataListAllV1ByTo(to, fromCondition, fromPars, fromEdbInfo.Source, 0)
 	if err != nil {
 		fmt.Println("from GetEdbDataListAll Err:" + err.Error())