|
@@ -48,6 +48,7 @@ func GetCustomAnalysisExcelData(excelInfo *excel.ExcelInfo) (luckySheet excelSer
|
|
|
tmpSheetDataList := make([]excelServices.LuckySheetCellData, 0)
|
|
|
err = json.Unmarshal([]byte(cellData.Data), &tmpSheetDataList)
|
|
|
if err != nil {
|
|
|
+ err = errors.New(fmt.Sprintf("解析data的配置失败,sheetId:%d,Err:%s", cellData.ExcelDataId, err.Error()))
|
|
|
return
|
|
|
}
|
|
|
sheetCellDataMapList[cellData.ExcelSheetId] = append(sheetDataList, tmpSheetDataList...)
|
|
@@ -63,6 +64,7 @@ func GetCustomAnalysisExcelData(excelInfo *excel.ExcelInfo) (luckySheet excelSer
|
|
|
var luckySheetDataConfig excelServices.LuckySheetDataConfig
|
|
|
err = json.Unmarshal([]byte(sheet.Config), &luckySheetDataConfig)
|
|
|
if err != nil {
|
|
|
+ err = errors.New(fmt.Sprintf("解析sheet的配置失败,sheetId:%d,Err:%s", sheet.ExcelSheetId, err.Error()))
|
|
|
return
|
|
|
}
|
|
|
tmpLuckySheetDataInfo := excelServices.LuckySheetData{
|
|
@@ -218,6 +220,7 @@ func Refresh(excelInfo *excel.ExcelInfo) (err error, errMsg string, isSendEmail
|
|
|
list, err := excel.GetAllExcelEdbMappingItemByExcelInfoId(excelInfo.ExcelInfoId)
|
|
|
if err != nil {
|
|
|
errMsg = "获取失败"
|
|
|
+ err = errors.New("查找所有的mapping失败" + err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -231,7 +234,7 @@ func Refresh(excelInfo *excel.ExcelInfo) (err error, errMsg string, isSendEmail
|
|
|
err = json.Unmarshal([]byte(v.CalculateFormula), &tmpCalculateFormula)
|
|
|
if err != nil {
|
|
|
errMsg = "获取失败"
|
|
|
- err = errors.New("公式转换失败,Err:" + err.Error())
|
|
|
+ err = errors.New(fmt.Sprintf("指标id:%d,公式转换失败,Err:%s", v.EdbInfoId, err.Error()))
|
|
|
return
|
|
|
}
|
|
|
v.DateSequenceStr = tmpCalculateFormula.DateSequenceStr
|
|
@@ -241,12 +244,14 @@ func Refresh(excelInfo *excel.ExcelInfo) (err error, errMsg string, isSendEmail
|
|
|
|
|
|
luckySheet, err, errMsg := GetCustomAnalysisExcelData(excelInfo)
|
|
|
if err != nil {
|
|
|
+ err = errors.New(fmt.Sprintf("获取自定义分析Excel数据失败,Err:%s", err.Error()))
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// 获取excel表格数据
|
|
|
xlsxFile, err := luckySheet.GetExcelData(false)
|
|
|
if err != nil {
|
|
|
+ err = errors.New(fmt.Sprintf("获取excel表格数据,Err:%s", err.Error()))
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -260,7 +265,7 @@ func Refresh(excelInfo *excel.ExcelInfo) (err error, errMsg string, isSendEmail
|
|
|
// 获取对应的日期和数据列表
|
|
|
relDateList, relDataList, tmpErr, tmpErrMsg := getDateAndDataList(v, xlsxFile)
|
|
|
if tmpErr != nil {
|
|
|
- err = tmpErr
|
|
|
+ err = errors.New(fmt.Sprintf("获取对应的日期和数据列表,Err:%s", tmpErr.Error()))
|
|
|
errMsg = tmpErrMsg
|
|
|
return
|
|
|
}
|
|
@@ -274,12 +279,12 @@ func Refresh(excelInfo *excel.ExcelInfo) (err error, errMsg string, isSendEmail
|
|
|
// 调用指标库去更新
|
|
|
reqJson, tmpErr := json.Marshal(req2)
|
|
|
if tmpErr != nil {
|
|
|
- err = tmpErr
|
|
|
+ err = errors.New(fmt.Sprintf("结构体转对象失败,Err:%s", tmpErr.Error()))
|
|
|
return
|
|
|
}
|
|
|
respItem, tmpErr := data.ResetCustomAnalysisData(string(reqJson))
|
|
|
if tmpErr != nil {
|
|
|
- err = tmpErr
|
|
|
+ err = errors.New(fmt.Sprintf("调用指标库去更新,Err:%s", tmpErr.Error()))
|
|
|
return
|
|
|
}
|
|
|
if respItem.Ret != 200 {
|