|
|
|
@ -360,7 +360,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, companyList,"客户资源信息一览表","企业类型", new CustomerCompanyVO()) |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, companyList, "客户资源信息一览表", "企业类型", new CustomerCompanyVO()) |
|
|
|
|
.finish(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
@ -378,7 +378,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, personalTemplates, "客户资源信息表模板", "个人类型", new PersonalTemplate()) |
|
|
|
|
.write(companyTemplates, "企业类型", new CompanyTemplate()) |
|
|
|
|
.finish();*/ |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, companyTemplates,"客户资源信息表模板","企业类型", new CompanyTemplate()) |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, companyTemplates, "客户资源信息表模板", "企业类型", new CompanyTemplate()) |
|
|
|
|
.finish(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORTTEMPLATE_EXSIT); |
|
|
|
@ -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); |
|
|
|
@ -692,7 +713,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity |
|
|
|
|
companyCustomerEntity.setCustomerId(entity.getId()); |
|
|
|
|
|
|
|
|
|
//根据企业id删除关联关系
|
|
|
|
|
crmsCustomerRelatedMapper.delete(new QueryWrapper<CrmsCustomerRelated>().eq("customer_id",entity.getId()));//companyCustomerEntity.getId()
|
|
|
|
|
crmsCustomerRelatedMapper.delete(new QueryWrapper<CrmsCustomerRelated>().eq("customer_id", entity.getId()));//companyCustomerEntity.getId()
|
|
|
|
|
|
|
|
|
|
//绑定关联关系
|
|
|
|
|
List<CrmsCustomerRelated> relatedList = new ArrayList<>(); |
|
|
|
|