|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package personnelapi |
|
|
|
|
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"hr_server/grocerystore" |
|
|
|
"hr_server/models" |
|
|
|
@ -82,6 +83,10 @@ func (s *StaffApi) ArchivesList(c *gin.Context) { |
|
|
|
for _, v := range manContList { |
|
|
|
var staffInfo peopleManOutList |
|
|
|
staffInfo.ManCont = v |
|
|
|
if v.IconPhoto != "" { |
|
|
|
staffInfo.Icon = v.IconPhoto |
|
|
|
} |
|
|
|
|
|
|
|
var getSpur models.Position |
|
|
|
getWhe := overallhandle.MapOut() |
|
|
|
getWhe["id"] = v.Position |
|
|
|
@ -133,6 +138,22 @@ func (s *StaffApi) ArchivesList(c *gin.Context) { |
|
|
|
staffInfo.WorkPostName = orgContTypeCont.Name |
|
|
|
} |
|
|
|
|
|
|
|
// if requestData.AdminOrg == v.AdminOrg && v.PersonInCharge == 1 {
|
|
|
|
// staffInfo.PersonInCharge = 1
|
|
|
|
// } else {
|
|
|
|
// staffInfo.PersonInCharge = 2
|
|
|
|
// }
|
|
|
|
staffInfo.PersonInCharge = 2 |
|
|
|
if v.PersonInCharge == 1 { |
|
|
|
orgResList := strings.Split(v.ResponsibleDepartment, ",") |
|
|
|
if len(orgResList) > 0 { |
|
|
|
orgIdStr := strconv.FormatInt(requestData.AdminOrg, 10) |
|
|
|
if overallhandle.IsInTrue[string](orgIdStr, orgResList) == true { |
|
|
|
staffInfo.PersonInCharge = 1 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
positionAry = append(positionAry, staffInfo) |
|
|
|
|
|
|
|
} |
|
|
|
@ -2092,6 +2113,11 @@ func (s *StaffApi) GetArchivesCon(c *gin.Context) { |
|
|
|
postisInfo.GetCont(map[string]interface{}{"`id`": satffCont.Position}, "`name`", "`person_in_charge`") |
|
|
|
staffCenter.PositionName = postisInfo.Name |
|
|
|
staffCenter.PersonInCharge = postisInfo.PersonInCharge |
|
|
|
if postisInfo.PersonInCharge != 1 { |
|
|
|
staffCenter.PersonInCharge = satffCont.PersonInCharge |
|
|
|
} |
|
|
|
} else { |
|
|
|
staffCenter.PersonInCharge = satffCont.PersonInCharge |
|
|
|
} |
|
|
|
if satffCont.JobClass != 0 { |
|
|
|
var jobsInfo models.JobClass |
|
|
|
@ -2149,6 +2175,9 @@ func (s *StaffApi) GetArchivesCon(c *gin.Context) { |
|
|
|
ruleCont.GetCont(map[string]interface{}{"`id`": satffCont.Ruleid}, "`name`") |
|
|
|
staffCenter.RuleId = strconv.FormatInt(satffCont.Ruleid, 10) |
|
|
|
staffCenter.RuleName = ruleCont.Name |
|
|
|
|
|
|
|
jsonErr := json.Unmarshal([]byte(satffCont.ResponsibleDepartmentJson), &staffCenter.OrgresList) |
|
|
|
fmt.Printf("satffCont---------->%v---------->%v---------->%v\n", satffCont.ResponsibleDepartmentJson, satffCont, jsonErr) |
|
|
|
overallhandle.Result(0, staffCenter, c) |
|
|
|
// return
|
|
|
|
} |
|
|
|
@ -2184,17 +2213,21 @@ func (s *StaffApi) GetPeopleMainCont(c *gin.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
var myCont models.PersonArchives |
|
|
|
err := myCont.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`id`", "`number`", "`name`", "`icon`", "`admin_org`", "`position`", "`teamid`", "`job_id`", "`job_class`", "`job_leve`", "`wechat`", "`work_wechat`", "`key`", "`company`", "`maindeparment`", "`sun_main_deparment`", "`ruleid`") |
|
|
|
err := myCont.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`id`", "`number`", "`name`", "`icon`", "`admin_org`", "`position`", "`teamid`", "`job_id`", "`job_class`", "`job_leve`", "`wechat`", "`work_wechat`", "`key`", "`company`", "`maindeparment`", "`sun_main_deparment`", "`ruleid`", "`icon_photo`") |
|
|
|
if err != nil { |
|
|
|
overallhandle.Result(107, requestData, c) |
|
|
|
return |
|
|
|
} |
|
|
|
// fmt.Printf("员工信息-------->%v\n", myCont)
|
|
|
|
var myInfo MyMainCont |
|
|
|
myInfo.Id = strconv.FormatInt(myCont.Id, 10) |
|
|
|
myInfo.Key = strconv.FormatInt(myCont.Key, 10) //员工key
|
|
|
|
myInfo.Number = myCont.Number //员工工号
|
|
|
|
myInfo.Name = myCont.Name //姓名
|
|
|
|
myInfo.Icon = myCont.Icon //头像
|
|
|
|
if myCont.IconPhoto != "" { |
|
|
|
myInfo.Icon = myCont.IconPhoto |
|
|
|
} |
|
|
|
myInfo.AdminOrg = myCont.AdminOrg //所属行政组织
|
|
|
|
myInfo.TeamId = myCont.TeamId //班组
|
|
|
|
myInfo.Position = myCont.Position //职位
|
|
|
|
|