作者 tangxvhui

创建公司时的bug

@@ -245,13 +245,13 @@ func AddCompanyData(data ModuleCompanytData) error { @@ -245,13 +245,13 @@ func AddCompanyData(data ModuleCompanytData) error {
245 return errors.New("处理user_department数据失败") 245 return errors.New("处理user_department数据失败")
246 } 246 }
247 //添加部门主管 247 //添加部门主管
248 - log.Info("添加department_charge表数据")  
249 - err = AddFirstDepartmentCharge(newDeparment, newUserCompany, newCompany, o)  
250 - if err != nil {  
251 - o.Rollback()  
252 - log.Error("处理部门主管数据,err:%s", err)  
253 - return errors.New("处理部门主管数据")  
254 - } 248 + // log.Info("添加department_charge表数据")
  249 + // err = AddFirstDepartmentCharge(newDeparment, newUserCompany, newCompany, o)
  250 + // if err != nil {
  251 + // o.Rollback()
  252 + // log.Error("处理部门主管数据,err:%s", err)
  253 + // return errors.New("处理部门主管数据")
  254 + // }
255 //添加角色组 255 //添加角色组
256 log.Info("添加role表数据") 256 log.Info("添加role表数据")
257 newRoleGroup, err = initRoleGroup(newCompany, o) 257 newRoleGroup, err = initRoleGroup(newCompany, o)
@@ -199,9 +199,9 @@ func departmentRelationUpdate(departmentUpdate models.Department, newparent mode @@ -199,9 +199,9 @@ func departmentRelationUpdate(departmentUpdate models.Department, newparent mode
199 for i := range departmentSubset { 199 for i := range departmentSubset {
200 err = models.UpdateDepartmentById(departmentSubset[i], []string{"ParentId", "Relation", "Level"}, o) 200 err = models.UpdateDepartmentById(departmentSubset[i], []string{"ParentId", "Relation", "Level"}, o)
201 if err != nil { 201 if err != nil {
202 - log.Error("更新position发生错误,bussiness_admin_id=%d,id=%d,err:%s", departmentSubset[i].BusinessDepartmentId, departmentSubset[i].Id, err) 202 + log.Error("更新position发生错误,bussiness_department_id=%d,id=%d,err:%s", departmentSubset[i].BusinessDepartmentId, departmentSubset[i].Id, err)
203 o.Rollback() 203 o.Rollback()
204 - return fmt.Errorf("更新position发生错误,bussiness_admin_id=%d", departmentSubset[i].BusinessDepartmentId) 204 + return fmt.Errorf("更新position发生错误,bussiness_department_id=%d", departmentSubset[i].BusinessDepartmentId)
205 } 205 }
206 } 206 }
207 o.Commit() 207 o.Commit()
@@ -254,8 +254,8 @@ func AddDepartmentData(data []ModuleDeparmentData) error { @@ -254,8 +254,8 @@ func AddDepartmentData(data []ModuleDeparmentData) error {
254 Filter("delete_at", 0). 254 Filter("delete_at", 0).
255 One(parentDepart) 255 One(parentDepart)
256 if err != nil { 256 if err != nil {
257 - log.Error("获取父级职位数据失败,business_admin_id=%d,err:%s", v.ParentId, err)  
258 - return errors.New("获取父级职位数据失败") 257 + log.Error("获取父级部门数据失败,business_department_id=%d,err:%s", v.ParentId, err)
  258 + return errors.New("获取父级部门数据失败")
259 } 259 }
260 departmentData.ParentId = parentDepart.Id 260 departmentData.ParentId = parentDepart.Id
261 departmentData.SetRelation(parentDepart) 261 departmentData.SetRelation(parentDepart)