Browse Source

修改变量值

v2_dev
超级管理员 3 years ago
parent
commit
55b648c4b6
  1. 20
      api/version1/administrativeorganization/position.go
  2. 51
      api/version1/administrativeorganization/type.go
  3. 149
      api/version1/personnelapi/staffarchives.go
  4. 58
      api/version1/personnelapi/type.go

20
api/version1/administrativeorganization/position.go

@ -12,7 +12,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
//职位(岗位)列表 // 职位(岗位)列表
func (o *OrganizationApi) PositionList(c *gin.Context) { func (o *OrganizationApi) PositionList(c *gin.Context) {
var requestData lookPositionList var requestData lookPositionList
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -66,6 +66,8 @@ func (o *OrganizationApi) PositionList(c *gin.Context) {
getSpurDepart.GetCont(getWheDepart, "name") getSpurDepart.GetCont(getWheDepart, "name")
positionAry[i].DepartmentName = getSpurDepart.Name positionAry[i].DepartmentName = getSpurDepart.Name
positionAry[i].IdStr = strconv.FormatInt(v.Id, 10)
} }
if errGorm != nil { if errGorm != nil {
overallhandle.Result(105, errGorm, c) overallhandle.Result(105, errGorm, c)
@ -74,7 +76,7 @@ func (o *OrganizationApi) PositionList(c *gin.Context) {
} }
} }
//添加职位(岗位) // 添加职位(岗位)
func (o *OrganizationApi) AddPositionCont(c *gin.Context) { func (o *OrganizationApi) AddPositionCont(c *gin.Context) {
var requestData addPositionInfo var requestData addPositionInfo
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -154,7 +156,7 @@ func (o *OrganizationApi) AddPositionCont(c *gin.Context) {
} }
} }
//获取职位(岗位)详情 // 获取职位(岗位)详情
func (o *OrganizationApi) GetPositionCont(c *gin.Context) { func (o *OrganizationApi) GetPositionCont(c *gin.Context) {
var requestData overallhandle.GetId var requestData overallhandle.GetId
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -188,7 +190,7 @@ func (o *OrganizationApi) GetPositionCont(c *gin.Context) {
} }
} }
//编辑职位(岗位) // 编辑职位(岗位)
func (o *OrganizationApi) EitePositionCont(c *gin.Context) { func (o *OrganizationApi) EitePositionCont(c *gin.Context) {
var requestData eitePositionInfo var requestData eitePositionInfo
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -267,7 +269,7 @@ func (o *OrganizationApi) EitePositionCont(c *gin.Context) {
} }
} }
//编辑职位(岗位)状态或删除 // 编辑职位(岗位)状态或删除
func (o *OrganizationApi) EitePositionStateOrDel(c *gin.Context) { func (o *OrganizationApi) EitePositionStateOrDel(c *gin.Context) {
var requestData EiteJobStateDel var requestData EiteJobStateDel
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -329,7 +331,7 @@ func (o *OrganizationApi) EitePositionStateOrDel(c *gin.Context) {
} }
} }
//获取职位权限配置清单 // 获取职位权限配置清单
func (o *OrganizationApi) GetPositionRole(c *gin.Context) { func (o *OrganizationApi) GetPositionRole(c *gin.Context) {
var requestData overallhandle.GetId var requestData overallhandle.GetId
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -359,7 +361,7 @@ func (o *OrganizationApi) GetPositionRole(c *gin.Context) {
overallhandle.Result(0, datahhh, c) overallhandle.Result(0, datahhh, c)
} }
//遍历确权 // 遍历确权
func GetMenuOperation(menuStr, menuOperStr string) (isTrue bool, sendData []powerConfigList) { func GetMenuOperation(menuStr, menuOperStr string) (isTrue bool, sendData []powerConfigList) {
isTrue = false isTrue = false
var menuStrMap []int64 var menuStrMap []int64
@ -378,7 +380,7 @@ func GetMenuOperation(menuStr, menuOperStr string) (isTrue bool, sendData []powe
return return
} }
//递归无限树 // 递归无限树
func GetMenuPowerThree(jurisd int, parentId int64, threeData []models.SystemMenu, menuStrMap, menuOperStrMap []int64) []powerConfigList { func GetMenuPowerThree(jurisd int, parentId int64, threeData []models.SystemMenu, menuStrMap, menuOperStrMap []int64) []powerConfigList {
// treeList := []SystemMenuThree{} // treeList := []SystemMenuThree{}
treeListPower := []powerConfigList{} treeListPower := []powerConfigList{}
@ -409,7 +411,7 @@ func GetMenuPowerThree(jurisd int, parentId int64, threeData []models.SystemMenu
return treeListPower return treeListPower
} }
//获取菜单操作项目 // 获取菜单操作项目
func MenuOperation(jurisd int, menuId int64) (isTrue bool, operation []models.MenuOperation) { func MenuOperation(jurisd int, menuId int64) (isTrue bool, operation []models.MenuOperation) {
isTrue = false isTrue = false
// if jurisd != 1 { // if jurisd != 1 {

51
api/version1/administrativeorganization/type.go

@ -9,51 +9,51 @@ import (
type OrganizationApi struct{} type OrganizationApi struct{}
//入口 // 入口
func (o *OrganizationApi) Index(c *gin.Context) { func (o *OrganizationApi) Index(c *gin.Context) {
outputCont := overallhandle.MapOut() outputCont := overallhandle.MapOut()
outputCont["index"] = "组织管理入口" outputCont["index"] = "组织管理入口"
overallhandle.Result(0, outputCont, c) overallhandle.Result(0, outputCont, c)
} }
//名称 // 名称
type NameVal struct { type NameVal struct {
Name string `json:"name"` //名称 Name string `json:"name"` //名称
} }
//职务类型翻页 // 职务类型翻页
type JobClassPageSelect struct { type JobClassPageSelect struct {
overallhandle.PageTurning overallhandle.PageTurning
NameVal NameVal
} }
//修改职务类型信息 // 修改职务类型信息
type EiteJobClassInfo struct { type EiteJobClassInfo struct {
overallhandle.GetId overallhandle.GetId
NameVal NameVal
overallhandle.StateOverall overallhandle.StateOverall
} }
//状态修改及删除操作 // 状态修改及删除操作
type EiteJobStateDel struct { type EiteJobStateDel struct {
overallhandle.GetId overallhandle.GetId
overallhandle.StateOverall overallhandle.StateOverall
IsTrue int `json:"istrue"` IsTrue int `json:"istrue"`
} }
//获取职务列表 // 获取职务列表
type dutiesListType struct { type dutiesListType struct {
JobClassPageSelect JobClassPageSelect
JobId string `json:"jobid"` JobId string `json:"jobid"`
} }
//职务输出 // 职务输出
type dutiesOutCont struct { type dutiesOutCont struct {
models.Duties models.Duties
DutiesClassName string `json:"dutiesclassname" gorm:"column:classname;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` DutiesClassName string `json:"dutiesclassname" gorm:"column:classname;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"`
} }
//添加职务 // 添加职务
type addDutiesInfo struct { type addDutiesInfo struct {
NameVal NameVal
JobType string `json:"jobtype"` //归属职务类型 JobType string `json:"jobtype"` //归属职务类型
@ -61,12 +61,12 @@ type addDutiesInfo struct {
overallhandle.NmuberOverall overallhandle.NmuberOverall
} }
//职务详情输出 // 职务详情输出
type getDutiesInfo struct { type getDutiesInfo struct {
dutiesOutCont dutiesOutCont
} }
//修改职务详情 // 修改职务详情
type eiteDutiesCont struct { type eiteDutiesCont struct {
overallhandle.GetId overallhandle.GetId
NameVal NameVal
@ -74,26 +74,26 @@ type eiteDutiesCont struct {
Weight int64 `json:weight` //权重 Weight int64 `json:weight` //权重
} }
//查询名称和状态 // 查询名称和状态
type selectNameOrState struct { type selectNameOrState struct {
JobClassPageSelect JobClassPageSelect
overallhandle.StateOverall overallhandle.StateOverall
Level int `json:"level"` Level int `json:"level"`
} }
//添加行政类型 // 添加行政类型
type addGovClassInfo struct { type addGovClassInfo struct {
NameVal NameVal
Level int64 `json:"level"` Level int64 `json:"level"`
} }
//修改行政类型内容 // 修改行政类型内容
type eiteGovClassInfo struct { type eiteGovClassInfo struct {
overallhandle.GetId overallhandle.GetId
addGovClassInfo addGovClassInfo
} }
//获取行政组织列表 // 获取行政组织列表
type govListType struct { type govListType struct {
JobClassPageSelect JobClassPageSelect
Number string `json:"number"` Number string `json:"number"`
@ -103,14 +103,14 @@ type govListType struct {
Level int `json:"level"` Level int `json:"level"`
} }
//输出行政组织信息 // 输出行政组织信息
type outGovCont struct { type outGovCont struct {
models.AdministrativeOrganization models.AdministrativeOrganization
ClassName string `json:"classname" gorm:"column:classname;type:varchar(255) unsigned;default:'';not null;comment:行政组织分类名称"` ClassName string `json:"classname" gorm:"column:classname;type:varchar(255) unsigned;default:'';not null;comment:行政组织分类名称"`
Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"` Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"`
} }
//添加行政组织 // 添加行政组织
type addGovInfo struct { type addGovInfo struct {
NameVal NameVal
Number string `json:"number"` Number string `json:"number"`
@ -120,13 +120,13 @@ type addGovInfo struct {
WechatId int `json:"wechatid"` WechatId int `json:"wechatid"`
} }
//修改行政组织 // 修改行政组织
type eiteGovInfo struct { type eiteGovInfo struct {
overallhandle.GetId overallhandle.GetId
addGovInfo addGovInfo
} }
//添加职位(岗位) // 添加职位(岗位)
type addPositionInfo struct { type addPositionInfo struct {
Number string `json:"number"` //职位编码 Number string `json:"number"` //职位编码
NameVal //职位名称 NameVal //职位名称
@ -137,13 +137,13 @@ type addPositionInfo struct {
Department string `json:"department"` //部门 Department string `json:"department"` //部门
} }
//编辑职位(岗位) // 编辑职位(岗位)
type eitePositionInfo struct { type eitePositionInfo struct {
overallhandle.GetId overallhandle.GetId
addPositionInfo addPositionInfo
} }
//查看职位 // 查看职位
type lookPositionList struct { type lookPositionList struct {
JobClassPageSelect JobClassPageSelect
Number string `json:"number"` //职位编码 Number string `json:"number"` //职位编码
@ -153,7 +153,7 @@ type lookPositionList struct {
Department string `json:"department"` //部门 Department string `json:"department"` //部门
} }
//职务列表输出 // 职务列表输出
type positionOutInfo struct { type positionOutInfo struct {
models.Position models.Position
DutiesName string `json:"dutiesname" gorm:"column:dutiesname;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` DutiesName string `json:"dutiesname" gorm:"column:dutiesname;type:varchar(255) unsigned;default:'';not null;comment:职务名称"`
@ -164,9 +164,10 @@ type positionOutInfo struct {
SuperiorName string `json:"superiorname"` //上级名称 SuperiorName string `json:"superiorname"` //上级名称
SuperiorNumber string `json:"superiornumber"` //上级编号 SuperiorNumber string `json:"superiornumber"` //上级编号
DepartmentName string `json:"departmentname"` DepartmentName string `json:"departmentname"`
IdStr string `json:"idstr"`
} }
//行政组织树查询 // 行政组织树查询
type govThreeType struct { type govThreeType struct {
overallhandle.GetId overallhandle.GetId
Level int `json:"level"` Level int `json:"level"`
@ -183,21 +184,21 @@ type powerCont struct {
IsTrue bool `json:"istrue"` IsTrue bool `json:"istrue"`
} }
//权限树 // 权限树
type powerConfigList struct { type powerConfigList struct {
powerCont powerCont
Child []powerConfigList `json:"child"` Child []powerConfigList `json:"child"`
MenuOperation []powerCont `json:"menuOperation"` MenuOperation []powerCont `json:"menuOperation"`
} }
//输出职务分类列表 // 输出职务分类列表
type outJobClassList struct { type outJobClassList struct {
Id string `json:"id"` Id string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
State int `json:"state"` State int `json:"state"`
} }
//修改班组 // 修改班组
type eidtTeamCont struct { type eidtTeamCont struct {
Id string `json:"id"` Id string `json:"id"`
Name string `json:"name"` Name string `json:"name"`

149
api/version1/personnelapi/staffarchives.go

@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
//人员列表 // 人员列表
func (s *StaffApi) ArchivesList(c *gin.Context) { func (s *StaffApi) ArchivesList(c *gin.Context) {
var requestData peopleList var requestData peopleList
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -134,8 +134,8 @@ func (s *StaffApi) ArchivesList(c *gin.Context) {
} }
} }
//获取单个人员档案 // 获取单个人员档案
//人员列表 // 人员列表
func (s *StaffApi) ArchivesCon(c *gin.Context) { func (s *StaffApi) ArchivesCon(c *gin.Context) {
var requestData overallhandle.GetId var requestData overallhandle.GetId
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -158,11 +158,30 @@ func (s *StaffApi) ArchivesCon(c *gin.Context) {
var staffCenter staffArchivesCont var staffCenter staffArchivesCont
staffCenter.ManCont = satffCont staffCenter.ManCont = satffCont
staffCenter.IdStr = strconv.FormatInt(satffCont.Id, 10) staffCenter.IdStr = strconv.FormatInt(satffCont.Id, 10)
staffCenter.BirthdayTime = overallhandle.UnixTimeToDay(satffCont.Birthday, 14) //生日 if satffCont.Birthday != 0 {
staffCenter.IdCardStartTimeData = overallhandle.UnixTimeToDay(satffCont.Idcardstartdate, 14) //身份证有效期开始时间 staffCenter.BirthdayTime = overallhandle.UnixTimeToDay(satffCont.Birthday, 14) //生日
staffCenter.IdCardEndTimeData = overallhandle.UnixTimeToDay(satffCont.Idcardenddate, 14) //身份证有效期结束时间 }
staffCenter.EntrydateTime = overallhandle.UnixTimeToDay(satffCont.Entrydate, 14) //入职日期 if satffCont.Idcardstartdate != 0 {
staffCenter.PlanformaldateTime = overallhandle.UnixTimeToDay(satffCont.Planformaldate, 14) //预计转正日期 staffCenter.IdCardStartTimeData = overallhandle.UnixTimeToDay(satffCont.Idcardstartdate, 14) //身份证有效期开始时间
}
if satffCont.Idcardenddate != 0 {
staffCenter.IdCardEndTimeData = overallhandle.UnixTimeToDay(satffCont.Idcardenddate, 14) //身份证有效期结束时间
}
if satffCont.Entrydate != 0 {
staffCenter.EntrydateTime = overallhandle.UnixTimeToDay(satffCont.Entrydate, 14) //入职日期
}
if satffCont.Planformaldate != 0 {
staffCenter.PlanformaldateTime = overallhandle.UnixTimeToDay(satffCont.Planformaldate, 14) //预计转正日期
}
if satffCont.Jobstartdate != 0 {
staffCenter.JobstartdateStr = overallhandle.UnixTimeToDay(satffCont.Jobstartdate, 14) //参加工作日期
}
if satffCont.Entrydate != 0 {
staffCenter.EntrydateStr = overallhandle.UnixTimeToDay(satffCont.Entrydate, 14) //入职日期
}
if satffCont.Company != 0 { if satffCont.Company != 0 {
var groupInfos models.AdministrativeOrganization var groupInfos models.AdministrativeOrganization
groupInfos.GetCont(map[string]interface{}{"`id`": satffCont.Company}, "`name`") groupInfos.GetCont(map[string]interface{}{"`id`": satffCont.Company}, "`name`")
@ -230,7 +249,7 @@ func (s *StaffApi) ArchivesCon(c *gin.Context) {
return return
} }
//获取双职工信息 // 获取双职工信息
func getDoubleWorkerCont(key int64) (doubleworkerlist []DoubleWorkerCont) { func getDoubleWorkerCont(key int64) (doubleworkerlist []DoubleWorkerCont) {
defer synPro.Done() defer synPro.Done()
var dowWorkMan []models.DoubleWorker var dowWorkMan []models.DoubleWorker
@ -252,7 +271,7 @@ func getDoubleWorkerCont(key int64) (doubleworkerlist []DoubleWorkerCont) {
return return
} }
//紧急联系人 // 紧急联系人
func getEmercyCallMan(key int64) (callMan []emergencyContact) { func getEmercyCallMan(key int64) (callMan []emergencyContact) {
defer synPro.Done() defer synPro.Done()
var dowWorkMan []models.EmergencyContact var dowWorkMan []models.EmergencyContact
@ -271,7 +290,7 @@ func getEmercyCallMan(key int64) (callMan []emergencyContact) {
return return
} }
//获取家庭成员 // 获取家庭成员
func getMemberOfFamily(key int64) (callMan []memberOfFamily) { func getMemberOfFamily(key int64) (callMan []memberOfFamily) {
defer synPro.Done() defer synPro.Done()
var dowWorkMan []models.FamilyMembers var dowWorkMan []models.FamilyMembers
@ -293,20 +312,25 @@ func getMemberOfFamily(key int64) (callMan []memberOfFamily) {
return return
} }
//获取教育经历 // 获取教育经历
func getEducationalExperience(key int64) (callMan []educatExp) { func getEducationalExperience(key int64) (callMan []educatExp) {
defer synPro.Done() defer synPro.Done()
var dowWorkMan []models.PersonnelEducation var dowWorkMan []models.PersonnelEducation
err := overall.CONSTANT_DB_HR.Select("`id`", "`education`", "`graduation_school`", "`subject`", "`admission_time`", "`graduation_time`", "`level`,`academic_degree`").Where("`state` = 1 AND `key` = ?", key).Find(&dowWorkMan).Error err := overall.CONSTANT_DB_HR.Select("`id`", "`education`", "`graduation_school`", "`subject`", "`admission_time`", "`graduation_time`", "`level`,`academic_degree`").Where("`state` = 1 AND `key` = ?", key).Find(&dowWorkMan).Error
if err == nil { if err == nil {
for _, v := range dowWorkMan { for _, v := range dowWorkMan {
var dwManCont educatExp // var dwManCont educatExp //
dwManCont.GraduationSchool = v.GraduationSchool //毕业学校 dwManCont.GraduationSchool = v.GraduationSchool //毕业学校
dwManCont.Subject = v.Subject //专业 dwManCont.Subject = v.Subject //专业
dwManCont.Education = v.Education //学历 dwManCont.Education = v.Education //学历
dwManCont.AdmissionTime = overallhandle.UnixTimeToDay(v.AdmissionTime, 14) //入学时间 if v.AdmissionTime != 0 {
dwManCont.GraduationTime = overallhandle.UnixTimeToDay(v.GraduationTime, 14) //毕业时间 dwManCont.AdmissionTime = overallhandle.UnixTimeToDay(v.AdmissionTime, 14) //入学时间
dwManCont.AcademicDegree = getXueWei(v.AcademicDegree) //学位 }
if v.GraduationTime != 0 {
dwManCont.GraduationTime = overallhandle.UnixTimeToDay(v.GraduationTime, 14) //毕业时间
}
dwManCont.AcademicDegree = getXueWei(v.AcademicDegree) //学位
dwManCont.AcademicDegreeId = v.AcademicDegree dwManCont.AcademicDegreeId = v.AcademicDegree
dwManCont.Level = getXueWeiClass(v.Level) dwManCont.Level = getXueWeiClass(v.Level)
dwManCont.LevelId = v.Level //学历类型 dwManCont.LevelId = v.Level //学历类型
@ -317,7 +341,7 @@ func getEducationalExperience(key int64) (callMan []educatExp) {
return return
} }
//学位 // 学位
func getXueWei(id int) string { func getXueWei(id int) string {
switch id { switch id {
case 1: case 1:
@ -334,7 +358,7 @@ func getXueWei(id int) string {
return "无" return "无"
} }
//学历类型 // 学历类型
func getXueWeiClass(id int) string { func getXueWeiClass(id int) string {
switch id { switch id {
case 2: case 2:
@ -347,7 +371,7 @@ func getXueWeiClass(id int) string {
return "普通" return "普通"
} }
//工作履历 // 工作履历
func getWorkHistoryList(key int64) (workHisList []workHistoryAry) { func getWorkHistoryList(key int64) (workHisList []workHistoryAry) {
defer synPro.Done() defer synPro.Done()
var workHisContList []models.WorkHistory var workHisContList []models.WorkHistory
@ -355,21 +379,26 @@ func getWorkHistoryList(key int64) (workHisList []workHistoryAry) {
if workHisContListErr == nil { if workHisContListErr == nil {
for _, v := range workHisContList { for _, v := range workHisContList {
var workCont workHistoryAry var workCont workHistoryAry
workCont.Company = v.Company //公司 workCont.Company = v.Company //公司
workCont.Department = v.Deparment //部门 workCont.Department = v.Deparment //部门
workCont.Position = v.Job //职务 workCont.Position = v.Job //职务
workCont.EntryTime = overallhandle.UnixTimeToDay(v.EntryTime, 14) //入职时间 if v.EntryTime != 0 {
workCont.LeaveDate = overallhandle.UnixTimeToDay(v.Leavedate, 14) //离职日期 workCont.EntryTime = overallhandle.UnixTimeToDay(v.EntryTime, 14) //入职时间
workCont.Witness = v.Witness //证明人 }
workCont.WitnessTel = v.WitnessTel //证明人电话 if v.Leavedate != 0 {
workCont.Remarks = v.Remarks //备注 workCont.LeaveDate = overallhandle.UnixTimeToDay(v.Leavedate, 14) //离职日期
}
workCont.Witness = v.Witness //证明人
workCont.WitnessTel = v.WitnessTel //证明人电话
workCont.Remarks = v.Remarks //备注
workHisList = append(workHisList, workCont) workHisList = append(workHisList, workCont)
} }
} }
return return
} }
//添加双职工 // 添加双职工
func (s *StaffApi) AddDoubleWorkerApi(c *gin.Context) { func (s *StaffApi) AddDoubleWorkerApi(c *gin.Context) {
var requestData DoubleWorkerCont var requestData DoubleWorkerCont
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -410,7 +439,7 @@ func (s *StaffApi) AddDoubleWorkerApi(c *gin.Context) {
overallhandle.Result(0, addErr, c) overallhandle.Result(0, addErr, c)
} }
//编辑双职工 // 编辑双职工
func (s *StaffApi) EidtDoubleWorkerApi(c *gin.Context) { func (s *StaffApi) EidtDoubleWorkerApi(c *gin.Context) {
var requestData DoubleWorkerCont var requestData DoubleWorkerCont
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -459,7 +488,7 @@ func (s *StaffApi) EidtDoubleWorkerApi(c *gin.Context) {
} }
} }
//编辑双职工状态 // 编辑双职工状态
func (s *StaffApi) EidtDoubleWorkerState(c *gin.Context) { func (s *StaffApi) EidtDoubleWorkerState(c *gin.Context) {
var requestData eidtWorkState var requestData eidtWorkState
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -510,7 +539,7 @@ func (s *StaffApi) EidtDoubleWorkerState(c *gin.Context) {
} }
} }
//添加紧急联系人 // 添加紧急联系人
func (s *StaffApi) AddEmercyCall(c *gin.Context) { func (s *StaffApi) AddEmercyCall(c *gin.Context) {
var requestData addEmergencyContact var requestData addEmergencyContact
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -562,7 +591,7 @@ func (s *StaffApi) AddEmercyCall(c *gin.Context) {
} }
} }
//编辑紧急联系人 // 编辑紧急联系人
func (s *StaffApi) EditEmercyCall(c *gin.Context) { func (s *StaffApi) EditEmercyCall(c *gin.Context) {
var requestData emergencyContact var requestData emergencyContact
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -599,7 +628,7 @@ func (s *StaffApi) EditEmercyCall(c *gin.Context) {
} }
} }
//编辑紧急联系人 // 编辑紧急联系人
func (s *StaffApi) EditEmercyCallState(c *gin.Context) { func (s *StaffApi) EditEmercyCallState(c *gin.Context) {
var requestData eidtWorkState var requestData eidtWorkState
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -650,7 +679,7 @@ func (s *StaffApi) EditEmercyCallState(c *gin.Context) {
} }
} }
//添加家庭成员 // 添加家庭成员
func (s *StaffApi) AddFamilyMembers(c *gin.Context) { func (s *StaffApi) AddFamilyMembers(c *gin.Context) {
var requestData addFamilyPeople var requestData addFamilyPeople
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -714,7 +743,7 @@ func (s *StaffApi) AddFamilyMembers(c *gin.Context) {
} }
} }
//编辑家属信息 // 编辑家属信息
func (s *StaffApi) EditFamilyMembers(c *gin.Context) { func (s *StaffApi) EditFamilyMembers(c *gin.Context) {
var requestData memberOfFamily var requestData memberOfFamily
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -764,7 +793,7 @@ func (s *StaffApi) EditFamilyMembers(c *gin.Context) {
} }
} }
//编辑家属状态 // 编辑家属状态
func (s *StaffApi) EditFamilyMembersSatte(c *gin.Context) { func (s *StaffApi) EditFamilyMembersSatte(c *gin.Context) {
var requestData eidtWorkState var requestData eidtWorkState
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -815,7 +844,7 @@ func (s *StaffApi) EditFamilyMembersSatte(c *gin.Context) {
} }
} }
//添加教育经历 // 添加教育经历
func (s *StaffApi) AddEducationalExperience(c *gin.Context) { func (s *StaffApi) AddEducationalExperience(c *gin.Context) {
var requestData addExpToSchool var requestData addExpToSchool
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -904,7 +933,7 @@ func (s *StaffApi) AddEducationalExperience(c *gin.Context) {
} }
} }
//编辑教育经历 // 编辑教育经历
func (s *StaffApi) EditEducationalExperience(c *gin.Context) { func (s *StaffApi) EditEducationalExperience(c *gin.Context) {
var requestData editExpToSchool var requestData editExpToSchool
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -982,7 +1011,7 @@ func (s *StaffApi) EditEducationalExperience(c *gin.Context) {
} }
} }
//编辑教育经历状态 // 编辑教育经历状态
func (s *StaffApi) EditEduExpState(c *gin.Context) { func (s *StaffApi) EditEduExpState(c *gin.Context) {
var requestData eidtWorkState var requestData eidtWorkState
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1033,7 +1062,7 @@ func (s *StaffApi) EditEduExpState(c *gin.Context) {
} }
} }
//添加工作履历 // 添加工作履历
func (s *StaffApi) AddWorkHistoryCont(c *gin.Context) { func (s *StaffApi) AddWorkHistoryCont(c *gin.Context) {
var requestData addWorkHistory var requestData addWorkHistory
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1105,7 +1134,7 @@ func (s *StaffApi) AddWorkHistoryCont(c *gin.Context) {
} }
} }
//编辑工作履历 // 编辑工作履历
func (s *StaffApi) EditWorkHistoryCont(c *gin.Context) { func (s *StaffApi) EditWorkHistoryCont(c *gin.Context) {
var requestData editWorkHistory var requestData editWorkHistory
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1167,7 +1196,7 @@ func (s *StaffApi) EditWorkHistoryCont(c *gin.Context) {
} }
} }
//编辑工作履历状态 // 编辑工作履历状态
func (s *StaffApi) EditWorkHistoryState(c *gin.Context) { func (s *StaffApi) EditWorkHistoryState(c *gin.Context) {
var requestData eidtWorkState var requestData eidtWorkState
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1218,7 +1247,7 @@ func (s *StaffApi) EditWorkHistoryState(c *gin.Context) {
} }
} }
//集团内部工作履历 // 集团内部工作履历
func getGroupWorkHistoryList(key int64) (workHisList []insideHistory) { func getGroupWorkHistoryList(key int64) (workHisList []insideHistory) {
defer synPro.Done() defer synPro.Done()
var workHisContList []models.InsideWorkHistory var workHisContList []models.InsideWorkHistory
@ -1248,17 +1277,21 @@ func getGroupWorkHistoryList(key int64) (workHisList []insideHistory) {
workCont.Position = positCont.Name //职务 workCont.Position = positCont.Name //职务
workCont.GradePositions = v.GradePositions //职务 workCont.GradePositions = v.GradePositions //职务
if v.StartTime != 0 {
workCont.StartTime = overallhandle.UnixTimeToDay(v.StartTime, 14) //开始日期
}
if v.EndTime != 0 {
workCont.EndTime = overallhandle.UnixTimeToDay(v.EndTime, 14) //结束日期
}
workCont.StartTime = overallhandle.UnixTimeToDay(v.StartTime, 14) //开始日期 workCont.ChangeType = v.ChangeType //
workCont.EndTime = overallhandle.UnixTimeToDay(v.EndTime, 14) //结束日期
workCont.ChangeType = v.ChangeType //
workHisList = append(workHisList, workCont) workHisList = append(workHisList, workCont)
} }
} }
return return
} }
//添加工作履历 // 添加工作履历
func (s *StaffApi) AddInsideHistory(c *gin.Context) { func (s *StaffApi) AddInsideHistory(c *gin.Context) {
var requestData eidtInsideHistoryWork var requestData eidtInsideHistoryWork
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -1322,7 +1355,7 @@ func (s *StaffApi) AddInsideHistory(c *gin.Context) {
} }
} }
//编辑集团内部工作 // 编辑集团内部工作
func (s *StaffApi) EidtInsideHistoryWorkCont(c *gin.Context) { func (s *StaffApi) EidtInsideHistoryWorkCont(c *gin.Context) {
var requestData eidtInsideHistoryWork var requestData eidtInsideHistoryWork
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
@ -1414,7 +1447,7 @@ func (s *StaffApi) EidtInsideHistoryWorkCont(c *gin.Context) {
} }
} }
//编辑或删除集团内工作记录 // 编辑或删除集团内工作记录
func (s *StaffApi) EditOrDelInsideWorkHistoryState(c *gin.Context) { func (s *StaffApi) EditOrDelInsideWorkHistoryState(c *gin.Context) {
var requestData eidtWorkState var requestData eidtWorkState
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1465,7 +1498,7 @@ func (s *StaffApi) EditOrDelInsideWorkHistoryState(c *gin.Context) {
} }
} }
//集团内部工作经历列表 // 集团内部工作经历列表
func (s *StaffApi) InsideWorkHistoryList(c *gin.Context) { func (s *StaffApi) InsideWorkHistoryList(c *gin.Context) {
var requestData allocationOfRightsToRole var requestData allocationOfRightsToRole
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1483,7 +1516,7 @@ func (s *StaffApi) InsideWorkHistoryList(c *gin.Context) {
} }
} }
//工作履历列表 // 工作履历列表
func (s *StaffApi) WorkHistoryList(c *gin.Context) { func (s *StaffApi) WorkHistoryList(c *gin.Context) {
var requestData allocationOfRightsToRole var requestData allocationOfRightsToRole
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1501,7 +1534,7 @@ func (s *StaffApi) WorkHistoryList(c *gin.Context) {
} }
} }
//教育经历列表 // 教育经历列表
func (s *StaffApi) PersonnelEducationList(c *gin.Context) { func (s *StaffApi) PersonnelEducationList(c *gin.Context) {
var requestData allocationOfRightsToRole var requestData allocationOfRightsToRole
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1519,7 +1552,7 @@ func (s *StaffApi) PersonnelEducationList(c *gin.Context) {
} }
} }
//家庭成员列表 // 家庭成员列表
func (s *StaffApi) FamilyMemBersList(c *gin.Context) { func (s *StaffApi) FamilyMemBersList(c *gin.Context) {
var requestData allocationOfRightsToRole var requestData allocationOfRightsToRole
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1537,7 +1570,7 @@ func (s *StaffApi) FamilyMemBersList(c *gin.Context) {
} }
} }
//紧急联系人列表 // 紧急联系人列表
func (s *StaffApi) EmergencyContactList(c *gin.Context) { func (s *StaffApi) EmergencyContactList(c *gin.Context) {
var requestData allocationOfRightsToRole var requestData allocationOfRightsToRole
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)
@ -1555,7 +1588,7 @@ func (s *StaffApi) EmergencyContactList(c *gin.Context) {
} }
} }
//双职工列表 // 双职工列表
func (s *StaffApi) DoubleWorkerList(c *gin.Context) { func (s *StaffApi) DoubleWorkerList(c *gin.Context) {
var requestData allocationOfRightsToRole var requestData allocationOfRightsToRole
c.ShouldBindJSON(&requestData) c.ShouldBindJSON(&requestData)

58
api/version1/personnelapi/type.go

@ -8,20 +8,20 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
//协程 // 协程
var synPro = sync.WaitGroup{} var synPro = sync.WaitGroup{}
//人员API // 人员API
type StaffApi struct{} type StaffApi struct{}
//入口 // 入口
func (s *StaffApi) Index(c *gin.Context) { func (s *StaffApi) Index(c *gin.Context) {
outputCont := overallhandle.MapOut() outputCont := overallhandle.MapOut()
outputCont["index"] = "人员档案API" outputCont["index"] = "人员档案API"
overallhandle.Result(0, outputCont, c) overallhandle.Result(0, outputCont, c)
} }
//人员列表查询 // 人员列表查询
type peopleList struct { type peopleList struct {
overallhandle.PageTurning overallhandle.PageTurning
Number string `json:"number"` //工号 Number string `json:"number"` //工号
@ -35,7 +35,7 @@ type peopleList struct {
Role string `json:"role"` Role string `json:"role"`
} }
//人员列表输出 // 人员列表输出
type peopleOutList struct { type peopleOutList struct {
models.Personnel models.Personnel
Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"`
@ -62,14 +62,14 @@ type peopleManOutList struct {
KeyStr string `json:"keystr"` //身份认证 KeyStr string `json:"keystr"` //身份认证
} }
//获取部门细腻些 // 获取部门细腻些
type getDepartmentInfo struct { type getDepartmentInfo struct {
Id int64 `json:"id"` //id Id int64 `json:"id"` //id
Number string `json:"number"` //行政编码 Number string `json:"number"` //行政编码
Name string `json:"name"` //组织名称 Name string `json:"name"` //组织名称
} }
//添加员工参数 // 添加员工参数
type addPersonnel struct { type addPersonnel struct {
//员工主表 //员工主表
Number string `json:"number"` //工号1 Number string `json:"number"` //工号1
@ -122,7 +122,7 @@ type addPersonnel struct {
InsideWorkHistory []insideHistoryerMy `json:"insideworkhistory"` //工作履历 InsideWorkHistory []insideHistoryerMy `json:"insideworkhistory"` //工作履历
} }
//集团内部工作履历 // 集团内部工作履历
type insideHistoryerMy struct { type insideHistoryerMy struct {
OrgId string `json:"orgid"` //行政组织 OrgId string `json:"orgid"` //行政组织
Position string `json:"position"` //职位 Position string `json:"position"` //职位
@ -134,7 +134,7 @@ type insideHistoryerMy struct {
Team string `json:"team"` //班组 Team string `json:"team"` //班组
} }
//教育经历 // 教育经历
type educationalExperience struct { type educationalExperience struct {
GraduationSchool string `json:"graduationschool"` //毕业学校 GraduationSchool string `json:"graduationschool"` //毕业学校
Subject string `json:"subject"` //专业 Subject string `json:"subject"` //专业
@ -146,7 +146,7 @@ type educationalExperience struct {
} }
//紧急联系人 // 紧急联系人
type emergencyContact struct { type emergencyContact struct {
Id string `json:"id"` Id string `json:"id"`
Name string `json:"name"` //姓名 Name string `json:"name"` //姓名
@ -154,7 +154,7 @@ type emergencyContact struct {
Mobilephone string `json:"mobilephone"` //联系电话 Mobilephone string `json:"mobilephone"` //联系电话
} }
//家庭成员 // 家庭成员
type memberOfFamily struct { type memberOfFamily struct {
emergencyContact emergencyContact
Company string `json:"company"` //公司 Company string `json:"company"` //公司
@ -164,7 +164,7 @@ type memberOfFamily struct {
IdStr string `json:"idstr"` IdStr string `json:"idstr"`
} }
//职务相关 // 职务相关
type jobAttber struct { type jobAttber struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Number string `json:"number" gorm:"column:number;type:varchar(255) unsigned;default:'';not null;comment:编号"` Number string `json:"number" gorm:"column:number;type:varchar(255) unsigned;default:'';not null;comment:编号"`
@ -177,13 +177,13 @@ type jobAttber struct {
JobName string `json:"jobname" gorm:"column:jobname;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` JobName string `json:"jobname" gorm:"column:jobname;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"`
} }
//配权 // 配权
type allocationOfRightsToRole struct { type allocationOfRightsToRole struct {
Id string `json:"id"` Id string `json:"id"`
RoleId string `json:"roleid"` RoleId string `json:"roleid"`
} }
//添加员工参数 // 添加员工参数
type addKingdeePersonnel struct { type addKingdeePersonnel struct {
Number string `json:"number"` //工号1 Number string `json:"number"` //工号1
Name string `json:"name"` //姓名1 Name string `json:"name"` //姓名1
@ -269,7 +269,7 @@ type addKingdeePersonnel struct {
InsideWorkHistory []insideHistory `json:"insideworkhistory"` //工作履历 InsideWorkHistory []insideHistory `json:"insideworkhistory"` //工作履历
} }
//人员档案详情 // 人员档案详情
type staffArchivesCont struct { type staffArchivesCont struct {
models.ManCont models.ManCont
BirthdayTime string `json:"birthdaytime"` //生日 BirthdayTime string `json:"birthdaytime"` //生日
@ -291,9 +291,11 @@ type staffArchivesCont struct {
JobClassName string `json:"jobclassname"` //职务分类 JobClassName string `json:"jobclassname"` //职务分类
JobIdName string `json:"jobidname"` //职务 JobIdName string `json:"jobidname"` //职务
PoliticalOutlookName string `json:"politicaloutlookname"` //政治面貌 PoliticalOutlookName string `json:"politicaloutlookname"` //政治面貌
JobstartdateStr string `json:"jobstartdatestr"` //参加工作日期"`
EntrydateStr string `json:"entrydatestr" ` //`入职日期"`
} }
//双职工 // 双职工
type DoubleWorkerCont struct { type DoubleWorkerCont struct {
Id string `json:"id"` Id string `json:"id"`
Number string `json:"number"` //工号 Number string `json:"number"` //工号
@ -319,7 +321,7 @@ type educatExp struct {
Id string `json:"id"` Id string `json:"id"`
} }
//工作履历 // 工作履历
type workHistoryAry struct { type workHistoryAry struct {
Company string `json:"company"` //公司 Company string `json:"company"` //公司
Department string `json:"department"` //部门 Department string `json:"department"` //部门
@ -331,21 +333,21 @@ type workHistoryAry struct {
Remarks string `json:"remarks"` //备注 Remarks string `json:"remarks"` //备注
} }
//判断是否需要编辑工作履历 // 判断是否需要编辑工作履历
type judgeWorkHistory struct { type judgeWorkHistory struct {
Company string `json:"company"` //公司 Company string `json:"company"` //公司
Department string `json:"department"` //部门 Department string `json:"department"` //部门
Position string `json:"position"` //职务 Position string `json:"position"` //职务
} }
//编辑双职工状态 // 编辑双职工状态
type eidtWorkState struct { type eidtWorkState struct {
Id string `json:"id"` Id string `json:"id"`
State int `json:"state"` State int `json:"state"`
IsDel int `json:"isdel"` IsDel int `json:"isdel"`
} }
//编辑员工参数 // 编辑员工参数
type eitePersonnel struct { type eitePersonnel struct {
Id string `json:"id"` Id string `json:"id"`
//员工主表 //员工主表
@ -392,43 +394,43 @@ type eitePersonnel struct {
} }
//添加紧急联系人 // 添加紧急联系人
type addEmergencyContact struct { type addEmergencyContact struct {
Id string `json:"id"` Id string `json:"id"`
List []emergencyContact `json:"list"` List []emergencyContact `json:"list"`
} }
//添加家庭成员 // 添加家庭成员
type addFamilyPeople struct { type addFamilyPeople struct {
Id string `json:"id"` Id string `json:"id"`
List []memberOfFamily `json:"list"` List []memberOfFamily `json:"list"`
} }
//添加教育经历 // 添加教育经历
type addExpToSchool struct { type addExpToSchool struct {
Id string `json:"id"` Id string `json:"id"`
List []educationalExperience `json:"list"` List []educationalExperience `json:"list"`
} }
//编辑教育经历 // 编辑教育经历
type editExpToSchool struct { type editExpToSchool struct {
Id string `json:"id"` Id string `json:"id"`
educationalExperience educationalExperience
} }
//添加工作履历 // 添加工作履历
type addWorkHistory struct { type addWorkHistory struct {
Id string `json:"id"` Id string `json:"id"`
List []workHistoryAry `json:"list"` List []workHistoryAry `json:"list"`
} }
//编辑教育经历 // 编辑教育经历
type editWorkHistory struct { type editWorkHistory struct {
Id string `json:"id"` Id string `json:"id"`
workHistoryAry workHistoryAry
} }
//集团内部工作履历 // 集团内部工作履历
type insideHistory struct { type insideHistory struct {
Group string `json:"group"` //集团 Group string `json:"group"` //集团
Company string `json:"company"` //公司 Company string `json:"company"` //公司
@ -442,7 +444,7 @@ type insideHistory struct {
ChangeType int `json:"changetype"` //变动类型(1:预入职;2:雇佣入职;3:转正;4:晋升;5:降级;6:职等调整;7:调动调入;8:跨公司调动调入;9:借调;10:平调;11:兼职;12:预离职;13:离职;14:退休;15:返聘;16:员工初始化;) ChangeType int `json:"changetype"` //变动类型(1:预入职;2:雇佣入职;3:转正;4:晋升;5:降级;6:职等调整;7:调动调入;8:跨公司调动调入;9:借调;10:平调;11:兼职;12:预离职;13:离职;14:退休;15:返聘;16:员工初始化;)
} }
//编辑集团工作履历 // 编辑集团工作履历
type eidtInsideHistoryWork struct { type eidtInsideHistoryWork struct {
Id string `json:"id"` Id string `json:"id"`
insideHistoryerMy insideHistoryerMy

Loading…
Cancel
Save