作者 tangxvhui

创建公司时的bug

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