|
|
|
|
package personnelapi
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"fmt"
|
|
|
|
|
"hr_server/models"
|
|
|
|
|
"hr_server/overall"
|
|
|
|
|
"hr_server/overall/overallhandle"
|
|
|
|
|
"strconv"
|
|
|
|
|
"strings"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 08:27:51
|
|
|
|
|
@ 功能: 主表数据处理(荣信表格模版)
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 人员信息
|
|
|
|
|
#meritsYear 绩效年度
|
|
|
|
|
#rewPunYearsmap 奖惩年度
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) ProcessMainTableRongXinNew(info map[int]string, meritsYear, rewPunYearsmap map[int]int, orgId string) {
|
|
|
|
|
if g.UserKey == 0 { //判断是否有唯一标识符
|
|
|
|
|
g.UserKey = overallhandle.OnlyOneNumber(2)
|
|
|
|
|
}
|
|
|
|
|
curryTime := time.Now().Unix()
|
|
|
|
|
if g.IsOk { //新增员工信息
|
|
|
|
|
var userInfo models.PersonArchives
|
|
|
|
|
userInfo.Key = g.UserKey //唯一编号
|
|
|
|
|
userInfo.Name = info[3] //姓名"`
|
|
|
|
|
userInfo.Number = info[2] //工号
|
|
|
|
|
userInfo.HireClass = 1 //雇佣类型(1:雇佣入职;2:再入职;)"`
|
|
|
|
|
userInfo.EmpType = 4 //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)"`
|
|
|
|
|
orgIdInt, _ := strconv.ParseInt(orgId, 10, 64)
|
|
|
|
|
userInfo.ExcelTemplate = orgIdInt //信息来源于哪个模板
|
|
|
|
|
userInfo.Time = curryTime //写入时间"`
|
|
|
|
|
userInfo.EiteTime = curryTime //编辑时间"`
|
|
|
|
|
userInfo.State = 1 //状态(1:启用;2:禁用;3:删除)`
|
|
|
|
|
userInfo.Key = g.UserKey //key"`
|
|
|
|
|
var md5JiaMi overallhandle.Md5Encryption
|
|
|
|
|
md5JiaMi.Md5EncryptionInit(overall.CONSTANT_CONFIG.Appsetup.DefaultPassword)
|
|
|
|
|
md5Token := md5JiaMi.Md5EncryptionAlgorithm()
|
|
|
|
|
userInfo.Password = md5Token //密码"`
|
|
|
|
|
userInfo.IsShowTrue = 1 //信息锁定
|
|
|
|
|
|
|
|
|
|
var adminOrg int64 //最终行政组织
|
|
|
|
|
var allOrgId []int64 //行政范围
|
|
|
|
|
|
|
|
|
|
//判定公司
|
|
|
|
|
if info[4] != "" { //判断主公司
|
|
|
|
|
var comOrg models.AdministrativeOrganization
|
|
|
|
|
comOrg.GetCont(map[string]interface{}{"`name`": info[4]}, "`id`")
|
|
|
|
|
if comOrg.Id != 0 {
|
|
|
|
|
var sunOrg overallhandle.GetOrgAllParent //获取当前公司下的所有子行政组织
|
|
|
|
|
if info[5] != "" { //判断子公司
|
|
|
|
|
var sunComOrg models.AdministrativeOrganization
|
|
|
|
|
sunComOrg.GetCont(map[string]interface{}{"`name`": info[5], "`superior`": comOrg.Id}, "`id`")
|
|
|
|
|
if sunComOrg.Id != 0 {
|
|
|
|
|
userInfo.Company = sunComOrg.Id //入职公司"`
|
|
|
|
|
adminOrg = sunComOrg.Id
|
|
|
|
|
} else {
|
|
|
|
|
userInfo.Company = comOrg.Id //入职公司"`
|
|
|
|
|
adminOrg = comOrg.Id
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
userInfo.Company = comOrg.Id //入职公司"`
|
|
|
|
|
adminOrg = comOrg.Id
|
|
|
|
|
}
|
|
|
|
|
sunOrg.GetGCSOrgSonAllId(adminOrg)
|
|
|
|
|
sunOrg.Id = append(sunOrg.Id, adminOrg)
|
|
|
|
|
allOrgId = sunOrg.Id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
//主部门
|
|
|
|
|
if info[6] != "" {
|
|
|
|
|
mastOrg := GetMyOrgSunId(info[6], allOrgId)
|
|
|
|
|
if mastOrg != 0 {
|
|
|
|
|
userInfo.MainDeparment = mastOrg //主部门"`
|
|
|
|
|
adminOrg = mastOrg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//二级部门
|
|
|
|
|
if info[7] != "" {
|
|
|
|
|
suntOrg := GetMyOrgSunId(info[7], allOrgId)
|
|
|
|
|
if suntOrg != 0 {
|
|
|
|
|
userInfo.SunMainDeparment = suntOrg //主部门"`
|
|
|
|
|
adminOrg = suntOrg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//工段
|
|
|
|
|
if info[8] != "" {
|
|
|
|
|
postOrg := GetMyOrgSunId(info[87], allOrgId)
|
|
|
|
|
if postOrg != 0 {
|
|
|
|
|
userInfo.WorkSection = postOrg //主部门"`
|
|
|
|
|
adminOrg = postOrg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//根据最终行政组织获取职务等信息
|
|
|
|
|
if adminOrg != 0 {
|
|
|
|
|
userInfo.AdminOrg = adminOrg //所属行政组织"`
|
|
|
|
|
userInfo.Position, userInfo.JobId, userInfo.PersonInCharge = GetMyPositisName(info[9], adminOrg)
|
|
|
|
|
}
|
|
|
|
|
switch info[10] {
|
|
|
|
|
case "一级":
|
|
|
|
|
userInfo.JobLeve = 1 // 职务等级"`
|
|
|
|
|
case "二级":
|
|
|
|
|
userInfo.JobLeve = 2 // 职务等级"`
|
|
|
|
|
case "三级":
|
|
|
|
|
userInfo.JobLeve = 3 // 职务等级"`
|
|
|
|
|
case "四级":
|
|
|
|
|
userInfo.JobLeve = 4 // 职务等级"`
|
|
|
|
|
case "五级":
|
|
|
|
|
userInfo.JobLeve = 5 // 职务等级"`
|
|
|
|
|
case "协议":
|
|
|
|
|
userInfo.JobLeve = 6 // 协议"`
|
|
|
|
|
default:
|
|
|
|
|
}
|
|
|
|
|
if info[11] != "" {
|
|
|
|
|
userInfo.PositionCategory = info[11]
|
|
|
|
|
}
|
|
|
|
|
if info[12] != "" { //管理类型
|
|
|
|
|
var jobInfo models.JobClass
|
|
|
|
|
jobInfo.GetCont(map[string]interface{}{"`name`": info[12]}, "`id`")
|
|
|
|
|
if jobInfo.Id != 0 {
|
|
|
|
|
userInfo.JobClass = jobInfo.Id //管理类别"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if info[34] != "" { //微信号
|
|
|
|
|
userInfo.Wechat = info[34]
|
|
|
|
|
}
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Create(&userInfo).Error
|
|
|
|
|
if err != nil {
|
|
|
|
|
g.Msg = append(g.Msg, fmt.Sprintf("%v[%v]处理失败!--- %v 原因:%v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11), err))
|
|
|
|
|
g.MsgStr = fmt.Sprintf("%v[%v]处理失败!--- %v 原因:%v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11), err)
|
|
|
|
|
} else {
|
|
|
|
|
g.Msg = append(g.Msg, fmt.Sprintf("%v[%v]处理完成!--- %v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11)))
|
|
|
|
|
g.MsgStr = fmt.Sprintf("%v[%v]处理完成!--- %v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11))
|
|
|
|
|
}
|
|
|
|
|
} else { //修改员工信息
|
|
|
|
|
editInfo := overallhandle.MapOut()
|
|
|
|
|
if info[3] != "" {
|
|
|
|
|
editInfo["`name`"] = info[3]
|
|
|
|
|
}
|
|
|
|
|
var adminOrg int64
|
|
|
|
|
var allOrgId []int64
|
|
|
|
|
//判定公司
|
|
|
|
|
if info[4] != "" { //判断主公司
|
|
|
|
|
var comOrg models.AdministrativeOrganization
|
|
|
|
|
comOrg.GetCont(map[string]interface{}{"`name`": info[4]}, "`id`")
|
|
|
|
|
if comOrg.Id != 0 {
|
|
|
|
|
var sunOrg overallhandle.GetOrgAllParent //获取当前公司下的所有子行政组织
|
|
|
|
|
if info[5] != "" { //判断子公司
|
|
|
|
|
var sunComOrg models.AdministrativeOrganization
|
|
|
|
|
sunComOrg.GetCont(map[string]interface{}{"`name`": info[5], "`superior`": comOrg.Id}, "`id`")
|
|
|
|
|
if sunComOrg.Id != 0 {
|
|
|
|
|
editInfo["`company`"] = sunComOrg.Id //入职公司"`
|
|
|
|
|
adminOrg = sunComOrg.Id
|
|
|
|
|
} else {
|
|
|
|
|
editInfo["`company`"] = comOrg.Id //入职公司"`
|
|
|
|
|
adminOrg = comOrg.Id
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
editInfo["`company`"] = comOrg.Id //入职公司"`
|
|
|
|
|
adminOrg = comOrg.Id
|
|
|
|
|
}
|
|
|
|
|
sunOrg.GetGCSOrgSonAllId(adminOrg)
|
|
|
|
|
sunOrg.Id = append(sunOrg.Id, adminOrg)
|
|
|
|
|
allOrgId = sunOrg.Id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
//主部门
|
|
|
|
|
if info[6] != "" {
|
|
|
|
|
mastOrg := GetMyOrgSunId(info[6], allOrgId)
|
|
|
|
|
if mastOrg != 0 {
|
|
|
|
|
editInfo["`maindeparment`"] = mastOrg //主部门"`
|
|
|
|
|
adminOrg = mastOrg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//二级部门
|
|
|
|
|
if info[7] != "" {
|
|
|
|
|
suntOrg := GetMyOrgSunId(info[7], allOrgId)
|
|
|
|
|
if suntOrg != 0 {
|
|
|
|
|
editInfo["`sun_main_deparment`"] = suntOrg //主部门"`
|
|
|
|
|
adminOrg = suntOrg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//工段
|
|
|
|
|
if info[8] != "" {
|
|
|
|
|
postOrg := GetMyOrgSunId(info[87], allOrgId)
|
|
|
|
|
if postOrg != 0 {
|
|
|
|
|
editInfo["`work_section`"] = postOrg //主部门"`
|
|
|
|
|
adminOrg = postOrg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//根据最终行政组织获取职务等信息
|
|
|
|
|
if adminOrg != 0 {
|
|
|
|
|
editInfo["`admin_org`"] = adminOrg //所属行政组织"`
|
|
|
|
|
position, jobId, PersonInCharge := GetMyPositisName(info[9], adminOrg)
|
|
|
|
|
if position != 0 {
|
|
|
|
|
editInfo["`position`"] = position
|
|
|
|
|
}
|
|
|
|
|
if jobId != 0 {
|
|
|
|
|
editInfo["`job_id`"] = jobId
|
|
|
|
|
}
|
|
|
|
|
if PersonInCharge != 0 {
|
|
|
|
|
editInfo["`person_in_charge`"] = PersonInCharge
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switch info[10] {
|
|
|
|
|
case "一级":
|
|
|
|
|
editInfo["`job_leve`"] = 1 // 职务等级"`
|
|
|
|
|
case "二级":
|
|
|
|
|
editInfo["`job_leve`"] = 2 // 职务等级"`
|
|
|
|
|
case "三级":
|
|
|
|
|
editInfo["`job_leve`"] = 3 // 职务等级"`
|
|
|
|
|
case "四级":
|
|
|
|
|
editInfo["`job_leve`"] = 4 // 职务等级"`
|
|
|
|
|
case "五级":
|
|
|
|
|
editInfo["`job_leve`"] = 5 // 职务等级"`
|
|
|
|
|
case "协议":
|
|
|
|
|
editInfo["`job_leve`"] = 6 // 协议"`
|
|
|
|
|
default:
|
|
|
|
|
}
|
|
|
|
|
if info[11] != "" {
|
|
|
|
|
editInfo["PositionCategory"] = info[11]
|
|
|
|
|
}
|
|
|
|
|
if info[12] != "" { //管理类型
|
|
|
|
|
var jobInfo models.JobClass
|
|
|
|
|
jobInfo.GetCont(map[string]interface{}{"`name`": info[12]}, "`id`")
|
|
|
|
|
if jobInfo.Id != 0 {
|
|
|
|
|
editInfo["`job_class`"] = jobInfo.Id //管理类别"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if info[34] != "" { //微信号
|
|
|
|
|
editInfo["`wechat`"] = info[34]
|
|
|
|
|
}
|
|
|
|
|
editInfo["`eite_time`"] = curryTime
|
|
|
|
|
editInfo["`is_show_true`"] = 1
|
|
|
|
|
editInfo["`excel_template`"] = orgId
|
|
|
|
|
var userInfo models.PersonArchives
|
|
|
|
|
err := userInfo.EiteCont(map[string]interface{}{"`key`": g.UserKey}, editInfo)
|
|
|
|
|
// fmt.Printf("编辑信息:%v\n", err)
|
|
|
|
|
if err != nil {
|
|
|
|
|
g.Msg = append(g.Msg, fmt.Sprintf("%v[%v]处理失败!--- %v 原因:%v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11), err))
|
|
|
|
|
g.MsgStr = fmt.Sprintf("%v[%v]处理失败!--- %v 原因:%v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11), err)
|
|
|
|
|
} else {
|
|
|
|
|
g.Msg = append(g.Msg, fmt.Sprintf("%v[%v]处理完成!--- %v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11)))
|
|
|
|
|
g.MsgStr = fmt.Sprintf("%v[%v]处理完成!--- %v", info[3], info[2], overallhandle.UnixTimeToDay(curryTime, 11))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//协程处理附属信息
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.OrgChannelInfoRx(info[4], info[5], info[6], info[7], info[8], "电子表格导入数据") //行政组织变更
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.AuxiliaryTableUserRx(info) //人员信息副本(荣信)
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.PoliticalOutlookEditRx(info) //政治面貌
|
|
|
|
|
synPros.Add(1)
|
|
|
|
|
go g.EditEducationInfoRx(info) //学历信息
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.FamilyMembersRx(info) //家庭成员
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.GrowthExpWitTheGroupRx(info, orgId) //集团内成长经历
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.ExtWorkExpOfTheGroupRx(info) //集团外部工作经历
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.EditExamLevelRx(info, meritsYear) //绩效考核成绩
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.EditRewPunRx(info, rewPunYearsmap) //奖惩记录
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.EditAcaTitleRx(info) //编辑职称
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.EditCerFicRx(info) //编辑证书
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.TalentInventoryNew(info, orgId) //人才盘点
|
|
|
|
|
// synPros.Add(1)
|
|
|
|
|
// go g.EditTrain(info) //培训
|
|
|
|
|
//监听所有协程都完成
|
|
|
|
|
synPros.Wait()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2025-04-09 10:52:06
|
|
|
|
|
@ 功能: 培训记录
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditTrain(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
// var trainInfo []models.TrainingLog
|
|
|
|
|
// err := overall.CONSTANT_DB_HR.Where("`userkey` = ?", g.UserKey).Find(&trainInfo).Error
|
|
|
|
|
// if err != nil || len(trainInfo) < 1 {
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
if info[340] != "" {
|
|
|
|
|
TrainEdit(g.UserKey, 1, info[340])
|
|
|
|
|
}
|
|
|
|
|
if info[341] != "" {
|
|
|
|
|
TrainEdit(g.UserKey, 2, info[341])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2025-04-09 11:09:26
|
|
|
|
|
@ 功能: 数据处理
|
|
|
|
|
*/
|
|
|
|
|
func TrainEdit(userKey int64, insout int, content string) {
|
|
|
|
|
var trainInfo models.TrainingLog
|
|
|
|
|
overall.CONSTANT_DB_HR.Where("`userkey` = ? AND `insout` = ?", userKey, insout).Find(&trainInfo)
|
|
|
|
|
if trainInfo.Id == 0 {
|
|
|
|
|
if content != "" {
|
|
|
|
|
var writeTrainInfo models.TrainingLog
|
|
|
|
|
writeTrainInfo.Insout = insout
|
|
|
|
|
writeTrainInfo.Centont = content
|
|
|
|
|
writeTrainInfo.Time = time.Now().Unix()
|
|
|
|
|
writeTrainInfo.EditTime = time.Now().Unix()
|
|
|
|
|
writeTrainInfo.Userkey = userKey
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&writeTrainInfo)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
editInfo := overallhandle.MapOut()
|
|
|
|
|
editInfo["centont"] = content
|
|
|
|
|
editInfo["insout"] = insout
|
|
|
|
|
editInfo["editTime"] = time.Now().Unix()
|
|
|
|
|
trainInfo.EiteTeamGroupCont(map[string]interface{}{"`id`": trainInfo.Id}, editInfo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-24 16:05:30
|
|
|
|
|
@ 功能: 荣信专供证书
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditCerFicRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var cerHonList []models.CertificateHonors
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`userKey` = ?", g.UserKey).Find(&cerHonList).Error
|
|
|
|
|
if err != nil || len(cerHonList) < 1 {
|
|
|
|
|
if info[339] != "" {
|
|
|
|
|
titleAry := strings.Split(info[339], ";")
|
|
|
|
|
fmt.Printf("证书--%v---%v---%T-->%v\n", g.UserNum, info[339], titleAry, titleAry)
|
|
|
|
|
for i, v := range titleAry {
|
|
|
|
|
fmt.Printf("证书-%v-->%v\n", i, v)
|
|
|
|
|
if v != "" {
|
|
|
|
|
g.EditCertificateCont(v, "", "", "", "", "", "是")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
jsonInfo, _ := json.Marshal(cerHonList)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧证书数据!", string(jsonInfo))
|
|
|
|
|
var workGroupLogCont models.CertificateHonors
|
|
|
|
|
workGroupLogCont.DelCont(map[string]interface{}{"`userKey`": g.UserKey})
|
|
|
|
|
if info[339] != "" {
|
|
|
|
|
titleAry := strings.Split(info[339], ";")
|
|
|
|
|
fmt.Printf("证书--%v---%v---%T-->%v\n", g.UserNum, info[339], titleAry, titleAry)
|
|
|
|
|
for i, v := range titleAry {
|
|
|
|
|
fmt.Printf("证书-%v-->%v\n", i, v)
|
|
|
|
|
if v != "" {
|
|
|
|
|
g.EditCertificateCont(v, "", "", "", "", "", "是")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-24 15:58:32
|
|
|
|
|
@ 功能: 荣信职称信息
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditAcaTitleRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var acaList []models.AcademicTitle
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`userKey` = ?", g.UserKey).Find(&acaList).Error
|
|
|
|
|
if err != nil || len(acaList) < 1 {
|
|
|
|
|
//新增职称
|
|
|
|
|
if info[338] != "" {
|
|
|
|
|
// g.InsetAcaInfoRx(info[322], info[323], info[324], "", "")
|
|
|
|
|
g.InsetAcaInfoRxNew(info[338])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//原先有数据
|
|
|
|
|
jsonInfo, _ := json.Marshal(acaList)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧职称数据!", string(jsonInfo))
|
|
|
|
|
var workGroupLogCont models.AcademicTitle
|
|
|
|
|
workGroupLogCont.DelCont(map[string]interface{}{"`userKey`": g.UserKey})
|
|
|
|
|
//新增职称
|
|
|
|
|
if info[338] != "" {
|
|
|
|
|
// g.InsetAcaInfoRx(info[322], info[323], info[324], "", "")
|
|
|
|
|
g.InsetAcaInfoRxNew(info[338])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-02-04 13:39:42
|
|
|
|
|
@ 功能: 写入职称
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) InsetAcaInfoRx(types, series, speciality, number, timeVal string) {
|
|
|
|
|
titleAry := strings.Split(types, ";")
|
|
|
|
|
// fmt.Printf("职称-%v-->%v\n", g.UserNum, titleAry)
|
|
|
|
|
for _, v := range titleAry {
|
|
|
|
|
if v != "" {
|
|
|
|
|
// fmt.Printf("职称-%v-%v-->%v\n", g.UserNum, i, v)
|
|
|
|
|
g.InsetAcaInfo(v, series, speciality, number, timeVal)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *GroupParsingData) InsetAcaInfoRxNew(timeVal string) {
|
|
|
|
|
var acaInfo models.AcademicTitle
|
|
|
|
|
acaInfo.TitleAndLevel = timeVal //职称级别"`
|
|
|
|
|
|
|
|
|
|
acaInfo.EditTime = time.Now().Unix() //写入时间"`
|
|
|
|
|
acaInfo.UserKey = g.UserKey //人员唯一识别符"`
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&acaInfo)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-28 09:28:07
|
|
|
|
|
@ 功能: 人才盘点
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 表格数据
|
|
|
|
|
#orgId 行政组织
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) TalentInventoryNew(info map[int]string, orgId string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
currentYear := overallhandle.UnixTimeToDay(time.Now().Unix(), 16)
|
|
|
|
|
switch orgId {
|
|
|
|
|
case "312":
|
|
|
|
|
EditTalentInventory(g.UserKey, currentYear, info[313], info[314], "", info[312])
|
|
|
|
|
default:
|
|
|
|
|
EditTalentInventory(g.UserKey, currentYear, info[313], info[314], "", "")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-27 14:03:14
|
|
|
|
|
@ 功能: 编辑证书(荣信)
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditCertificateRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var cerHonList []models.CertificateHonors
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`userKey` = ?", g.UserKey).Find(&cerHonList).Error
|
|
|
|
|
if err != nil || len(cerHonList) < 1 {
|
|
|
|
|
if info[346] != "" {
|
|
|
|
|
g.EditCertificateCont(info[345], info[346], info[347], info[348], info[349], info[350], "是")
|
|
|
|
|
}
|
|
|
|
|
if info[352] != "" {
|
|
|
|
|
g.EditCertificateCont(info[351], info[352], info[353], info[354], info[355], info[356], "是")
|
|
|
|
|
}
|
|
|
|
|
if info[358] != "" {
|
|
|
|
|
g.EditCertificateCont(info[357], info[358], info[359], info[360], info[361], info[362], "是")
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
jsonInfo, _ := json.Marshal(cerHonList)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧证书数据!", string(jsonInfo))
|
|
|
|
|
var workGroupLogCont models.CertificateHonors
|
|
|
|
|
workGroupLogCont.DelCont(map[string]interface{}{"`userKey`": g.UserKey})
|
|
|
|
|
if info[346] != "" {
|
|
|
|
|
g.EditCertificateCont(info[345], info[346], info[347], info[348], info[349], info[350], "是")
|
|
|
|
|
}
|
|
|
|
|
if info[352] != "" {
|
|
|
|
|
g.EditCertificateCont(info[351], info[352], info[353], info[354], info[355], info[356], "是")
|
|
|
|
|
}
|
|
|
|
|
if info[358] != "" {
|
|
|
|
|
g.EditCertificateCont(info[357], info[358], info[359], info[360], info[361], info[362], "是")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-27 13:58:10
|
|
|
|
|
@ 功能: 编辑职称
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditAcademicTitleRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var acaList []models.AcademicTitle
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`userKey` = ?", g.UserKey).Find(&acaList).Error
|
|
|
|
|
if err != nil || len(acaList) < 1 {
|
|
|
|
|
//新增职称
|
|
|
|
|
if info[335] != "" {
|
|
|
|
|
g.InsetAcaInfo(info[335], info[336], info[337], info[338], info[339])
|
|
|
|
|
}
|
|
|
|
|
if info[340] != "" {
|
|
|
|
|
g.InsetAcaInfo(info[340], info[341], info[342], info[343], info[344])
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//原先有数据
|
|
|
|
|
jsonInfo, _ := json.Marshal(acaList)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧职称数据!", string(jsonInfo))
|
|
|
|
|
var workGroupLogCont models.AcademicTitle
|
|
|
|
|
workGroupLogCont.DelCont(map[string]interface{}{"`userKey`": g.UserKey})
|
|
|
|
|
if info[335] != "" {
|
|
|
|
|
g.InsetAcaInfo(info[335], info[336], info[337], info[338], info[339])
|
|
|
|
|
}
|
|
|
|
|
if info[340] != "" {
|
|
|
|
|
g.InsetAcaInfo(info[340], info[341], info[342], info[343], info[344])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-27 13:44:40
|
|
|
|
|
@ 功能: 编辑奖惩记录
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditRewPunRx(info map[int]string, rewPunYearsmap map[int]int) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
if val, isOk := rewPunYearsmap[0]; isOk {
|
|
|
|
|
g.EditRewPunInfoRx(val, info[320], info[321], info[322], info[323], info[324], info[325])
|
|
|
|
|
}
|
|
|
|
|
if val, isOk := rewPunYearsmap[1]; isOk {
|
|
|
|
|
g.EditRewPunInfoRx(val, info[326], info[327], info[328], info[329], info[330], info[331])
|
|
|
|
|
}
|
|
|
|
|
if val, isOk := rewPunYearsmap[2]; isOk {
|
|
|
|
|
g.EditRewPunInfoRx(val, info[332], info[333], info[334], info[335], info[336], info[337])
|
|
|
|
|
}
|
|
|
|
|
// if val, isOk := rewPunYearsmap[3]; isOk {
|
|
|
|
|
// g.EditRewPunInfoRx(val, info[325], info[326], info[327], info[328], info[329], info[330])
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 写入奖惩记录
|
|
|
|
|
func (g *GroupParsingData) EditRewPunInfoRx(years int, level, rewPunClass, title, timeData, issuingUnit, prePunNum string) {
|
|
|
|
|
var oldId []int64
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Model(&models.RewardsPenalties{}).Select("`id`").Where("`months` = 0 AND `userkey` = ? AND `years` = ?", g.UserKey, years).Find(&oldId).Error
|
|
|
|
|
|
|
|
|
|
// var rewPunYearCont models.RewardsPenalties
|
|
|
|
|
// err := rewPunYearCont.GetCont(map[string]interface{}{"`userkey`": g.UserKey, "`years`": years, "`months`": 0})
|
|
|
|
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
if len(oldId) > 0 {
|
|
|
|
|
overall.CONSTANT_DB_HR.Where("`id` IN ? ", oldId).Delete(&models.RewardsPenalties{})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
timeVal := time.Now().Unix()
|
|
|
|
|
if timeData != "" {
|
|
|
|
|
timeVal = overallhandle.ExcelDateToDate(timeData).Unix()
|
|
|
|
|
// fmt.Printf("奖惩记录3: %v\n", timeVal)
|
|
|
|
|
}
|
|
|
|
|
if title != "" {
|
|
|
|
|
titleAry := strings.Split(title, ";")
|
|
|
|
|
for _, v := range titleAry {
|
|
|
|
|
if v != "" {
|
|
|
|
|
var rewPunYearCont models.RewardsPenalties
|
|
|
|
|
jiangCeng := RewPunLevelClassStr(rewPunClass)
|
|
|
|
|
rewPunYearCont.Title = v //奖励/处分项目"`
|
|
|
|
|
rewPunYearCont.UserKey = g.UserKey //获得人员"`
|
|
|
|
|
if jiangCeng <= 6 {
|
|
|
|
|
rewPunYearCont.Types = 1 //类型(1:奖励;2:处分;)`
|
|
|
|
|
} else {
|
|
|
|
|
rewPunYearCont.Types = 2 //类型(1:奖励;2:处分;)`
|
|
|
|
|
}
|
|
|
|
|
rewPunYearCont.State = 1 //状态(1:启用;2:禁用;3:删除)`
|
|
|
|
|
rewPunYearCont.IssuingUnit = issuingUnit //颁发单位"`
|
|
|
|
|
|
|
|
|
|
rewPunYearCont.TimeData = timeVal //获得时间"`
|
|
|
|
|
|
|
|
|
|
rewPunYearCont.Years = years //年"`
|
|
|
|
|
rewPunYearCont.Months = 0 //月"`
|
|
|
|
|
rewPunYearCont.Level = RewPunLevelStr(level) //奖惩级别(1:部门级;2:公司级;3:县级;4:市级;5:省级;6:国家级)"`
|
|
|
|
|
rewPunYearCont.RewPunClass = jiangCeng //奖惩类型(1:年终评优;2:表扬;3:嘉奖;4:记功;5:记大功;6:特别奖励;7:批评;8:警告;9:记过;10:记大过;11:降级;12:留用察看;13:开除)"`
|
|
|
|
|
rewPunYearCont.RewPunNumber = prePunNum
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&rewPunYearCont)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-27 13:25:00
|
|
|
|
|
@ 功能: 编辑考核成绩(荣信)
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 表单内容
|
|
|
|
|
#meritsYear 年份
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditExamLevelRx(info map[int]string, meritsYear map[int]int) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
if val, isOk := meritsYear[0]; isOk {
|
|
|
|
|
g.EditExamLevelInfoRongXin(info[306], info[307], val)
|
|
|
|
|
}
|
|
|
|
|
if val, isOk := meritsYear[1]; isOk {
|
|
|
|
|
g.EditExamLevelInfoRongXin(info[308], info[309], val)
|
|
|
|
|
}
|
|
|
|
|
if val, isOk := meritsYear[2]; isOk {
|
|
|
|
|
g.EditExamLevelInfoRongXin(info[310], info[311], val)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 11:32:26
|
|
|
|
|
@ 功能: 集团外部工作经历
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) ExtWorkExpOfTheGroupRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var workList []models.WorkHistory
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`key` = ?", g.UserKey).Find(&workList).Error
|
|
|
|
|
if err != nil || len(workList) < 1 { //没有记录进行新增
|
|
|
|
|
if info[240] != "" { //集团外工作经历1
|
|
|
|
|
g.ExternalWorkGroupLog(info[240], info[241], info[242], info[243], info[244], info[245], info[246], info[247], info[248], info[249], info[250], info[251], info[252])
|
|
|
|
|
}
|
|
|
|
|
if info[253] != "" { //集团外工作经历2
|
|
|
|
|
g.ExternalWorkGroupLog(info[253], info[254], info[255], info[256], info[257], info[258], info[259], info[260], info[261], info[262], info[263], info[264], info[265])
|
|
|
|
|
}
|
|
|
|
|
if info[266] != "" { //集团外工作经历3
|
|
|
|
|
g.ExternalWorkGroupLog(info[266], info[267], info[268], info[269], info[270], info[271], info[272], info[273], info[274], info[275], info[276], info[277], info[278])
|
|
|
|
|
}
|
|
|
|
|
if info[279] != "" { //集团外工作经历4
|
|
|
|
|
g.ExternalWorkGroupLog(info[279], info[280], info[281], info[282], info[283], info[284], info[285], info[286], info[287], info[288], info[289], info[290], info[291])
|
|
|
|
|
}
|
|
|
|
|
if info[292] != "" { //集团外工作经历5
|
|
|
|
|
g.ExternalWorkGroupLog(info[292], info[293], info[294], info[295], info[296], info[297], info[298], info[299], info[230], info[231], info[232], info[233], info[234])
|
|
|
|
|
}
|
|
|
|
|
} else { //已经存在历史记录了
|
|
|
|
|
jsonInfo, _ := json.Marshal(workList)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧集团外部工作经历数据!", string(jsonInfo))
|
|
|
|
|
var workGroupLogCont models.WorkHistory
|
|
|
|
|
workGroupLogCont.DelCont(map[string]interface{}{"`key`": g.UserKey})
|
|
|
|
|
if info[240] != "" { //集团外工作经历1
|
|
|
|
|
g.ExternalWorkGroupLog(info[240], info[241], info[242], info[243], info[244], info[245], info[246], info[247], info[248], info[249], info[250], info[251], info[252])
|
|
|
|
|
}
|
|
|
|
|
if info[253] != "" { //集团外工作经历2
|
|
|
|
|
g.ExternalWorkGroupLog(info[253], info[254], info[255], info[256], info[257], info[258], info[259], info[260], info[261], info[262], info[263], info[264], info[265])
|
|
|
|
|
}
|
|
|
|
|
if info[266] != "" { //集团外工作经历3
|
|
|
|
|
g.ExternalWorkGroupLog(info[266], info[267], info[268], info[269], info[270], info[271], info[272], info[273], info[274], info[275], info[276], info[277], info[278])
|
|
|
|
|
}
|
|
|
|
|
if info[279] != "" { //集团外工作经历4
|
|
|
|
|
g.ExternalWorkGroupLog(info[279], info[280], info[281], info[282], info[283], info[284], info[285], info[286], info[287], info[288], info[289], info[290], info[291])
|
|
|
|
|
}
|
|
|
|
|
if info[292] != "" { //集团外工作经历5
|
|
|
|
|
g.ExternalWorkGroupLog(info[292], info[293], info[294], info[295], info[296], info[297], info[298], info[299], info[300], info[301], info[302], info[303], info[304])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 11:23:58
|
|
|
|
|
@ 功能: 集团内成长经历
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) GrowthExpWitTheGroupRx(info map[int]string, orgId string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var growInGroup []models.InsideWorkHistory
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`key` = ?", g.UserKey).Find(&growInGroup).Error
|
|
|
|
|
if err != nil || len(growInGroup) < 1 {
|
|
|
|
|
//没有集团经历,那么进行新增
|
|
|
|
|
if info[99] != "" { //集团内工作经历1
|
|
|
|
|
g.EditGroupInWorkLog(info[99], info[100], info[101], info[102], info[103], info[104], info[105], info[106], info[107], info[108], info[109], info[110], info[111], info[112], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[113] != "" { //集团内工作经历2
|
|
|
|
|
g.EditGroupInWorkLog(info[113], info[114], info[115], info[116], info[117], info[118], info[119], info[120], info[121], info[122], info[123], info[124], info[125], info[126], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[127] != "" { //集团内工作经历3
|
|
|
|
|
g.EditGroupInWorkLog(info[127], info[128], info[129], info[130], info[131], info[132], info[133], info[134], info[135], info[136], info[137], info[138], info[139], info[140], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[141] != "" { //集团内工作经历4
|
|
|
|
|
g.EditGroupInWorkLog(info[141], info[142], info[143], info[144], info[145], info[146], info[147], info[148], info[149], info[150], info[151], info[152], info[153], info[154], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[155] != "" { //集团内工作经历5
|
|
|
|
|
g.EditGroupInWorkLog(info[155], info[156], info[157], info[158], info[159], info[160], info[161], info[162], info[163], info[164], info[165], info[166], info[167], info[168], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[169] != "" { //集团内工作经历6
|
|
|
|
|
g.EditGroupInWorkLog(info[169], info[170], info[171], info[172], info[173], info[174], info[175], info[176], info[177], info[178], info[179], info[180], info[181], info[182], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[183] != "" { //集团内工作经历7
|
|
|
|
|
g.EditGroupInWorkLog(info[183], info[184], info[185], info[186], info[187], info[188], info[189], info[190], info[191], info[192], info[193], info[194], info[195], info[196], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[197] != "" { //集团内工作经历8
|
|
|
|
|
g.EditGroupInWorkLog(info[197], info[198], info[199], info[200], info[201], info[202], info[203], info[204], info[205], info[206], info[207], info[208], info[209], info[210], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[211] != "" { //集团内工作经历9
|
|
|
|
|
g.EditGroupInWorkLog(info[211], info[212], info[213], info[214], info[215], info[216], info[217], info[218], info[219], info[220], info[221], info[222], info[223], info[224], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[225] != "" { //集团内工作经历10
|
|
|
|
|
g.EditGroupInWorkLog(info[225], info[226], info[227], info[228], info[229], info[230], info[231], info[232], info[233], info[234], info[235], info[236], info[237], info[238], orgId)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//有集团经历,那么删除旧的经历再新增
|
|
|
|
|
jsonInfo, _ := json.Marshal(growInGroup)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧集团内部经历数据!", string(jsonInfo))
|
|
|
|
|
var workGroupLogCont models.InsideWorkHistory
|
|
|
|
|
workGroupLogCont.DelCont(map[string]interface{}{"`key`": g.UserKey})
|
|
|
|
|
if info[99] != "" { //集团内工作经历1
|
|
|
|
|
g.EditGroupInWorkLog(info[99], info[100], info[101], info[102], info[103], info[104], info[105], info[106], info[107], info[108], info[109], info[110], info[111], info[112], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[113] != "" { //集团内工作经历2
|
|
|
|
|
g.EditGroupInWorkLog(info[113], info[114], info[115], info[116], info[117], info[118], info[119], info[120], info[121], info[122], info[123], info[124], info[125], info[126], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[127] != "" { //集团内工作经历3
|
|
|
|
|
g.EditGroupInWorkLog(info[127], info[128], info[129], info[130], info[131], info[132], info[133], info[134], info[135], info[136], info[137], info[138], info[139], info[140], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[141] != "" { //集团内工作经历4
|
|
|
|
|
g.EditGroupInWorkLog(info[141], info[142], info[143], info[144], info[145], info[146], info[147], info[148], info[149], info[150], info[151], info[152], info[153], info[154], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[155] != "" { //集团内工作经历5
|
|
|
|
|
g.EditGroupInWorkLog(info[155], info[156], info[157], info[158], info[159], info[160], info[161], info[162], info[163], info[164], info[165], info[166], info[167], info[168], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[169] != "" { //集团内工作经历6
|
|
|
|
|
g.EditGroupInWorkLog(info[169], info[170], info[171], info[172], info[173], info[174], info[175], info[176], info[177], info[178], info[179], info[180], info[181], info[182], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[183] != "" { //集团内工作经历7
|
|
|
|
|
g.EditGroupInWorkLog(info[183], info[184], info[185], info[186], info[187], info[188], info[189], info[190], info[191], info[192], info[193], info[194], info[195], info[196], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[197] != "" { //集团内工作经历8
|
|
|
|
|
g.EditGroupInWorkLog(info[197], info[198], info[199], info[200], info[201], info[202], info[203], info[204], info[205], info[206], info[207], info[208], info[209], info[210], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[211] != "" { //集团内工作经历9
|
|
|
|
|
g.EditGroupInWorkLog(info[211], info[212], info[213], info[214], info[215], info[216], info[217], info[218], info[219], info[220], info[221], info[222], info[223], info[224], orgId)
|
|
|
|
|
}
|
|
|
|
|
if info[225] != "" { //集团内工作经历10
|
|
|
|
|
g.EditGroupInWorkLog(info[225], info[226], info[227], info[228], info[229], info[230], info[231], info[232], info[233], info[234], info[235], info[236], info[237], info[238], orgId)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 11:13:08
|
|
|
|
|
@ 功能: 家庭成员
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) FamilyMembersRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var familyAry []models.FamilyMembers
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Where("`key` = ?", g.UserKey).Find(&familyAry).Error
|
|
|
|
|
if err != nil || len(familyAry) < 1 { //不存在,新增
|
|
|
|
|
if info[61] != "" && info[62] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[61], info[62], info[63], info[64], info[65], info[66], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[67] != "" && info[68] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[67], info[68], info[69], info[70], info[71], info[72], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[73] != "" && info[74] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[73], info[74], info[75], info[76], info[77], info[78], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[79] != "" && info[80] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[79], info[80], info[81], info[82], info[83], info[84], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[85] != "" && info[86] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[85], info[86], info[87], info[88], info[89], info[90], "否")
|
|
|
|
|
}
|
|
|
|
|
} else { //存在,删除旧数据后,再新增
|
|
|
|
|
jsonInfo, _ := json.Marshal(familyAry)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧家庭成员数据!", string(jsonInfo))
|
|
|
|
|
var familyCont models.FamilyMembers
|
|
|
|
|
familyCont.DelCont(map[string]interface{}{"`key`": g.UserKey})
|
|
|
|
|
if info[61] != "" && info[62] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[61], info[62], info[63], info[64], info[65], info[66], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[67] != "" && info[68] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[67], info[68], info[69], info[70], info[71], info[72], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[73] != "" && info[74] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[73], info[74], info[75], info[76], info[77], info[78], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[79] != "" && info[80] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[79], info[80], info[81], info[82], info[83], info[84], "否")
|
|
|
|
|
}
|
|
|
|
|
if info[85] != "" && info[86] != "" {
|
|
|
|
|
g.EditFamilyInfo(info[85], info[86], info[87], info[88], info[89], info[90], "否")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 11:05:13
|
|
|
|
|
@ 功能:
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 电子表格信息
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) EditEducationInfoRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var mySchoolLog []models.PersonnelEducation
|
|
|
|
|
err := overall.CONSTANT_DB_HR.Model(&models.PersonnelEducation{}).Where("`key` = ?", g.UserKey).Find(&mySchoolLog).Error
|
|
|
|
|
|
|
|
|
|
xul, _ := json.Marshal(info)
|
|
|
|
|
fmt.Printf("\n\n获取得学历--------->%v\n\n", string(xul)) //专业"`
|
|
|
|
|
if err != nil || len(mySchoolLog) < 1 { //不存在,新增
|
|
|
|
|
if info[36] != "" || info[38] != "" { //第一学历
|
|
|
|
|
g.AddOneSchollLog(info[36], "1", "", info[38], info[37], "", info[39], info[40], info[41], 2)
|
|
|
|
|
}
|
|
|
|
|
if info[42] != "" || info[44] != "" { //最高学历
|
|
|
|
|
g.AddOneSchollLog(info[42], "1", "", info[44], info[43], "", info[45], info[46], info[47], 3)
|
|
|
|
|
}
|
|
|
|
|
if info[48] != "" || info[50] != "" { //其他学历
|
|
|
|
|
g.AddOneSchollLog(info[48], "1", "", info[50], info[49], "", info[51], info[52], info[53], 1)
|
|
|
|
|
}
|
|
|
|
|
if info[54] != "" || info[56] != "" { //其他学历
|
|
|
|
|
g.AddOneSchollLog(info[54], "1", "", info[56], info[55], "", info[57], info[58], info[59], 1)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//存在,删除旧的,再新增
|
|
|
|
|
jsonInfo, _ := json.Marshal(mySchoolLog)
|
|
|
|
|
overallhandle.WriteLog("del", "删除旧集团外部工作经历数据!", string(jsonInfo))
|
|
|
|
|
var delScho models.PersonnelEducation
|
|
|
|
|
delScho.DelCont(map[string]interface{}{"`key`": g.UserKey})
|
|
|
|
|
if info[36] != "" || info[38] != "" { //第一学历
|
|
|
|
|
g.AddOneSchollLog(info[36], "1", "", info[38], info[37], "", info[39], info[40], info[41], 2)
|
|
|
|
|
}
|
|
|
|
|
if info[42] != "" || info[44] != "" { //最高学历
|
|
|
|
|
g.AddOneSchollLog(info[42], "1", "", info[44], info[43], "", info[45], info[46], info[47], 3)
|
|
|
|
|
}
|
|
|
|
|
if info[48] != "" || info[50] != "" { //其他学历
|
|
|
|
|
g.AddOneSchollLog(info[48], "1", "", info[50], info[49], "", info[51], info[52], info[53], 1)
|
|
|
|
|
}
|
|
|
|
|
if info[54] != "" || info[56] != "" { //其他学历
|
|
|
|
|
g.AddOneSchollLog(info[54], "1", "", info[56], info[55], "", info[57], info[58], info[59], 1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 10:39:34
|
|
|
|
|
@ 功能: 政治面貌
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 电子表格信息
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) PoliticalOutlookEditRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
if info[331] != "" {
|
|
|
|
|
var polOutInfo models.PoliticalIdentity
|
|
|
|
|
err := polOutInfo.GetCont(map[string]interface{}{"`userkey`": g.UserKey})
|
|
|
|
|
if err != nil { //不存在,新增
|
|
|
|
|
polOutInfo.Userkey = g.UserKey //员工唯一识别符;"`
|
|
|
|
|
polOutInfo.PoliticalOutlook = politiToInt(info[331]) //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"`
|
|
|
|
|
if info[332] != "" {
|
|
|
|
|
polOutInfo.JoinTime = overallhandle.ExcelDateToDate(info[332]).Unix() //加入时间"`
|
|
|
|
|
}
|
|
|
|
|
polOutInfo.Branch = info[333] //所在党支部"`
|
|
|
|
|
polOutInfo.Bosition = info[334] //党内职务"`
|
|
|
|
|
polOutInfo.Time = time.Now().Unix() //创建时间"`
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&polOutInfo)
|
|
|
|
|
} else {
|
|
|
|
|
//存在,编辑内容
|
|
|
|
|
editCont := overallhandle.MapOut()
|
|
|
|
|
if info[331] != "" {
|
|
|
|
|
poloutName := politiToInt(info[331])
|
|
|
|
|
if poloutName != polOutInfo.PoliticalOutlook {
|
|
|
|
|
editCont["`political_outlook`"] = poloutName
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if info[332] != "" {
|
|
|
|
|
joinTimeVal := overallhandle.ExcelDateToDate(info[332]).Unix()
|
|
|
|
|
if joinTimeVal != polOutInfo.JoinTime {
|
|
|
|
|
editCont["`joinTime`"] = joinTimeVal
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if info[333] != "" && info[333] != polOutInfo.Branch {
|
|
|
|
|
editCont["`branch`"] = info[333]
|
|
|
|
|
}
|
|
|
|
|
if info[334] != "" && info[334] != polOutInfo.Bosition {
|
|
|
|
|
editCont["`position`"] = info[334]
|
|
|
|
|
}
|
|
|
|
|
if len(editCont) > 0 {
|
|
|
|
|
editCont["`time`"] = time.Now().Unix()
|
|
|
|
|
polOutInfo.EiteCont(map[string]interface{}{"`userkey`": g.UserKey}, editCont)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
var polOutInfo models.PoliticalIdentity
|
|
|
|
|
polOutInfo.DelCont(map[string]interface{}{"`userkey`": g.UserKey})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-20 09:13:44
|
|
|
|
|
@ 功能:人员信息副本(荣信)
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 电子表格信息
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) AuxiliaryTableUserRx(info map[int]string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var myInfo models.PersonnelContent
|
|
|
|
|
err := myInfo.GetCont(map[string]interface{}{"`key`": g.UserKey}, "`number`")
|
|
|
|
|
if err != nil { //附属内容不存在,进行新增。
|
|
|
|
|
myInfo.Key = g.UserKey //Key"`
|
|
|
|
|
myInfo.Number = g.UserNum //员工工号;index"`
|
|
|
|
|
myInfo.Idcardno = info[26] //身份证号
|
|
|
|
|
myInfo.Mobilephone = info[31] //手机号码"`
|
|
|
|
|
myInfo.Email = info[35] //电子邮件"`
|
|
|
|
|
myInfo.Gender = genderToInt(info[13]) //性别(1:男性;2:女性;3:中性)"`
|
|
|
|
|
if info[14] != "" {
|
|
|
|
|
myInfo.Birthday = overallhandle.ExcelDateToDate(info[14]).Unix() //生日"`
|
|
|
|
|
}
|
|
|
|
|
myInfo.Myfolk = info[16] //民族"`
|
|
|
|
|
myInfo.Nativeplace = info[22] //籍贯"`
|
|
|
|
|
if info[27] != "" {
|
|
|
|
|
myInfo.Idcardstartdate = overallhandle.ExcelDateToDate(info[27]).Unix() //身份证有效期开始"`
|
|
|
|
|
}
|
|
|
|
|
if info[28] != "" {
|
|
|
|
|
myInfo.Idcardenddate = overallhandle.ExcelDateToDate(info[28]).Unix() //身份证有效期结束"`
|
|
|
|
|
}
|
|
|
|
|
myInfo.Idcardaddress = info[30] //身份证地址"`
|
|
|
|
|
myInfo.Health = healthToInt(info[18]) //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"`
|
|
|
|
|
myInfo.Maritalstatus = maritalstatusToInt(info[17]) //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"`
|
|
|
|
|
myInfo.Currentresidence = info[21] //现居住地址"`
|
|
|
|
|
myInfo.Time = time.Now().Unix() //创建时间"`
|
|
|
|
|
myInfo.Constellation = consteToInt(info[24]) //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"`
|
|
|
|
|
if info[91] == "是" {
|
|
|
|
|
myInfo.Isdoubleworker = 1 //是否双职工(1:是;2:否)"`
|
|
|
|
|
g.WorkingCoupleRx(info, true)
|
|
|
|
|
} else {
|
|
|
|
|
myInfo.Isdoubleworker = 2 //是否双职工(1:是;2:否)"`
|
|
|
|
|
g.WorkingCoupleRx(info, false)
|
|
|
|
|
}
|
|
|
|
|
if info[316] != "" {
|
|
|
|
|
myInfo.Jobstartdate = overallhandle.ExcelDateToDate(info[316]).Unix() //参加工作日期"`
|
|
|
|
|
}
|
|
|
|
|
if info[318] != "" {
|
|
|
|
|
myInfo.Entrydate = overallhandle.ExcelDateToDate(info[318]).Unix() //入职日期"`
|
|
|
|
|
}
|
|
|
|
|
if info[19] != "" {
|
|
|
|
|
myInfo.PoliticalOutlook = politiToInt(info[19]) //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"`
|
|
|
|
|
}
|
|
|
|
|
// if info[18] != "" {
|
|
|
|
|
// myInfo.PoliticalOutlook = politiToInt(info[18]) //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"`
|
|
|
|
|
// }
|
|
|
|
|
myInfo.MaritalstatusCn = info[17] //婚姻状况汉字说明"`
|
|
|
|
|
myInfo.ConstellationingCn = info[24] //星座汉字说明"`
|
|
|
|
|
myInfo.PoliticalOutlookCn = info[19] //政治面貌汉字说明"`
|
|
|
|
|
myInfo.HealthCn = info[18] //健康状况中文说明"`
|
|
|
|
|
myInfo.CareerPlanning = info[313] //职业生涯规划"`
|
|
|
|
|
myInfo.HelpObtained = info[314] //个人期望从组织获得的帮助"`
|
|
|
|
|
myInfo.Hobby = info[25] //爱好"`
|
|
|
|
|
myInfo.DomicileType = info[20] //户籍类型
|
|
|
|
|
if info[29] == "是" {
|
|
|
|
|
myInfo.IdCardnoLongTerm = 1 //身份证是否长期有效(1:是;2:否)
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
myInfo.IdCardnoLongTerm = 2 //身份证是否长期有效(1:是;2:否)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
myInfo.MobileShortNumber = info[31] //手机小号
|
|
|
|
|
myInfo.Channel = JoinJobChanel(info[315]) //入职渠道(1:社会招聘;2:校园招聘;3:内部推荐)
|
|
|
|
|
myInfo.BloodType = info[22] //血型
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&myInfo)
|
|
|
|
|
} else { //附属内容存在,进行编辑。
|
|
|
|
|
editCont := overallhandle.MapOut()
|
|
|
|
|
editCont["`idcardno`"] = info[26] //身份证号
|
|
|
|
|
editCont["`mobilephone`"] = info[31] //电话号码
|
|
|
|
|
editCont["`email`"] = info[35] //邮箱
|
|
|
|
|
editCont["`gender`"] = genderToInt(info[13]) //性别
|
|
|
|
|
if info[14] != "" {
|
|
|
|
|
editCont["`birthday`"] = overallhandle.ExcelDateToDate(info[14]).Unix()
|
|
|
|
|
}
|
|
|
|
|
editCont["`myfolk`"] = info[16]
|
|
|
|
|
editCont["`nativeplace`"] = info[22] //籍贯
|
|
|
|
|
if info[27] != "" {
|
|
|
|
|
editCont["`idcardstartdate`"] = overallhandle.ExcelDateToDate(info[27]).Unix()
|
|
|
|
|
}
|
|
|
|
|
if info[28] != "" {
|
|
|
|
|
editCont["`idcardenddate`"] = overallhandle.ExcelDateToDate(info[28]).Unix()
|
|
|
|
|
}
|
|
|
|
|
editCont["`idcardaddress`"] = info[30] //身份证地址
|
|
|
|
|
editCont["`health`"] = healthToInt(info[18]) //健康状况
|
|
|
|
|
editCont["`maritalstatus`"] = maritalstatusToInt(info[17]) //婚姻
|
|
|
|
|
editCont["`currentresidence`"] = info[21] //现居住地址
|
|
|
|
|
editCont["`constellationing`"] = consteToInt(info[24]) //星座
|
|
|
|
|
if info[91] == "是" {
|
|
|
|
|
editCont["`isdoubleworker`"] = 1 //是否双职工(1:是;2:否)"`
|
|
|
|
|
g.WorkingCoupleRx(info, true)
|
|
|
|
|
} else {
|
|
|
|
|
editCont["`isdoubleworker`"] = 2 //是否双职工(1:是;2:否)"`
|
|
|
|
|
g.WorkingCoupleRx(info, false)
|
|
|
|
|
}
|
|
|
|
|
if info[316] != "" {
|
|
|
|
|
editCont["`jobstartdate`"] = overallhandle.ExcelDateToDate(info[316]).Unix()
|
|
|
|
|
}
|
|
|
|
|
if info[318] != "" {
|
|
|
|
|
editCont["`entrydate`"] = overallhandle.ExcelDateToDate(info[318]).Unix()
|
|
|
|
|
}
|
|
|
|
|
if info[19] != "" {
|
|
|
|
|
editCont["`political_outlook`"] = politiToInt(info[19])
|
|
|
|
|
}
|
|
|
|
|
editCont["`maritalstatus_cn`"] = info[17]
|
|
|
|
|
editCont["`constellationing_cn`"] = info[24]
|
|
|
|
|
editCont["`political_outlook_cn`"] = info[19]
|
|
|
|
|
editCont["`health_cn`"] = info[18]
|
|
|
|
|
editCont["`career_planning`"] = info[313]
|
|
|
|
|
editCont["`help_obtained`"] = info[314]
|
|
|
|
|
editCont["`hobby`"] = info[25]
|
|
|
|
|
editCont["`domicile_type`"] = info[20]
|
|
|
|
|
if info[29] == "是" {
|
|
|
|
|
editCont["`idCardnoLongTerm`"] = 1 //身份证是否长期有效(1:是;2:否)
|
|
|
|
|
} else {
|
|
|
|
|
editCont["`idCardnoLongTerm`"] = 2 //身份证是否长期有效(1:是;2:否)
|
|
|
|
|
}
|
|
|
|
|
editCont["`mobileShortNumber`"] = info[31]
|
|
|
|
|
editCont["`channel`"] = JoinJobChanel(info[315])
|
|
|
|
|
editCont["`bloodType`"] = info[22]
|
|
|
|
|
editCont["`time`"] = time.Now().Unix()
|
|
|
|
|
myInfo.EiteCont(map[string]interface{}{"`key`": g.UserKey}, editCont)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-27 08:47:04
|
|
|
|
|
@ 功能: 双职工处理
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#info 表单内容
|
|
|
|
|
#isTrue 是否为双职工
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) WorkingCoupleRx(info map[int]string, isTrue bool) {
|
|
|
|
|
var doubleWorkMan []models.DoubleWorker
|
|
|
|
|
overall.CONSTANT_DB_HR.Where("`key` = ?", g.UserKey).Find(&doubleWorkMan) //获取旧数据
|
|
|
|
|
if isTrue {
|
|
|
|
|
if len(doubleWorkMan) < 1 { //无记录,新增
|
|
|
|
|
NewAddDoubleWorkRx(g.UserKey, g.UserNum, info)
|
|
|
|
|
} else {
|
|
|
|
|
oldId := int64(0)
|
|
|
|
|
for _, v := range doubleWorkMan {
|
|
|
|
|
if v.Name == info[92] {
|
|
|
|
|
oldId = v.Id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if oldId != 0 { //存在,数据编辑
|
|
|
|
|
editInfo := overallhandle.MapOut()
|
|
|
|
|
editInfo["`name`"] = info[92]
|
|
|
|
|
editInfo["`company`"] = info[93]
|
|
|
|
|
editInfo["`department`"] = info[94]
|
|
|
|
|
editInfo["`position`"] = info[96]
|
|
|
|
|
editInfo["`workPosit`"] = info[96]
|
|
|
|
|
editInfo["`workUnit`"] = info[95]
|
|
|
|
|
// editInfo["`levele`"] = info[89]
|
|
|
|
|
if info[97] != "" {
|
|
|
|
|
editInfo["`joinTime`"] = overallhandle.ExcelDateToDate(info[97]).Unix()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
editInfo["`tel`"] = info[98]
|
|
|
|
|
editInfo["`time`"] = time.Now().Unix()
|
|
|
|
|
editInfo["`state`"] = 1
|
|
|
|
|
var editCont models.DoubleWorker
|
|
|
|
|
editCont.EiteCont(map[string]interface{}{"`id`": oldId}, editInfo)
|
|
|
|
|
} else {
|
|
|
|
|
NewAddDoubleWorkRx(g.UserKey, g.UserNum, info)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else { //不是双职工,软删除老数据
|
|
|
|
|
if len(doubleWorkMan) > 0 {
|
|
|
|
|
var delDoubleWork models.DoubleWorker
|
|
|
|
|
delDoubleWork.EiteCont(map[string]interface{}{"`key`": g.UserKey}, map[string]interface{}{"`state`": 3})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-08-27 09:25:01
|
|
|
|
|
@ 功能: 新增双职工(荣信模版)
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#userKey 人员KEY
|
|
|
|
|
#userNum 人员工号
|
|
|
|
|
#info 电子表格信息
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func NewAddDoubleWorkRx(userKey int64, userNum string, info map[int]string) {
|
|
|
|
|
var inSetInfo models.DoubleWorker
|
|
|
|
|
inSetInfo.Key = userKey //
|
|
|
|
|
inSetInfo.Number = userNum //"`
|
|
|
|
|
inSetInfo.Name = info[92] //姓名"`
|
|
|
|
|
inSetInfo.Company = info[93] //所在公司"`
|
|
|
|
|
inSetInfo.Department = info[94] //所在部门"`
|
|
|
|
|
inSetInfo.Position = info[96] //所在岗位"`
|
|
|
|
|
inSetInfo.WorkUnit = info[95]
|
|
|
|
|
inSetInfo.WorkPosit = info[96]
|
|
|
|
|
|
|
|
|
|
// inSetInfo.Levele = info[89]
|
|
|
|
|
if info[97] != "" {
|
|
|
|
|
inSetInfo.JoinTime = overallhandle.ExcelDateToDate(info[97]).Unix()
|
|
|
|
|
}
|
|
|
|
|
inSetInfo.Tel = info[98] //联系方式"`
|
|
|
|
|
inSetInfo.Time = time.Now().Unix() //创建时间"`
|
|
|
|
|
inSetInfo.State = 1 //状态(1:启用;2:禁用;3:删除)`
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&inSetInfo)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-09-05 09:50:36
|
|
|
|
|
@ 功能: 行政组织变动
|
|
|
|
|
@ 参数
|
|
|
|
|
|
|
|
|
|
#company 公司
|
|
|
|
|
#firstDepartment 第一部门
|
|
|
|
|
#secondaryDepartment 第二部门
|
|
|
|
|
#workshop 工段
|
|
|
|
|
#notes 备注
|
|
|
|
|
|
|
|
|
|
@ 返回值
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
@ 方法原型
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
*/
|
|
|
|
|
func (g *GroupParsingData) OrgChannelInfoRx(company, sunCompany, firstDepartment, secondaryDepartment, workshop, notes string) {
|
|
|
|
|
defer synPros.Done()
|
|
|
|
|
var orgChangeInfo []models.OrgChangeRecord
|
|
|
|
|
overall.CONSTANT_DB_HR.Model(&models.OrgChangeRecord{}).Where("`userKey` = ?", g.UserKey).Find(&orgChangeInfo)
|
|
|
|
|
if len(orgChangeInfo) > 0 {
|
|
|
|
|
var comId int64
|
|
|
|
|
var firstDepId int64
|
|
|
|
|
var secDepId int64
|
|
|
|
|
var workspId int64
|
|
|
|
|
var allOrgId []int64
|
|
|
|
|
//公司
|
|
|
|
|
if company != "" {
|
|
|
|
|
var comOrg models.AdministrativeOrganization
|
|
|
|
|
comOrg.GetCont(map[string]interface{}{"`name`": company}, "`id`")
|
|
|
|
|
if comOrg.Id != 0 {
|
|
|
|
|
if sunCompany != "" { //判断子公司
|
|
|
|
|
var sunComOrg models.AdministrativeOrganization
|
|
|
|
|
sunComOrg.GetCont(map[string]interface{}{"`name`": sunCompany, "`superior`": comOrg.Id}, "`id`")
|
|
|
|
|
if sunComOrg.Id != 0 {
|
|
|
|
|
comId = sunComOrg.Id //入职公司"`
|
|
|
|
|
} else {
|
|
|
|
|
comId = comOrg.Id //入职公司"`
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
comId = comOrg.Id //入职公司"`
|
|
|
|
|
}
|
|
|
|
|
var sunOrg overallhandle.GetOrgAllParent
|
|
|
|
|
sunOrg.GetGCSOrgSonAllId(comId)
|
|
|
|
|
sunOrg.Id = append(sunOrg.Id, comId)
|
|
|
|
|
allOrgId = sunOrg.Id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if firstDepartment != "" {
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
mastOrg := GetMyOrgSunId(firstDepartment, allOrgId)
|
|
|
|
|
if mastOrg != 0 {
|
|
|
|
|
firstDepId = mastOrg //主部门"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if secondaryDepartment != "" {
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
suntOrg := GetMyOrgSunId(secondaryDepartment, allOrgId)
|
|
|
|
|
if suntOrg != 0 {
|
|
|
|
|
secDepId = suntOrg //二级主部门"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if workshop != "" {
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
postOrg := GetMyOrgSunId(workshop, allOrgId)
|
|
|
|
|
if postOrg != 0 {
|
|
|
|
|
workspId = postOrg //二级主部门"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
isEdit := true
|
|
|
|
|
for _, v := range orgChangeInfo {
|
|
|
|
|
if v.CompanyCn == company {
|
|
|
|
|
if v.FirstDepartment != firstDepartment {
|
|
|
|
|
if v.SecondaryDepartment != secondaryDepartment {
|
|
|
|
|
if v.WorkShop != workshop {
|
|
|
|
|
isEdit = false
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if isEdit {
|
|
|
|
|
var inSetInfo models.OrgChangeRecord
|
|
|
|
|
inSetInfo.Userkey = g.UserKey
|
|
|
|
|
inSetInfo.CompanyCn = company
|
|
|
|
|
inSetInfo.FirstDepartment = firstDepartment
|
|
|
|
|
inSetInfo.SecondaryDepartment = secondaryDepartment
|
|
|
|
|
inSetInfo.WorkShop = workshop
|
|
|
|
|
inSetInfo.CompanyId = comId //入职公司"`
|
|
|
|
|
inSetInfo.FirstDepartmentId = firstDepId //主部门"`
|
|
|
|
|
inSetInfo.SecondaryDepartmentId = secDepId //二级主部门"`
|
|
|
|
|
inSetInfo.WorkShopid = workspId //二级主部门"`
|
|
|
|
|
inSetInfo.Time = time.Now().Unix()
|
|
|
|
|
inSetInfo.Notes = "表格导入信息行政组织调动"
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&inSetInfo)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
var inSetInfo models.OrgChangeRecord
|
|
|
|
|
inSetInfo.Userkey = g.UserKey
|
|
|
|
|
inSetInfo.CompanyCn = company
|
|
|
|
|
inSetInfo.FirstDepartment = firstDepartment
|
|
|
|
|
inSetInfo.SecondaryDepartment = secondaryDepartment
|
|
|
|
|
inSetInfo.WorkShop = workshop
|
|
|
|
|
|
|
|
|
|
var allOrgId []int64
|
|
|
|
|
//公司
|
|
|
|
|
if company != "" {
|
|
|
|
|
var comOrg models.AdministrativeOrganization
|
|
|
|
|
comOrg.GetCont(map[string]interface{}{"`name`": company}, "`id`")
|
|
|
|
|
if comOrg.Id != 0 {
|
|
|
|
|
|
|
|
|
|
var sunOrg overallhandle.GetOrgAllParent
|
|
|
|
|
|
|
|
|
|
if sunCompany != "" { //判断子公司
|
|
|
|
|
var sunComOrg models.AdministrativeOrganization
|
|
|
|
|
sunComOrg.GetCont(map[string]interface{}{"`name`": sunCompany, "`superior`": comOrg.Id}, "`id`")
|
|
|
|
|
if sunComOrg.Id != 0 {
|
|
|
|
|
inSetInfo.CompanyId = sunComOrg.Id //入职公司"`
|
|
|
|
|
sunOrg.GetGCSOrgSonAllId(sunComOrg.Id)
|
|
|
|
|
sunOrg.Id = append(sunOrg.Id, sunComOrg.Id)
|
|
|
|
|
} else {
|
|
|
|
|
inSetInfo.CompanyId = comOrg.Id //入职公司"`
|
|
|
|
|
sunOrg.GetGCSOrgSonAllId(comOrg.Id)
|
|
|
|
|
sunOrg.Id = append(sunOrg.Id, comOrg.Id)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
inSetInfo.CompanyId = comOrg.Id //入职公司"`
|
|
|
|
|
sunOrg.GetGCSOrgSonAllId(comOrg.Id)
|
|
|
|
|
sunOrg.Id = append(sunOrg.Id, comOrg.Id)
|
|
|
|
|
}
|
|
|
|
|
allOrgId = sunOrg.Id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if firstDepartment != "" {
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
mastOrg := GetMyOrgSunId(firstDepartment, allOrgId)
|
|
|
|
|
if mastOrg != 0 {
|
|
|
|
|
inSetInfo.FirstDepartmentId = mastOrg //主部门"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if secondaryDepartment != "" {
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
suntOrg := GetMyOrgSunId(secondaryDepartment, allOrgId)
|
|
|
|
|
if suntOrg != 0 {
|
|
|
|
|
inSetInfo.SecondaryDepartmentId = suntOrg //二级主部门"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if workshop != "" {
|
|
|
|
|
if len(allOrgId) > 0 {
|
|
|
|
|
postOrg := GetMyOrgSunId(workshop, allOrgId)
|
|
|
|
|
if postOrg != 0 {
|
|
|
|
|
inSetInfo.WorkShopid = postOrg //二级主部门"`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
inSetInfo.Time = time.Now().Unix()
|
|
|
|
|
inSetInfo.Notes = "初始化表格导入信息"
|
|
|
|
|
overall.CONSTANT_DB_HR.Create(&inSetInfo)
|
|
|
|
|
}
|
|
|
|
|
}
|