|
|
|
@ -616,6 +616,15 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 客户社会统一代码判重
|
|
|
|
|
if (companyCustomerReq.getSocialUnifiedCode() != null && companyCustomerReq.getSocialUnifiedCode().length() != 0) { |
|
|
|
|
List<String> socialUnifiedCodes = customerDao.listSocialUnifiedCode(); |
|
|
|
|
for (String socialUnifiedCode : socialUnifiedCodes) { |
|
|
|
|
if (companyCustomerReq.getSocialUnifiedCode().equals(socialUnifiedCode)) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_SOCIAL_UNIFIED_CODE_REPETITION); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
CustomerEntity customerEntity = new CustomerEntity(); |
|
|
|
|
CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); |
|
|
|
|
BeanUtils.copyProperties(companyCustomerReq, customerEntity); |
|
|
|
@ -674,6 +683,18 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 社会统一代码判重,注意判断是否与原来相同
|
|
|
|
|
if (companyCustomerReq.getSocialUnifiedCode() != null && companyCustomerReq.getSocialUnifiedCode().length() != 0) { |
|
|
|
|
String newSocialUnifiedCode = customerDao.getSocialUnifiedCodeByCustomerId(companyCustomerReq.getId()); |
|
|
|
|
if (!companyCustomerReq.getSocialUnifiedCode().equals(newSocialUnifiedCode)) { |
|
|
|
|
List<String> socialUnifiedCodes = customerDao.listSocialUnifiedCode(); |
|
|
|
|
for (String socialUnifiedCode : socialUnifiedCodes) { |
|
|
|
|
if (companyCustomerReq.getSocialUnifiedCode().equals(socialUnifiedCode)) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_SOCIAL_UNIFIED_CODE_REPETITION); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
CustomerEntity customerEntity = new CustomerEntity(); |
|
|
|
|
CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); |
|
|
|
|
BeanUtils.copyProperties(companyCustomerReq, customerEntity); |
|
|
|
|