|
@@ -175,22 +175,11 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
*/
|
|
|
public Long customerConversionAll(CustomerInfoVo vo) {
|
|
|
SecurityUtils.setTenantId(XiaomanContant.TENANT_ID);
|
|
|
-
|
|
|
Customer customer = new Customer();
|
|
|
-
|
|
|
customer.setId(vo.getCompanyId());
|
|
|
-
|
|
|
extracted(vo, customer);
|
|
|
-
|
|
|
-
|
|
|
|
|
|
if (!vo.getCustomers().isEmpty()){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
for (CustomerInfoVo.Customer cus : vo.getCustomers()){
|
|
|
if (StringUtils.isNotEmpty(cus.getEmail())){
|
|
|
CustomerUser customerUser = new CustomerUser();
|
|
@@ -214,12 +203,8 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
customerUser.setPhone(cus.getTel());
|
|
|
customerUser.setContactJson(JSON.toJSONString(maps));
|
|
|
customerUserService.save(customerUser);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
customer.setXmCountryName(vo.getCountryName());
|
|
|
customerService.save(customer);
|
|
@@ -243,7 +228,6 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
.or()
|
|
|
.eq(Objects.nonNull(vo.getCompanyId()), Customer::getCompanyId, vo.getCompanyId())
|
|
|
.list();
|
|
|
-
|
|
|
if (!list.isEmpty()){
|
|
|
for (Customer customer :list){
|
|
|
|
|
@@ -254,13 +238,10 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
extracted(vo, customer);
|
|
|
|
|
|
if (!vo.getCustomers().isEmpty()){
|
|
|
-
|
|
|
|
|
|
customerUserService.lambdaUpdate()
|
|
|
.eq(CustomerUser::getCustomerId,customer.getId()).remove();
|
|
|
-
|
|
|
for (CustomerInfoVo.Customer cus :vo.getCustomers()) {
|
|
|
-
|
|
|
CustomerUser customerUser = new CustomerUser();
|
|
|
customerUser.setCustomerId(customer.getId());
|
|
|
customerUser.setName(cus.getName());
|
|
@@ -282,83 +263,13 @@ public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMappe
|
|
|
customerUser.setPhone(cus.getTel());
|
|
|
customerUser.setContactJson(JSON.toJSONString(maps));
|
|
|
customerUserService.save(customerUser);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
customer.setXmCountryName(vo.getCountryName());
|
|
|
customerService.updateById(customer);
|
|
|
}
|
|
|
+ }else {
|
|
|
+ customerConversionAll(vo);
|
|
|
}
|
|
|
SecurityUtils.clearTenantId();
|
|
|
if (!list.isEmpty()) {
|