作者 yangfu

Merge branch 'test' of http://gitlab.fjmaimaimai.com/mmm-go/oppmg into test

... ... @@ -121,7 +121,7 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio
return nil, protocol.NewErrWithMessage("1", e)
}
//理部门上级发生变化的情况
if param.ParentID != 0 {
if param.ParentID != positionUpdate.ParentId && param.ParentID != 0 {
parentPosition, err = models.GetPositionById(param.ParentID)
if err != nil {
e := fmt.Errorf("GetDepartmentById(%d) err:%s", param.ParentID, err)
... ... @@ -181,7 +181,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P
relationLike string = oldRelation + "%"
newRelation string
)
if newparent == nil {
if newparent == nil || newparent.Id == 0 {
//修改节点为顶层节点的情况
newparent = &models.Position{}
newRelation = fmt.Sprintf("%d", positionUpdate.Id)
... ...