|
@@ -116,11 +116,11 @@ func getIncomeListV2(ch chan models.IncomeChartResp) (incomeChart models.IncomeC
|
|
}
|
|
}
|
|
ch <- incomeChart
|
|
ch <- incomeChart
|
|
}()
|
|
}()
|
|
- todayStr := utils.GetToday("20060102")
|
|
|
|
- key := "admin:home:fmsIncomeList:" + todayStr
|
|
|
|
|
|
+ //todayStr := utils.GetToday("20060102")
|
|
|
|
+ //key := "admin:home:fmsIncomeList:" + todayStr
|
|
|
|
|
|
- redisJsonData, redisErr := global.Redis.Get(context.TODO(), key).Result()
|
|
|
|
- if redisErr != nil {
|
|
|
|
|
|
+ //redisJsonData, redisErr := global.Redis.Get(context.TODO(), key).Result()
|
|
|
|
+ //if redisErr != nil {
|
|
var dateSlice []string
|
|
var dateSlice []string
|
|
var contractMoneySlice []float64
|
|
var contractMoneySlice []float64
|
|
var ArrivalMoneySlice []float64
|
|
var ArrivalMoneySlice []float64
|
|
@@ -151,8 +151,10 @@ func getIncomeListV2(ch chan models.IncomeChartResp) (incomeChart models.IncomeC
|
|
cond := `1 = 1`
|
|
cond := `1 = 1`
|
|
pars := make([]interface{}, 0)
|
|
pars := make([]interface{}, 0)
|
|
|
|
|
|
- cond += ` AND ((c.invoice_time BETWEEN ? AND ?) or (d.invoice_time BETWEEN ? AND ?)) `
|
|
|
|
- pars = append(pars, startDate, endDate, startDate, endDate)
|
|
|
|
|
|
+ st := fmt.Sprint(startDate, " 00:00:00")
|
|
|
|
+ ed := fmt.Sprint(endDate, " 23:59:59")
|
|
|
|
+ cond += ` AND ((c.invoice_time BETWEEN ? AND ?) or (d.invoice_time BETWEEN ? AND ?))`
|
|
|
|
+ pars = append(pars, st, ed, st, ed)
|
|
|
|
|
|
summaryIds, e := fms.GetInvoicePaymentCensusSummaryDataIds(cond, pars)
|
|
summaryIds, e := fms.GetInvoicePaymentCensusSummaryDataIds(cond, pars)
|
|
if e != nil {
|
|
if e != nil {
|
|
@@ -186,16 +188,16 @@ func getIncomeListV2(ch chan models.IncomeChartResp) (incomeChart models.IncomeC
|
|
incomeChart.ContractMoney = contractMoneySlice
|
|
incomeChart.ContractMoney = contractMoneySlice
|
|
incomeChart.ArrivalMoney = ArrivalMoneySlice
|
|
incomeChart.ArrivalMoney = ArrivalMoneySlice
|
|
|
|
|
|
- redisJsonData, err := json.Marshal(incomeChart)
|
|
|
|
- if err == nil {
|
|
|
|
- global.Redis.SetEX(context.TODO(), key, string(redisJsonData), time.Minute*30)
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- err = json.Unmarshal([]byte(redisJsonData), &incomeChart)
|
|
|
|
- if err != nil {
|
|
|
|
- fmt.Println("近两年的收入统计数据,json转换失败")
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // redisJsonData, err := json.Marshal(incomeChart)
|
|
|
|
+ // if err == nil {
|
|
|
|
+ // global.Redis.SetEX(context.TODO(), key, string(redisJsonData), time.Minute*30)
|
|
|
|
+ // }
|
|
|
|
+ //}else {
|
|
|
|
+ // err = json.Unmarshal([]byte(redisJsonData), &incomeChart)
|
|
|
|
+ // if err != nil {
|
|
|
|
+ // fmt.Println("近两年的收入统计数据,json转换失败")
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|