作者 linmadan

修复同步变更管理员bug

... ... @@ -188,7 +188,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if _, err := employeeRepository.Save(employee); err != nil {
return false, nil
return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
}
}
... ... @@ -213,7 +213,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
case "edit":
employee, err := employeeRepository.FindOne(map[string]interface{}{"uid": uid})
if err != nil {
return false, nil
return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if employee == nil {
return false, nil
... ... @@ -228,19 +228,19 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if _, err := employeeRepository.Save(employee); err != nil {
return false, nil
return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
break
case "batchDelete":
err := employeeDao.BatchRemove(uids)
if err != nil {
return false, nil
return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
break
case "batchForbid":
err := employeeDao.BatchSetStatus(uids, status)
if err != nil {
return false, nil
return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
break
default:
... ... @@ -255,7 +255,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
case "changeAdmin":
err := employeeDao.ChangePrincipal(companyId, employeeAccount)
if err != nil {
return false, nil
return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
break
default:
... ...