Merge branch 'test' of http://gitlab.fjmaimaimai.com/mmm-go/oppmg into test
正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -121,7 +121,7 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | @@ -121,7 +121,7 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | ||
| 121 | return nil, protocol.NewErrWithMessage("1", e) | 121 | return nil, protocol.NewErrWithMessage("1", e) |
| 122 | } | 122 | } |
| 123 | //理部门上级发生变化的情况 | 123 | //理部门上级发生变化的情况 |
| 124 | - if param.ParentID != 0 { | 124 | + if param.ParentID != positionUpdate.ParentId && param.ParentID != 0 { |
| 125 | parentPosition, err = models.GetPositionById(param.ParentID) | 125 | parentPosition, err = models.GetPositionById(param.ParentID) |
| 126 | if err != nil { | 126 | if err != nil { |
| 127 | e := fmt.Errorf("GetDepartmentById(%d) err:%s", param.ParentID, err) | 127 | e := fmt.Errorf("GetDepartmentById(%d) err:%s", param.ParentID, err) |
| @@ -181,7 +181,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P | @@ -181,7 +181,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P | ||
| 181 | relationLike string = oldRelation + "%" | 181 | relationLike string = oldRelation + "%" |
| 182 | newRelation string | 182 | newRelation string |
| 183 | ) | 183 | ) |
| 184 | - if newparent == nil { | 184 | + if newparent == nil || newparent.Id == 0 { |
| 185 | //修改节点为顶层节点的情况 | 185 | //修改节点为顶层节点的情况 |
| 186 | newparent = &models.Position{} | 186 | newparent = &models.Position{} |
| 187 | newRelation = fmt.Sprintf("%d", positionUpdate.Id) | 187 | newRelation = fmt.Sprintf("%d", positionUpdate.Id) |
-
请 注册 或 登录 后发表评论