|
@@ -125,7 +125,16 @@ public class WeComUserDetailJob {
|
|
|
List<ThirdPartWeComStaffUser> existUserList = getThirdPartWeComStaffUserListByStaffId(thirdStaffId);
|
|
List<ThirdPartWeComStaffUser> existUserList = getThirdPartWeComStaffUserListByStaffId(thirdStaffId);
|
|
|
List<Long> existUserIdList = existUserList.stream().map(ThirdPartWeComStaffUser::getUserId).collect(Collectors.toList());
|
|
List<Long> existUserIdList = existUserList.stream().map(ThirdPartWeComStaffUser::getUserId).collect(Collectors.toList());
|
|
|
Map<Long, ThirdPartWeComStaffUser> existUserMap = existUserList.stream()
|
|
Map<Long, ThirdPartWeComStaffUser> existUserMap = existUserList.stream()
|
|
|
- .collect(Collectors.toMap(ThirdPartWeComStaffUser::getUserId, user -> user));
|
|
|
|
|
|
|
+ .collect(Collectors.toMap(ThirdPartWeComStaffUser::getUserId, user -> user, (a, b) -> {
|
|
|
|
|
+ if (a.getAddCustomerTime() == 0) {
|
|
|
|
|
+ return b;
|
|
|
|
|
+ } else if (b.getAddCustomerTime() == 0) {
|
|
|
|
|
+ return a;
|
|
|
|
|
+ } else if (a.getAddCustomerTime() > b.getAddCustomerTime()) {
|
|
|
|
|
+ return b;
|
|
|
|
|
+ }
|
|
|
|
|
+ return b;
|
|
|
|
|
+ }));
|
|
|
List<ThirdPartWeComStaffUser> saveList = new ArrayList<>();
|
|
List<ThirdPartWeComStaffUser> saveList = new ArrayList<>();
|
|
|
List<ThirdPartWeComStaffUser> updateList = new ArrayList<>();
|
|
List<ThirdPartWeComStaffUser> updateList = new ArrayList<>();
|
|
|
for (ExternalContactsResponse.ContactItem contactItem : contactItemList) {
|
|
for (ExternalContactsResponse.ContactItem contactItem : contactItemList) {
|