Browse Source

Merge branch 'bzq1/fix_manual_bug' of eta_server/eta_api into master

baoziqiang 1 week ago
parent
commit
74eb420300
1 changed files with 8 additions and 2 deletions
  1. 8 2
      controllers/data_manage/manual_edb.go

+ 8 - 2
controllers/data_manage/manual_edb.go

@@ -10,12 +10,13 @@ import (
 	etaTrialService "eta/eta_api/services/eta_trial"
 	"eta/eta_api/utils"
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/paging"
-	"github.com/shopspring/decimal"
 	"os"
 	"strconv"
 	"strings"
 	"time"
+
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"github.com/shopspring/decimal"
 )
 
 // ManualEdbController 手工指标服务(鉴权)
@@ -585,6 +586,11 @@ func (c *ManualEdbController) EditExcelData() {
 	dateValueMap := make(map[string]string)
 	//取到所有数据
 	for _, dateValue := range req.Data {
+		// 检验时间格式
+		_, err := time.Parse(utils.FormatDate, dateValue.Date)
+		if err != nil {
+			continue
+		}
 		dateValueMap[dateValue.Date] = strconv.FormatFloat(dateValue.Value, 'f', -1, 64)
 	}