|
@@ -178,7 +178,14 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
|
|
|
//联系人
|
|
|
if (!vo.getCustomers().isEmpty()){
|
|
|
- for (CustomerInfoVo.Customer cus :vo.getCustomers()){
|
|
|
+ List<CustomerInfoVo.Customer> newCistomer = new ArrayList<>();
|
|
|
+ vo.getCustomers().stream().collect(Collectors.groupingBy(CustomerInfoVo.Customer::getEmail)).forEach((k,v)->{
|
|
|
+ CustomerInfoVo.Customer customer1 = v.stream().sorted(Comparator.comparing(CustomerInfoVo.Customer::getCustomerId).reversed()).collect(Collectors.toList())
|
|
|
+ .get(v.size() - 1);
|
|
|
+ newCistomer.add(customer1);
|
|
|
+ });
|
|
|
+
|
|
|
+ for (CustomerInfoVo.Customer cus : newCistomer){
|
|
|
if (StringUtils.isNotEmpty(cus.getEmail())){
|
|
|
CustomerUser customerUser = new CustomerUser();
|
|
|
customerUser.setCustomerId(customer.getId());
|
|
@@ -201,6 +208,7 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
customerUser.setPhone(cus.getTel());
|
|
|
customerUser.setContactJson(JSON.toJSONString(maps));
|
|
|
customerUserService.save(customerUser);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|