Browse Source

近期数据修改

v2
herenshan112 4 months ago
parent
commit
dd0821eb85
  1. 2
      api/version1/customChartesing/analyData.go
  2. 635
      api/version1/customChartesing/bar.go
  3. 2
      api/version1/customChartesing/barRace.go
  4. 2
      api/version1/customChartesing/chartType.go
  5. 36
      api/version1/customChartesing/formTable.go
  6. 157
      api/version1/customChartesing/getSearchTime.go
  7. 2
      api/version1/customChartesing/pieChart.go
  8. 2
      api/version1/customChartesing/radar.go
  9. 2
      api/version1/customChartesing/target.go
  10. 2
      api/version1/customChartesing/type.go
  11. 4
      api/version1/entry.go

2
api/version1/customChartes/analyData.go → api/version1/customChartesing/analyData.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"

635
api/version1/customChartes/bar.go → api/version1/customChartesing/bar.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"
@ -33,88 +33,641 @@ func (c *ChartInfo) TimeDataAnaly(x XAxisInfo, y []YAxisInfo, val interface{}, c
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
charData.XAxis.Types = "category" charData.XAxis.Types = "category"
charData.YAxis.Types = "value" charData.YAxis.Types = "value"
searchTime := c.JieXiSearchTime()
fmt.Printf("时间字段--->%v\n\n", x.TimeType)
switch x.TimeType { switch x.TimeType {
case "year": case "year":
yearVal := publicmethod.UnixTimeToDay(tayTime, 16) yearVal := publicmethod.UnixTimeToDay(tayTime, 16)
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = []string{yearVal} charData.XAxis.Data = []string{yearVal}
charData.CalculateNumericalValues(y, val, x.Field, chartType, "all", 12) }
charData.CalculateNumericalValues(y, val, x.Field, chartType, "all", 12, charData.XAxis.Data)
case "month": case "month":
var timeList []string var timeList []string
tayTime := int(time.Now().Month()) yearVal := publicmethod.UnixTimeToDay(tayTime, 16)
for i := 1; i <= tayTime; i++ { tayTimeing := int(time.Now().Month())
timeList = append(timeList, fmt.Sprintf("%v月", i)) for i := 1; i <= tayTimeing; i++ {
timeList = append(timeList, fmt.Sprintf("%v-%v", yearVal, i))
} }
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = timeList charData.XAxis.Data = timeList
charData.CalculateNumericalValues(y, val, x.Field, chartType, "month", tayTime) }
charData.CalculateNumericalValues(y, val, x.Field, chartType, "month", tayTimeing, charData.XAxis.Data)
case "day": case "day":
// tayTime := int(time.Now().Day()) tayTimeing := int(time.Now().Day())
yearVal := publicmethod.UnixTimeToDay(tayTime, 4) yearVal := publicmethod.UnixTimeToDay(tayTime, 15)
charData.XAxis.Data = []string{yearVal} fmt.Printf("时间字段-1-->%v\n\n", tayTimeing)
charData.CalculateNumericalValues(y, val, x.Field, chartType, "day", 1) var timeList []string
for i := 1; i <= tayTimeing; i++ {
timeList = append(timeList, fmt.Sprintf("%v-%v", yearVal, i))
}
fmt.Printf("时间字段-1-->%v-->%v\n\n", len(searchTime), searchTime)
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = timeList
}
charData.NewCalculateNumericalValues(y, val, x.Field, chartType, "day", tayTimeing, charData.XAxis.Data)
case "hour": case "hour":
var timeList []string var timeList []string
yearVal := publicmethod.UnixTimeToDay(tayTime, 7) yearVal := publicmethod.UnixTimeToDay(tayTime, 7)
ymd := publicmethod.UnixTimeToDay(tayTime, 4) ymd := publicmethod.UnixTimeToDay(tayTime, 14)
hourInt, _ := strconv.Atoi(yearVal) hourInt, _ := strconv.Atoi(yearVal)
for i := 1; i <= hourInt; i++ { for i := 1; i <= hourInt; i++ {
timeList = append(timeList, fmt.Sprintf("%v 时", ymd, i)) timeList = append(timeList, fmt.Sprintf("%v %v", ymd, i))
} }
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = timeList charData.XAxis.Data = timeList
charData.CalculateNumericalValues(y, val, x.Field, chartType, "hour", hourInt) }
charData.CalculateNumericalValues(y, val, x.Field, chartType, "hour", hourInt, charData.XAxis.Data)
case "minute": case "minute":
var timeList []string var timeList []string
yearVal := publicmethod.UnixTimeToDay(tayTime, 9) yearVal := publicmethod.UnixTimeToDay(tayTime, 9)
ymd := publicmethod.UnixTimeToDay(tayTime, 3) ymd := publicmethod.UnixTimeToDay(tayTime, 13)
hourInt, _ := strconv.Atoi(yearVal) hourInt, _ := strconv.Atoi(yearVal)
for i := 1; i <= hourInt; i++ { for i := 1; i <= hourInt; i++ {
timeList = append(timeList, fmt.Sprintf("%v", ymd, i)) timeList = append(timeList, fmt.Sprintf("%v %v", ymd, i))
} }
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = timeList charData.XAxis.Data = timeList
charData.CalculateNumericalValues(y, val, x.Field, chartType, "minute", hourInt) }
charData.CalculateNumericalValues(y, val, x.Field, chartType, "minute", hourInt, charData.XAxis.Data)
case "second": case "second":
var timeList []string var timeList []string
yearVal := publicmethod.UnixTimeToDay(tayTime, 10) yearVal := publicmethod.UnixTimeToDay(tayTime, 10)
ymd := publicmethod.UnixTimeToDay(tayTime, 2) ymd := publicmethod.UnixTimeToDay(tayTime, 12)
hourInt, _ := strconv.Atoi(yearVal) hourInt, _ := strconv.Atoi(yearVal)
for i := 1; i <= hourInt; i++ { for i := 1; i <= hourInt; i++ {
timeList = append(timeList, fmt.Sprintf("%v", ymd, i)) timeList = append(timeList, fmt.Sprintf("%v %v", ymd, i))
} }
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = timeList charData.XAxis.Data = timeList
charData.CalculateNumericalValues(y, val, x.Field, chartType, "second", hourInt) }
charData.CalculateNumericalValues(y, val, x.Field, chartType, "second", hourInt, charData.XAxis.Data)
default: default:
var timeList []string var timeList []string
yearVal := publicmethod.UnixTimeToDay(tayTime, 15)
tayTime := int(time.Now().Month()) tayTime := int(time.Now().Month())
for i := 1; i <= tayTime; i++ { for i := 1; i <= tayTime; i++ {
timeList = append(timeList, fmt.Sprintf("%v月", i)) timeList = append(timeList, fmt.Sprintf("%v-%v", yearVal, i))
} }
if len(searchTime) > 0 {
charData.XAxis.Data = searchTime
} else {
charData.XAxis.Data = timeList charData.XAxis.Data = timeList
charData.CalculateNumericalValues(y, val, x.Field, chartType, "month", tayTime)
} }
charData.CalculateNumericalValues(y, val, x.Field, chartType, "month", tayTime, charData.XAxis.Data)
}
// xAxis := c.JieXiSearchTime()
// if len(xAxis) > 0 {
// charData.XAxis.Data = xAxis
// }
return return
} }
// 计算数值 // 计算数值
// 1:求和;2:平均值;3:计数;4:去重计数;5:最大值;6:最小值 // 1:求和;2:平均值;3:计数;4:去重计数;5:最大值;6:最小值
// 当字段为时间类型时. 1:自动(原始值);2:整数;3:保留1位小数;4:保留2位小数;5:百分比;6:百分比1位小数;7:百分比2位小数; // 当字段为时间类型时. 1:自动(原始值);2:整数;3:保留1位小数;4:保留2位小数;5:百分比;6:百分比1位小数;7:百分比2位小数;
func (b *BarDataInfo) CalculateNumericalValues(y []YAxisInfo, val interface{}, xField, chartType string, types string, lenght int) { func (b *BarDataInfo) NewCalculateNumericalValues(y []YAxisInfo, val interface{}, xField, chartType string, types string, lenght int, timeAry []string) {
for _, v := range y { for _, v := range y {
var seriesInfo SeriesList var seriesInfo SeriesList
seriesInfo.Name = v.OldTitle seriesInfo.Name = v.OldTitle
seriesInfo.Types = chartType seriesInfo.Types = chartType
switch v.Method { switch v.Method {
case 2: case 2:
seriesInfo.AverageValue(xField, v.Field, types, val, v.Format, lenght) seriesInfo.NewAverageValue(xField, v.Field, types, val, v.Format, timeAry)
case 3: case 3:
seriesInfo.StatisticalQuantity(xField, v.Field, types, val, v.Format, lenght) seriesInfo.NewStatisticalQuantity(xField, v.Field, types, val, v.Format, timeAry)
case 4: case 4:
seriesInfo.RemoveDuplicateCounts(xField, v.Field, types, val, v.Format, lenght) seriesInfo.NewRemoveDuplicateCounts(xField, v.Field, types, val, v.Format, timeAry)
case 5: case 5:
seriesInfo.maxData(xField, v.Field, types, val, v.Format, lenght) seriesInfo.NewmaxData(xField, v.Field, types, val, v.Format, timeAry)
case 6: case 6:
seriesInfo.minData(xField, v.Field, types, val, v.Format, lenght) seriesInfo.NewminData(xField, v.Field, types, val, v.Format, timeAry)
default: default:
seriesInfo.sumData(xField, v.Field, types, val, v.Format, lenght) seriesInfo.NewsumData(xField, v.Field, types, val, v.Format, timeAry)
}
if !publicmethod.IsInTrue[string](v.OldTitle, b.Legend.Data) {
b.Legend.Data = append(b.Legend.Data, v.OldTitle)
}
// if yVal, isOk := val.([]map[string]interface{}); isOk {
// for mi, mv := range yVal {
// fmt.Printf("\n\nyVal =====> %v =====> %v\n\n", mi, mv)
// }
// }
b.Series = append(b.Series, seriesInfo)
}
}
/*
*
@ 作者: 秦东
@ 时间: 2025-07-25 14:51:33
@ 功能:
#xField X轴信息
#yField Y轴信息
#types 时间信息
#format 值约束
#timeAry 时间数组
*/
func (s *SeriesList) NewAverageValue(xField, yField, types string, val interface{}, format int, timeAry []string) {
var monthAry []interface{}
for _, v := range timeAry {
switch types {
case "year":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", v))
monthAry = append(monthAry, s.QuPingjunSumData(startTime, endTime, val, xField, yField, format))
case "month":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01 00:00:00", v))
yearValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 16))
monthValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 17))
endTime := publicmethod.GetDaysInMonth(yearValInt, monthValInt)
monthAry = append(monthAry, s.QuPingjunSumData(startTime, endTime.AllTime, val, xField, yField, format))
case "day":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 23:59:59", v))
monthAry = append(monthAry, s.QuPingjunSumData(startTime, endTime, val, xField, yField, format))
case "hour":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuPingjunSumData(startTime, endTime, val, xField, yField, format))
case "minute":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59", v))
monthAry = append(monthAry, s.QuPingjunSumData(startTime, endTime, val, xField, yField, format))
case "second":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuPingjunSumData(startTime, endTime, val, xField, yField, format))
default:
}
}
s.Data = monthAry
}
func (s *SeriesList) QuPingjunSumData(startTime, endTime int64, val interface{}, xField, yField string, format int) (jieguo interface{}) {
if yVal, isOk := val.([]map[string]interface{}); isOk {
var sumVal float64
jibuqi := 0
for _, mv := range yVal {
if yVal, isOk := mv[yField]; isOk {
if xVal, isOk := mv[xField]; isOk {
pageTime, _ := publicmethod.StringToInt64(xVal)
if publicmethod.GetIntLength(pageTime) >= 13 {
startTime = startTime * 1000
endTime = endTime * 1000
}
if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil {
sumVal = sumVal + minVal
jibuqi++
}
}
}
}
}
if jibuqi > 0 {
avgVal := sumVal / float64(jibuqi)
jieguo = publicmethod.DataChuli(avgVal, format)
} else {
jieguo = publicmethod.DataChuli(sumVal, format)
}
}
return
}
/*
*
@ 作者: 秦东
@ 时间: 2025-07-25 14:51:33
@ 功能:
#xField X轴信息
#yField Y轴信息
#types 时间信息
#format 值约束
#timeAry 时间数组
*/
func (s *SeriesList) NewStatisticalQuantity(xField, yField, types string, val interface{}, format int, timeAry []string) {
var monthAry []interface{}
for _, v := range timeAry {
switch types {
case "year":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", v))
monthAry = append(monthAry, s.QuJishuData(startTime, endTime, val, xField, yField, format))
case "month":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01 00:00:00", v))
yearValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 16))
monthValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 17))
endTime := publicmethod.GetDaysInMonth(yearValInt, monthValInt)
monthAry = append(monthAry, s.QuJishuData(startTime, endTime.AllTime, val, xField, yField, format))
case "day":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 23:59:59", v))
monthAry = append(monthAry, s.QuJishuData(startTime, endTime, val, xField, yField, format))
case "hour":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuJishuData(startTime, endTime, val, xField, yField, format))
case "minute":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59", v))
monthAry = append(monthAry, s.QuJishuData(startTime, endTime, val, xField, yField, format))
case "second":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuJishuData(startTime, endTime, val, xField, yField, format))
default:
}
}
s.Data = monthAry
}
func (s *SeriesList) QuJishuData(startTime, endTime int64, val interface{}, xField, yField string, format int) (jieguo interface{}) {
if yVal, isOk := val.([]map[string]interface{}); isOk {
var valAry []float64
for _, mv := range yVal {
if yVal, isOk := mv[yField]; isOk {
if xVal, isOk := mv[xField]; isOk {
pageTime, _ := publicmethod.StringToInt64(xVal)
if publicmethod.GetIntLength(pageTime) >= 13 {
startTime = startTime * 1000
endTime = endTime * 1000
}
if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil {
valAry = append(valAry, minVal)
}
}
}
}
}
jieguo = len(valAry)
}
return
}
/*
*
@ 作者: 秦东
@ 时间: 2025-07-25 14:51:33
@ 功能:
#xField X轴信息
#yField Y轴信息
#types 时间信息
#format 值约束
#timeAry 时间数组
*/
func (s *SeriesList) NewRemoveDuplicateCounts(xField, yField, types string, val interface{}, format int, timeAry []string) {
var monthAry []interface{}
for _, v := range timeAry {
switch types {
case "year":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", v))
monthAry = append(monthAry, s.QuChongData(startTime, endTime, val, xField, yField, format))
case "month":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01 00:00:00", v))
yearValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 16))
monthValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 17))
endTime := publicmethod.GetDaysInMonth(yearValInt, monthValInt)
monthAry = append(monthAry, s.QuChongData(startTime, endTime.AllTime, val, xField, yField, format))
case "day":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 23:59:59", v))
monthAry = append(monthAry, s.QuChongData(startTime, endTime, val, xField, yField, format))
case "hour":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuChongData(startTime, endTime, val, xField, yField, format))
case "minute":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59", v))
monthAry = append(monthAry, s.QuChongData(startTime, endTime, val, xField, yField, format))
case "second":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuChongData(startTime, endTime, val, xField, yField, format))
default:
}
}
s.Data = monthAry
}
func (s *SeriesList) QuChongData(startTime, endTime int64, val interface{}, xField, yField string, format int) (jieguo interface{}) {
if yVal, isOk := val.([]map[string]interface{}); isOk {
var valAry []float64
for _, mv := range yVal {
if yVal, isOk := mv[yField]; isOk {
if xVal, isOk := mv[xField]; isOk {
pageTime, _ := publicmethod.StringToInt64(xVal)
if publicmethod.GetIntLength(pageTime) >= 13 {
startTime = startTime * 1000
endTime = endTime * 1000
}
if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil {
if !publicmethod.IsInTrue[float64](minVal, valAry) {
valAry = append(valAry, minVal)
}
}
}
}
}
}
jieguo = len(valAry)
}
return
}
/*
*
@ 作者: 秦东
@ 时间: 2025-07-25 14:51:33
@ 功能:
#xField X轴信息
#yField Y轴信息
#types 时间信息
#format 值约束
#timeAry 时间数组
*/
func (s *SeriesList) NewmaxData(xField, yField, types string, val interface{}, format int, timeAry []string) {
var monthAry []interface{}
for _, v := range timeAry {
switch types {
case "year":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", v))
monthAry = append(monthAry, s.QuMaxData(startTime, endTime, val, xField, yField, format))
case "month":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01 00:00:00", v))
yearValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 16))
monthValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 17))
endTime := publicmethod.GetDaysInMonth(yearValInt, monthValInt)
monthAry = append(monthAry, s.QuMaxData(startTime, endTime.AllTime, val, xField, yField, format))
case "day":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 23:59:59", v))
monthAry = append(monthAry, s.QuMaxData(startTime, endTime, val, xField, yField, format))
case "hour":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuMaxData(startTime, endTime, val, xField, yField, format))
case "minute":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59", v))
monthAry = append(monthAry, s.QuMaxData(startTime, endTime, val, xField, yField, format))
case "second":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuMaxData(startTime, endTime, val, xField, yField, format))
default:
}
}
s.Data = monthAry
}
func (s *SeriesList) QuMaxData(startTime, endTime int64, val interface{}, xField, yField string, format int) (jieguo interface{}) {
if yVal, isOk := val.([]map[string]interface{}); isOk {
var sumVal float64
for i, mv := range yVal {
if yVal, isOk := mv[yField]; isOk {
if xVal, isOk := mv[xField]; isOk {
pageTime, _ := publicmethod.StringToInt64(xVal)
if publicmethod.GetIntLength(pageTime) >= 13 {
startTime = startTime * 1000
endTime = endTime * 1000
}
if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil {
if i == 0 {
sumVal = minVal
} else {
if sumVal <= minVal {
sumVal = minVal
}
}
}
}
}
}
}
jieguo = publicmethod.DataChuli(sumVal, format)
}
return
}
/*
*
@ 作者: 秦东
@ 时间: 2025-07-25 14:51:33
@ 功能:
#xField X轴信息
#yField Y轴信息
#types 时间信息
#format 值约束
#timeAry 时间数组
*/
func (s *SeriesList) NewminData(xField, yField, types string, val interface{}, format int, timeAry []string) {
var monthAry []interface{}
for _, v := range timeAry {
switch types {
case "year":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", v))
monthAry = append(monthAry, s.QuMinData(startTime, endTime, val, xField, yField, format))
case "month":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01 00:00:00", v))
yearValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 16))
monthValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 17))
endTime := publicmethod.GetDaysInMonth(yearValInt, monthValInt)
monthAry = append(monthAry, s.QuMinData(startTime, endTime.AllTime, val, xField, yField, format))
case "day":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 23:59:59", v))
monthAry = append(monthAry, s.QuMinData(startTime, endTime, val, xField, yField, format))
case "hour":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuMinData(startTime, endTime, val, xField, yField, format))
case "minute":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59", v))
monthAry = append(monthAry, s.QuMinData(startTime, endTime, val, xField, yField, format))
case "second":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuMinData(startTime, endTime, val, xField, yField, format))
default:
}
}
s.Data = monthAry
}
func (s *SeriesList) QuMinData(startTime, endTime int64, val interface{}, xField, yField string, format int) (jieguo interface{}) {
if yVal, isOk := val.([]map[string]interface{}); isOk {
var sumVal float64
for i, mv := range yVal {
if yVal, isOk := mv[yField]; isOk {
if xVal, isOk := mv[xField]; isOk {
pageTime, _ := publicmethod.StringToInt64(xVal)
if publicmethod.GetIntLength(pageTime) >= 13 {
startTime = startTime * 1000
endTime = endTime * 1000
}
if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil {
if i == 0 {
sumVal = minVal
} else {
if sumVal >= minVal {
sumVal = minVal
}
}
}
}
}
}
}
jieguo = publicmethod.DataChuli(sumVal, format)
}
return
}
/*
*
@ 作者: 秦东
@ 时间: 2025-07-25 14:51:33
@ 功能:
#xField X轴信息
#yField Y轴信息
#types 时间信息
#format 值约束
#timeAry 时间数组
*/
func (s *SeriesList) NewsumData(xField, yField, types string, val interface{}, format int, timeAry []string) {
var monthAry []interface{}
for _, v := range timeAry {
switch types {
case "year":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", v))
monthAry = append(monthAry, s.QuSumData(startTime, endTime, val, xField, yField, format))
case "month":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01 00:00:00", v))
yearValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 16))
monthValInt, _ := strconv.Atoi(publicmethod.UnixTimeToDay(startTime, 17))
endTime := publicmethod.GetDaysInMonth(yearValInt, monthValInt)
monthAry = append(monthAry, s.QuSumData(startTime, endTime.AllTime, val, xField, yField, format))
case "day":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 23:59:59", v))
monthAry = append(monthAry, s.QuSumData(startTime, endTime, val, xField, yField, format))
case "hour":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuSumData(startTime, endTime, val, xField, yField, format))
case "minute":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59", v))
monthAry = append(monthAry, s.QuSumData(startTime, endTime, val, xField, yField, format))
case "second":
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", v))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:59:59", v))
monthAry = append(monthAry, s.QuSumData(startTime, endTime, val, xField, yField, format))
default:
}
}
s.Data = monthAry
}
func (s *SeriesList) QuSumData(startTime, endTime int64, val interface{}, xField, yField string, format int) (jieguo interface{}) {
if yVal, isOk := val.([]map[string]interface{}); isOk {
var sumVal float64
for _, mv := range yVal {
if yVal, isOk := mv[yField]; isOk {
if xVal, isOk := mv[xField]; isOk {
pageTime, _ := publicmethod.StringToInt64(xVal)
if publicmethod.GetIntLength(pageTime) >= 13 {
startTime = startTime * 1000
endTime = endTime * 1000
}
if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil {
sumVal = sumVal + minVal
}
}
}
}
}
jieguo = publicmethod.DataChuli(sumVal, format)
}
return
}
// 计算数值
// 1:求和;2:平均值;3:计数;4:去重计数;5:最大值;6:最小值
// 当字段为时间类型时. 1:自动(原始值);2:整数;3:保留1位小数;4:保留2位小数;5:百分比;6:百分比1位小数;7:百分比2位小数;
func (b *BarDataInfo) CalculateNumericalValues(y []YAxisInfo, val interface{}, xField, chartType string, types string, lenght int, timeAry []string) {
for _, v := range y {
var seriesInfo SeriesList
seriesInfo.Name = v.OldTitle
seriesInfo.Types = chartType
switch v.Method {
case 2:
seriesInfo.AverageValue(xField, v.Field, types, val, v.Format, lenght, timeAry)
case 3:
seriesInfo.StatisticalQuantity(xField, v.Field, types, val, v.Format, lenght, timeAry)
case 4:
seriesInfo.RemoveDuplicateCounts(xField, v.Field, types, val, v.Format, lenght, timeAry)
case 5:
seriesInfo.maxData(xField, v.Field, types, val, v.Format, lenght, timeAry)
case 6:
seriesInfo.minData(xField, v.Field, types, val, v.Format, lenght, timeAry)
default:
seriesInfo.sumData(xField, v.Field, types, val, v.Format, lenght, timeAry)
} }
if !publicmethod.IsInTrue[string](v.OldTitle, b.Legend.Data) { if !publicmethod.IsInTrue[string](v.OldTitle, b.Legend.Data) {
@ -130,7 +683,7 @@ func (b *BarDataInfo) CalculateNumericalValues(y []YAxisInfo, val interface{}, x
} }
// 求平均值 // 求平均值
func (s *SeriesList) AverageValue(xField, yField, types string, val interface{}, format, lenght int) { func (s *SeriesList) AverageValue(xField, yField, types string, val interface{}, format, lenght int, timeAry []string) {
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
switch types { switch types {
case "month": case "month":
@ -523,7 +1076,7 @@ func (s *SeriesList) AverageValue(xField, yField, types string, val interface{},
} }
// 统计数量 // 统计数量
func (s *SeriesList) StatisticalQuantity(xField, yField, types string, val interface{}, format, lenght int) { func (s *SeriesList) StatisticalQuantity(xField, yField, types string, val interface{}, format, lenght int, timeAry []string) {
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
switch types { switch types {
case "month": case "month":
@ -852,7 +1405,7 @@ func (s *SeriesList) StatisticalQuantity(xField, yField, types string, val inter
} }
// 去重计数 // 去重计数
func (s *SeriesList) RemoveDuplicateCounts(xField, yField, types string, val interface{}, format, lenght int) { func (s *SeriesList) RemoveDuplicateCounts(xField, yField, types string, val interface{}, format, lenght int, timeAry []string) {
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
switch types { switch types {
case "month": case "month":
@ -1201,7 +1754,8 @@ func (s *SeriesList) RemoveDuplicateCounts(xField, yField, types string, val int
} }
// 求和 // 求和
func (s *SeriesList) sumData(xField, yField, types string, val interface{}, format, lenght int) { func (s *SeriesList) sumData(xField, yField, types string, val interface{}, format, lenght int, timeAry []string) {
fmt.Printf("求和------------>%v\n\n", lenght)
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
switch types { switch types {
case "month": case "month":
@ -1257,6 +1811,7 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form
startTime = startTime * 1000 startTime = startTime * 1000
endTime = endTime * 1000 endTime = endTime * 1000
} }
if startTime <= pageTime && pageTime <= endTime { if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64) minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil { if err == nil {
@ -1272,16 +1827,16 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form
jieguo := publicmethod.DataChuli(sumVal, format) jieguo := publicmethod.DataChuli(sumVal, format)
dayAry = append(dayAry, jieguo) dayAry = append(dayAry, jieguo)
} else { } else {
ymd := publicmethod.UnixTimeToDay(tayTime, 14) ymd := publicmethod.UnixTimeToDay(tayTime, 15)
for i := 1; i <= lenght; i++ { for i := 1; i <= lenght; i++ {
createTime := fmt.Sprintf("%v %v:00:00", ymd, i) createTime := fmt.Sprintf("%v-%v 00:00:00", ymd, i)
if i < 10 { if i < 10 {
createTime = fmt.Sprintf("%v 0%v:00:00", ymd, i) createTime = fmt.Sprintf("%v-0%v 00:00:00", ymd, i)
} }
startTime := publicmethod.DateToTimeStampOld(createTime) startTime := publicmethod.DateToTimeStampOld(createTime)
endTimeStr := fmt.Sprintf("%v %v:59:59", ymd, i) endTimeStr := fmt.Sprintf("%v-%v 23:59:59", ymd, i)
if i < 10 { if i < 10 {
endTimeStr = fmt.Sprintf("%v 0%v:59:59", ymd, i) endTimeStr = fmt.Sprintf("%v-0%v 23:59:59", ymd, i)
} }
endTime := publicmethod.DateToTimeStampOld(endTimeStr) endTime := publicmethod.DateToTimeStampOld(endTimeStr)
var sumVal float64 var sumVal float64
@ -1294,7 +1849,9 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form
startTime = startTime * 1000 startTime = startTime * 1000
endTime = endTime * 1000 endTime = endTime * 1000
} }
// fmt.Printf("startTime:%v====>pageTime%v=======endTime%v\n\n", startTime, pageTime, endTime)
if startTime <= pageTime && pageTime <= endTime { if startTime <= pageTime && pageTime <= endTime {
minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64) minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64)
if err == nil { if err == nil {
sumVal = sumVal + minVal sumVal = sumVal + minVal
@ -1529,7 +2086,7 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form
} }
// 求最小值 // 求最小值
func (s *SeriesList) maxData(xField, yField, types string, val interface{}, format, lenght int) { func (s *SeriesList) maxData(xField, yField, types string, val interface{}, format, lenght int, timeAry []string) {
var valData float64 = 1 var valData float64 = 1
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
switch types { switch types {
@ -1666,7 +2223,7 @@ func (s *SeriesList) maxData(xField, yField, types string, val interface{}, form
} }
// 求最小值 // 求最小值
func (s *SeriesList) minData(xField, yField, types string, val interface{}, format, lenght int) { func (s *SeriesList) minData(xField, yField, types string, val interface{}, format, lenght int, timeAry []string) {
var valData float64 = 1 var valData float64 = 1
tayTime := time.Now().Unix() tayTime := time.Now().Unix()
switch types { switch types {

2
api/version1/customChartes/barRace.go → api/version1/customChartesing/barRace.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"

2
api/version1/customChartes/chartType.go → api/version1/customChartesing/chartType.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
/** /**
@ 作者: 秦东 @ 作者: 秦东

36
api/version1/customChartes/formTable.go → api/version1/customChartesing/formTable.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"
@ -227,11 +227,28 @@ func (a *ApiMethod) AnalyzeChartData(c *gin.Context) {
publicmethod.Result(1, requestData, c, "未知数据源表!2") publicmethod.Result(1, requestData, c, "未知数据源表!2")
return return
} }
var formJsonCont customerform.CustomerFormMaster var formJsonCont customerform.CustomerFormMaster
json.Unmarshal([]byte(custForm.MastesFormJson), &formJsonCont) json.Unmarshal([]byte(custForm.MastesFormJson), &formJsonCont)
var chartList []ChartInfo var chartList []ChartInfo
if searchMap, isOk := requestData.SetConfig.Search.(map[string]interface{}); isOk {
if valDate, isOk := searchMap["factor"]; isOk {
if factor, isOk := valDate.([]interface{}); isOk {
if len(factor) > 0 {
// charJson, _ := json.Marshal(requestData.SetConfig)
// err = json.Unmarshal(charJson, &chartList)
chartList = append(chartList, requestData.SetConfig)
} else {
err = json.Unmarshal([]byte(custForm.ChartView), &chartList) err = json.Unmarshal([]byte(custForm.ChartView), &chartList)
}
}
}
}
fmt.Printf("")
if err != nil { if err != nil {
publicmethod.Result(200, chartList, c, "当前没有视图表 ") publicmethod.Result(200, chartList, c, "当前没有视图表 ")
return return
@ -312,9 +329,9 @@ func (c *ChartInfo) AnalyzeBarChart(tableName string, formJsonCont customerform.
return nil return nil
} }
} }
gormDb = sqlDborm.Table(tableName) gormDb = sqlDborm.Table(tableName).Where("`states` = 1")
} else { } else {
gormDb = overall.CONSTANT_DB_CustomerForm.Table(tableName) gormDb = overall.CONSTANT_DB_CustomerForm.Table(tableName).Where("`states` = 1")
} }
//判断是否有过滤条件 //判断是否有过滤条件
if len(c.Filter) > 0 { if len(c.Filter) > 0 {
@ -358,7 +375,9 @@ func (c *ChartInfo) AnalyzeBarChart(tableName string, formJsonCont customerform.
*/ */
func MakeSearchSql(searck interface{}, gormDb *gorm.DB) *gorm.DB { func MakeSearchSql(searck interface{}, gormDb *gorm.DB) *gorm.DB {
if searchMap, isOk := searck.(map[string]interface{}); isOk { if searchMap, isOk := searck.(map[string]interface{}); isOk {
if factor, isOk := searchMap["factor"]; isOk { if factor, isOk := searchMap["factor"]; isOk {
if factorMap, isOk := factor.([]interface{}); isOk { if factorMap, isOk := factor.([]interface{}); isOk {
for _, v := range factorMap { for _, v := range factorMap {
@ -370,6 +389,17 @@ func MakeSearchSql(searck interface{}, gormDb *gorm.DB) *gorm.DB {
if isTrue { if isTrue {
var startTime int64 var startTime int64
var endTime int64 var endTime int64
if valData, isOk := val["value"]; isOk {
if valMap, isok := valData.([]interface{}); isok {
if len(valMap) > 0 {
startTime, _ = publicmethod.StringToInt64(valMap[0])
endTime, _ = publicmethod.StringToInt64(valMap[len(valMap)-1])
sqlStr := fmt.Sprintf("%v BETWEEN %v AND %v", fieldVal, startTime, endTime)
gormDb = gormDb.Where(sqlStr)
}
}
}
if startTimeVal, isOk := val["startTime"]; isOk { if startTimeVal, isOk := val["startTime"]; isOk {
startTime, _ = publicmethod.StringToInt64(startTimeVal) startTime, _ = publicmethod.StringToInt64(startTimeVal)
} }

157
api/version1/customChartesing/getSearchTime.go

@ -0,0 +1,157 @@
package customChartesing
import (
"appPlatform/overall/publicmethod"
"fmt"
"strconv"
)
func (c *ChartInfo) JieXiSearchTime() (xAlist []string) {
if searchMap, isOk := c.Search.(map[string]interface{}); isOk {
if factor, isOk := searchMap["factor"]; isOk {
if factorMap, isOk := factor.([]interface{}); isOk {
for _, v := range factorMap {
if val, isOk := v.(map[string]interface{}); isOk {
if _, isOk := val["field"]; isOk {
if isTime, isOk := val["isTime"]; isOk {
if isTrue, isOk := isTime.(bool); isOk {
if isTrue {
var startTime int64 = 0
var endTime int64 = 0
if valData, isOk := val["value"]; isOk {
if valMap, isok := valData.([]interface{}); isok {
if len(valMap) > 0 {
startTime, _ = publicmethod.StringToInt64(valMap[0])
endTime, _ = publicmethod.StringToInt64(valMap[len(valMap)-1])
if publicmethod.GetIntLength(startTime) >= 13 {
startTime = startTime / 1000
}
if publicmethod.GetIntLength(endTime) >= 13 {
endTime = endTime / 1000
}
if timeType, isOk := val["timeType"]; isOk {
timeTypeStr := publicmethod.TypeToInterface(timeType)
switch timeTypeStr {
case "year":
starYear := publicmethod.UnixTimeToDay(startTime, 16)
endYear := publicmethod.UnixTimeToDay(endTime, 16)
starYearInt, _ := strconv.ParseInt(starYear, 10, 64)
endYearInt, _ := strconv.ParseInt(endYear, 10, 64)
buJinzhi := endYearInt - starYearInt
if buJinzhi == 0 {
xAlist = append(xAlist, fmt.Sprintf("%v", buJinzhi))
} else {
var i int64
for i = 0; i <= buJinzhi; i++ {
xAlist = append(xAlist, fmt.Sprintf("%v", starYearInt+i))
}
}
case "month":
starYear := publicmethod.UnixTimeToDay(startTime, 16)
beginMonth := publicmethod.UnixTimeToDay(startTime, 17)
endYear := publicmethod.UnixTimeToDay(endTime, 16)
endMonth := publicmethod.UnixTimeToDay(endTime, 17)
if starYear == endYear && beginMonth == endMonth {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", starYear, beginMonth))
} else if starYear == endYear && beginMonth != endMonth {
beginMonthInt, _ := strconv.ParseInt(beginMonth, 10, 64)
endMonthInt, _ := strconv.ParseInt(endMonth, 10, 64)
for i := beginMonthInt; i <= endMonthInt; i++ {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", starYear, beginMonthInt+i))
}
} else {
beginMonthInt, _ := strconv.ParseInt(beginMonth, 10, 64)
endMonthInt, _ := strconv.ParseInt(endMonth, 10, 64)
for i := beginMonthInt; i <= 12; i++ {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", starYear, beginMonthInt+i))
}
var j int64
for j = 0; j <= endMonthInt; j++ {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", endYear, j))
}
}
case "day":
starday := publicmethod.UnixTimeToDay(startTime, 14)
endday := publicmethod.UnixTimeToDay(endTime, 14)
beginDayInt := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", starday))
endDayInt := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v 00:00:00", endday))
for beginDayInt <= endDayInt {
xAlist = append(xAlist, publicmethod.UnixTimeToDay(beginDayInt, 14))
beginDayInt = beginDayInt + 86400
}
case "hour":
starday := publicmethod.UnixTimeToDay(startTime, 13)
endday := publicmethod.UnixTimeToDay(endTime, 13)
beginDayInt := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", starday))
endDayInt := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00:00", endday))
for beginDayInt <= endDayInt {
xAlist = append(xAlist, publicmethod.UnixTimeToDay(beginDayInt, 13))
beginDayInt = beginDayInt + 60
}
case "minute":
starday := publicmethod.UnixTimeToDay(startTime, 12)
endday := publicmethod.UnixTimeToDay(endTime, 12)
beginDayInt := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", starday))
endDayInt := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v:00", endday))
for beginDayInt <= endDayInt {
xAlist = append(xAlist, publicmethod.UnixTimeToDay(beginDayInt, 12))
beginDayInt = beginDayInt + 60
}
case "second":
// starday := publicmethod.UnixTimeToDay(startTime, 11)
// endday := publicmethod.UnixTimeToDay(endTime, 11)
// beginDayInt := publicmethod.DateToTimeStampOld(starday)
// endDayInt := publicmethod.DateToTimeStampOld(endday)
for startTime <= endTime {
xAlist = append(xAlist, publicmethod.UnixTimeToDay(startTime, 11))
startTime = startTime + 1
}
default:
starYear := publicmethod.UnixTimeToDay(startTime, 16)
beginMonth := publicmethod.UnixTimeToDay(startTime, 17)
endYear := publicmethod.UnixTimeToDay(endTime, 16)
endMonth := publicmethod.UnixTimeToDay(endTime, 17)
if starYear == endYear && beginMonth == endMonth {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", starYear, beginMonth))
} else if starYear == endYear && beginMonth != endMonth {
beginMonthInt, _ := strconv.ParseInt(beginMonth, 10, 64)
endMonthInt, _ := strconv.ParseInt(endMonth, 10, 64)
for i := beginMonthInt; i <= endMonthInt; i++ {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", starYear, beginMonthInt+i))
}
} else {
beginMonthInt, _ := strconv.ParseInt(beginMonth, 10, 64)
endMonthInt, _ := strconv.ParseInt(endMonth, 10, 64)
for i := beginMonthInt; i <= 12; i++ {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", starYear, beginMonthInt+i))
}
var j int64
for j = 0; j <= endMonthInt; j++ {
xAlist = append(xAlist, fmt.Sprintf("%v-%v", endYear, j))
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return
}

2
api/version1/customChartes/pieChart.go → api/version1/customChartesing/pieChart.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"

2
api/version1/customChartes/radar.go → api/version1/customChartesing/radar.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"

2
api/version1/customChartes/target.go → api/version1/customChartesing/target.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"

2
api/version1/customChartes/type.go → api/version1/customChartesing/type.go

@ -1,4 +1,4 @@
package customChartes package customChartesing
import ( import (
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"

4
api/version1/entry.go

@ -1,7 +1,7 @@
package version1 package version1
import ( import (
"appPlatform/api/version1/customChartes" "appPlatform/api/version1/customChartesing"
"appPlatform/api/version1/customerApp" "appPlatform/api/version1/customerApp"
"appPlatform/api/version1/customerform" "appPlatform/api/version1/customerform"
datacenter "appPlatform/api/version1/dataCenter" datacenter "appPlatform/api/version1/dataCenter"
@ -39,7 +39,7 @@ type ApiEntry struct {
CustomerAppApi customerApp.ApiMethod //自定App CustomerAppApi customerApp.ApiMethod //自定App
WebSocketApi webstocetmsg.ApiMethod //webSocket通讯相关 WebSocketApi webstocetmsg.ApiMethod //webSocket通讯相关
WorkFlowApi workflowRun.ApiMethod //工作流相关 WorkFlowApi workflowRun.ApiMethod //工作流相关
ChartApi customChartes.ApiMethod ChartApi customChartesing.ApiMethod
} }
var AppApiEntry = new(ApiEntry) var AppApiEntry = new(ApiEntry)

Loading…
Cancel
Save