...
|
...
|
@@ -192,6 +192,7 @@ func (service SyncEmployeeService) addEmployeeData(datas []EmployeeData) error { |
|
|
ChargeStatus: data.ChargeStatus,
|
|
|
Permission: []domain.AdminPermissionBase{}, //初始化权限
|
|
|
AccessPartners: []domain.Partner{}, //默认初始化
|
|
|
AdminType: data.AdminType,
|
|
|
}
|
|
|
newUser.EntryTime, _ = time.Parse("2006-01-02", data.EntryTime)
|
|
|
if err = usersRepository.Add(&newUser); err != nil {
|
...
|
...
|
@@ -244,6 +245,7 @@ func (service SyncEmployeeService) updateEmployeeData(datas []EmployeeData) erro |
|
|
"Remarks": data.Remarks,
|
|
|
"ChargeStatus": data.ChargeStatus,
|
|
|
"EntryTime": entryTime,
|
|
|
"AdminType": data.AdminType,
|
|
|
})
|
|
|
if err = usersRepository.Edit(&oldUser); err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -369,14 +371,14 @@ func (service SyncEmployeeService) ChangeSuperAdmin(cmd command.ChanceSuperAdmin |
|
|
}
|
|
|
err = usersRepository.Edit(&oldSuperUser)
|
|
|
if err != nil {
|
|
|
e := fmt.Sprintf("更新公司主管user数据(id=%d)",
|
|
|
oldSuperUser.Id)
|
|
|
e := fmt.Sprintf("更新公司主管user数据(id=%d)失败:%s",
|
|
|
oldSuperUser.Id, err)
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, e)
|
|
|
}
|
|
|
err = usersRepository.Edit(&newSuperUser)
|
|
|
if err != nil {
|
|
|
e := fmt.Sprintf("更新公司主管user数据(id=%d)",
|
|
|
newSuperUser.Id)
|
|
|
e := fmt.Sprintf("更新公司主管user数据(id=%d)失败:%s",
|
|
|
newSuperUser.Id, err)
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, e)
|
|
|
}
|
|
|
err = transactionContext.CommitTransaction()
|
...
|
...
|
|