1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- package Performance
- import (
- db "ERP_salary/initialize"
- "time"
- )
- var (
- DeviceTypeMap = map[string]string{
- "X": "箱",
- "G": "柜",
- "C": "车",
- "K": "库",
- "XT": "系统",
- "WZ": "位置",
- "PX": "培训",
- "XJ": "巡检",
- "QT": "其他",
- }
- )
- type Perf struct {
- Id int `json:"Id" gorm:"primaryKey;autoIncrement;comment:主键编码"` // 主键编码
- T_date string `json:"T_date" gorm:"size:128"` // 所属月份
- T_submit string `json:"T_submit" gorm:"size:128"` // 员工
- T_workload float64 `json:"T_workload" gorm:"type:decimal(10,1)"` // 工作量
- T_audit int `json:"T_audit" gorm:"size:4"` // 审核状态 待提交1 已提交2 已打款3
- T_assess_points int `json:"T_assess_points" gorm:"size:4"`
- T_perf float64 `json:"T_perf" gorm:"type:decimal(10,1)"` // 绩效金额
- T_performance_target_id int `json:"T_performance_target_id" gorm:"size:11;comment:工资级别id"`
- T_State int `json:"T_State" gorm:"column:t__state;size(2);default(1)"` // 0 删除(伪删除) 1 正常
- CreateTime db.Time `json:"CreateTime" gorm:"column:create_time;autoCreateTime;comment:创建时间"` // 创建时间
- UpdateTime db.Time `json:"UpdateTime" gorm:"column:update_time;autoUpdateTime;comment:最后更新时间"` // 最后更新时间
- T_submit_name string `json:"T_submit_name" gorm:"-"` // 员工名称
- // 关联的绩效点列表
- PointList []PerfPoint `json:"PointList" gorm:"foreignKey:T_performance_id"`
- Target PerformanceTarget `json:"Target" gorm:"foreignKey:T_performance_target_id"`
- }
- // 绩效点详情
- type PerfPoint struct {
- Id int `json:"Id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
- T_performance_id int `json:"T_performance_id" gorm:"size:11;comment:绩效记录ID"`
- T_performance_points_id int `json:"T_performance_points_id" gorm:"size:11;comment:绩效点ID"`
- T_quantity int `json:"T_quantity" gorm:"size:11;comment:数量"`
- T_points_numerator int `json:"T_points_numerator" gorm:"size:4;comment:绩效点分子"`
- T_points_denominator int `json:"T_points_denominator" gorm:"size:4;comment:绩效点分母"`
- T_type string `json:"T_type" gorm:"size:50;comment:工作类型"` // 工作类型: reporting 或 collection
- T_remark string `json:"T_remark" gorm:"size:text;comment:备注"`
- T_State int `json:"T_State" gorm:"column:t__state;size(2);default(1)"` // 0 删除(伪删除) 1 正常
- CreateTime db.Time `json:"CreateTime" gorm:"column:create_time;autoCreateTime;comment:创建时间"` // 创建时间
- UpdateTime db.Time `json:"UpdateTime" gorm:"column:update_time;autoUpdateTime;comment:最后更新时间"` // 最后更新时间
- // 关联的绩效点信息
- PerformancePoints PerformancePoints `json:"PerformancePoints" gorm:"foreignKey:T_performance_points_id"`
- }
- func (e *PerfPoint) TableName() string {
- return "perf_point"
- }
- type VerifyTask struct {
- Id int `orm:"column(ID);size(11);auto;pk"`
- T_Distributor_id string `orm:"size(256);null"` // 分销商id
- T_task_id string `orm:"size(256);null"` // 任务ID
- T_uuid string `orm:"size(256);null"` // 用户 UUID
- T_name string `orm:"size(256);null"` // 标题
- T_scheme string `orm:"size(256);null"` // 实施方案 负责人UUID
- T_collection string `orm:"size(256);null"` // 数据采集 负责人UUID
- T_reporting string `orm:"size(256);null"` // 报告编写 负责人UUID
- T_delivery string `orm:"size(256);null"` // 交付审核 负责人UUID
- T_scheme_state int `orm:"size(2);default(0)"` // 实施方案 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
- T_reporting_state int `orm:"size(2);default(0)"` // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
- T_State int `orm:"size(2);default(1)"` // 0 删除 1 正常
- T_device_type string `orm:"size(256);null"` // 设备类型
- T_verify_type string `orm:"size(256);null"` // 验证类型
- T_reporting_pass_time string `orm:"size(256);null"` // 验证报告负责人通过时间
- T_device_quantity int `orm:"size(2);default(0)"` // 终端数量
- CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now_add"` //auto_now_add 第一次保存时才设置时间
- UpdateTime time.Time `orm:"column(update_time);type(timestamp);null;auto_now"` //auto_now 每次 model 保存时都会对时间自动更新
- }
- func (e *Perf) TableName() string {
- return "perf"
- }
|