|
@@ -93,7 +93,7 @@ func RefreshCalculateTbz(edbInfoId int, fromEdbInfo *EdbInfo, edbCode, startDate
|
|
//上一年的日期
|
|
//上一年的日期
|
|
preDate := currentDate.AddDate(-1, 0, 0)
|
|
preDate := currentDate.AddDate(-1, 0, 0)
|
|
preDateStr := preDate.Format(utils.FormatDate)
|
|
preDateStr := preDate.Format(utils.FormatDate)
|
|
- if findItem, ok := dataMap[preDateStr]; ok { //上一年同期找到
|
|
|
|
|
|
+ if findItem, ok := dataMap[preDateStr]; ok && findItem.Value != 0 { //上一年同期找到
|
|
//dataTime, _ := time.Parse(utils.FormatDate, date)
|
|
//dataTime, _ := time.Parse(utils.FormatDate, date)
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
@@ -127,7 +127,7 @@ func RefreshCalculateTbz(edbInfoId int, fromEdbInfo *EdbInfo, edbCode, startDate
|
|
nextDateDay = nextDateDay.AddDate(0, 0, i)
|
|
nextDateDay = nextDateDay.AddDate(0, 0, i)
|
|
nextDateDayStr = nextDateDay.Format(utils.FormatDate)
|
|
nextDateDayStr = nextDateDay.Format(utils.FormatDate)
|
|
}
|
|
}
|
|
- if findItem, ok := dataMap[nextDateDayStr]; ok { //上一年同期->下一个月找到
|
|
|
|
|
|
+ if findItem, ok := dataMap[nextDateDayStr]; ok && findItem.Value != 0 { //上一年同期->下一个月找到
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
@@ -151,7 +151,7 @@ func RefreshCalculateTbz(edbInfoId int, fromEdbInfo *EdbInfo, edbCode, startDate
|
|
preDateDay = preDate.AddDate(0, 0, -i)
|
|
preDateDay = preDate.AddDate(0, 0, -i)
|
|
preDateDayStr = nextDateDay.Format(utils.FormatDate)
|
|
preDateDayStr = nextDateDay.Format(utils.FormatDate)
|
|
}
|
|
}
|
|
- if findItem, ok := dataMap[preDateDayStr]; ok { //上一年同期->上一个月找到
|
|
|
|
|
|
+ if findItem, ok := dataMap[preDateDayStr]; ok && findItem.Value != 0 { //上一年同期->上一个月找到
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
@@ -174,7 +174,7 @@ func RefreshCalculateTbz(edbInfoId int, fromEdbInfo *EdbInfo, edbCode, startDate
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if fromEdbInfo.Frequency == "季度" || fromEdbInfo.Frequency == "年度" {
|
|
} else if fromEdbInfo.Frequency == "季度" || fromEdbInfo.Frequency == "年度" {
|
|
- if findItem, ok := dataMap[preDateStr]; ok { //上一年同期->下一个月找到
|
|
|
|
|
|
+ if findItem, ok := dataMap[preDateStr]; ok && findItem.Value != 0 { //上一年同期->下一个月找到
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
@@ -200,7 +200,7 @@ func RefreshCalculateTbz(edbInfoId int, fromEdbInfo *EdbInfo, edbCode, startDate
|
|
|
|
|
|
for i := 0; i < 35; i++ {
|
|
for i := 0; i < 35; i++ {
|
|
nextDateDayStr := nextDateDay.Format(utils.FormatDate)
|
|
nextDateDayStr := nextDateDay.Format(utils.FormatDate)
|
|
- if findItem, ok := dataMap[nextDateDayStr]; ok { //上一年同期->下一个月找到
|
|
|
|
|
|
+ if findItem, ok := dataMap[nextDateDayStr]; ok && findItem.Value != 0 { //上一年同期->下一个月找到
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
@@ -221,7 +221,7 @@ func RefreshCalculateTbz(edbInfoId int, fromEdbInfo *EdbInfo, edbCode, startDate
|
|
break
|
|
break
|
|
} else {
|
|
} else {
|
|
preDateDayStr := preDateDay.Format(utils.FormatDate)
|
|
preDateDayStr := preDateDay.Format(utils.FormatDate)
|
|
- if findItem, ok := dataMap[preDateDayStr]; ok { //上一年同期->上一个月找到
|
|
|
|
|
|
+ if findItem, ok := dataMap[preDateDayStr]; ok && findItem.Value != 0 { //上一年同期->上一个月找到
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestamp := currentDate.UnixNano() / 1e6
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
timestampStr := fmt.Sprintf("%d", timestamp)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|
|
val := TbzDiv(currentItem.Value, findItem.Value)
|