|
|
|
|
package statistics
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//统计
|
|
|
|
|
type ApiGroup struct{}
|
|
|
|
|
|
|
|
|
|
//协程设置
|
|
|
|
|
var syncProcess = sync.WaitGroup{}
|
|
|
|
|
|
|
|
|
|
var syncProcessDepartTarget = sync.WaitGroup{} //获取指标相关参数
|
|
|
|
|
|
|
|
|
|
//数据计量统计(表格统计)
|
|
|
|
|
type tablePlanVersionStic struct {
|
|
|
|
|
TableScore []TableScoreList
|
|
|
|
|
mutext sync.RWMutex
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//读取锁数据
|
|
|
|
|
func (t *tablePlanVersionStic) readMyDayData() []TableScoreList {
|
|
|
|
|
t.mutext.RLock()
|
|
|
|
|
defer t.mutext.RUnlock()
|
|
|
|
|
return t.TableScore
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//数据锁统计
|
|
|
|
|
type dataLockStatistics struct {
|
|
|
|
|
outData []TargetContOutCont
|
|
|
|
|
mutext sync.RWMutex
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//读取锁数据
|
|
|
|
|
func (d *dataLockStatistics) readMyDayData() []TargetContOutCont {
|
|
|
|
|
d.mutext.RLock()
|
|
|
|
|
defer d.mutext.RUnlock()
|
|
|
|
|
return d.outData
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//考核方案版本列表查询
|
|
|
|
|
type DutyPlanVersio struct {
|
|
|
|
|
Group string `json:"group"` //归属集团
|
|
|
|
|
DeaprtId string `json:"deaprtid"` //部门ID
|
|
|
|
|
Year string `json:"year"` //年度
|
|
|
|
|
Versio string `json:"versio"` //版本
|
|
|
|
|
VersioNum string `json:"versionum"` //编号
|
|
|
|
|
State int `json:"state"` //状态
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//考核方案版本列表查询输出
|
|
|
|
|
type DutyPlanVersioOut struct {
|
|
|
|
|
assessmentmodel.PlanVersio
|
|
|
|
|
GroupName string `json:"groupname"` //归属集团
|
|
|
|
|
DeaprtName string `json:"deaprtname"` //部门ID
|
|
|
|
|
Time string `json:"time"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//方案回显
|
|
|
|
|
type AddDutyNewCont struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
// Order int64 `json:"ordering"`
|
|
|
|
|
ZhiFraction int `json:"zhiFraction"`
|
|
|
|
|
Child []EvaluPross `json:"child"` //考核细则
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//指标
|
|
|
|
|
type EvaluPross struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Content string `json:"content"` //指标说明
|
|
|
|
|
Unit string `json:"unit"` //单位"`
|
|
|
|
|
ReferenceScore int64 `json:"referencescore"` //标准分值"`
|
|
|
|
|
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
|
|
|
|
|
CycleAttres int `json:"cycleattr"` //辅助计数"`
|
|
|
|
|
State int `json:"state"`
|
|
|
|
|
Score int64 `json:"score"` //分数
|
|
|
|
|
QualEvalId string `json:"qeid"`
|
|
|
|
|
Status int `json:"status"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//统计表格输出
|
|
|
|
|
type StaticsOut struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Key string `json:"name"`
|
|
|
|
|
Group string `json:"group"` //归属集团
|
|
|
|
|
GroupName string `json:"groupname"` //归属集团名称
|
|
|
|
|
DeaprtId string `json:"deaprtid"` //部门ID
|
|
|
|
|
DeaprtName string `json:"deaprtname"` //部门名称
|
|
|
|
|
Child []StaticsOutData `json:"child"` //考核细则
|
|
|
|
|
}
|
|
|
|
|
type StaticsOutData struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Content string `json:"content"` //指标说明
|
|
|
|
|
Unit string `json:"unit"` //单位"`
|
|
|
|
|
ReferenceScore int64 `json:"referencescore"` //标准分值"`
|
|
|
|
|
DeaprtName string `json:"deaprtname"` //数据提交部门ID
|
|
|
|
|
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
|
|
|
|
|
CycleAttres int `json:"cycleattr"` //辅助计数"`
|
|
|
|
|
StatisticsData []float64 `json:"statisticsdata"` //统计值
|
|
|
|
|
Child []StaticsOutData `json:"child"` //考核细则
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type OrgStatics struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Child []OrgStaticsDepary `json:"child"` //考核细则
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type OrgStaticsDepary struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Child []ProgrammeStatisticsCallBack `json:"child"` //考核细则
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//方案统计回显
|
|
|
|
|
type ProgrammeStatisticsCallBack struct {
|
|
|
|
|
Id string `json:"id"` //维度ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
ZhiFraction int `json:"zhiFraction"`
|
|
|
|
|
Child []EvaluProssCall `json:"child"` //考核细则
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//指标
|
|
|
|
|
type EvaluProssCall struct {
|
|
|
|
|
Id string `json:"id"` //指标ID
|
|
|
|
|
Name string `json:"name"` //指标名称
|
|
|
|
|
Content string `json:"content"` //指标说明
|
|
|
|
|
Unit string `json:"unit"` //单位"`
|
|
|
|
|
ReferenceScore int64 `json:"referencescore"` //标准分值"`
|
|
|
|
|
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
|
|
|
|
|
CycleAttres int `json:"cycleattr"` //辅助计数"`
|
|
|
|
|
ExecuteDepart []string `json:"executedepart"` //执行部门
|
|
|
|
|
TimeData []float64 `json:"timedata"` //统计结果
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//考核方案细则列表输出
|
|
|
|
|
type TargetContOutCont struct {
|
|
|
|
|
Id string `json:"id"`
|
|
|
|
|
Type int `json:"type"`
|
|
|
|
|
Group string `json:"group"`
|
|
|
|
|
GroupName string `json:"groupname"`
|
|
|
|
|
DepartmentId string `json:"departmentid"`
|
|
|
|
|
DepartmentName string `json:"departmentname"`
|
|
|
|
|
Dimension string `json:"dimension"` //维度ID
|
|
|
|
|
DimensionName string `json:"dimensionname"` //维度名称
|
|
|
|
|
DimensionWeight int64 `json:"dimensionweight"` //维度权重
|
|
|
|
|
Target string `json:"target"` //指标Id
|
|
|
|
|
TargetName string `json:"targetname"` //指标名称
|
|
|
|
|
TargetCont string `json:"targetcont"` //指标描述
|
|
|
|
|
TargetWeight int64 `json:"targetweight"` //指标权重
|
|
|
|
|
Unit string `json:"unit"` //单位"`
|
|
|
|
|
ReferenceScore int64 `json:"referencescore"` //标准分值"`
|
|
|
|
|
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
|
|
|
|
|
CycleAttres int `json:"cycleattr"` //辅助计数"`
|
|
|
|
|
Score []ScoreList `json:"score"` //得分
|
|
|
|
|
ExecutiveDepartment []string `json:"executivedepartment"` //执行部门
|
|
|
|
|
ScoreAllList []ScoreListAry `json:"scorealllist"`
|
|
|
|
|
StatisticsName []string `json:"statisticsname"` //执行部门
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ScoreList struct {
|
|
|
|
|
Class int `json:"class"` //统计类型
|
|
|
|
|
ScoreVal float64 `json:"scoreval"` //原始值
|
|
|
|
|
AllPrize float64 `json:"allprize"` //全奖值
|
|
|
|
|
ZeroPrize float64 `json:"zeroprize"` //零奖值
|
|
|
|
|
CappingVal float64 `json:"cappingval"` //封顶值
|
|
|
|
|
ActualScore float64 `json:"actualscore"` //实际得分
|
|
|
|
|
Achievement float64 `json:"achievement"` //达成率
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ScoreListAry struct {
|
|
|
|
|
Class int `json:"class"` //统计类型
|
|
|
|
|
ScoreVal []float64 `json:"scoreval"` //原始值
|
|
|
|
|
AllPrize []float64 `json:"allprize"` //全奖值
|
|
|
|
|
ZeroPrize []float64 `json:"zeroprize"` //零奖值
|
|
|
|
|
CappingVal []float64 `json:"cappingval"` //封顶值
|
|
|
|
|
ActualScore []float64 `json:"actualscore"` //实际得分
|
|
|
|
|
Achievement []float64 `json:"achievement"` //达成率
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//协程表格统计
|
|
|
|
|
type TableScoreList struct {
|
|
|
|
|
Counter int `json:"counter"` //计数器
|
|
|
|
|
ScoreList
|
|
|
|
|
ExecutiveDepartment []string `json:"executivedepartment"` //执行部门
|
|
|
|
|
}
|