Performance.go 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package Performance
  2. import (
  3. db "ERP_salary/initialize"
  4. "time"
  5. )
  6. var (
  7. DeviceTypeMap = map[string]string{
  8. "X": "箱",
  9. "G": "柜",
  10. "C": "车",
  11. "K": "库",
  12. "XT": "系统",
  13. "WZ": "位置",
  14. "PX": "培训",
  15. "XJ": "巡检",
  16. "QT": "其他",
  17. }
  18. )
  19. type Perf struct {
  20. Id int `json:"Id" gorm:"primaryKey;autoIncrement;comment:主键编码"` // 主键编码
  21. T_date string `json:"T_date" gorm:"size:128"` // 所属月份
  22. T_submit string `json:"T_submit" gorm:"size:128"` // 员工
  23. T_workload float64 `json:"T_workload" gorm:"type:decimal(10,1)"` // 工作量
  24. T_audit int `json:"T_audit" gorm:"size:4"` // 审核状态 待提交1 已提交2 已打款3
  25. T_assess_points int `json:"T_assess_points" gorm:"size:4"`
  26. T_perf float64 `json:"T_perf" gorm:"type:decimal(10,1)"` // 绩效金额
  27. T_performance_target_id int `json:"T_performance_target_id" gorm:"size:11;comment:工资级别id"`
  28. T_State int `json:"T_State" gorm:"column:t__state;size(2);default(1)"` // 0 删除(伪删除) 1 正常
  29. CreateTime db.Time `json:"CreateTime" gorm:"column:create_time;autoCreateTime;comment:创建时间"` // 创建时间
  30. UpdateTime db.Time `json:"UpdateTime" gorm:"column:update_time;autoUpdateTime;comment:最后更新时间"` // 最后更新时间
  31. T_submit_name string `json:"T_submit_name" gorm:"-"` // 员工名称
  32. // 关联的绩效点列表
  33. PointList []PerfPoint `json:"PointList" gorm:"foreignKey:T_performance_id"`
  34. Target PerformanceTarget `json:"Target" gorm:"foreignKey:T_performance_target_id"`
  35. }
  36. // 绩效点详情
  37. type PerfPoint struct {
  38. Id int `json:"Id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
  39. T_performance_id int `json:"T_performance_id" gorm:"size:11;comment:绩效记录ID"`
  40. T_performance_points_id int `json:"T_performance_points_id" gorm:"size:11;comment:绩效点ID"`
  41. T_quantity int `json:"T_quantity" gorm:"size:11;comment:数量"`
  42. T_points_numerator int `json:"T_points_numerator" gorm:"size:4;comment:绩效点分子"`
  43. T_points_denominator int `json:"T_points_denominator" gorm:"size:4;comment:绩效点分母"`
  44. T_type string `json:"T_type" gorm:"size:50;comment:工作类型"` // 工作类型: reporting 或 collection
  45. T_remark string `json:"T_remark" gorm:"size:text;comment:备注"`
  46. T_State int `json:"T_State" gorm:"column:t__state;size(2);default(1)"` // 0 删除(伪删除) 1 正常
  47. CreateTime db.Time `json:"CreateTime" gorm:"column:create_time;autoCreateTime;comment:创建时间"` // 创建时间
  48. UpdateTime db.Time `json:"UpdateTime" gorm:"column:update_time;autoUpdateTime;comment:最后更新时间"` // 最后更新时间
  49. // 关联的绩效点信息
  50. PerformancePoints PerformancePoints `json:"PerformancePoints" gorm:"foreignKey:T_performance_points_id"`
  51. }
  52. func (e *PerfPoint) TableName() string {
  53. return "perf_point"
  54. }
  55. type VerifyTask struct {
  56. Id int `orm:"column(ID);size(11);auto;pk"`
  57. T_Distributor_id string `orm:"size(256);null"` // 分销商id
  58. T_task_id string `orm:"size(256);null"` // 任务ID
  59. T_uuid string `orm:"size(256);null"` // 用户 UUID
  60. T_name string `orm:"size(256);null"` // 标题
  61. T_scheme string `orm:"size(256);null"` // 实施方案 负责人UUID
  62. T_collection string `orm:"size(256);null"` // 数据采集 负责人UUID
  63. T_reporting string `orm:"size(256);null"` // 报告编写 负责人UUID
  64. T_delivery string `orm:"size(256);null"` // 交付审核 负责人UUID
  65. T_scheme_state int `orm:"size(2);default(0)"` // 实施方案 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
  66. T_reporting_state int `orm:"size(2);default(0)"` // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
  67. T_State int `orm:"size(2);default(1)"` // 0 删除 1 正常
  68. T_device_type string `orm:"size(256);null"` // 设备类型
  69. T_verify_type string `orm:"size(256);null"` // 验证类型
  70. T_reporting_pass_time string `orm:"size(256);null"` // 验证报告负责人通过时间
  71. T_device_quantity int `orm:"size(2);default(0)"` // 终端数量
  72. CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now_add"` //auto_now_add 第一次保存时才设置时间
  73. UpdateTime time.Time `orm:"column(update_time);type(timestamp);null;auto_now"` //auto_now 每次 model 保存时都会对时间自动更新
  74. }
  75. func (e *Perf) TableName() string {
  76. return "perf"
  77. }