From ce3531bd188247cf1867ae81c12287fee8975042 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Thu, 7 Jan 2021 11:48:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dq-govern-gateway/src/main/resources/jwt.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dq-govern-gateway/src/main/resources/jwt.properties b/dq-govern-gateway/src/main/resources/jwt.properties index 61efd42f..1975fc96 100644 --- a/dq-govern-gateway/src/main/resources/jwt.properties +++ b/dq-govern-gateway/src/main/resources/jwt.properties @@ -27,7 +27,8 @@ jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,\ /api-guarantee/dg-loan-notice/exportLoanNotice,\ /api-hrms/hrms/user/uploadFile,\ /apiHrmsAuth/hrms/auth/permission/getUserRoles,\ - /api-hrms/hrms/permission/getPermission + /api-hrms/hrms/permission/getPermission,\ + /api-guarantee/guarantee/efficiency/personalEfficiencyListExport From fa0b7dea1f048602e70099ad4aa0cf4b9fbafa10 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Thu, 7 Jan 2021 15:52:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=A4=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial/crms/dao/CustomerDao.java | 4 ++ .../service/impl/CustomerServiceImpl.java | 45 ++++++++++++++++++- .../resources/mapper/crms/CustomerDao.xml | 10 +++++ .../model/response/ResponseResult.java | 2 +- .../domain/crms/response/CrmsCode.java | 3 +- 5 files changed, 61 insertions(+), 3 deletions(-) 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 2e41e8cd..631968ba 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 @@ -39,4 +39,8 @@ public interface CustomerDao extends BaseMapper { List queryCompanyCodeAndName(int type); String getCodeByType(Integer type); + + List listCustomerName(Integer type); + + String getNameByCustomerId(Long CustomerId); } 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 0ee98a22..38dc57a4 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 @@ -215,11 +215,20 @@ public class CustomerServiceImpl extends ServiceImpl names = customerDao.listCustomerName(0); // 个人类型客户名称 + for (String name : names) { + if (customerPersonalTOI.getName().equals(name)) { + ExceptionCast.cast(CrmsCode.CUSTOMER_NAME_REPETITION); + } + } + } CustomerEntity customerEntity = new CustomerEntity(); PersonalCustomerEntity personalCustomerEntity = new PersonalCustomerEntity(); BeanUtils.copyProperties(customerPersonalTOI, customerEntity); BeanUtils.copyProperties(customerPersonalTOI, personalCustomerEntity); - //TODO 设置客户编号 + // 设置客户编号 String code = customerDao.getCodeByType(CrmsConstant.CustomerType.PERSONAL_CUSTOMER.getType()); if (code == null || code.length() == 0) { code = PromptSuccess.PERSONAL_START_CODE; @@ -263,12 +272,25 @@ public class CustomerServiceImpl extends ServiceImpl names = customerDao.listCustomerName(0); + for (String name : names) { + if (customerPersonalTOU.getName().equals(name)) { + ExceptionCast.cast(CrmsCode.CUSTOMER_NAME_REPETITION); + } + } + } + } CustomerEntity customerEntity = new CustomerEntity(); PersonalCustomerEntity personalCustomerEntity = new PersonalCustomerEntity(); BeanUtils.copyProperties(customerPersonalTOU, customerEntity); @@ -568,6 +590,15 @@ public class CustomerServiceImpl extends ServiceImpl names = customerDao.listCustomerName(1); // 企业类型客户名称 + for (String name : names) { + if (companyCustomerReq.getName().equals(name)) { + ExceptionCast.cast(CrmsCode.CUSTOMER_NAME_REPETITION); + } + } + } CustomerEntity customerEntity = new CustomerEntity(); CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); BeanUtils.copyProperties(companyCustomerReq, customerEntity); @@ -612,6 +643,18 @@ public class CustomerServiceImpl extends ServiceImpl names = customerDao.listCustomerName(1); + for (String name : names) { + if (companyCustomerReq.getName().equals(name)) { + ExceptionCast.cast(CrmsCode.CUSTOMER_NAME_REPETITION); + } + } + } + } CustomerEntity customerEntity = new CustomerEntity(); CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); BeanUtils.copyProperties(companyCustomerReq, customerEntity); 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 a0ccbe54..8f147d8f 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml @@ -100,4 +100,14 @@ + + + + + + \ No newline at end of file diff --git a/dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java b/dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java index b04b8237..dee2b60c 100644 --- a/dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java +++ b/dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java @@ -57,7 +57,7 @@ public class ResponseResult { } public static ResponseResult FAIL(Object t) { - return new ResponseResult<>(false, 99999, t, "操作失败,请检查文件或者数据格式是否正确!"); + return new ResponseResult<>(false, 99999, t, "操作失败,请检查客户名称是否已存在或者文件和数据格式是否正确!"); } public ResponseResult SUCCESS_DATA(T t){ diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java index 9e91ff7e..318d16d5 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java @@ -19,7 +19,8 @@ public enum CrmsCode implements ResultCode { CUSTOMER_EXPORT_EXSIT(false,20002,"导出数据失败,请稍后再试!"), CUSTOMER_EXPORTTEMPLATE_EXSIT(false,20003,"导出excel模板失败,请稍后再试!"), NOT_NULL(false,20004,"上传的文件不能为空"), - CUSTOMER_IS_NULL(false,20005,"导入数据失败,当前员工不存在!"); + CUSTOMER_IS_NULL(false,20005,"导入数据失败,当前员工不存在!"), + CUSTOMER_NAME_REPETITION(false, 20006, "当前客户名称已存在!"); /**