绩效考核
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.
 
 
 

324 lines
11 KiB

package statistics
import (
"sync"
"gin_server_admin/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 TranscriptTableData struct {
ScoreStatistics []TranscriptTableDateList
Defen []defenfenxi
mutext sync.RWMutex
}
// 读取成绩表锁数据
func (t *TranscriptTableData) readTranscriptData() []TranscriptTableDateList {
t.mutext.RLock()
defer t.mutext.RUnlock()
return t.ScoreStatistics
}
// 数据锁统计
type dataLockStatistics struct {
outData []TargetContOutCont
mutext sync.RWMutex
}
// 读取锁数据
func (d *dataLockStatistics) readMyDayData() []TargetContOutCont {
d.mutext.RLock()
defer d.mutext.RUnlock()
return d.outData
}
// 计算部门每月成绩分数
type countEveryDepartmentMonthScore struct {
outData []everyDepartmentScore
mutext sync.RWMutex
}
// 部门月分数
type everyDepartmentScore struct {
MonthVal int64 `json:"monthval"`
Score float64 `json:"score"`
}
// 读取锁数据
func (c *countEveryDepartmentMonthScore) readMyDayData() []everyDepartmentScore {
c.mutext.RLock()
defer c.mutext.RUnlock()
return c.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 PlanVersioMingXi struct {
Group string `json:"group"` //归属集团
DeaprtId string `json:"deaprtid"` //部门ID
Year string `json:"year"` //年度
Title string `json:"title"` //编号
Class int `json:"class"` //状态
Month int `json:"month"` //月
}
// 考核方案版本列表查询输出
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"` //执行部门
ManualGear int `json:"manualgear"` //1:自动;2:手动
}
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"` //执行部门
}
type TongjiFenShu struct {
Score float64 `json:"score" gorm:"column:sf_score;type:bigint(20) unsigned;default:0;not null;comment:分值(乘100录入)"`
Count float64 `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"`
}
type banNian struct {
Month []int `json:"month"`
}
// 定量流水全奖值、零奖值、封顶值
type FlowLogAllZreo struct {
Id string `json:"id"`
TargetId string `json:"targetid"` //指标ID`
Zeroprize float64 `json:"zeroprize"` //零奖值"`
Allprize float64 `json:"allprize"` //全奖值"`
Capping float64 `json:"capping"` //封顶值"`
}
type FlowDataLogList struct {
assessmentmodel.FlowLogData
Key int64 `json:"key" gorm:"column:fld_flow_log;type:bigint(20) unsigned;default:0;not null;comment:识别标志"`
Score int64 `json:"score" gorm:"column:fld_score;type:bigint(20) unsigned;default:0;not null;comment:数据"`
ScoringMethod int `json:"scoringmethod" gorm:"column:fld_scoring_method;type:int(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"`
ScoringScore float64 `json:"scoringscore" gorm:"column:fld_scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"`
EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:fl_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"`
}
// 绩效考核成绩表
type TranscriptTable struct {
Group string `json:"group"`
Department string `json:"department"`
Year string `year`
Month []int `json:"month"`
}
// 绩效考核成绩表结果
type TranscriptTableDateList struct {
DepartmentId string `json:"departmentid"`
Department string `json:"department"`
A float64 `json:"a"`
B float64 `json:"b"`
C float64 `json:"C"`
D float64 `json:"d"`
E float64 `json:"e"`
F float64 `json:"f"`
G float64 `json:"g"`
H float64 `json:"h"`
I float64 `json:"i"`
J float64 `json:"J"`
K float64 `json:"K"`
L float64 `json:"L"`
}
// 图标维度输出
type TranscriptTableDateListChars struct {
XLine []string `json:"xline"`
Cylindrical []string `json:"cylindrical"`
YLine []YlineData `json:"cylindricaldata"`
}
type YlineData struct {
Name string `json:"name"`
Data []float64 `json:"data"`
}
// 计算得分性质
type defenfenxi struct {
Title string `json:"title"`
TimeClass string `json:"timeclass"`
Month int64 `json:"month"`
Stroce float64 `json:"stroce"`
State int `json:"state"`
}
// 行政组织级统计
type orgShierTongji struct {
A []float64 `json:"a"`
B []float64 `json:"b"`
C []float64 `json:"C"`
D []float64 `json:"d"`
E []float64 `json:"e"`
F []float64 `json:"f"`
G []float64 `json:"g"`
H []float64 `json:"h"`
I []float64 `json:"i"`
J []float64 `json:"J"`
K []float64 `json:"K"`
L []float64 `json:"L"`
}