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

146 lines
11 KiB

package assessmentmodel
import (
"strings"
"gin_server_admin/global"
)
// 分数流水
type ScoreFlow struct {
Id int64 `json:"id" gorm:"primaryKey;column:sf_id;type:bigint(20) unsigned;not null;comment:Id"`
EvaluationPlan int64 `json:"evaluationplan" gorm:"column:sf_evaluation_plan;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"`
PlusReduceScore int `json:"plusreducescore" gorm:"column:sf_plus_reduce_score;type:tinyint(1) unsigned;default:1;not null;comment:1:加分;2:减分"`
Score int64 `json:"score" gorm:"column:sf_score;type:bigint(20) unsigned;default:0;not null;comment:分值(乘100录入)"`
Key int64 `json:"key" gorm:"column:sf_key;type:bigint(20) unsigned;default:0;not null;comment:识别标志"`
Reason string `json:"reason" gorm:"column:sf_reason;type:mediumtext;comment:操作原因"`
Content string `json:"content" gorm:"column:sf_content;type:mediumtext;comment:操作结构体"`
Time int64 `json:"time" gorm:"column:sf_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eitetime" gorm:"column:sf_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"`
EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:sf_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"`
EvaluationUser int64 `json:"evaluationuser" gorm:"column:sf_evaluation_user;type:bigint(20) unsigned;default:0;not null;comment:测评人"`
EvaluationGroup int64 `json:"evaluationgroup" gorm:"column:sf_evaluation_group;type:bigint(20) unsigned;default:0;not null;comment:测评集团"`
Year int64 `json:"year" gorm:"column:sf_year;type:int(7) unsigned;default:0;not null;comment:年分"`
Quarter int64 `json:"quarter" gorm:"column:sf_quarter;type:int(2) unsigned;default:0;not null;comment:季度"`
Month int64 `json:"month" gorm:"column:sf_month;type:int(2) unsigned;default:0;not null;comment:月"`
Week int64 `json:"week" gorm:"column:sf_week;type:int(5) unsigned;default:0;not null;comment:周"`
Enclosure string `json:"enclosure" gorm:"column:sf_enclosure;type:longtext;comment:附件"`
DutyGroup int64 `json:"dutygroup" gorm:"column:sf_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"`
DutyDepartment int64 `json:"dutydepartment" gorm:"column:sf_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"`
Reply int `json:"reply" gorm:"column:sf_reply;type:int(2) unsigned;default:1;not null;comment:状态(0:删除;1:起草;2:审批;3:通过)"`
Rectification int `json:"rectification" gorm:"column:sf_rectification;type:tinyint(1) unsigned;default:1;not null;comment:1、需要整改;2:无需整改"`
HappenTime int64 `json:"happentime" gorm:"column:sf_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"`
Count int `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"`
CorrectionTime int64 `json:"correctiontime" gorm:"column:sf_correctiontime;type:bigint(20) unsigned;default:0;not null;comment:整改期限"`
PlanVersion string `json:"planversion" gorm:"column:sf_planversion;type:varchar(255);comment:版本号"`
TargetId int64 `json:"targetid" gorm:"column:sf_target_id;type:bigint(20) unsigned;default:0;not null;comment:指标ID"`
DetailedId int64 `json:"detailedid" gorm:"column:sf_detailed_id;type:bigint(20) unsigned;default:0;not null;comment:指标细则"`
}
func (ScoreFlow *ScoreFlow) TableName() string {
return "score_flow"
}
// 划分责任 division_responsibilities
type DivisionResponsibilities struct {
Id int64 `json:"id" gorm:"primaryKey;column:df_id;type:bigint(20) unsigned;not null"`
ScoreFlow int64 `json:"scoreflow" gorm:"column:df_sf_id;type:bigint(20) unsigned;default:0;not null;comment:归属加减分关联值"`
Type int `json:"type" gorm:"column:df_type;type:tinyint(1) unsigned;default:1;not null;comment:责任类型(1、主要责任人;2、互保责任人;3、责任班组;4、责任班组长;5、主管;6、三大员;7、厂长、主任)"`
UserName string `json:"username" gorm:"column:df_user_name;type:varchar(100);comment:责任人名"`
UserKey int64 `json:"userkey" gorm:"column:df_user_key;type:bigint(20) unsigned;default:0;not null;comment:责任人KEY"`
Department int64 `json:"department" gorm:"column:df_department_id;type:bigint(20) unsigned;default:0;not null;comment:责任人部门"`
Group int64 `json:"group" gorm:"column:df_group;type:bigint(20) unsigned;default:0;not null;comment:责任人集团"`
Tema int64 `json:"tema" gorm:"column:df_tema;type:bigint(20) unsigned;default:0;not null;comment:责任人班组"`
Weight int64 `json:"weight" gorm:"column:df_weight;type:int(7) unsigned;default:0;not null;comment:比重"`
Time int64 `json:"time" gorm:"column:df_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eitetime" gorm:"column:df_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"`
DistributionUser int64 `json:"distributionuser" gorm:"column:df_distribution_user;type:bigint(20) unsigned;default:0;not null;comment:分配任key"`
EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:df_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"`
EvaluationUser int64 `json:"evaluationuser" gorm:"column:df_evaluation_user;type:bigint(20) unsigned;default:0;not null;comment:测评人"`
EvaluationGroup int64 `json:"evaluationgroup" gorm:"column:df_evaluation_group;type:bigint(20) unsigned;default:0;not null;comment:测评集团"`
}
func (DivisionResponsibilities *DivisionResponsibilities) TableName() string {
return "division_responsibilities"
}
// 流程步进器
type EvaluationProcess struct {
Id int64 `json:"id" gorm:"primaryKey;column:ep_id;type:bigint(20) unsigned;not null"`
OrderKey int64 `json:"orderkey" gorm:"column:ep_order_key;type:bigint(20) unsigned;default:0;not null;comment:发起表单key"`
Step int `json:"step" gorm:"column:ep_step;type:int(7) unsigned;default:1;not null;comment:当前执行到第几部"`
Content string `json:"content" gorm:"column:ep_cont;type:longtext;comment:流程步进值"`
NextContent string `json:"nextcontent" gorm:"column:ep_next_cont;type:mediumtext;comment:下一步内容"`
Time int64 `json:"time" gorm:"column:ep_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
State int `json:"state" gorm:"column:ep_state;type:int(2) unsigned;default:1;not null;comment:1:起草,2:审批中;3:通过;4:驳回"`
RoleGroup int64 `json:"rolegroup" gorm:"column:ep_role_group;type:bigint(20) unsigned;default:0;not null;comment:角色组"`
TypeClass int `json:"type" gorm:"column:ep_type;type:tinyint(1) unsigned;default:1;not null;comment:1、定性;2、定量"`
Participants string `json:"participants" gorm:"column:ep_participants;type:mediumtext;comment:参与人"`
StartTime int64 `json:"starttime" gorm:"column:ep_start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"`
NextStep int `json:"nextstep" gorm:"column:ep_next_step;type:int(7) unsigned;default:1;not null;comment:下一步"`
NextExecutor string `json:"nextexecutor" gorm:"column:ep_next_executor;type:mediumtext;comment:下一步执行人"`
SetupDepartment int64 `json:"setupdepartment" gorm:"column:ep_setup_department;type:bigint(20) unsigned;default:0;not null;comment:发起部门"`
Dimension string `json:"dimension" gorm:"column:ep_dimension;type:mediumtext;comment:维度"`
Target string `json:"target" gorm:"column:ep_target;type:mediumtext;comment:指标"`
DetailedTarget string `json:"detailedtarget" gorm:"column:ep_detailedtarget;type:mediumtext;comment:指标细则"`
AcceptDepartment int64 `json:"acceptdepartment" gorm:"column:ep_accept_department;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"`
HappenTime int64 `json:"happentime" gorm:"column:ep_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"`
}
func (EvaluationProcess *EvaluationProcess) TableName() string {
return "evaluation_process"
}
// 整改单具
type RectificationMeasures struct {
Id int64 `json:"id" gorm:"primaryKey;column:rm_id;type:bigint(20) unsigned;not null"`
UserKey int64 `json:"userkey" gorm:"column:rm_user_key;type:bigint(20) unsigned;default:0;not null;comment:整改人"`
Department int64 `json:"department" gorm:"column:rm_department;type:bigint(20) unsigned;default:0;not null;comment:整改部门"`
Group int64 `json:"group" gorm:"column:rm_group;type:bigint(20) unsigned;default:0;not null;comment:集团"`
OrderKey int64 `json:"order" gorm:"column:rm_order;type:bigint(20) unsigned;default:0;not null;comment:订单ID"`
State int `json:"state" gorm:"column:rm_state;type:int(1) unsigned;default:1;not null;comment:1:草果;2:审批中;3:不合格;4:合格"`
Time int64 `json:"time" gorm:"column:rm_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eitetime" gorm:"column:rm_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"`
Content string `json:"content" gorm:"column:rm_content;type:longtext;comment:整改内容"`
Enclosure string `json:"enclosure" gorm:"column:rm_files;type:longtext;comment:附件"`
}
func (RectificationMeasures *RectificationMeasures) TableName() string {
return "rectification_measures"
}
// 挂号
type Register struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null"`
Number int64 `json:"userkey" gorm:"column:number;type:bigint(20) unsigned;default:0;not null;comment:号码"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:1:正常;2:已经使用"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
}
func (Register *Register) TableName() string {
return "register"
}
// 添加
func (r *Register) AddCont() (err error) {
err = global.GVA_DB_Performanceappraisal.Create(&r).Error
return
}
// 编辑内容
func (r *Register) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
err = global.GVA_DB_Performanceappraisal.Model(&r).Where(whereMap).Updates(saveData).Error
return
}
// 获取内容
func (r *Register) GetCont(whereMap interface{}, field ...string) (err error) {
gormDb := global.GVA_DB_Performanceappraisal.Model(&r)
if len(field) > 0 {
fieldStr := strings.Join(field, ",")
gormDb = gormDb.Select(fieldStr)
}
gormDb = gormDb.Where(whereMap)
err = gormDb.First(&r).Error
return
}