15 changed files with 666 additions and 26 deletions
Binary file not shown.
@ -0,0 +1,73 @@ |
|||
package models |
|||
|
|||
//个人信息主表
|
|||
type WorkMan struct { |
|||
Id int64 `json:"id" gorm:"column:wm_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"` |
|||
Number string `json:"number" gorm:"column:wm_number;type:varchar(10);not null;comment:员工编号"` |
|||
Password string `json:"pwd" gorm:"column:wm_pwd;type:varchar(50);not null;comment:密码"` |
|||
DepartmentId int64 `json:"departmentid" gorm:"column:wm_bf_id;type:bigint(20) unsigned;default:0;not null;comment:分厂"` |
|||
WorkshopId int64 `json:"workshopid" gorm:"column:wm_ws_id;type:bigint(20) unsigned;default:0;not null;comment:工段"` |
|||
PostId int64 `json:"postid" gorm:"column:wm_pt_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` |
|||
Key int64 `json:"key" gorm:"column:wm_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` |
|||
State int `json:"state" gorm:"column:wm_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` |
|||
HireSet int `json:"hireset" gorm:"column:wm_hire_set;type:tinyint(1) unsigned;default:1;not null;comment:雇佣状态(1:在职;2:离职)"` |
|||
Time int64 `json:"time" gorm:"column:wm_time;type:bigint(20) unsigned;default:0;not null;comment:添加事件"` |
|||
EiteTime int64 `json:"eitetime" gorm:"column:wm_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改事件"` |
|||
UserId int64 `json:"userid" gorm:"column:wm_user_id;type:bigint(50) unsigned;default:0;not null;comment:录入人"` |
|||
QuitTime int64 `json:"quitime" gorm:"column:wm_quit_time;type:bigint(20) unsigned;default:0;not null"` |
|||
Group int64 `json:"group" gorm:"column:wm_group;type:bigint(20) unsigned;default:0;not null;comment:集团公司"` |
|||
Soptcheck int `json:"soptcheck" gorm:"column:wm_soptcheck;type:tinyint(1) unsigned;default:1;not null"` |
|||
Tema int64 `json:"tema" gorm:"column:wm_tema;type:bigint(20) unsigned;default:0;not null;comment:班组"` |
|||
IsOne int `json:"isone" gorm:"column:wm_one;type:tinyint(1) unsigned;default:1;not null;comment:第一次登陆"` |
|||
WorkWechatId string `json:"workwechatid" gorm:"column:qywx_key;type:varchar(255);not null;comment:企业微信KEY"` |
|||
WechatId string `json:"wechatid" gorm:"column:wx_key;type:varchar(255);not null;comment:微信KEY"` |
|||
} |
|||
|
|||
func (WorkMan *WorkMan) TableName() string { |
|||
return "worker_man" |
|||
} |
|||
|
|||
//个人信息附表
|
|||
type WorkManAttribute struct { |
|||
KeyAttr int64 `json:"key" gorm:"column:wmd_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别符"` |
|||
Name string `json:"name" gorm:"column:wmd_name;type:varchar(50);not null;comment:姓名"` |
|||
Gender int `json:"gender" gorm:"column:wmd_gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男;2:女)"` |
|||
Age int `json:"age" gorm:"column:wmd_age;type:tinyint(3) unsigned;default:1;not null;comment:年龄"` |
|||
Tel string `json:"tel" gorm:"column:wmd_tel;type:varchar(25);not null;comment:联系方式"` |
|||
Category int `json:"category" gorm:"column:wmd_category;type:tinyint(1) unsigned;default:1;not null;comment:人员类别(1:正式工;2:合同工;3:实习生)"` |
|||
CertificatesType int `json:"certificatesType" gorm:"column:wmd_certificates_type;type:tinyint(1) unsigned;default:1;not null;comment:证件类型(1:身份证;2:驾驶证;3:军人证;4:护照;5:居住证)"` |
|||
CertificatesNum string `json:"certificatesNum" gorm:"column:wmd_certificates_number;type:varbinary(50);comment:证件编号"` |
|||
Birthday int64 `json:"birthday" gorm:"column:wmd_birthday;type:bigint(20) unsigned;default:0;not null;comment:出生日期"` |
|||
EntryTime int64 `json:"entryTime" gorm:"column:wmd_entry_time;type:bigint(20) unsigned;default:0;not null;comment:入职日期"` |
|||
QuitTimeAttr int64 `json:"quitTime" gorm:"column:wmd_quit_time;type:bigint(20) unsigned;default:0;not null;comment:离职日期"` |
|||
EiteTimeAttr int64 `json:"eiteTime" gorm:"column:wmd_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` |
|||
Addrest string `json:"addrest" gorm:"column:wmd_addrest;type:varchar(255);comment:家庭住址"` |
|||
Icon string `json:"icon" gorm:"column:wmd_icon;type:varchar(255);comment:照片"` |
|||
NickName string `json:"nickName" gorm:"column:wmd_nickname;type:varchar(255);comment:昵称"` |
|||
} |
|||
|
|||
func (WorkManAttribute *WorkManAttribute) TableName() string { |
|||
return "worker_man_data" |
|||
} |
|||
|
|||
//个人详细信息
|
|||
type PersonalDetails struct { |
|||
WorkMan |
|||
WorkManAttribute |
|||
} |
|||
|
|||
//Redis身份识别
|
|||
type RedisUserInfo struct { |
|||
Id string `json:"id"` |
|||
Number string `json:"number"` |
|||
DepartmentId string `json:"departmentid"` |
|||
WorkshopId string `json:"workshopid"` |
|||
PostId string `json:"postid"` |
|||
Key string `json:"key"` |
|||
Group string `json:"group"` |
|||
Tema string `json:"tema"` |
|||
WorkWechatId string `json:"workwechatid"` |
|||
WechatId string `json:"wechatid"` |
|||
Name string `json:"name"` |
|||
NickName string `json:"nickname"` |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package models |
|||
|
|||
//企业微信人员架构
|
|||
type WechatUsers struct { |
|||
Uid int64 `json:"uid" gorm:"column:u_id;type:bigint(20) unsigned;default:0;not null;comment:id"` |
|||
Userid string `json:"userid" gorm:"column:userid;type:varchar(255);not null;comment:wechat user id企业微信用户ID"` |
|||
Name string `json:"name" gorm:"column:name;type:varchar(100);not null;comment:姓名"` |
|||
Department string `json:"department" gorm:"column:department;type:text;comment:归属部门json"` |
|||
Position string `json:"position" gorm:"column:position;type:varchar(255);not null;comment:企业微信职务"` |
|||
Mobile string `json:"mobile" gorm:"column:mobile;type:varchar(100);not null;comment:企业微信电话"` |
|||
Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别。1表示男性,2表示女性"` |
|||
Email string `json:"email" gorm:"column:email;type:varchar(255);not null;comment:邮箱"` |
|||
Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255);not null;comment:员工头像"` |
|||
Status int `json:"status" gorm:"column:status;type:tinyint(1) unsigned;default:1;not null;comment:激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。"` |
|||
Extattr string `json:"extattr" gorm:"column:extattr;type:mediumtext;comment:企业微信员工扩展属性"` |
|||
MainDepartment int64 `json:"main_department" gorm:"column:main_department;type:int(8) unsigned;default:0;not null;comment:主部门"` |
|||
QrCode string `json:"qr_code" gorm:"column:qr_code;type:text;comment:员工个人二维码,扫描可添加为外部联系人(注意返回的是一个url,可在浏览器上打开该url以展示二维码);第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取"` |
|||
IsLeaderInDept string `json:"is_leader_in_dept" gorm:"column:is_leader_in_dept;type:text;comment:表示在所在的部门内是否为上级。0-否;1-是。是一个列表,数量必须与department一致。第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取"` |
|||
ThumbAvatar string `json:"thumb_avatar" gorm:"column:thumb_avatar;type:varchar(255);not null;comment:头像缩略图url"` |
|||
UserNumber string `json:"user_number" gorm:"column:user_number;type:varchar(8);not null;comment:工号"` |
|||
SysBf int64 `json:"sys_bf" gorm:"column:sys_bf;type:int(20) unsigned;default:0;not null;comment:系统分厂"` |
|||
SysWs int64 `json:"sys_ws" gorm:"column:sys_ws;type:int(20) unsigned;default:0;not null;comment:系统工段"` |
|||
SysPs int64 `json:"sys_ps" gorm:"column:sys_ps;type:int(20) unsigned;default:0;not null;comment:系统职务"` |
|||
WmTema int64 `json:"wm_tema" gorm:"column:wm_tema;type:int(20) unsigned;default:0;not null;comment:系统班组"` |
|||
IsAdmin int `json:"is_admin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:管理员1、否;2:是"` |
|||
IsRole int64 `json:"is_role" gorm:"column:is_role;type:int(20) unsigned;default:0;not null;comment:角色"` |
|||
Pwd string `json:"pwd" gorm:"column:pwd;type:varchar(255);not null;comment:密码"` |
|||
Time int64 `json:"time" gorm:"column:time;type:int(20) unsigned;default:0;not null;comment:写入时间"` |
|||
} |
|||
|
|||
func (WechatUsers *WechatUsers) TableName() string { |
|||
// return "wechatusers_es"
|
|||
return "wechatusers" |
|||
} |
|||
Loading…
Reference in new issue