|
@@ -78,8 +78,8 @@ type ImportEmployeeData struct { |
|
@@ -78,8 +78,8 @@ type ImportEmployeeData struct { |
78
|
|
78
|
|
79
|
// ChangePhoneData 修改手机号
|
79
|
// ChangePhoneData 修改手机号
|
80
|
type ChangePhoneData struct {
|
80
|
type ChangePhoneData struct {
|
81
|
- OldPhone string `json:"oldPhone"`
|
|
|
82
|
- NewPhone string `json:"newPhone"`
|
81
|
+ OldPhone string `json:"old_phone"`
|
|
|
82
|
+ NewPhone string `json:"new_phone"`
|
83
|
}
|
83
|
}
|
84
|
|
84
|
|
85
|
//SyncEmployeeService 同步用户数据
|
85
|
//SyncEmployeeService 同步用户数据
|
|
@@ -150,7 +150,7 @@ func (service SyncEmployeeService) DoAction(action string, byteData []byte) erro |
|
@@ -150,7 +150,7 @@ func (service SyncEmployeeService) DoAction(action string, byteData []byte) erro |
150
|
// case "batchRemove":
|
150
|
// case "batchRemove":
|
151
|
// //移动通讯录用户部门 暂时不需要
|
151
|
// //移动通讯录用户部门 暂时不需要
|
152
|
// return nil
|
152
|
// return nil
|
153
|
- case "changePhone": // TODO 修改手机号
|
153
|
+ case "changePhoneAllCompany": // TODO 修改手机号
|
154
|
// 修改手机号
|
154
|
// 修改手机号
|
155
|
var (
|
155
|
var (
|
156
|
err error
|
156
|
err error
|
|
@@ -445,7 +445,7 @@ func (service SyncEmployeeService) updateUsersStatus(data ForbidAllowUserData) e |
|
@@ -445,7 +445,7 @@ func (service SyncEmployeeService) updateUsersStatus(data ForbidAllowUserData) e |
445
|
return err
|
445
|
return err
|
446
|
}
|
446
|
}
|
447
|
|
447
|
|
448
|
-// ChangePhone 修改手机号
|
448
|
+// ChangePhone TODO 修改手机号
|
449
|
func (service SyncEmployeeService) changePhone(data ChangePhoneData) error {
|
449
|
func (service SyncEmployeeService) changePhone(data ChangePhoneData) error {
|
450
|
var (
|
450
|
var (
|
451
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
451
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
@@ -457,15 +457,31 @@ func (service SyncEmployeeService) changePhone(data ChangePhoneData) error { |
|
@@ -457,15 +457,31 @@ func (service SyncEmployeeService) changePhone(data ChangePhoneData) error { |
457
|
defer func() {
|
457
|
defer func() {
|
458
|
_ = transactionContext.RollbackTransaction()
|
458
|
_ = transactionContext.RollbackTransaction()
|
459
|
}()
|
459
|
}()
|
|
|
460
|
+
|
460
|
var uDao *dao.UsersDao
|
461
|
var uDao *dao.UsersDao
|
461
|
if uDao, err = factory.CreateUsersDao(map[string]interface{}{
|
462
|
if uDao, err = factory.CreateUsersDao(map[string]interface{}{
|
462
|
"transactionContext": transactionContext,
|
463
|
"transactionContext": transactionContext,
|
463
|
}); err != nil {
|
464
|
}); err != nil {
|
464
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
465
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
465
|
}
|
466
|
}
|
|
|
467
|
+
|
|
|
468
|
+ var pDao *dao.PartnerInfoDao
|
|
|
469
|
+ if pDao, err = factory.CreatePartnerInfoDao(map[string]interface{}{
|
|
|
470
|
+ "transactionContext": transactionContext,
|
|
|
471
|
+ }); err != nil {
|
|
|
472
|
+ return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
473
|
+ }
|
|
|
474
|
+
|
|
|
475
|
+ // 更新高管手机号
|
466
|
if err = uDao.UpdateUserPhone(data.OldPhone, data.NewPhone); err != nil {
|
476
|
if err = uDao.UpdateUserPhone(data.OldPhone, data.NewPhone); err != nil {
|
467
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
477
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
468
|
}
|
478
|
}
|
|
|
479
|
+
|
|
|
480
|
+ // 更新合伙人手机号
|
|
|
481
|
+ if err = pDao.UpdatePartnerPhone(data.OldPhone, data.NewPhone); err != nil {
|
|
|
482
|
+ return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
483
|
+ }
|
|
|
484
|
+
|
469
|
err = transactionContext.CommitTransaction()
|
485
|
err = transactionContext.CommitTransaction()
|
470
|
return err
|
486
|
return err
|
471
|
}
|
487
|
}
|