Roc 1 rok pred
rodič
commit
91bb87aa89

+ 1 - 1
services/data/base_edb_lib.go

@@ -409,6 +409,6 @@ func HttpPost(url, postData string, params ...string) ([]byte, error) {
 	resp, err := client.Do(req)
 	defer resp.Body.Close()
 	b, err := ioutil.ReadAll(resp.Body)
-	fmt.Println("HttpPost:" + string(b))
+	utils.FileLog.Debug("HttpPost:" + string(b))
 	return b, err
 }

+ 10 - 4
services/data/excel/mixed_table.go

@@ -304,8 +304,9 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 				continue
 			}
 
-			val, tmpErr, has := getCalculateValueByCell(calculateCellMap, cellKey, cellKeyVal)
+			val, has, tmpErr, tmpErrMsg := getCalculateValueByCell(calculateCellMap, cellKey, cellKeyVal)
 			if tmpErr != nil {
+				errMsg = tmpErrMsg
 				err = tmpErr
 				return
 			}
@@ -326,7 +327,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 }
 
 // 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]
 	if ok {
@@ -357,11 +358,16 @@ func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellK
 		err = errors.New(colData.Uid + "没有绑定关系")
 		return
 	}
+	err = json.Unmarshal([]byte(colData.Extra), &relationCellList)
+	if err != nil {
+		return
+	}
 
 	for _, relation := range relationCellList {
 		//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 {
+			errMsg = tmpErrMsg
 			err = tmpErr
 			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 {
 		return
 	}

+ 1 - 2
services/data/future_good/base_future_good_lib.go

@@ -5,7 +5,6 @@ import (
 	"eta/eta_api/models"
 	"eta/eta_api/models/data_manage"
 	"eta/eta_api/utils"
-	"fmt"
 	"io/ioutil"
 	"net/http"
 	"strings"
@@ -86,6 +85,6 @@ func HttpPost(url, postData string, params ...string) ([]byte, error) {
 	resp, err := client.Do(req)
 	defer resp.Body.Close()
 	b, err := ioutil.ReadAll(resp.Body)
-	fmt.Println("HttpPost:" + string(b))
+	utils.FileLog.Debug("HttpPost:" + string(b))
 	return b, err
 }

+ 1 - 2
services/data/supply_analysis/base_supply_analysis_lib.go

@@ -4,7 +4,6 @@ import (
 	"encoding/json"
 	"eta/eta_api/models"
 	"eta/eta_api/utils"
-	"fmt"
 	"io/ioutil"
 	"net/http"
 	"strings"
@@ -92,6 +91,6 @@ func HttpPost(url, postData string, params ...string) ([]byte, error) {
 	resp, err := client.Do(req)
 	defer resp.Body.Close()
 	b, err := ioutil.ReadAll(resp.Body)
-	fmt.Println("HttpPost:" + string(b))
+	utils.FileLog.Debug("HttpPost:" + string(b))
 	return b, err
 }