diff --git a/api/version1/customChartes/analyData.go b/api/version1/customChartesing/analyData.go similarity index 99% rename from api/version1/customChartes/analyData.go rename to api/version1/customChartesing/analyData.go index dc52874..97100ae 100644 --- a/api/version1/customChartes/analyData.go +++ b/api/version1/customChartesing/analyData.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" diff --git a/api/version1/customChartes/bar.go b/api/version1/customChartesing/bar.go similarity index 69% rename from api/version1/customChartes/bar.go rename to api/version1/customChartesing/bar.go index a5c1bc2..004959e 100644 --- a/api/version1/customChartes/bar.go +++ b/api/version1/customChartesing/bar.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" @@ -33,88 +33,641 @@ func (c *ChartInfo) TimeDataAnaly(x XAxisInfo, y []YAxisInfo, val interface{}, c tayTime := time.Now().Unix() charData.XAxis.Types = "category" charData.YAxis.Types = "value" + + searchTime := c.JieXiSearchTime() + + fmt.Printf("时间字段--->%v\n\n", x.TimeType) + switch x.TimeType { case "year": yearVal := publicmethod.UnixTimeToDay(tayTime, 16) - charData.XAxis.Data = []string{yearVal} - charData.CalculateNumericalValues(y, val, x.Field, chartType, "all", 12) + if len(searchTime) > 0 { + charData.XAxis.Data = searchTime + } else { + charData.XAxis.Data = []string{yearVal} + } + charData.CalculateNumericalValues(y, val, x.Field, chartType, "all", 12, charData.XAxis.Data) case "month": var timeList []string - tayTime := int(time.Now().Month()) - for i := 1; i <= tayTime; i++ { - timeList = append(timeList, fmt.Sprintf("%v月", i)) + yearVal := publicmethod.UnixTimeToDay(tayTime, 16) + tayTimeing := int(time.Now().Month()) + 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": - // tayTime := int(time.Now().Day()) - yearVal := publicmethod.UnixTimeToDay(tayTime, 4) - charData.XAxis.Data = []string{yearVal} - charData.CalculateNumericalValues(y, val, x.Field, chartType, "day", 1) + tayTimeing := int(time.Now().Day()) + yearVal := publicmethod.UnixTimeToDay(tayTime, 15) + fmt.Printf("时间字段-1-->%v\n\n", tayTimeing) + 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": var timeList []string yearVal := publicmethod.UnixTimeToDay(tayTime, 7) - ymd := publicmethod.UnixTimeToDay(tayTime, 4) + ymd := publicmethod.UnixTimeToDay(tayTime, 14) hourInt, _ := strconv.Atoi(yearVal) 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": var timeList []string yearVal := publicmethod.UnixTimeToDay(tayTime, 9) - ymd := publicmethod.UnixTimeToDay(tayTime, 3) + ymd := publicmethod.UnixTimeToDay(tayTime, 13) hourInt, _ := strconv.Atoi(yearVal) for i := 1; i <= hourInt; i++ { - timeList = append(timeList, fmt.Sprintf("%v", ymd, i)) + timeList = append(timeList, fmt.Sprintf("%v %v", ymd, i)) } - charData.XAxis.Data = timeList - charData.CalculateNumericalValues(y, val, x.Field, chartType, "minute", hourInt) + if len(searchTime) > 0 { + charData.XAxis.Data = searchTime + } else { + charData.XAxis.Data = timeList + } + charData.CalculateNumericalValues(y, val, x.Field, chartType, "minute", hourInt, charData.XAxis.Data) case "second": var timeList []string yearVal := publicmethod.UnixTimeToDay(tayTime, 10) - ymd := publicmethod.UnixTimeToDay(tayTime, 2) + ymd := publicmethod.UnixTimeToDay(tayTime, 12) hourInt, _ := strconv.Atoi(yearVal) for i := 1; i <= hourInt; i++ { - timeList = append(timeList, fmt.Sprintf("%v", ymd, i)) + timeList = append(timeList, fmt.Sprintf("%v %v", ymd, i)) } - charData.XAxis.Data = timeList - charData.CalculateNumericalValues(y, val, x.Field, chartType, "second", hourInt) + if len(searchTime) > 0 { + charData.XAxis.Data = searchTime + } else { + charData.XAxis.Data = timeList + } + charData.CalculateNumericalValues(y, val, x.Field, chartType, "second", hourInt, charData.XAxis.Data) default: var timeList []string + yearVal := publicmethod.UnixTimeToDay(tayTime, 15) tayTime := int(time.Now().Month()) 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 } // 计算数值 // 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) { +func (b *BarDataInfo) NewCalculateNumericalValues(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) + seriesInfo.NewAverageValue(xField, v.Field, types, val, v.Format, timeAry) case 3: - seriesInfo.StatisticalQuantity(xField, v.Field, types, val, v.Format, lenght) + seriesInfo.NewStatisticalQuantity(xField, v.Field, types, val, v.Format, timeAry) case 4: - seriesInfo.RemoveDuplicateCounts(xField, v.Field, types, val, v.Format, lenght) + seriesInfo.NewRemoveDuplicateCounts(xField, v.Field, types, val, v.Format, timeAry) case 5: - seriesInfo.maxData(xField, v.Field, types, val, v.Format, lenght) + seriesInfo.NewmaxData(xField, v.Field, types, val, v.Format, timeAry) case 6: - seriesInfo.minData(xField, v.Field, types, val, v.Format, lenght) + seriesInfo.NewminData(xField, v.Field, types, val, v.Format, timeAry) 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) { @@ -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() switch types { 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() switch types { 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() switch types { 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() switch types { case "month": @@ -1257,6 +1811,7 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form startTime = startTime * 1000 endTime = endTime * 1000 } + if startTime <= pageTime && pageTime <= endTime { minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64) if err == nil { @@ -1272,16 +1827,16 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form jieguo := publicmethod.DataChuli(sumVal, format) dayAry = append(dayAry, jieguo) } else { - ymd := publicmethod.UnixTimeToDay(tayTime, 14) + ymd := publicmethod.UnixTimeToDay(tayTime, 15) 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 { - 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) - endTimeStr := fmt.Sprintf("%v %v:59:59", ymd, i) + endTimeStr := fmt.Sprintf("%v-%v 23:59:59", ymd, i) 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) var sumVal float64 @@ -1294,7 +1849,9 @@ func (s *SeriesList) sumData(xField, yField, types string, val interface{}, form startTime = startTime * 1000 endTime = endTime * 1000 } + // fmt.Printf("startTime:%v====>pageTime%v=======endTime%v\n\n", startTime, pageTime, endTime) if startTime <= pageTime && pageTime <= endTime { + minVal, err := strconv.ParseFloat(publicmethod.TypeToInterface(yVal), 64) if err == nil { 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 tayTime := time.Now().Unix() 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 tayTime := time.Now().Unix() switch types { diff --git a/api/version1/customChartes/barRace.go b/api/version1/customChartesing/barRace.go similarity index 99% rename from api/version1/customChartes/barRace.go rename to api/version1/customChartesing/barRace.go index 6e7c789..db9c2a8 100644 --- a/api/version1/customChartes/barRace.go +++ b/api/version1/customChartesing/barRace.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" diff --git a/api/version1/customChartes/chartType.go b/api/version1/customChartesing/chartType.go similarity index 96% rename from api/version1/customChartes/chartType.go rename to api/version1/customChartesing/chartType.go index 55f03eb..2036dbc 100644 --- a/api/version1/customChartes/chartType.go +++ b/api/version1/customChartesing/chartType.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing /** @ 作者: 秦东 diff --git a/api/version1/customChartes/formTable.go b/api/version1/customChartesing/formTable.go similarity index 93% rename from api/version1/customChartes/formTable.go rename to api/version1/customChartesing/formTable.go index 70b9fa9..acec647 100644 --- a/api/version1/customChartes/formTable.go +++ b/api/version1/customChartesing/formTable.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" @@ -227,11 +227,28 @@ func (a *ApiMethod) AnalyzeChartData(c *gin.Context) { publicmethod.Result(1, requestData, c, "未知数据源表!2") return } + var formJsonCont customerform.CustomerFormMaster json.Unmarshal([]byte(custForm.MastesFormJson), &formJsonCont) var chartList []ChartInfo - err = json.Unmarshal([]byte(custForm.ChartView), &chartList) + + 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) + } + } + } + } + + fmt.Printf("") + if err != nil { publicmethod.Result(200, chartList, c, "当前没有视图表 ") return @@ -312,9 +329,9 @@ func (c *ChartInfo) AnalyzeBarChart(tableName string, formJsonCont customerform. return nil } } - gormDb = sqlDborm.Table(tableName) + gormDb = sqlDborm.Table(tableName).Where("`states` = 1") } else { - gormDb = overall.CONSTANT_DB_CustomerForm.Table(tableName) + gormDb = overall.CONSTANT_DB_CustomerForm.Table(tableName).Where("`states` = 1") } //判断是否有过滤条件 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 { if searchMap, isOk := searck.(map[string]interface{}); isOk { + if factor, isOk := searchMap["factor"]; isOk { + if factorMap, isOk := factor.([]interface{}); isOk { for _, v := range factorMap { @@ -370,6 +389,17 @@ func MakeSearchSql(searck interface{}, gormDb *gorm.DB) *gorm.DB { if isTrue { var startTime 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 { startTime, _ = publicmethod.StringToInt64(startTimeVal) } diff --git a/api/version1/customChartesing/getSearchTime.go b/api/version1/customChartesing/getSearchTime.go new file mode 100644 index 0000000..0fd44b5 --- /dev/null +++ b/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 +} diff --git a/api/version1/customChartes/pieChart.go b/api/version1/customChartesing/pieChart.go similarity index 99% rename from api/version1/customChartes/pieChart.go rename to api/version1/customChartesing/pieChart.go index bb11465..2010d36 100644 --- a/api/version1/customChartes/pieChart.go +++ b/api/version1/customChartesing/pieChart.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" diff --git a/api/version1/customChartes/radar.go b/api/version1/customChartesing/radar.go similarity index 99% rename from api/version1/customChartes/radar.go rename to api/version1/customChartesing/radar.go index eff5958..c567c90 100644 --- a/api/version1/customChartes/radar.go +++ b/api/version1/customChartesing/radar.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" diff --git a/api/version1/customChartes/target.go b/api/version1/customChartesing/target.go similarity index 99% rename from api/version1/customChartes/target.go rename to api/version1/customChartesing/target.go index 3a663bd..b2e4f37 100644 --- a/api/version1/customChartes/target.go +++ b/api/version1/customChartesing/target.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" diff --git a/api/version1/customChartes/type.go b/api/version1/customChartesing/type.go similarity index 99% rename from api/version1/customChartes/type.go rename to api/version1/customChartesing/type.go index c167dac..37f02be 100644 --- a/api/version1/customChartes/type.go +++ b/api/version1/customChartesing/type.go @@ -1,4 +1,4 @@ -package customChartes +package customChartesing import ( "appPlatform/api/version1/customerform" diff --git a/api/version1/entry.go b/api/version1/entry.go index ecfcb4f..63c8738 100644 --- a/api/version1/entry.go +++ b/api/version1/entry.go @@ -1,7 +1,7 @@ package version1 import ( - "appPlatform/api/version1/customChartes" + "appPlatform/api/version1/customChartesing" "appPlatform/api/version1/customerApp" "appPlatform/api/version1/customerform" datacenter "appPlatform/api/version1/dataCenter" @@ -39,7 +39,7 @@ type ApiEntry struct { CustomerAppApi customerApp.ApiMethod //自定App WebSocketApi webstocetmsg.ApiMethod //webSocket通讯相关 WorkFlowApi workflowRun.ApiMethod //工作流相关 - ChartApi customChartes.ApiMethod + ChartApi customChartesing.ApiMethod } var AppApiEntry = new(ApiEntry)