|
@@ -1613,7 +1613,6 @@ func GetChartPredictEdbInfoDataListByRuleDynamicYOYComparisonOrDifference(ruleTy
|
|
if replaceValue, replaceOk := getReplaceValue(existMap, 35, 1,-1, preDate); !replaceOk {
|
|
if replaceValue, replaceOk := getReplaceValue(existMap, 35, 1,-1, preDate); !replaceOk {
|
|
continue
|
|
continue
|
|
} else {
|
|
} else {
|
|
- fmt.Println(replaceValue)
|
|
|
|
baseDynamicDataList[preDateStr] = replaceValue
|
|
baseDynamicDataList[preDateStr] = replaceValue
|
|
predictDayList = append(predictDayList, date)
|
|
predictDayList = append(predictDayList, date)
|
|
}
|
|
}
|
|
@@ -1625,16 +1624,16 @@ func GetChartPredictEdbInfoDataListByRuleDynamicYOYComparisonOrDifference(ruleTy
|
|
for k, currentDate := range predictDayList {
|
|
for k, currentDate := range predictDayList {
|
|
var calculateValue decimal.Decimal
|
|
var calculateValue decimal.Decimal
|
|
var dateStr = currentDate.Format(utils.FormatDate)
|
|
var dateStr = currentDate.Format(utils.FormatDate)
|
|
|
|
+ preDate := currentDate.AddDate(-1, 0, 0)
|
|
|
|
+ var preDateStr=preDate.Format(utils.FormatDate)
|
|
_, dynamicVal := DynamicCalculateDataList[dateStr];
|
|
_, dynamicVal := DynamicCalculateDataList[dateStr];
|
|
- _, baseVal := baseDynamicDataList[dateStr];
|
|
|
|
|
|
+ _, baseVal := baseDynamicDataList[preDateStr];
|
|
if dynamicVal && baseVal{
|
|
if dynamicVal && baseVal{
|
|
switch ruleType {
|
|
switch ruleType {
|
|
case 17:
|
|
case 17:
|
|
- fmt.Println(baseDynamicDataList[dateStr])
|
|
|
|
- fmt.Println(DynamicCalculateDataList[dateStr])
|
|
|
|
- calculateValue = baseDynamicDataList[dateStr].Mul(DynamicCalculateDataList[dateStr].Add(decimal.NewFromInt(1)))
|
|
|
|
|
|
+ calculateValue = baseDynamicDataList[preDateStr].Mul(DynamicCalculateDataList[dateStr].Add(decimal.NewFromInt(1)))
|
|
case 18:
|
|
case 18:
|
|
- calculateValue = baseDynamicDataList[dateStr].Add(DynamicCalculateDataList[dateStr])
|
|
|
|
|
|
+ calculateValue = baseDynamicDataList[preDateStr].Add(DynamicCalculateDataList[dateStr])
|
|
default:
|
|
default:
|
|
err = errors.New("计算规则不存在")
|
|
err = errors.New("计算规则不存在")
|
|
return
|
|
return
|