diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java index 79bc6040..67fcfefc 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java @@ -45,4 +45,8 @@ public interface CustomerDao extends BaseMapper { List listCustomerName(Integer type); String getNameByCustomerId(Long CustomerId); + + String getSocialUnifiedCodeByCustomerId(Long customerId); + + List listSocialUnifiedCode(); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java index 72644145..a8cfff31 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java @@ -360,7 +360,7 @@ public class CustomerServiceImpl extends ServiceImpl 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 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().eq("customer_id",entity.getId()));//companyCustomerEntity.getId() + crmsCustomerRelatedMapper.delete(new QueryWrapper().eq("customer_id", entity.getId()));//companyCustomerEntity.getId() //绑定关联关系 List relatedList = new ArrayList<>(); diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml index 321e4a6f..fae250d8 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml @@ -59,7 +59,7 @@ AND l.status = #{status} - AND l.role_id = 58 + AND l.type = 1 diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml index 9a0bf792..e8df6940 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml @@ -118,4 +118,18 @@ + + + + + + + \ No newline at end of file