|
|
|
@ -475,6 +475,7 @@ func Position() { |
|
|
|
overallhandle.WriteLog("e", "金蝶对照数据!", orgInfo) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var kingDeeIdAry []string |
|
|
|
//批量写入
|
|
|
|
var batchPosition []models.Position |
|
|
|
@ -483,6 +484,13 @@ func Position() { |
|
|
|
if overallhandle.StringIsInMap(v.Id, kingDeeIdAry) == false { |
|
|
|
kingDeeIdAry = append(kingDeeIdAry, v.Id) |
|
|
|
} |
|
|
|
// strconv.Atoi(v.FIsRespPosition)
|
|
|
|
personInt64, _ := strconv.Atoi(v.FIsRespPosition) |
|
|
|
|
|
|
|
//获取职务信息
|
|
|
|
var zhiwuCont models.Duties |
|
|
|
zhiwuCont.GetCont(map[string]interface{}{"kingdeeid": v.FJobID}, "id") |
|
|
|
|
|
|
|
//判断该项是否存在
|
|
|
|
var positCont models.Position |
|
|
|
positContErr := positCont.GetCont(map[string]interface{}{"kingdeeid": v.Id}) |
|
|
|
@ -503,6 +511,10 @@ func Position() { |
|
|
|
saveData["number"] = v.Fnumber |
|
|
|
isEdit = true |
|
|
|
} |
|
|
|
if zhiwuCont.Id != positCont.Duties { |
|
|
|
saveData["duties"] = zhiwuCont.Id |
|
|
|
isEdit = true |
|
|
|
} |
|
|
|
//获取行政组织
|
|
|
|
var orgCont models.AdministrativeOrganization |
|
|
|
orgContErr := orgCont.GetCont(map[string]interface{}{"kingdeeid": v.FAdminOrgUnitID}, "id", "superior") |
|
|
|
@ -540,10 +552,16 @@ func Position() { |
|
|
|
//获取知行学院及企业微信对照码
|
|
|
|
var orgOldCont models.Position |
|
|
|
orgOldErr := overall.CONSTANT_DB_HR_Jin.Model(&models.Position{}).Select("school,person_in_charge").Where("`number` = ?", v.Fnumber).First(&orgOldCont).Error |
|
|
|
positCont.PersonInCharge = personInt64 |
|
|
|
if orgOldErr == nil { |
|
|
|
positCont.PersonInCharge = orgOldCont.PersonInCharge |
|
|
|
if personInt64 != orgOldCont.PersonInCharge { |
|
|
|
if orgOldCont.PersonInCharge == 1 { |
|
|
|
positCont.PersonInCharge = orgOldCont.PersonInCharge |
|
|
|
} |
|
|
|
} |
|
|
|
positCont.School = orgOldCont.School |
|
|
|
} |
|
|
|
positCont.Duties = zhiwuCont.Id |
|
|
|
batchPosition = append(batchPosition, positCont) |
|
|
|
// if v.Id == "QBsfJ1fbSKW+3q6eOJltjHSuYS4=" {
|
|
|
|
// fmt.Printf("positCont---->%v\n", positCont)
|
|
|
|
|