作者 tangxvhui

bug 修复

@@ -64,11 +64,6 @@ func (c *CompanyController) DepartmentAdd() { @@ -64,11 +64,6 @@ func (c *CompanyController) DepartmentAdd() {
64 return 64 return
65 } 65 }
66 66
67 - if param.ParentID <= 0 {  
68 - //部门必定有上级部门 ,至少是公司一级  
69 - msg = protocol.BadRequestParam("10042")  
70 - return  
71 - }  
72 param.CompanyID = c.GetCompanyId() 67 param.CompanyID = c.GetCompanyId()
73 if param.CompanyID <= 0 { 68 if param.CompanyID <= 0 {
74 log.Error("param.CompanyID <= 0") 69 log.Error("param.CompanyID <= 0")
@@ -174,14 +174,14 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error { @@ -174,14 +174,14 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error {
174 174
175 } 175 }
176 //更新部门关系数据 176 //更新部门关系数据
177 - if departUpdate.ParentId > 0 {  
178 - err = departmentRelationUpdate(departUpdate, newparent)  
179 - if err != nil {  
180 - e := fmt.Errorf("departmentRelationUpdate err:%s", err)  
181 - log.Error(e.Error())  
182 - return err  
183 - } 177 + // if departUpdate.ParentId > 0 {
  178 + err = departmentRelationUpdate(departUpdate, newparent)
  179 + if err != nil {
  180 + e := fmt.Errorf("departmentRelationUpdate err:%s", err)
  181 + log.Error(e.Error())
  182 + return err
184 } 183 }
  184 + // }
185 185
186 return nil 186 return nil
187 } 187 }