...
|
...
|
@@ -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)
|
...
|
...
|
|