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

Merge branch 'bugfix_3457' into debug

# Conflicts:
#	go.mod
#	utils/config.go
ziwen пре 1 година
родитељ
комит
129aea0952
3 измењених фајлова са 20 додато и 2 уклоњено
  1. 3 1
      controllers/resource.go
  2. 11 0
      controllers/target.go
  3. 6 1
      models/data_manage/excel_style.go

+ 3 - 1
controllers/resource.go

@@ -789,6 +789,9 @@ func (this *ResourceController) OssSTSToken() {
 			return
 		}
 		br.Data = resp
+		br.Msg = "获取成功"
+		br.Ret = 200
+		br.Success = true
 	} else if source == utils.STORAGESOURCE_MINIO {
 		resp, err := services.GetMinIOSTSToken()
 		if err != nil {
@@ -797,7 +800,6 @@ func (this *ResourceController) OssSTSToken() {
 			return
 		}
 		br.Data = resp
-
 		br.Msg = "获取成功"
 		br.Ret = 200
 		br.Success = true

+ 11 - 0
controllers/target.go

@@ -3483,6 +3483,17 @@ func (this *TargetController) ExcelDataAdd() {
 						continue
 					}
 					valueListMap[index] = valueMap["m"].(string)
+
+					// 09-27 千位分隔符时用 "m" 取字符串存数据库会把逗号当小数点,现在换用 "v" 直接取数字再转为字符串,看看会不会有问题
+					if ct, ok := valueMap["ct"].(map[string]interface{}); ok{
+						fa, _ := ct["fa"]
+						if fa == "#,##0.000" {
+							value = valueMap["v"]
+							floatValue := valueMap["v"].(float64)
+							valueListMap[index] = strconv.FormatFloat(floatValue, 'f', -1, 64)
+						}
+					}
+
 					//valueList = append(valueList, valueMap["m"].(string))
 					//fmt.Println("valueList:", valueList)
 				}

+ 6 - 1
models/data_manage/excel_style.go

@@ -203,4 +203,9 @@ func GetExcelEdbdataMappingCount(classifyId int, tradeCode, frequency string) (c
 //	o := orm.NewOrmUsingDB("edb")
 //	_, err = o.Raw(sql, close, tradeCode, dt).Exec()
 //	return
-//}
+//}
+
+type Ct struct {
+	Fa string `json:"fa"`
+	T  string `json:"t"`
+}