You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
621 lines
28 KiB
621 lines
28 KiB
package quantification
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"gin_server_admin/commonus"
|
|
)
|
|
|
|
//维度计算
|
|
/*
|
|
@normName 标准名称
|
|
@wherStr 查询条件
|
|
@calculationMethod 计算方式 1:和;2:平均值;3:和与平均值
|
|
*/
|
|
func DimensionCalculation(normName, wherStr string, calculationMethod int, oldStatistics GraphicStatistics) (outputData GraphicStatistics) {
|
|
switch calculationMethod {
|
|
case 1: //计算
|
|
sumScore, _ := AverageOfSum(wherStr)
|
|
normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
if commonus.IsItTrueString(normNameTotal, oldStatistics.Cylindrical) == false {
|
|
outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
var seriesInfo series
|
|
seriesInfo.Name = normNameTotal
|
|
seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
} else {
|
|
for cdi, cdv := range outputData.CylindricalData {
|
|
if cdv.Name == normNameTotal {
|
|
outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
}
|
|
}
|
|
}
|
|
case 2:
|
|
_, averageScore := AverageOfSum(wherStr, 1)
|
|
normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
if commonus.IsItTrueString(normNameAverage, oldStatistics.Cylindrical) == false {
|
|
outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
var seriesInfoAverage series
|
|
seriesInfoAverage.Name = normNameAverage
|
|
seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
} else {
|
|
for cdi, cdv := range outputData.CylindricalData {
|
|
if cdv.Name == normNameAverage {
|
|
outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
}
|
|
}
|
|
}
|
|
case 3:
|
|
//合计与平均
|
|
sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
var seriesInfo series
|
|
seriesInfo.Name = normNameTotal
|
|
seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
} else {
|
|
for cdi, cdv := range outputData.CylindricalData {
|
|
if cdv.Name == normNameTotal {
|
|
outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
}
|
|
}
|
|
}
|
|
normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
var seriesInfoAverage series
|
|
seriesInfoAverage.Name = normNameAverage
|
|
seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
} else {
|
|
for cdi, cdv := range outputData.CylindricalData {
|
|
if cdv.Name == normNameAverage {
|
|
outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
// func ssd() {
|
|
// outErr = true
|
|
// var normName string = ""
|
|
// if len(dataAry.TargetId) > 1 {
|
|
// //当同时查询多个指标时启用 获取指标名称
|
|
// var qualEvalCont assessmentmodel.QualitativeEvaluation
|
|
// qualEvaWhe := commonus.MapOut()
|
|
// qualEvaWhe["qe_id"] = taskId
|
|
// qualEvalCont.GetCont(qualEvaWhe, "qe_target")
|
|
// taskCont, taskErr := commonus.GetTargetInfo(qualEvalCont.Target)
|
|
// if taskErr == true {
|
|
// normName = taskCont.Title
|
|
// outErr = taskErr
|
|
// } else {
|
|
// // outErr = error.Error("此考核项目没有数据!")
|
|
// outErr = taskErr
|
|
// return
|
|
// }
|
|
// }
|
|
// //以时间维度,获取X坐标轴
|
|
// timeFrame := EstimatedTime(dataAry)
|
|
// //统计方式
|
|
// statisticalMethod := 3
|
|
// if len(dataAry.AccMethod) == 1 {
|
|
// if commonus.IsItTrueInt(1, dataAry.AccMethod) == true {
|
|
// statisticalMethod = 1
|
|
// } else {
|
|
// statisticalMethod = 2
|
|
// }
|
|
// }
|
|
|
|
// // fmt.Sprintf("timeFrame--------->%v\n", timeFrame)
|
|
// //根据时间维度进行统计
|
|
// for _, tfv := range timeFrame {
|
|
// switch tfv.Class {
|
|
// case 1:
|
|
// // fmt.Sprintf("KKKKK--------->%v\n", tfv.XLine)
|
|
// if commonus.IsItTrueString(tfv.XLine, outputData.XLine) == false {
|
|
// outputData.XLine = append(outputData.XLine, tfv.XLine)
|
|
// }
|
|
// monthStr := "("
|
|
// for twi, twv := range tfv.Where {
|
|
// if twi != 0 {
|
|
// monthStr = fmt.Sprintf("%v,%v", monthStr, twv)
|
|
// } else {
|
|
// monthStr = fmt.Sprintf("%v%v", monthStr, twv)
|
|
// }
|
|
|
|
// }
|
|
// monthStr = fmt.Sprintf("%v)", monthStr)
|
|
// wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_month` IN %v", taskId, tfv.YearName, monthStr)
|
|
// if len(dataAry.AccMethod) > 0 {
|
|
// if commonus.IsItTrueInt(1, dataAry.AccMethod) == true && commonus.IsItTrueInt(2, dataAry.AccMethod) == true {
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// } else if commonus.IsItTrueInt(1, dataAry.AccMethod) == true {
|
|
// //合计
|
|
// sumScore, _ := AverageOfSum(wherStr)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// } else if commonus.IsItTrueInt(2, dataAry.AccMethod) == true {
|
|
// _, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// } else {
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// case 2:
|
|
// //季度
|
|
// if commonus.IsItTrueString(tfv.XLine, outputData.XLine) == false {
|
|
// outputData.XLine = append(outputData.XLine, tfv.XLine)
|
|
// }
|
|
// for _, yearVal := range dataAry.Year {
|
|
// wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_quarter` = %v", taskId, yearVal, tfv.YearName)
|
|
// if len(dataAry.AccMethod) > 0 {
|
|
// if commonus.IsItTrueInt(1, dataAry.AccMethod) == true && commonus.IsItTrueInt(2, dataAry.AccMethod) == true {
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// } else if commonus.IsItTrueInt(1, dataAry.AccMethod) == true {
|
|
// //合计
|
|
// sumScore, _ := AverageOfSum(wherStr)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// } else if commonus.IsItTrueInt(2, dataAry.AccMethod) == true {
|
|
// _, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// } else {
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// case 3:
|
|
// //月
|
|
// if commonus.IsItTrueString(tfv.XLine, outputData.XLine) == false {
|
|
// outputData.XLine = append(outputData.XLine, tfv.XLine)
|
|
// }
|
|
// for _, yearVal := range dataAry.Year {
|
|
// wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_month` = %v", taskId, yearVal, tfv.YearName)
|
|
// if len(dataAry.AccMethod) > 0 {
|
|
// if commonus.IsItTrueInt(1, dataAry.AccMethod) == true && commonus.IsItTrueInt(2, dataAry.AccMethod) == true {
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// } else if commonus.IsItTrueInt(1, dataAry.AccMethod) == true {
|
|
// //合计
|
|
// sumScore, _ := AverageOfSum(wherStr)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// } else if commonus.IsItTrueInt(2, dataAry.AccMethod) == true {
|
|
// _, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// } else {
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// default:
|
|
// //全年
|
|
// if commonus.IsItTrueString(tfv.XLine, outputData.XLine) == false {
|
|
// outputData.XLine = append(outputData.XLine, tfv.XLine)
|
|
// }
|
|
|
|
// for _, tfwv := range tfv.Where {
|
|
// wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v", taskId, tfwv)
|
|
// if len(dataAry.Org) > 0 {
|
|
// //存在组织结构
|
|
// _, orgList := getGroupOrg(dataAry.Org)
|
|
// if len(orgList) > 0 {
|
|
// for _, orgv := range orgList {
|
|
// if orgv.Level <= 2 {
|
|
// wherStr = fmt.Sprintf("%v AND `fl_duty_group` = %v", wherStr, orgv.Id)
|
|
// } else {
|
|
// wherStr = fmt.Sprintf("%v AND `fl_duty_department` = %v", wherStr, orgv.Id)
|
|
// }
|
|
// switch statisticalMethod {
|
|
// case 1:
|
|
// //合计
|
|
// sumScore, _ := AverageOfSum(wherStr)
|
|
// normNameTotal := fmt.Sprintf("%v %v总值", orgv.Name, normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// case 2:
|
|
// _, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameAverage := fmt.Sprintf("%v %v平均值", orgv.Name, normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// default:
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v %v总值", orgv.Name, normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v %v平均值", orgv.Name, normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// } else {
|
|
// //不存在行政组织
|
|
// switch statisticalMethod {
|
|
// case 1:
|
|
// //合计
|
|
// sumScore, _ := AverageOfSum(wherStr)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// case 2:
|
|
// _, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// default:
|
|
// //合计与平均
|
|
// sumScore, averageScore := AverageOfSum(wherStr, 1)
|
|
// normNameTotal := fmt.Sprintf("%v总值", normName)
|
|
// if commonus.IsItTrueString(normNameTotal, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameTotal)
|
|
// var seriesInfo series
|
|
// seriesInfo.Name = normNameTotal
|
|
// seriesInfo.Data = append(seriesInfo.Data, sumScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfo)
|
|
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameTotal {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, sumScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// normNameAverage := fmt.Sprintf("%v平均值", normName)
|
|
// if commonus.IsItTrueString(normNameAverage, outputData.Cylindrical) == false {
|
|
// outputData.Cylindrical = append(outputData.Cylindrical, normNameAverage)
|
|
// var seriesInfoAverage series
|
|
// seriesInfoAverage.Name = normNameAverage
|
|
// seriesInfoAverage.Data = append(seriesInfoAverage.Data, averageScore)
|
|
// outputData.CylindricalData = append(outputData.CylindricalData, seriesInfoAverage)
|
|
// } else {
|
|
// for cdi, cdv := range outputData.CylindricalData {
|
|
// if cdv.Name == normNameAverage {
|
|
// outputData.CylindricalData[cdi].Data = append(outputData.CylindricalData[cdi].Data, averageScore)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// }
|
|
// // fmt.Println(normName)
|
|
// return
|
|
// }
|
|
|