From 859bbdf9c7b373861247b52982d21c5d7d1f4b75 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Tue, 22 Sep 2020 18:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B5=84=E6=BA=90=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E7=9A=84=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dq-financial-crms-auth/pom.xml | 20 ++++ .../DqFinancialCrmsAuthApplication.java | 6 + .../crauth/config/AuthorizationServer.java | 104 ++++++++++++++++ .../crauth/config/SecurityConfig.java | 68 +++++++++++ .../financial/crauth/config/TokenConfig.java | 22 ++++ .../controller/CustomerLoginController.java | 27 +++++ .../crauth/dao/CustomerLoginDao.java | 14 +++ .../crauth/service/CustomerLoginService.java | 8 ++ .../impl/CustomerLoginServiceImpl.java | 39 ++++++ .../src/main/resources/application.properties | 1 - .../src/main/resources/bootstrap.properties | 19 +++ .../mapper/crmsauth/CustomerLoginMapper.xml | 10 ++ .../service/impl/CustomerServiceImpl.java | 112 ++++++++++++------ .../crms/feign/HrmsFeignService.class | Bin 1397 -> 1669 bytes .../service/impl/CustomerServiceImpl.class | Bin 19108 -> 20386 bytes .../hrms/controller/EmployeeController.class | Bin 3781 -> 3947 bytes .../financial/hrms/dao/EmployeeDao.class | Bin 1020 -> 1148 bytes .../hrms/service/EmployeeService.class | Bin 681 -> 809 bytes .../service/impl/EmployeeServiceImpl.class | Bin 1544 -> 1743 bytes .../classes/mapper/hrms/EmployeeDao.xml | 6 + .../domain/crms/ext/ManagerName.java | 20 ++++ .../domain/crms/response/CrmsCode.java | 51 ++++++++ 22 files changed, 488 insertions(+), 39 deletions(-) create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/AuthorizationServer.java create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/SecurityConfig.java create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/TokenConfig.java create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/controller/CustomerLoginController.java create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/dao/CustomerLoginDao.java create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/CustomerLoginService.java create mode 100644 dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/impl/CustomerLoginServiceImpl.java delete mode 100644 dq-financial-crms-auth/src/main/resources/application.properties create mode 100644 dq-financial-crms-auth/src/main/resources/bootstrap.properties create mode 100644 dq-financial-crms-auth/src/main/resources/mapper/crmsauth/CustomerLoginMapper.xml create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/ManagerName.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java diff --git a/dq-financial-crms-auth/pom.xml b/dq-financial-crms-auth/pom.xml index e2266989..2e38007c 100644 --- a/dq-financial-crms-auth/pom.xml +++ b/dq-financial-crms-auth/pom.xml @@ -38,6 +38,26 @@ org.springframework.cloud spring-cloud-starter-openfeign + + org.springframework.cloud + spring-cloud-starter-security + + + org.springframework.security + spring-security-jwt + 1.1.1.RELEASE + + + io.jsonwebtoken + jjwt + 0.9.0 + + + org.springframework.security.oauth + spring-security-oauth2 + + 2.3.3.RELEASE + org.springframework.boot diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/DqFinancialCrmsAuthApplication.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/DqFinancialCrmsAuthApplication.java index 76c68c1b..1360824d 100644 --- a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/DqFinancialCrmsAuthApplication.java +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/DqFinancialCrmsAuthApplication.java @@ -2,8 +2,14 @@ package com.daqing.financial.crauth; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.ComponentScan; +@EnableFeignClients(basePackages = "com.daqing.financial.crauth.feign") +@EnableDiscoveryClient @SpringBootApplication +@ComponentScan(basePackages = "com.daqing") public class DqFinancialCrmsAuthApplication { public static void main(String[] args) { diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/AuthorizationServer.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/AuthorizationServer.java new file mode 100644 index 00000000..3ff57348 --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/AuthorizationServer.java @@ -0,0 +1,104 @@ +package com.daqing.financial.crauth.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authorization.AuthorityReactiveAuthorizationManager; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; +import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer; +import org.springframework.security.oauth2.provider.ClientDetailsService; +import org.springframework.security.oauth2.provider.code.AuthorizationCodeServices; +import org.springframework.security.oauth2.provider.code.InMemoryAuthorizationCodeServices; +import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices; +import org.springframework.security.oauth2.provider.token.DefaultTokenServices; +import org.springframework.security.oauth2.provider.token.TokenStore; + +/** + * 配置OAuth2.0授权服务器 + * + * @auther River + * @date 2020/9/21 17:49 + */ +@Configuration +@EnableAuthorizationServer +public class AuthorizationServer extends AuthorizationServerConfigurerAdapter { + + @Autowired + private TokenStore tokenStore; + + @Autowired + private ClientDetailsService clientDetailsService; + + @Autowired + private AuthenticationManager authenticationManager; + + @Autowired + private AuthorizationCodeServices authorizationCodeServices; + + /** + * 配置令牌的安全约束(允许哪些请求访问) + */ + @Override + public void configure(AuthorizationServerSecurityConfigurer security) throws Exception { + security + .tokenKeyAccess("permitAll()") // 公开提供公钥加密的端点(就是使用jwt令牌的时候需要的) + .checkTokenAccess("permitAll()") // 校验令牌 + .allowFormAuthenticationForClients(); //允许表单提交 + } + + /** + * 配置支持哪些客户端访问 + */ + @Override + public void configure(ClientDetailsServiceConfigurer clients) throws Exception { + clients.inMemory() // 配置在内存里,后期配置在数据库 + .withClient("river") // 客户端id + .secret(new BCryptPasswordEncoder().encode("secret")) // 客户端秘钥(后期客户端访问会带着这个秘钥) + .resourceIds("resource1") // 客户端可以访问的资源列表(支持多个) + .authorizedGrantTypes("authorization_code","password","client_credentials","implicit","refresh_token") // 该客户端允许授权的方式 + .scopes("all") // 允许授权的范围 + .autoApprove(false) // false表示跳转到授权页面授权 + .redirectUris("http://www.baidu.com"); // 加上验证回调地址 + } + + /** + * 配置令牌(token)的访问端点 + */ + @Override + public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { + endpoints + .authenticationManager(authenticationManager) // 密码模式需要 + .authorizationCodeServices(authorizationCodeServices) // 授权码模式需要 + .tokenServices(tokenServices()) // 令牌的管理方式 + .allowedTokenEndpointRequestMethods(HttpMethod.POST); // 允许的请求方式 + } + + /** + * 令牌服务 + */ + @Bean + public AuthorizationServerTokenServices tokenServices(){ + DefaultTokenServices service = new DefaultTokenServices(); + service.setClientDetailsService(clientDetailsService); // 客户端信息的服务 + service.setSupportRefreshToken(true); // 是否产生刷新令牌 + service.setTokenStore(tokenStore); // 令牌的存储策略 + service.setAccessTokenValiditySeconds(7200); // 令牌有效期 + service.setRefreshTokenValiditySeconds(259200); // 刷新令牌有效期 + return service; + } + + /** + * 授权码服务(设置授权码模式的授权码如何存取,暂时在内存,后期在数据库) + */ + @Bean + public AuthorizationCodeServices authorizationCodeServices(){ + + return new InMemoryAuthorizationCodeServices(); + } +} diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/SecurityConfig.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/SecurityConfig.java new file mode 100644 index 00000000..6ffb91a8 --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/SecurityConfig.java @@ -0,0 +1,68 @@ +package com.daqing.financial.crauth.config; + +import com.daqing.financial.crauth.service.impl.CustomerLoginServiceImpl; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.authentication.PasswordEncoderParser; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; + +/** + * @auther River + * @date 2020/9/22 10:26 + */ +@Configuration +@EnableWebSecurity // 开启security +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + /** + * 不能直接new对象,否则会在注入之前被拦截器拦截 + */ + @Bean + public CustomerLoginServiceImpl customerLoginService(){ + + return new CustomerLoginServiceImpl(); + } + + // 定义用户信息(查询用户信息),security帮助我们查询,但是需要告诉他如何去查询 + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + + auth.userDetailsService(customerLoginService()); + } + + + // 密码编码器,比对密码的方式 + @Bean + public PasswordEncoder passwordEncoder(){ + + return new BCryptPasswordEncoder(); + } + + /** + * 认证管理器 + */ + @Override + @Bean + public AuthenticationManager authenticationManagerBean() throws Exception { + + return super.authenticationManagerBean(); + } + + // 安全拦截机制 + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .antMatchers("/*").authenticated() // 该路径下所有请求都会被拦截 + .anyRequest().permitAll() // 其余的请求可以通过 + .and() + .formLogin() // 允许表单认证 + .successForwardUrl("/customerLogin/loginSuccess"); // 登录成功跳转路径 + } +} + diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/TokenConfig.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/TokenConfig.java new file mode 100644 index 00000000..c6db268d --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/config/TokenConfig.java @@ -0,0 +1,22 @@ +package com.daqing.financial.crauth.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; + +/** + * 令牌配置类 + * + * @auther River + * @date 2020/9/22 9:54 + */ +@Configuration +public class TokenConfig { + + @Bean + public TokenStore tokenStore(){ + // 内存生成,普通令牌 + return new InMemoryTokenStore(); + } +} diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/controller/CustomerLoginController.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/controller/CustomerLoginController.java new file mode 100644 index 00000000..a9dfed54 --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/controller/CustomerLoginController.java @@ -0,0 +1,27 @@ +package com.daqing.financial.crauth.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @auther River + * @date 2020/9/22 15:27 + */ +@RestController +@RequestMapping("/customerLogin") +public class CustomerLoginController { + + @PostMapping("/loginSuccess") + public String loginSuccess(){ + + return "success"; + } + + @GetMapping("/test") + public String test(){ + + return "Hello"; + } +} diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/dao/CustomerLoginDao.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/dao/CustomerLoginDao.java new file mode 100644 index 00000000..5408f65d --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/dao/CustomerLoginDao.java @@ -0,0 +1,14 @@ +package com.daqing.financial.crauth.dao; + +import com.daqing.framework.domain.crms.CustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * @auther River + * @date 2020/9/22 14:55 + */ +@Mapper +public interface CustomerLoginDao { + + CustomerEntity getCustomer(String code); +} diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/CustomerLoginService.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/CustomerLoginService.java new file mode 100644 index 00000000..65089e78 --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/CustomerLoginService.java @@ -0,0 +1,8 @@ +package com.daqing.financial.crauth.service; + +/** + * @auther River + * @date 2020/9/22 15:00 + */ +public interface CustomerLoginService { +} diff --git a/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/impl/CustomerLoginServiceImpl.java b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/impl/CustomerLoginServiceImpl.java new file mode 100644 index 00000000..9c564a85 --- /dev/null +++ b/dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/impl/CustomerLoginServiceImpl.java @@ -0,0 +1,39 @@ +package com.daqing.financial.crauth.service.impl; + +import com.daqing.financial.crauth.dao.CustomerLoginDao; +import com.daqing.financial.crauth.service.CustomerLoginService; +import com.daqing.framework.domain.crms.CustomerEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @auther River + * @date 2020/9/22 15:01 + */ +@Service +public class CustomerLoginServiceImpl implements CustomerLoginService, UserDetailsService { + + @Autowired + private CustomerLoginDao customerLoginDao; + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + + CustomerEntity customer = customerLoginDao.getCustomer(username); + List authorities = new ArrayList<>(); + authorities.add(new SimpleGrantedAuthority("ROLE_ADMIN")); + System.out.println(customer); + UserDetails userDetails = new User(customer.getCode(),new BCryptPasswordEncoder().encode(customer.getPassword()),authorities); + + return userDetails; + } +} diff --git a/dq-financial-crms-auth/src/main/resources/application.properties b/dq-financial-crms-auth/src/main/resources/application.properties deleted file mode 100644 index 8b137891..00000000 --- a/dq-financial-crms-auth/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dq-financial-crms-auth/src/main/resources/bootstrap.properties b/dq-financial-crms-auth/src/main/resources/bootstrap.properties new file mode 100644 index 00000000..160ddf8b --- /dev/null +++ b/dq-financial-crms-auth/src/main/resources/bootstrap.properties @@ -0,0 +1,19 @@ + +# +spring.application.name=dq-financial-crms +#ĵַ +spring.cloud.nacos.config.server-addr=192.168.31.142:8848 +spring.cloud.nacos.config.namespace=37d72d30-3178-4173-8b5e-269a23355ed9 +#spring.cloud.nacos.config.group=prod + +spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +spring.cloud.nacos.config.ext-config[0].group=dev +spring.cloud.nacos.config.ext-config[0].refresh=true + +spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +spring.cloud.nacos.config.ext-config[1].group=dev +spring.cloud.nacos.config.ext-config[1].refresh=true + +spring.cloud.nacos.config.ext-config[2].data-id=other.yml +spring.cloud.nacos.config.ext-config[2].group=dev +spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file diff --git a/dq-financial-crms-auth/src/main/resources/mapper/crmsauth/CustomerLoginMapper.xml b/dq-financial-crms-auth/src/main/resources/mapper/crmsauth/CustomerLoginMapper.xml new file mode 100644 index 00000000..13e9de18 --- /dev/null +++ b/dq-financial-crms-auth/src/main/resources/mapper/crmsauth/CustomerLoginMapper.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file 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 559a7c53..5405652b 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 @@ -12,13 +12,13 @@ import com.daqing.financial.crms.service.CustomerService; import com.daqing.framework.domain.crms.CompanyCustomerEntity; import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.PersonalCustomerEntity; -import com.daqing.framework.domain.crms.ext.CrmsConstant; -import com.daqing.framework.domain.crms.ext.CustomerTO; -import com.daqing.framework.domain.crms.ext.CustomerCompanyVO; -import com.daqing.framework.domain.crms.ext.CustomerPersonalVO; +import com.daqing.framework.domain.crms.ext.*; import com.daqing.framework.domain.crms.request.CustomerRequest; +import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.hrms.ext.EmployeeTO; import com.daqing.framework.domain.hrms.ext.EmployeeVO; +import com.daqing.framework.domain.hrms.response.HrmsCode; +import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.SnowflakeIdUtils; @@ -208,25 +208,30 @@ public class CustomerServiceImpl extends ServiceImpl companyList = new ArrayList<>(); - List personalList = new ArrayList<>(); - List longList = customerDao.listCustomerId(); - for (Long id : longList) { - ResponseResult responseResult = this.queryCustomerById(id); - if ((responseResult.getData()).getClass() == CustomerCompanyVO.class){ - companyList.add((CustomerCompanyVO) responseResult.getData()); - }else { - personalList.add((CustomerPersonalVO) responseResult.getData()); + try { + List companyList = new ArrayList<>(); + List personalList = new ArrayList<>(); + List longList = customerDao.listCustomerId(); + for (Long id : longList) { + ResponseResult responseResult = this.queryCustomerById(id); + if ((responseResult.getData()).getClass() == CustomerCompanyVO.class){ + companyList.add((CustomerCompanyVO) responseResult.getData()); + }else { + personalList.add((CustomerPersonalVO) responseResult.getData()); + } } + ExcelUtil.writeExcelWithSheets(response,personalList,"客户资源信息一览表","个人类型",new CustomerPersonalVO()) + .write(companyList,"企业类型",new CustomerCompanyVO()) + .finish(); + }catch (Exception e){ + ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); } - ExcelUtil.writeExcelWithSheets(response,personalList,"客户资源信息一览表","个人类型",new CustomerPersonalVO()) - .write(companyList,"企业类型",new CustomerCompanyVO()) - .finish(); } /** @@ -234,37 +239,68 @@ public class CustomerServiceImpl extends ServiceImpl companyList = new ArrayList<>(); - List personalList = new ArrayList<>(); - ExcelUtil.writeExcelWithSheets(response,personalList,"客户资源信息表模板","个人类型",new CustomerPersonalVO()) - .write(companyList,"企业类型",new CustomerCompanyVO()) - .finish(); + try { + List companyList = new ArrayList<>(); + List personalList = new ArrayList<>(); + ExcelUtil.writeExcelWithSheets(response,personalList,"客户资源信息表模板","个人类型",new CustomerPersonalVO()) + .write(companyList,"企业类型",new CustomerCompanyVO()) + .finish(); + }catch (Exception e){ + ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORTTEMPLATE_EXSIT); + } } /** * 导入excel数据 * @param excel */ + @Transactional @Override public void excelImportCustomer(MultipartFile excel) { //TODO 导入excel数据到数据库,思路耗时太长,有待优化 - List personalList = ExcelUtil.readExcel(excel, new CustomerPersonalVO(), 1); - List companyList = ExcelUtil.readExcel(excel, new CustomerCompanyVO(), 2); - List nameList = hrmsFeignService.listEmployeeName().getData(); - List customerList = new ArrayList<>(); - CustomerEntity customer; - List pcList = new ArrayList<>(); - PersonalCustomerEntity pc; - for (Object personal : personalList) { - customer = new CustomerEntity(); - pc = new PersonalCustomerEntity(); - BeanUtils.copyProperties(personal,customer); - BeanUtils.copyProperties(personal,pc); - customerList.add(customer); - pcList.add(pc); + try { + List personalList = ExcelUtil.readExcel(excel, new CustomerPersonalVO(), 1); + List companyList = ExcelUtil.readExcel(excel, new CustomerCompanyVO(), 2); + List nameList = hrmsFeignService.listEmployeeName().getData(); + CustomerEntity customer; // 客户基本信息 + PersonalCustomerEntity pc; // 个人类型信息 + CompanyCustomerEntity cc; // 企业类型信息 + ManagerName manager; // 客户名称 + // 个人类型 + for (Object personal : personalList) { + customer = new CustomerEntity(); + manager = new ManagerName(); + pc = new PersonalCustomerEntity(); + BeanUtils.copyProperties(personal,customer); + BeanUtils.copyProperties(personal,pc); + BeanUtils.copyProperties(personal,manager); + // 根据客户经理名称找到对应的员工id + for (EmployeeVO employeeVO : nameList){ + if (Objects.equals(manager.getManager(),employeeVO.getName())){ + customer.setManager(employeeVO.getId()); + } + } + this.saveCustomerPersonal(customer,pc); + } + // 企业类型 + for (Object company : companyList){ + customer = new CustomerEntity(); + manager = new ManagerName(); + cc = new CompanyCustomerEntity(); + BeanUtils.copyProperties(company,customer); + BeanUtils.copyProperties(company,cc); + BeanUtils.copyProperties(company,manager); + // 根据客户经理名称找到对应的员工id + for (EmployeeVO employeeVO : nameList){ + if (Objects.equals(manager.getManager(),employeeVO.getName())){ + customer.setManager(employeeVO.getId()); + } + } + this.saveCustomerCompany(customer,cc); + } + }catch (Exception e){ + ExceptionCast.cast(CrmsCode.CUSTOMER_IMPORT_EXSIT); } - System.out.println(customerList); - System.out.println(pcList); } /** diff --git a/dq-financial-crms/target/classes/com/daqing/financial/crms/feign/HrmsFeignService.class b/dq-financial-crms/target/classes/com/daqing/financial/crms/feign/HrmsFeignService.class index b1b46d44227e9b06b6d43cbb32e6f446c41c10ff..19fe26e927ed991c6f4018dc8da5ba1889d1725f 100644 GIT binary patch delta 176 zcmey$)ygYy>ff$?3=9k=49e^bitG$Z8wJiYiwfjq7MHl@7Ubktrl$HO=B6?-m}yKr zV9rzxBuyq4G1+T|`CHooAtQslenwGlv3@F4wLZGm$#ff$?3=9k=4D##@vg{0U8wJiYPd?4Ehmm=52kSm*1||kcpfnSM6ay!a P=4N1IkOpGzVg?xi3-=5z diff --git a/dq-financial-crms/target/classes/com/daqing/financial/crms/service/impl/CustomerServiceImpl.class b/dq-financial-crms/target/classes/com/daqing/financial/crms/service/impl/CustomerServiceImpl.class index c3c41f41016f7ef010527f7a8e66268a0e6ca05c..d35007dddaf2b831bf55bb95f11384156bfa0771 100644 GIT binary patch delta 7722 zcmbVR30zf0)IVq5<6U^~vMT69QCvbr5L_#8!39$jw~(MkB_+`i5YSAkm-}woO-m~^ zwJb9?>Z(y@Sy+~4`(~SIR<>uBOY!~BJhrm$*Z2GQ!QB7MojK>sf6h5GbJ?_#H>_jd zp}(HlM?_s59o+N@&vNr@o+HIvDdxH97|)ktK@f_C9$v(YJ-mdMdZ+;}iy-2AJ-m`v zMG*5EK@S-0kggAU_#s~Frl!2k;PoQmVS_igDN$@8F$o6x-dri_1mRQyzYrZPBn>s(U=Vm!FYpg~89d zDUoN1tE0VVj6rdI>`kUU?L z;&thK*x(~>N)t=-`3)(Kx~YI)7WAf|w?xI;V%IxvDw7vw(zci1l^5^Hi}$7afrovI z_(QSpBM*Pf$E5hg;7`T;&)obue_`-(dHtoqCj$9oAb;hiY_akbe;vr*xG762-|}fG zzBBmyApU`Wbn{RAb0GgBm0zXr8Da7_gU^bIvkd;-O%vt$hua5p0nSOoc{ddb&xJCJ ze7+!7Tr~JkF&}e1#(#;xDz_rVs44{)Q4T4bZn{$iNZ~S+A&xrW(6xxtOy|)2qCK4vTfL zbD4?;QcVOkl_Cb6RWm`&1;q+#fkFgi%dl+ek}Yqu{bO6g|FTspDIlRhwH9=lpg2Ko z1ho~^PEfp{_JR@wB?{^wC`nMVppJq%3F<7Ui=eK8x(T{m&=rEN6qJJbXRB0!-KDXI zpq_$y2}%>xThh4!W$I|` z>X6(?d8tgs*rG|rxrMh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DC{ebvBwjRg3dRHqKBE&osaTJ=J79N3-%r?*k>2C zUijJ^FCAxgYJ}ti}5637tT`I1r zq}lNcEIDo(%rXSiYWt_gF8@_WYHSF@1e6-L>KJb_$zK)x%7CeCr;*IHZG=bb#+zWTh%o`hQ6hjzW@HZ1)zvm4tj9eK@_ze zNZ?8o3%F|In&6@=*B#uzO|h0_xn<+FM4Oa5;<;<1Zlhu2-bQ_@+x^x3KG~1m8u#%) zqYpc6Jk)rEWp~pqrpK|O@fa&Mo@hM9s>U-s*OhAFoP3cdU+AtLT#P2I#KF+!vet^?d1BPwE7?laT|4GV)@ zB^b0)T(uW~J=n{gLK;H|o8%gIVfwx}o!VZH!&IgIhr0ry=r+mvb? zLz71wM~tWp$-vfl6^WJSiQ>5@#WGU56y2R995oWOG)~$_33{$toZikd-D25_jRjt<&a_70 z)lz=PQoLAL;+)VKoMAt!B#~+LJZI_YprAcUv+Z|mjZ%fla~z(KOwU?;O)W2Q(7#J8#806R)q}dr{*coIu3X3vn3FKrJm$>E@k@#$jHbtxtTdykA;yzm_dYrk%0qfEE9t$ X12dE*#vl$BkzkMn(riE#QVa|L#oHNx delta 70 zcmeyv@rPab)W2Q(7#J8#7^K-5B-j}w*%_oZ3X3vrp1~Bw$jChTGjp^Y12Y2$Pze)* UFoOt~7G)3v(rgTj4B`w706LNj5&!@I diff --git a/dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/EmployeeService.class b/dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/EmployeeService.class index f8ea318c8d5c3ee4f8d7a92ea6722b4b71270f35..8fa777c9ffe45478bf609c0b956e4d17617d3472 100644 GIT binary patch delta 126 zcmZ3E@$jCJLCX=2J0}}%WPze(Q KF9RQ#<_7?Tya}fO diff --git a/dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.class b/dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.class index 245eea9478d4d797625e774052495becb0672836..4b57229b45b16ddb9334ac7edea7e70048938b95 100644 GIT binary patch delta 524 zcmZ`#O-lk%6g_XoaZG2-v^32!`%=ep`hq~AAaExIF50zl;lfY~v>*sv)_#6Ke<2A9 zTSV(NE&4YtqVr}X7t!L~d+vSro_p@SGd@iF{rlw=z%F)z2p}JXj)D#=1QkVT)}`6d zQPN@S*c@0f#fr3B-CnhG(LTR!Hjf&era&}bsGT*g8un$c)wXN=uLxB0&aF7`og7#8 zAIr+A2m}!_u!U{sUM)qY5H*m(oPh;o1j^2hl5#q}fb*q()^&;zn4mHrJ^N@4MmD{m z*Q{rV0f7RO*6$|62ooD#0VWY)B)~ab!EiEKra!JtxV3TigUG9uD28eF%>44mOq`hn zGn!xk%wk8m=I| zeu|5`uA8^rT=%Fs?>1_cfo|6RI8CyyBv%p}8Q9RXY%0`mrF`8>irWr7`UgE^rvnWI ViGESL?6t^(k+xT9UvK=t!4HP*7ybYM diff --git a/dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml b/dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml index ca722c24..319113ee 100644 --- a/dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml +++ b/dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml @@ -57,4 +57,10 @@ ON ed.dept_id = d.id WHERE d.id = #{id} + + + \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/ManagerName.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/ManagerName.java new file mode 100644 index 00000000..edc8e3e4 --- /dev/null +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/ManagerName.java @@ -0,0 +1,20 @@ +package com.daqing.framework.domain.crms.ext; + +import lombok.Data; +import lombok.ToString; + +/** + * 用于接收从excel导入的数据中客户的客户经理姓名 + * 从而比对所有的员工name找到对应的id + * 用ExcelUtil.readExcel()中获取的数据无法强转类型而通过get方法获取属性值 + * 故而通过类来接收 + * + * @auther River + * @date 2020/9/21 9:25 + */ +@Data +@ToString +public class ManagerName { + + private String manager; +} 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 new file mode 100644 index 00000000..6f150867 --- /dev/null +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java @@ -0,0 +1,51 @@ +package com.daqing.framework.domain.crms.response; + +import com.daqing.framework.model.response.ResultCode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.ToString; + +/** + * 客户资源管理操作状态集 + * + * @auther River + * @date 2020/9/21 10:16 + */ +@ToString +@AllArgsConstructor +public enum CrmsCode implements ResultCode { + + CUSTOMER_IMPORT_EXSIT(false,20001,"导入数据失败,请检查文件和数据格式或稍后再试!"), + CUSTOMER_EXPORT_EXSIT(false,20002,"导出数据失败,请稍后再试!"), + CUSTOMER_EXPORTTEMPLATE_EXSIT(false,20003,"导出excel模板失败,请稍后再试!"); + + /** + * 操作是否成功 + */ + @Getter + private boolean success; + + /** + * 状态码 + */ + @Getter + private int code; + + /** + * 提示信息 + */ + @Getter + private String message; + + public boolean success() { + return this.success; + } + + public int code() { + return this.code; + } + + public String message() { + return this.message; + } +}