|
@@ -848,21 +848,6 @@ func handleDateDataMapZero(saveDataMap map[string]map[int]float64, date string,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetFormulaMaxMinReplace(index, edbInfoId int, formulaStr string, edbInfoIdBytes []string, formulaMap map[string]string, valArr map[int]float64) (formulaResult string, isReplace bool) {
|
|
|
- formulaStr = GetMaxMinEdbInfo(formulaStr)
|
|
|
- formulaResult = formulaStr
|
|
|
- dKey := edbInfoIdBytes[index]
|
|
|
- if _, ok := formulaMap[dKey]; ok { //公式中存在
|
|
|
- // todo 判断公式中存在max、min,如果存在,则值从valArrMax中获取,其余的值从valArr中获取
|
|
|
- if val, valOk := valArr[edbInfoId]; valOk { //值存在
|
|
|
- dvStr := fmt.Sprintf("%v", val)
|
|
|
- formulaResult = strings.Replace(formulaStr, dKey, dvStr, -1)
|
|
|
- isReplace = true
|
|
|
- }
|
|
|
- }
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
func GetMaxMinEdbInfo(formula string) string {
|
|
|
//formula := "A+min(A,B,max(A,C))"
|
|
|
// todo 无法处理max里嵌套max或者min的情况
|