|
@@ -30,6 +30,9 @@ func GetMixedTableCellData(cellRelationConf string, config [][]request.MixedTabl
|
|
|
|
|
|
// 找出所有的关联指标id
|
|
|
config, edbInfoIdList, _, err, errMsg := handleConfig(config)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
// 查询所有关联的指标信息
|
|
|
edbInfoList, err := data_manage.GetEdbInfoByIdList(edbInfoIdList)
|
|
@@ -125,6 +128,16 @@ func GetMixedTableCellData(cellRelationConf string, config [][]request.MixedTabl
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// handleConfig
|
|
|
+// @Description: 处理混合表格配置
|
|
|
+// @author: Roc
|
|
|
+// @datetime2023-10-27 13:24:53
|
|
|
+// @param configList [][]request.MixedTableCellDataReq
|
|
|
+// @return newConfig [][]request.MixedTableCellDataReq
|
|
|
+// @return edbInfoIdList []int
|
|
|
+// @return dataEdbInfoIdList []int
|
|
|
+// @return err error
|
|
|
+// @return errMsg string
|
|
|
func handleConfig(configList [][]request.MixedTableCellDataReq) (newConfig [][]request.MixedTableCellDataReq, edbInfoIdList []int, dataEdbInfoIdList []int, err error, errMsg string) {
|
|
|
edbInfoIdList = make([]int, 0)
|
|
|
dataEdbInfoIdList = make([]int, 0)
|
|
@@ -138,7 +151,12 @@ func handleConfig(configList [][]request.MixedTableCellDataReq) (newConfig [][]r
|
|
|
dataEdbInfoIdList = append(dataEdbInfoIdList, cell.EdbInfoId)
|
|
|
case request.DateDT: // 日期类型
|
|
|
if cell.DataTimeType == request.EdbDateDT {
|
|
|
- edbInfoIdList = append(edbInfoIdList, cell.EdbInfoId)
|
|
|
+ var config request.EdbDateConf
|
|
|
+ err = json.Unmarshal([]byte(cell.Value), &config)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ edbInfoIdList = append(edbInfoIdList, config.EdbInfoId)
|
|
|
} else {
|
|
|
date, tmpErr, tmpErrMsg := handleDate(cell.DataTimeType, cell.Value)
|
|
|
if tmpErr != nil {
|
|
@@ -216,11 +234,6 @@ func handleSystemDateT(confStr string) (date string, err error, errMsg string) {
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- type SystemCalculateVal struct {
|
|
|
- Source int `description:"类型,"`
|
|
|
- Num int
|
|
|
- Frequency string
|
|
|
- }
|
|
|
switch config.Source {
|
|
|
case request.SystemCurrDateT:
|
|
|
date = time.Now().Format(utils.FormatDate)
|