作者 庄敏学

同步用户增加入职日期

... ... @@ -8,6 +8,7 @@ type SaveUserCommand struct {
AdminType int `json:"admin_type"` // 1普通员工 2 主管理员
Name string `json:"name"` // 用户姓名
Status int `json:"status"` // 用户状态(1正常 2禁用)
EntryTime string `json:"entryTime"` //入职日期
Email string `json:"email"` // 邮箱
UserDepartments []struct {
DepartmentId int `json:"department_id" `
... ...
... ... @@ -102,6 +102,7 @@ func (srv SyncDataUserService) AddUser(param *command.SaveUserCommand) error {
Name: param.Name,
Email: param.Email,
Status: param.Status,
EntryTime: param.EntryTime,
UpdatedAt: nowTime,
CreatedAt: nowTime,
}
... ... @@ -160,6 +161,7 @@ func (srv SyncDataUserService) UpdateUser(param *command.SaveUserCommand) error
newUser.AdminType = param.AdminType
newUser.Name = param.Name
newUser.Status = param.Status
newUser.EntryTime = param.EntryTime
newUser.PositionId = param.PositionIds()
newUser.DepartmentId = param.DepartmentIds()
... ... @@ -294,6 +296,7 @@ func (srv SyncDataUserService) importUser(param *command.ImportUserCommand) erro
editUserList[i].Name = mVal.Name
editUserList[i].Status = mVal.Status
editUserList[i].CompanyId = mVal.CompanyId
editUserList[i].EntryTime = mVal.EntryTime
editUserList[i].UpdatedAt = nowTime
_, err = userRepo.Update(editUserList[i])
if err != nil {
... ... @@ -312,6 +315,7 @@ func (srv SyncDataUserService) importUser(param *command.ImportUserCommand) erro
AdminType: param.AddUsers[i].AdminType,
Name: param.AddUsers[i].Name,
Status: param.AddUsers[i].Status,
EntryTime: param.AddUsers[i].EntryTime,
UpdatedAt: nowTime,
DeletedAt: nil,
CreatedAt: nowTime,
... ...