diff --git a/api/version1/personnelapi/mancont.go b/api/version1/personnelapi/mancont.go index 2275215..a561d41 100644 --- a/api/version1/personnelapi/mancont.go +++ b/api/version1/personnelapi/mancont.go @@ -1,11 +1,13 @@ package personnelapi import ( + "encoding/json" "fmt" "hr_server/models" "hr_server/overall" "hr_server/overall/overallhandle" "strconv" + "strings" "time" "github.com/gin-gonic/gin" @@ -62,6 +64,11 @@ func (s *StaffApi) EditManOrgCont(c *gin.Context) { if requestData.JobLeve == 0 { requestData.JobLeve = 3 } + if requestData.PersonInCharge != 1 { + requestData.PersonInCharge = 2 + } + // fmt.Printf("%v\n", requestData) + // return wher := map[string]interface{}{"`id`": requestData.Id} var myCont models.PersonArchives err = myCont.GetCont(wher, "`id`", "`admin_org`", "`position`", "`job_id`", "`job_leve`", "`teamid`") @@ -102,6 +109,30 @@ func (s *StaffApi) EditManOrgCont(c *gin.Context) { if requestData.Ruleid != ruleidStr { saveData["ruleid"] = requestData.Ruleid } + + if requestData.PersonInCharge != myCont.PersonInCharge { + saveData["person_in_charge"] = requestData.PersonInCharge + } + + if len(requestData.OrgresList) > 0 { + jsonCont, jsonErr := json.Marshal(requestData.OrgresList) + if jsonErr == nil { + saveData["responsible_department_json"] = string(jsonCont) + } + } + if len(requestData.Resallorg) > 0 { + var orgResList []string + for i := 0; i < len(requestData.Resallorg); i++ { + resAllOrgIdStr := strconv.Itoa(requestData.Resallorg[i]) + if overallhandle.IsInTrue[string](resAllOrgIdStr, orgResList) == false { + orgResList = append(orgResList, resAllOrgIdStr) + } + } + orgResListStr := strings.Join(orgResList, ",") + saveData["responsible_department"] = orgResListStr + } + // fmt.Printf("%v\n", saveData) + // return if len(saveData) < 1 { overallhandle.Result(0, saveData, c) return diff --git a/api/version1/personnelapi/staffarchives.go b/api/version1/personnelapi/staffarchives.go index b7be551..9acaa28 100644 --- a/api/version1/personnelapi/staffarchives.go +++ b/api/version1/personnelapi/staffarchives.go @@ -1,6 +1,7 @@ package personnelapi import ( + "encoding/json" "fmt" "hr_server/grocerystore" "hr_server/models" @@ -82,6 +83,10 @@ func (s *StaffApi) ArchivesList(c *gin.Context) { for _, v := range manContList { var staffInfo peopleManOutList staffInfo.ManCont = v + if v.IconPhoto != "" { + staffInfo.Icon = v.IconPhoto + } + var getSpur models.Position getWhe := overallhandle.MapOut() getWhe["id"] = v.Position @@ -133,6 +138,22 @@ func (s *StaffApi) ArchivesList(c *gin.Context) { staffInfo.WorkPostName = orgContTypeCont.Name } + // if requestData.AdminOrg == v.AdminOrg && v.PersonInCharge == 1 { + // staffInfo.PersonInCharge = 1 + // } else { + // staffInfo.PersonInCharge = 2 + // } + staffInfo.PersonInCharge = 2 + if v.PersonInCharge == 1 { + orgResList := strings.Split(v.ResponsibleDepartment, ",") + if len(orgResList) > 0 { + orgIdStr := strconv.FormatInt(requestData.AdminOrg, 10) + if overallhandle.IsInTrue[string](orgIdStr, orgResList) == true { + staffInfo.PersonInCharge = 1 + } + } + } + positionAry = append(positionAry, staffInfo) } @@ -2092,6 +2113,11 @@ func (s *StaffApi) GetArchivesCon(c *gin.Context) { postisInfo.GetCont(map[string]interface{}{"`id`": satffCont.Position}, "`name`", "`person_in_charge`") staffCenter.PositionName = postisInfo.Name staffCenter.PersonInCharge = postisInfo.PersonInCharge + if postisInfo.PersonInCharge != 1 { + staffCenter.PersonInCharge = satffCont.PersonInCharge + } + } else { + staffCenter.PersonInCharge = satffCont.PersonInCharge } if satffCont.JobClass != 0 { var jobsInfo models.JobClass @@ -2149,6 +2175,9 @@ func (s *StaffApi) GetArchivesCon(c *gin.Context) { ruleCont.GetCont(map[string]interface{}{"`id`": satffCont.Ruleid}, "`name`") staffCenter.RuleId = strconv.FormatInt(satffCont.Ruleid, 10) staffCenter.RuleName = ruleCont.Name + + jsonErr := json.Unmarshal([]byte(satffCont.ResponsibleDepartmentJson), &staffCenter.OrgresList) + fmt.Printf("satffCont---------->%v---------->%v---------->%v\n", satffCont.ResponsibleDepartmentJson, satffCont, jsonErr) overallhandle.Result(0, staffCenter, c) // return } @@ -2184,25 +2213,29 @@ func (s *StaffApi) GetPeopleMainCont(c *gin.Context) { } } var myCont models.PersonArchives - err := myCont.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`id`", "`number`", "`name`", "`icon`", "`admin_org`", "`position`", "`teamid`", "`job_id`", "`job_class`", "`job_leve`", "`wechat`", "`work_wechat`", "`key`", "`company`", "`maindeparment`", "`sun_main_deparment`", "`ruleid`") + err := myCont.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`id`", "`number`", "`name`", "`icon`", "`admin_org`", "`position`", "`teamid`", "`job_id`", "`job_class`", "`job_leve`", "`wechat`", "`work_wechat`", "`key`", "`company`", "`maindeparment`", "`sun_main_deparment`", "`ruleid`", "`icon_photo`") if err != nil { overallhandle.Result(107, requestData, c) return } + // fmt.Printf("员工信息-------->%v\n", myCont) var myInfo MyMainCont myInfo.Id = strconv.FormatInt(myCont.Id, 10) myInfo.Key = strconv.FormatInt(myCont.Key, 10) //员工key myInfo.Number = myCont.Number //员工工号 myInfo.Name = myCont.Name //姓名 myInfo.Icon = myCont.Icon //头像 - myInfo.AdminOrg = myCont.AdminOrg //所属行政组织 - myInfo.TeamId = myCont.TeamId //班组 - myInfo.Position = myCont.Position //职位 - myInfo.JobClass = myCont.JobClass //职务分类 - myInfo.JobId = myCont.JobId //职务 - myInfo.JobLeve = myCont.JobLeve //职务等级 - myInfo.Wechat = myCont.Wechat //微信UserId"` - myInfo.WorkWechat = myCont.WorkWechat //`企业微信UserId"` + if myCont.IconPhoto != "" { + myInfo.Icon = myCont.IconPhoto + } + myInfo.AdminOrg = myCont.AdminOrg //所属行政组织 + myInfo.TeamId = myCont.TeamId //班组 + myInfo.Position = myCont.Position //职位 + myInfo.JobClass = myCont.JobClass //职务分类 + myInfo.JobId = myCont.JobId //职务 + myInfo.JobLeve = myCont.JobLeve //职务等级 + myInfo.Wechat = myCont.Wechat //微信UserId"` + myInfo.WorkWechat = myCont.WorkWechat //`企业微信UserId"` if myCont.Company != 0 { var comCont models.AdministrativeOrganization comCont.GetCont(map[string]interface{}{"`id`": myCont.Company}, "`name`") diff --git a/api/version1/personnelapi/type.go b/api/version1/personnelapi/type.go index 459f615..73f86c1 100644 --- a/api/version1/personnelapi/type.go +++ b/api/version1/personnelapi/type.go @@ -316,6 +316,8 @@ type staffArchivesCont struct { AllOrgList []int64 `json:"allorglist"` //全行政组织 RuleId string `json:"ruleid"` //轮询规则ID RuleName string `json:"rulename"` //轮询规则名称 + // PersonInCharge int `json:"personincharge"` //负责人(1:是;2:否) + OrgresList [][]int `json:"orgreslist"` //负责部门列表json } // 双职工 diff --git a/api/version1/personnelapi/types.go b/api/version1/personnelapi/types.go index f3d10f3..c6a6076 100644 --- a/api/version1/personnelapi/types.go +++ b/api/version1/personnelapi/types.go @@ -182,15 +182,21 @@ type outWorkHistory struct { //编辑人员行政组织关系 type EditOrgPeople struct { - Id string `json:"id"` - OrgId int64 `json:"orgid"` //行政组织 - Position int64 `json:"position"` //岗位 - TeamId int64 `json:"teamid"` //班组 - JobId int64 `json:"jobid"` //职务 - JobLeve int64 `json:"jobleve"` //职务等级 - Ruleid string `json:"ruleid"` //排班规则 + Id string `json:"id"` + OrgId int64 `json:"orgid"` //行政组织 + Position int64 `json:"position"` //岗位 + TeamId int64 `json:"teamid"` //班组 + JobId int64 `json:"jobid"` //职务 + JobLeve int64 `json:"jobleve"` //职务等级 + Ruleid string `json:"ruleid"` //排班规则 + PersonInCharge int `json:"personInCharge"` //部门负责人(1:是;2:否) + OrgresList [][]int `json:"orgreslist"` //负责部门列表json + Resallorg []int `json:"resallorg"` //负责部门列表 } +// type OrgresListStruct struct{ +// []int +// } //编辑人员主体信息 type EditContData struct { Id string `json:"id"` diff --git a/models/man_cont.go b/models/man_cont.go index 41c865e..0b4cc47 100644 --- a/models/man_cont.go +++ b/models/man_cont.go @@ -6,59 +6,63 @@ import ( ) type ManCont struct { - Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` - Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` - Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` - Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` - HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` - EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)"` - Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` - MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` - SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_department;type:bigint(20) unsigned;default:0;not null;comment:二级主部门"` - Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` - AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` - TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` - Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` - JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` - JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` - JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` - Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` - EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` - Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` - WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` - State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` - Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` - IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` - Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` - Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` - Idcardno string `json:"idcardno" gorm:"column:idcardno;type:varchar(50) unsigned;default:'';not null;comment:身份证号"` - Passportno string `json:"passportno" gorm:"column:passportno;type:varchar(50) unsigned;default:'';not null;comment:护照号码"` - Globalroaming string `json:"globalroaming" gorm:"column:globalroaming;type:varchar(50) unsigned;default:'';not null;comment:国际区号"` - Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` - Email string `json:"email" gorm:"column:email;type:varchar(255) unsigned;default:'';not null;comment:电子邮件"` - Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` - Birthday int64 `json:"birthday" gorm:"column:birthday;type:bigint(20) unsigned;default:0;not null;comment:birthday"` - Myfolk string `json:"myfolk" gorm:"column:myfolk;type:varchar(50) unsigned;default:'';not null;comment:民族"` - Nativeplace string `json:"nativeplace" gorm:"column:nativeplace;type:varchar(255) unsigned;default:'';not null;comment:籍贯"` - Idcardstartdate int64 `json:"idcardstartdate" gorm:"column:idcardstartdate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期开始"` - Idcardenddate int64 `json:"idcardenddate" gorm:"column:idcardenddate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期结束"` - Idcardaddress string `json:"idcardaddress" gorm:"column:idcardaddress;type:varchar(255) unsigned;default:'';not null;comment:身份证地址"` - IdcardIssued string `json:"idcardIssued" gorm:"column:idcardIssued;type:varchar(255) unsigned;default:'';not null;comment:身份证签发机关"` - Health int `json:"health" gorm:"column:health;type:tinyint(1) unsigned;default:1;not null;comment:健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` - Maritalstatus int `json:"maritalstatus" gorm:"column:maritalstatus;type:tinyint(1) unsigned;default:1;not null;comment:婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` - Internaltelephone string `json:"internaltelephone" gorm:"column:internaltelephone;type:varchar(255) unsigned;default:'';not null;comment:内线电话"` - Currentresidence string `json:"currentresidence" gorm:"column:currentresidence;type:varchar(255) unsigned;default:'';not null;comment:现居住地址"` - Constellation int `json:"constellationing" gorm:"column:constellationing;type:tinyint(3) unsigned;comment:星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` - Isdoubleworker int `json:"isdoubleworker" gorm:"column:isdoubleworker;type:tinyint(1) unsigned;default:1;comment:是否双职工(1:是;2:否)"` - Isveterans int `json:"isveterans" gorm:"column:isveterans;type:tinyint(1) unsigned;default:1;comment:是否为退役军人(1:是;2:否)"` - Veteransnumber string `json:"veteransnumber" gorm:"column:veteransnumber;type:varchar(255) unsigned;default:'';comment:退役证编号"` - Jobstartdate int64 `json:"jobstartdate" gorm:"column:jobstartdate;type:bigint(20) unsigned;default:0;comment:参加工作日期"` - Entrydate int64 `json:"entrydate" gorm:"column:entrydate;type:bigint(20) unsigned;default:0;comment:入职日期"` - Probationperiod int `json:"probationperiod" gorm:"column:probationperiod;type:int(5) unsigned;default:0;comment:试用期"` - Planformaldate int64 `json:"planformaldate" gorm:"column:planformaldate;type:bigint(20) unsigned;default:0;comment:预计转正日期"` - PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:tinyint(3) unsigned;default:1;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` - NameUsedBefore string `json:"nameusedbefore" gorm:"column:name_used_before;type:varchar(255) unsigned;default:'';not null;comment:曾用名"` - Ruleid int64 `json:"ruleid" gorm:"column:ruleid;type:bigint(20) unsigned;default:0;comment:轮询规则"` + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_department;type:bigint(20) unsigned;default:0;not null;comment:二级主部门"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + Idcardno string `json:"idcardno" gorm:"column:idcardno;type:varchar(50) unsigned;default:'';not null;comment:身份证号"` + Passportno string `json:"passportno" gorm:"column:passportno;type:varchar(50) unsigned;default:'';not null;comment:护照号码"` + Globalroaming string `json:"globalroaming" gorm:"column:globalroaming;type:varchar(50) unsigned;default:'';not null;comment:国际区号"` + Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` + Email string `json:"email" gorm:"column:email;type:varchar(255) unsigned;default:'';not null;comment:电子邮件"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` + Birthday int64 `json:"birthday" gorm:"column:birthday;type:bigint(20) unsigned;default:0;not null;comment:birthday"` + Myfolk string `json:"myfolk" gorm:"column:myfolk;type:varchar(50) unsigned;default:'';not null;comment:民族"` + Nativeplace string `json:"nativeplace" gorm:"column:nativeplace;type:varchar(255) unsigned;default:'';not null;comment:籍贯"` + Idcardstartdate int64 `json:"idcardstartdate" gorm:"column:idcardstartdate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期开始"` + Idcardenddate int64 `json:"idcardenddate" gorm:"column:idcardenddate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期结束"` + Idcardaddress string `json:"idcardaddress" gorm:"column:idcardaddress;type:varchar(255) unsigned;default:'';not null;comment:身份证地址"` + IdcardIssued string `json:"idcardIssued" gorm:"column:idcardIssued;type:varchar(255) unsigned;default:'';not null;comment:身份证签发机关"` + Health int `json:"health" gorm:"column:health;type:tinyint(1) unsigned;default:1;not null;comment:健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` + Maritalstatus int `json:"maritalstatus" gorm:"column:maritalstatus;type:tinyint(1) unsigned;default:1;not null;comment:婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` + Internaltelephone string `json:"internaltelephone" gorm:"column:internaltelephone;type:varchar(255) unsigned;default:'';not null;comment:内线电话"` + Currentresidence string `json:"currentresidence" gorm:"column:currentresidence;type:varchar(255) unsigned;default:'';not null;comment:现居住地址"` + Constellation int `json:"constellationing" gorm:"column:constellationing;type:tinyint(3) unsigned;comment:星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` + Isdoubleworker int `json:"isdoubleworker" gorm:"column:isdoubleworker;type:tinyint(1) unsigned;default:1;comment:是否双职工(1:是;2:否)"` + Isveterans int `json:"isveterans" gorm:"column:isveterans;type:tinyint(1) unsigned;default:1;comment:是否为退役军人(1:是;2:否)"` + Veteransnumber string `json:"veteransnumber" gorm:"column:veteransnumber;type:varchar(255) unsigned;default:'';comment:退役证编号"` + Jobstartdate int64 `json:"jobstartdate" gorm:"column:jobstartdate;type:bigint(20) unsigned;default:0;comment:参加工作日期"` + Entrydate int64 `json:"entrydate" gorm:"column:entrydate;type:bigint(20) unsigned;default:0;comment:入职日期"` + Probationperiod int `json:"probationperiod" gorm:"column:probationperiod;type:int(5) unsigned;default:0;comment:试用期"` + Planformaldate int64 `json:"planformaldate" gorm:"column:planformaldate;type:bigint(20) unsigned;default:0;comment:预计转正日期"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:tinyint(3) unsigned;default:1;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` + NameUsedBefore string `json:"nameusedbefore" gorm:"column:name_used_before;type:varchar(255) unsigned;default:'';not null;comment:曾用名"` + Ruleid int64 `json:"ruleid" gorm:"column:ruleid;type:bigint(20) unsigned;default:0;comment:轮询规则"` + IconPhoto string `json:"iconphoto" gorm:"column:icon_photo;type:longtext;default:'';not null;comment:照片"` + PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:tinyint(1) unsigned;default:1;not null;comment:负责人(1:是;2:否)` + ResponsibleDepartment string `json:"responsibledepartment" gorm:"column:responsible_department;type:longtext;default:'';not null;comment:负责的行政组织"` + ResponsibleDepartmentJson string `json:"responsibledepartmentjson" gorm:"column:responsible_department_json;type:longtext;default:'';not null;comment:负责的行政组织json"` } func (ManCont *ManCont) TableName() string { diff --git a/models/personarchives.go b/models/personarchives.go index e7968ef..68bd6ea 100644 --- a/models/personarchives.go +++ b/models/personarchives.go @@ -7,35 +7,38 @@ import ( // 员工档案(主) type PersonArchives struct { - Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` - Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` - Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` - Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` - HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` - EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)"` - Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` - MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` - Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` - AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` - TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` - Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` - JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` - JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` - JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` - Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` - EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` - Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` - WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` - State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` - Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` - IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` - Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` - Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` - EmpTypeName string `json:"emptypename" gorm:"column:emp_type_name;type:varchar(255) unsigned;default:'';not null;comment:用工关系中文"` - HireClassName string `json:"hireclassname" gorm:"column:hire_class_name;type:varchar(255) unsigned;default:'';not null;comment:雇佣类型中文"` - SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_deparment;type:bigint(20) unsigned;default:0;not null;comment:二级主部门"` - Ruleid int64 `json:"ruleid" gorm:"column:ruleid;type:bigint(20) unsigned;default:0;not null;comment:轮询规则"` - IconPhoto string `json:"iconphoto" gorm:"column:icon_photo;type:longtext;default:'';not null;comment:照片"` + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + EmpTypeName string `json:"emptypename" gorm:"column:emp_type_name;type:varchar(255) unsigned;default:'';not null;comment:用工关系中文"` + HireClassName string `json:"hireclassname" gorm:"column:hire_class_name;type:varchar(255) unsigned;default:'';not null;comment:雇佣类型中文"` + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_deparment;type:bigint(20) unsigned;default:0;not null;comment:二级主部门"` + Ruleid int64 `json:"ruleid" gorm:"column:ruleid;type:bigint(20) unsigned;default:0;not null;comment:轮询规则"` + IconPhoto string `json:"iconphoto" gorm:"column:icon_photo;type:longtext;default:'';not null;comment:照片"` + PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:tinyint(1) unsigned;default:1;not null;comment:负责人(1:是;2:否)` + ResponsibleDepartment string `json:"responsibledepartment" gorm:"column:responsible_department;type:longtext;default:'';not null;comment:负责的行政组织"` + ResponsibleDepartmentJson string `json:"responsibledepartmentjson" gorm:"column:responsible_department_json;type:longtext;default:'';not null;comment:负责的行政组织json"` } func (PersonArchives *PersonArchives) TableName() string {