...
|
...
|
@@ -83,10 +83,6 @@ func (srv SyncDataUserService) AddUser(param *command.SaveUserCommand) error { |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
departmentIds := make([]int, 0)
|
|
|
for _, v := range param.UserDepartments {
|
|
|
departmentIds = append(departmentIds, v.DepartmentId)
|
|
|
}
|
|
|
nowTime := time.Now()
|
|
|
newUser := domain.User{
|
|
|
Id: param.Id,
|
...
|
...
|
@@ -94,7 +90,8 @@ func (srv SyncDataUserService) AddUser(param *command.SaveUserCommand) error { |
|
|
AvatarUrl: param.Avatar,
|
|
|
CompanyId: param.CompanyId,
|
|
|
AdminType: param.AdminType,
|
|
|
DepartmentId: departmentIds,
|
|
|
DepartmentId: param.DepartmentIds(),
|
|
|
PositionId: param.PositionIds(),
|
|
|
Name: param.Name,
|
|
|
Email: param.Email,
|
|
|
Status: param.Status,
|
...
|
...
|
@@ -156,8 +153,8 @@ func (srv SyncDataUserService) UpdateUser(param *command.SaveUserCommand) error |
|
|
newUser.AdminType = param.AdminType
|
|
|
newUser.Name = param.Name
|
|
|
newUser.Status = param.Status
|
|
|
newUser.PositionId = make([]int, 0)
|
|
|
newUser.DepartmentId = make([]int, 0)
|
|
|
newUser.PositionId = param.PositionIds()
|
|
|
newUser.DepartmentId = param.DepartmentIds()
|
|
|
|
|
|
newUser.UpdatedAt = nowTime
|
|
|
if len(userList) > 0 {
|
...
|
...
|
|