|
@@ -304,8 +304,9 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
|
|
- val, tmpErr, has := getCalculateValueByCell(calculateCellMap, cellKey, cellKeyVal)
|
|
|
|
|
|
+ val, has, tmpErr, tmpErrMsg := getCalculateValueByCell(calculateCellMap, cellKey, cellKeyVal)
|
|
if tmpErr != nil {
|
|
if tmpErr != nil {
|
|
|
|
+ errMsg = tmpErrMsg
|
|
err = tmpErr
|
|
err = tmpErr
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -326,7 +327,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
}
|
|
}
|
|
|
|
|
|
// getCalculateValue 获取公式计算的结果
|
|
// getCalculateValue 获取公式计算的结果
|
|
-func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellKeyValMap map[string]float64) (val float64, err error, has bool) {
|
|
|
|
|
|
+func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellKeyValMap map[string]float64) (val float64, has bool, err error, errMsg string) {
|
|
// 单元格的标签名
|
|
// 单元格的标签名
|
|
val, ok := cellKeyValMap[key]
|
|
val, ok := cellKeyValMap[key]
|
|
if ok {
|
|
if ok {
|
|
@@ -357,11 +358,16 @@ func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellK
|
|
err = errors.New(colData.Uid + "没有绑定关系")
|
|
err = errors.New(colData.Uid + "没有绑定关系")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ err = json.Unmarshal([]byte(colData.Extra), &relationCellList)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
for _, relation := range relationCellList {
|
|
for _, relation := range relationCellList {
|
|
//relationCellTagName := strings.ToUpper(relation.Tag) + relation.Row
|
|
//relationCellTagName := strings.ToUpper(relation.Tag) + relation.Row
|
|
- tmpVal, tmpErr, _ := getCalculateValueByCell(calculateCellMap, relation.Key, cellKeyValMap)
|
|
|
|
|
|
+ tmpVal, _, tmpErr, tmpErrMsg := getCalculateValueByCell(calculateCellMap, relation.Key, cellKeyValMap)
|
|
if tmpErr != nil {
|
|
if tmpErr != nil {
|
|
|
|
+ errMsg = tmpErrMsg
|
|
err = tmpErr
|
|
err = tmpErr
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -381,7 +387,7 @@ func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellK
|
|
}
|
|
}
|
|
|
|
|
|
// 计算
|
|
// 计算
|
|
- val, _, err = calculateByCellList(strings.ToUpper(colData.Value), tagList)
|
|
|
|
|
|
+ val, errMsg, err = calculateByCellList(strings.ToUpper(colData.Value), tagList)
|
|
if err != nil {
|
|
if err != nil {
|
|
return
|
|
return
|
|
}
|
|
}
|