...
|
...
|
@@ -282,31 +282,32 @@ func getRangeDataRelationLsit(rankRangeId int64, rangeType int8) []protocol.Rank |
|
|
}
|
|
|
switch rangeType {
|
|
|
case models.RANK_RANGE_TYPE_DEPARTMENT:
|
|
|
//员工
|
|
|
users, err := models.GetUserCompanyByIds(relationIds)
|
|
|
//部门
|
|
|
departments, err := models.GetDepartmentByIds(relationIds)
|
|
|
if err != nil {
|
|
|
log.Error("获取员工数据失败")
|
|
|
log.Error("获取部门数据失败")
|
|
|
}
|
|
|
for i := range users {
|
|
|
for i := range departments {
|
|
|
m := protocol.RankRangeRelation{
|
|
|
Id: users[i].Id,
|
|
|
Name: users[i].NickName,
|
|
|
Id: departments[i].Id,
|
|
|
Name: departments[i].Name,
|
|
|
}
|
|
|
datalist = append(datalist, m)
|
|
|
}
|
|
|
case models.RANK_RANGE_TYPE_EMPLAYEE:
|
|
|
//部门
|
|
|
departments, err := models.GetDepartmentByIds(relationIds)
|
|
|
//员工
|
|
|
users, err := models.GetUserCompanyByIds(relationIds)
|
|
|
if err != nil {
|
|
|
log.Error("获取部门数据失败")
|
|
|
log.Error("获取员工数据失败")
|
|
|
}
|
|
|
for i := range departments {
|
|
|
for i := range users {
|
|
|
m := protocol.RankRangeRelation{
|
|
|
Id: departments[i].Id,
|
|
|
Name: departments[i].Name,
|
|
|
Id: users[i].Id,
|
|
|
Name: users[i].NickName,
|
|
|
}
|
|
|
datalist = append(datalist, m)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return datalist
|
|
|
}
|
...
|
...
|
@@ -473,31 +474,32 @@ func GetRankRangeInfo(id int64) protocol.ResponseRankRangeInfo { |
|
|
}
|
|
|
switch rankRange.Type {
|
|
|
case models.RANK_RANGE_TYPE_DEPARTMENT:
|
|
|
//员工
|
|
|
users, err := models.GetUserCompanyByIds(relationIds)
|
|
|
//部门
|
|
|
departments, err := models.GetDepartmentByIds(relationIds)
|
|
|
if err != nil {
|
|
|
log.Error("获取员工数据失败")
|
|
|
log.Error("获取部门数据失败")
|
|
|
}
|
|
|
for i := range users {
|
|
|
for i := range departments {
|
|
|
m := protocol.RankRangeRelation{
|
|
|
Id: users[i].Id,
|
|
|
Name: users[i].NickName,
|
|
|
Id: departments[i].Id,
|
|
|
Name: departments[i].Name,
|
|
|
}
|
|
|
rspdata.Relation = append(rspdata.Relation, m)
|
|
|
}
|
|
|
case models.RANK_RANGE_TYPE_EMPLAYEE:
|
|
|
//部门
|
|
|
departments, err := models.GetDepartmentByIds(relationIds)
|
|
|
//员工
|
|
|
users, err := models.GetUserCompanyByIds(relationIds)
|
|
|
if err != nil {
|
|
|
log.Error("获取部门数据失败")
|
|
|
log.Error("获取员工数据失败")
|
|
|
}
|
|
|
for i := range departments {
|
|
|
for i := range users {
|
|
|
m := protocol.RankRangeRelation{
|
|
|
Id: departments[i].Id,
|
|
|
Name: departments[i].Name,
|
|
|
Id: users[i].Id,
|
|
|
Name: users[i].NickName,
|
|
|
}
|
|
|
rspdata.Relation = append(rspdata.Relation, m)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return rspdata
|
|
|
}
|
...
|
...
|
|