|
@@ -691,12 +691,17 @@ func (srv StaffAssessServeice) GetAssessInviteUser(param *query.GetAssessInviteU |
|
@@ -691,12 +691,17 @@ func (srv StaffAssessServeice) GetAssessInviteUser(param *query.GetAssessInviteU |
|
691
|
// 保存某个员工360邀请的人员
|
691
|
// 保存某个员工360邀请的人员
|
|
692
|
func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInvite) (map[string]interface{}, error) {
|
692
|
func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInvite) (map[string]interface{}, error) {
|
|
693
|
inviteSameSuperId := []int{}
|
693
|
inviteSameSuperId := []int{}
|
|
|
|
694
|
+ userIdMap := map[int]struct{}{} //过滤重复的id
|
|
694
|
InviteDiffSuperId := []int{}
|
695
|
InviteDiffSuperId := []int{}
|
|
695
|
for _, v := range param.InviteDiffSuper {
|
696
|
for _, v := range param.InviteDiffSuper {
|
|
696
|
id, err := strconv.Atoi(v)
|
697
|
id, err := strconv.Atoi(v)
|
|
697
|
if err != nil {
|
698
|
if err != nil {
|
|
698
|
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
|
699
|
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
|
|
699
|
}
|
700
|
}
|
|
|
|
701
|
+ if _, ok := userIdMap[id]; ok {
|
|
|
|
702
|
+ continue
|
|
|
|
703
|
+ }
|
|
|
|
704
|
+ userIdMap[id] = struct{}{}
|
|
700
|
InviteDiffSuperId = append(InviteDiffSuperId, id)
|
705
|
InviteDiffSuperId = append(InviteDiffSuperId, id)
|
|
701
|
}
|
706
|
}
|
|
702
|
for _, v := range param.InviteSameSuper {
|
707
|
for _, v := range param.InviteSameSuper {
|
|
@@ -704,6 +709,10 @@ func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInv |
|
@@ -704,6 +709,10 @@ func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInv |
|
704
|
if err != nil {
|
709
|
if err != nil {
|
|
705
|
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
|
710
|
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
|
|
706
|
}
|
711
|
}
|
|
|
|
712
|
+ if _, ok := userIdMap[id]; ok {
|
|
|
|
713
|
+ continue
|
|
|
|
714
|
+ }
|
|
|
|
715
|
+ userIdMap[id] = struct{}{}
|
|
707
|
inviteSameSuperId = append(inviteSameSuperId, id)
|
716
|
inviteSameSuperId = append(inviteSameSuperId, id)
|
|
708
|
}
|
717
|
}
|
|
709
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
718
|
transactionContext, err := factory.CreateTransactionContext(nil)
|