...
|
...
|
@@ -152,8 +152,8 @@ func positionRelationUpdate(positionUpdate models.Position, newparent models.Pos |
|
|
//重建关系树
|
|
|
s := strings.TrimLeft(positionSubset[i].Relation, oldRelation)
|
|
|
positionSubset[i].Relation = fmt.Sprintf("%s%s", newRelation, s)
|
|
|
s1 := strings.Split(positionSubset[i].Relation, "/")
|
|
|
positionSubset[i].Level = len(s1) - 1
|
|
|
s1 := strings.Split(positionSubset[i].Relation, ",")
|
|
|
positionSubset[i].Level = len(s1) - 2
|
|
|
}
|
|
|
|
|
|
//修改部门及子级部门的relation
|
...
|
...
|
@@ -198,8 +198,8 @@ func AddPosition(data ModulePositionData) error { |
|
|
}
|
|
|
|
|
|
positioninfo.SetRelation(parentPosition)
|
|
|
s := strings.Split(positioninfo.Relation, "/")
|
|
|
positioninfo.Level = len(s) - 1
|
|
|
s := strings.Split(positioninfo.Relation, ",")
|
|
|
positioninfo.Level = len(s) - 2
|
|
|
_, err = models.AddPosition(positioninfo)
|
|
|
if err != nil {
|
|
|
log.Error("添加职位失败:%s", err)
|
...
|
...
|
|