作者 tangxvhui

bug 修复

... ... @@ -64,11 +64,6 @@ func (c *CompanyController) DepartmentAdd() {
return
}
if param.ParentID <= 0 {
//部门必定有上级部门 ,至少是公司一级
msg = protocol.BadRequestParam("10042")
return
}
param.CompanyID = c.GetCompanyId()
if param.CompanyID <= 0 {
log.Error("param.CompanyID <= 0")
... ...
... ... @@ -174,14 +174,14 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error {
}
//更新部门关系数据
if departUpdate.ParentId > 0 {
err = departmentRelationUpdate(departUpdate, newparent)
if err != nil {
e := fmt.Errorf("departmentRelationUpdate err:%s", err)
log.Error(e.Error())
return err
}
// if departUpdate.ParentId > 0 {
err = departmentRelationUpdate(departUpdate, newparent)
if err != nil {
e := fmt.Errorf("departmentRelationUpdate err:%s", err)
log.Error(e.Error())
return err
}
// }
return nil
}
... ...