|
@@ -124,7 +124,13 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
for i, cell := range row {
|
|
|
|
|
|
if cell.DataType == request.DateDT && cell.DataTimeType == request.EdbDateDT {
|
|
|
- if edbInfo, ok := edbInfoMap[cell.EdbInfoId]; ok {
|
|
|
+
|
|
|
+ var edbDateConfig request.EdbDateConf
|
|
|
+ err = json.Unmarshal([]byte(cell.Value), &edbDateConfig)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if edbInfo, ok := edbInfoMap[edbDateConfig.EdbInfoId]; ok {
|
|
|
cell.ShowValue = edbInfo.EndDate
|
|
|
cell.DataTime = edbInfo.EndDate
|
|
|
config[k][i] = cell
|
|
@@ -156,37 +162,69 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
cell.ShowValue = edbInfo.EdbName
|
|
|
}
|
|
|
case request.InsertDataDT, request.PopInsertDataDT:
|
|
|
- if cell.DataTime == `` {
|
|
|
-
|
|
|
- if dateValList, ok := edbDataListMap[cell.EdbInfoId]; ok {
|
|
|
- tmpLenData := len(dateValList)
|
|
|
- if tmpLenData > 0 {
|
|
|
- cellKeyVal[cell.Uid] = dateValList[tmpLenData-1].Value
|
|
|
-
|
|
|
- cell.ShowValue = fmt.Sprint(dateValList[tmpLenData-1].Value)
|
|
|
- }
|
|
|
+
|
|
|
+ if relationConf, ok := cellRelationConfMap[cell.Uid]; ok {
|
|
|
+ if relationConf.RelationDate.Key == `` {
|
|
|
+
|
|
|
+ continue
|
|
|
}
|
|
|
- } else {
|
|
|
- tmpDateList := strings.Split(cell.DataTime, "-")
|
|
|
- tmpDateValMap := make(map[string]float64)
|
|
|
- if len(tmpDateList) == 2 {
|
|
|
-
|
|
|
- if dateValMap, ok := edbMonthDataListMap[cell.EdbInfoId]; ok {
|
|
|
- tmpDateValMap = dateValMap
|
|
|
- }
|
|
|
- } else {
|
|
|
-
|
|
|
- if dateValMap, ok := edbDayDataListMap[cell.EdbInfoId]; ok {
|
|
|
- tmpDateValMap = dateValMap
|
|
|
- }
|
|
|
+
|
|
|
+ relationCell, ok := cellDataRelationMap[relationConf.RelationDate.Key]
|
|
|
+ if !ok {
|
|
|
+
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ cell.ShowValue = ``
|
|
|
+ cell.Value = ``
|
|
|
|
|
|
+ tmpDateValMap := make(map[string]float64)
|
|
|
+
|
|
|
+ if dateValMap, ok := edbDayDataListMap[cell.EdbInfoId]; ok {
|
|
|
+ tmpDateValMap = dateValMap
|
|
|
}
|
|
|
- if val, ok2 := tmpDateValMap[cell.DataTime]; ok2 {
|
|
|
+
|
|
|
+ if val, ok2 := tmpDateValMap[relationCell.DataTime]; ok2 {
|
|
|
|
|
|
cellKeyVal[cell.Uid] = val
|
|
|
-
|
|
|
cell.ShowValue = fmt.Sprint(val)
|
|
|
}
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ if cell.DataTime == `` {
|
|
|
+
|
|
|
+ if dateValList, ok := edbDataListMap[cell.EdbInfoId]; ok {
|
|
|
+ tmpLenData := len(dateValList)
|
|
|
+ if tmpLenData > 0 {
|
|
|
+ cellKeyVal[cell.Uid] = dateValList[tmpLenData-1].Value
|
|
|
+
|
|
|
+ cell.ShowValue = fmt.Sprint(dateValList[tmpLenData-1].Value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tmpDateList := strings.Split(cell.DataTime, "-")
|
|
|
+ tmpDateValMap := make(map[string]float64)
|
|
|
+ if len(tmpDateList) == 2 {
|
|
|
+
|
|
|
+ if dateValMap, ok := edbMonthDataListMap[cell.EdbInfoId]; ok {
|
|
|
+ tmpDateValMap = dateValMap
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ if dateValMap, ok := edbDayDataListMap[cell.EdbInfoId]; ok {
|
|
|
+ tmpDateValMap = dateValMap
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if val, ok2 := tmpDateValMap[cell.DataTime]; ok2 {
|
|
|
+
|
|
|
+ cellKeyVal[cell.Uid] = val
|
|
|
+
|
|
|
+ cell.ShowValue = fmt.Sprint(val)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
calculateCellMap[cell.Uid] = Cell{
|
|
@@ -448,6 +486,16 @@ func handleConfig(configList [][]request.MixedTableCellDataReq) (newConfig [][]r
|
|
|
dataEdbInfoIdList = append(dataEdbInfoIdList, cell.EdbInfoId)
|
|
|
|
|
|
case request.DateDT:
|
|
|
+ date, tmpErr, tmpErrMsg := handleDate(cell.DataTimeType, cell.Value)
|
|
|
+ if tmpErr != nil {
|
|
|
+ err = tmpErr
|
|
|
+ errMsg = tmpErrMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
+ rowList[rk].DataTime = date
|
|
|
+ rowList[rk].ShowValue = date
|
|
|
+
|
|
|
+
|
|
|
if cell.DataTimeType == request.EdbDateDT {
|
|
|
var config request.EdbDateConf
|
|
|
err = json.Unmarshal([]byte(cell.Value), &config)
|
|
@@ -455,15 +503,6 @@ func handleConfig(configList [][]request.MixedTableCellDataReq) (newConfig [][]r
|
|
|
return
|
|
|
}
|
|
|
edbInfoIdList = append(edbInfoIdList, config.EdbInfoId)
|
|
|
- } else {
|
|
|
- date, tmpErr, tmpErrMsg := handleDate(cell.DataTimeType, cell.Value)
|
|
|
- if tmpErr != nil {
|
|
|
- err = tmpErr
|
|
|
- errMsg = tmpErrMsg
|
|
|
- return
|
|
|
- }
|
|
|
- rowList[rk].DataTime = date
|
|
|
- rowList[rk].ShowValue = date
|
|
|
}
|
|
|
}
|
|
|
}
|