Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dq-financial-hrms/pom.xml
#	dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/UserController.java
#	dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java
#	dq-govern-gateway/src/main/resources/application.yml
#	dq-govern-gateway/src/main/resources/bootstrap.properties
master
shijie 4 years ago
commit 29540a25a4
  1. 16
      dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerControllerApi.java
  2. 13
      dq-financial-api/src/main/java/com/daqing/financial/hrms/DeptControllerApi.java
  3. 3
      dq-financial-api/src/main/java/com/daqing/financial/hrms/EmployeeControllerApi.java
  4. BIN
      dq-financial-api/target/classes/com/daqing/financial/crms/CustomerControllerApi.class
  5. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/DeptControllerApi.class
  6. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/EmployeeControllerApi.class
  7. 2
      dq-financial-crms-auth/src/main/java/com/daqing/financial/crauth/service/impl/CustomerLoginServiceImpl.java
  8. 6
      dq-financial-crms-auth/src/main/resources/bootstrap.properties
  9. 2
      dq-financial-crms-auth/src/main/resources/mapper/crmsauth/CustomerLoginMapper.xml
  10. 19
      dq-financial-crms-auth/target/classes/bootstrap.properties
  11. 47
      dq-financial-crms-auth/target/classes/logback-spring.xml
  12. 10
      dq-financial-crms-auth/target/classes/mapper/crmsauth/CustomerLoginMapper.xml
  13. BIN
      dq-financial-crms-auth/target/test-classes/com/daqing/financial/crauth/DqFinancialCrmsAuthApplicationTests.class
  14. 33
      dq-financial-crms/src/main/java/com/daqing/financial/crms/config/CorsConfig.java
  15. 43
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java
  16. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java
  17. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java
  18. 193
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  19. 4
      dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml
  20. 6
      dq-financial-crms/src/main/resources/mapper/crms/CustomerDao.xml
  21. 4
      dq-financial-crms/src/main/resources/mapper/crms/PersonalCustomerDao.xml
  22. BIN
      dq-financial-crms/target/classes/META-INF/dq-financial-crms.kotlin_module
  23. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/DqFinancialCrmsApplication.class
  24. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/CorsConfig.class
  25. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/IPageConfig.class
  26. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/controller/CustomerController.class
  27. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CompanyCustomerDao.class
  28. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CustomerDao.class
  29. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/PersonalCustomerDao.class
  30. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/feign/HrmsFeignService.class
  31. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/CustomerService.class
  32. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/impl/CustomerServiceImpl.class
  33. 4
      dq-financial-crms/target/classes/mapper/crms/CompanyCustomerDao.xml
  34. 6
      dq-financial-crms/target/classes/mapper/crms/CustomerDao.xml
  35. 4
      dq-financial-crms/target/classes/mapper/crms/PersonalCustomerDao.xml
  36. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java
  37. 4
      dq-financial-hrms-auth/src/main/resources/bootstrap.properties
  38. 2
      dq-financial-hrms/pom.xml
  39. 33
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/config/CorsConfig.java
  40. 11
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java
  41. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  42. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/DeptDao.java
  43. 4
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java
  44. 25
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java
  45. 1
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  46. 5
      dq-financial-hrms/src/main/resources/mapper/hrms/DeptDao.xml
  47. 25
      dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml
  48. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/config/CorsConfig.class
  49. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/DeptController.class
  50. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/EmployeeController.class
  51. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PermissionController.class
  52. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PositionController.class
  53. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/UserController.class
  54. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/DeptDao.class
  55. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/DeptService.class
  56. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/DeptServiceImpl.class
  57. 5
      dq-financial-hrms/target/classes/mapper/hrms/DeptDao.xml
  58. 25
      dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml
  59. BIN
      dq-financial-hrms/target/test-classes/com/daqing/financial/hrms/DqFinancialHrmsApplicationTests.class
  60. 5
      dq-framework-common/src/main/java/com/daqing/framework/model/response/CommonCode.java
  61. 32
      dq-framework-common/src/main/java/com/daqing/framework/model/response/PromptSuccess.java
  62. 4
      dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java
  63. 6
      dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java
  64. BIN
      dq-framework-common/target/classes/com/daqing/framework/exception/ExceptionCatch.class
  65. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/response/CommonCode.class
  66. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/response/PromptSuccess.class
  67. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/response/ResponseResult.class
  68. 13
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java
  69. 20
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java
  70. 25
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/PersonalCustomerEntity.java
  71. 92
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java
  72. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyTO.java
  73. 6
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyVO.java
  74. 101
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerPersonalDTO.java
  75. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerPersonalTO.java
  76. 8
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerPersonalVO.java
  77. 10
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerTO.java
  78. 11
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/request/CustomerRequest.java
  79. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CrmsCode.java
  80. 4
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/DepartmentVO.java
  81. 4
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/DeptEntity.java
  82. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/ext/EmployeeVO.java
  83. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/CompanyCustomerEntity.class
  84. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/CustomerEntity.class
  85. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/PersonalCustomerEntity.class
  86. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerCompanyTO.class
  87. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerCompanyVO.class
  88. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerPersonalTO.class
  89. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerPersonalVO.class
  90. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerTO.class
  91. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/ManagerName.class
  92. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/request/CustomerRequest.class
  93. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/response/CrmsCode.class
  94. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/hrms/DepartmentVO.class
  95. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/hrms/DeptEntity.class
  96. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/hrms/ext/EmployeeVO.class
  97. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/hrms/response/HrmsCode.class
  98. BIN
      dq-framework-utils/target/classes/com/daqing/framework/utils/PageUtils.class
  99. BIN
      dq-framework-utils/target/classes/com/daqing/framework/utils/Query.class
  100. 2
      dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -3,6 +3,7 @@ package com.daqing.financial.crms;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTO;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTO;
import com.daqing.framework.domain.crms.ext.CustomerTO;
import com.daqing.framework.domain.crms.request.CustomerRequest;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
@ -10,8 +11,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import javax.validation.Valid;
/**
* @Author: gongsj.
@ -25,7 +25,7 @@ public interface CustomerControllerApi {
/**
* 列表展示
*/
@ApiOperation(value = "客户信息列表展示", notes = "客户信息列表展示")
@ApiOperation(value = "客户信息列表展示", notes = "客户信息列表展示",response = CustomerTO.class)
ResponseResult queryList(Integer page, Integer size, CustomerRequest customerRequest);
/**
@ -41,15 +41,15 @@ public interface CustomerControllerApi {
ResponseResult deleteCustomer(Long[] ids);
/**
* 插入个人类型客户信息
* 新增个人类型客户信息
*/
@ApiOperation(value = "插入个人类型客户信息", notes = "插入个人类型客户信息")
@ApiOperation(value = "新增个人类型客户信息", notes = "新增个人类型客户信息")
ResponseResult savePersonal(CustomerPersonalTO customerPersonalTO);
/**
* 插入企业类型客户信息
* 新增企业类型客户信息
*/
@ApiOperation(value = "插入企业类型客户信息", notes = "插入企业类型客户信息")
@ApiOperation(value = "新增企业类型客户信息", notes = "新增企业类型客户信息")
ResponseResult saveCompany(CustomerCompanyTO customerCompanyTO);
/**
@ -68,7 +68,7 @@ public interface CustomerControllerApi {
* 导入excel数据
*/
@ApiOperation(value = "导入excel数据", notes = "导入excel数据")
void excelImportCustomer(MultipartFile file);
ResponseResult excelImportCustomer(MultipartFile file);
/**
* 导出数据到excel

@ -1,5 +1,6 @@
package com.daqing.financial.hrms;
import com.daqing.framework.domain.crms.ext.CustomerCompanyVO;
import com.daqing.framework.domain.hrms.DeptEntity;
import com.daqing.framework.domain.hrms.request.DeptAddRequest;
import com.daqing.framework.model.response.ResponseResult;
@ -42,7 +43,7 @@ public interface DeptControllerApi {
/**
* 根据id修改部门信息
*/
@ApiOperation(value = "根据id修改部门信息", notes = "根据id修改部门信息")
@ApiOperation(value = "根据id修改部门信息", notes = "根据id修改部门信息", response = CustomerCompanyVO.class)
ResponseResult update(DeptEntity dept);
/**
@ -54,6 +55,12 @@ public interface DeptControllerApi {
/**
* 查询所有部门及部门下的员工信息
*/
@ApiOperation(value = "查询所有部门及部门下的员工信息", notes = "查询所有部门及部门下的员工信息")
ResponseResult trees();
/*@ApiOperation(value = "查询所有部门及部门下的员工信息", notes = "查询所有部门及部门下的员工信息")
ResponseResult trees();*/
/**
* 查询该部门下所有子部门及部门下的的员工
*/
@ApiOperation(value = "查询该部门下所有子部门及部门下的的员工", notes = "查询该部门下所有子部门及部门下的的员工")
ResponseResult children(Long id);
}

@ -26,4 +26,7 @@ public interface EmployeeControllerApi {
@ApiOperation(value = "根据id删除员工信息", notes = "根据id删除员工信息")
ResponseResult delete(Long[] ids);
@ApiOperation(value = "查询所有员工id和姓名",notes = "查询所有员工id和姓名")
ResponseResult listEmployeeName();
}

@ -32,7 +32,7 @@ public class CustomerLoginServiceImpl implements CustomerLoginService, UserDetai
List<SimpleGrantedAuthority> 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);
UserDetails userDetails = new User(customer.getPhone(),new BCryptPasswordEncoder().encode(customer.getPassword()),authorities);
return userDetails;
}

@ -1,7 +1,7 @@
#服务名称
spring.application.name=dq-financial-crms
#配置中心地址
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
spring.application.name=dq-financial-crms-auth
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ
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

@ -4,7 +4,7 @@
<mapper namespace="com.daqing.financial.crauth.dao.CustomerLoginDao">
<select id="getCustomer" parameterType="string" resultType="com.daqing.framework.domain.crms.CustomerEntity">
SELECT code,password FROM crms_customer WHERE code = #{code}
SELECT phone,password FROM crms_customer WHERE phone = #{phone}
</select>
</mapper>

@ -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

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--定义日志文件的存储地址,使用绝对路径-->
<property name="LOG_HOME" value="d:/logs/daqing/crms_auth"/>
<!-- Console 输出设置 -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<fileNamePattern>${LOG_HOME}/crms_auth.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- 异步输出 -->
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="FILE"/>
</appender>
<logger name="org.apache.ibatis.cache.decorators.LoggingCache" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="org.springframework.boot" level="DEBUG"/>
<root level="info">
<!--<appender-ref ref="ASYNC"/>-->
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.crauth.dao.CustomerLoginDao">
<select id="getCustomer" parameterType="string" resultType="com.daqing.framework.domain.crms.CustomerEntity">
SELECT phone,password FROM crms_customer WHERE phone = #{phone}
</select>
</mapper>

@ -0,0 +1,33 @@
package com.daqing.financial.crms.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/**
* 实现基本的跨域请求
*
* @auther River
* @date 2020/9/25 15:09
*/
@Configuration
public class CorsConfig {
@Bean
public CorsFilter corsFilter() {
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
final CorsConfiguration corsConfiguration = new CorsConfiguration();
/*是否允许请求带有验证信息*/
corsConfiguration.setAllowCredentials(true);
/*允许访问的客户端域名*/
corsConfiguration.addAllowedOrigin("*");
/*允许服务端访问的客户端请求头*/
corsConfiguration.addAllowedHeader("*");
/*允许访问的方法名,GET POST等*/
corsConfiguration.addAllowedMethod("*");
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
return new CorsFilter(urlBasedCorsConfigurationSource);
}
}

@ -5,14 +5,19 @@ import com.daqing.financial.crms.service.CustomerService;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTO;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTO;
import com.daqing.framework.domain.crms.request.CustomerRequest;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
import java.util.Objects;
/**
@ -63,57 +68,60 @@ public class CustomerController implements CustomerControllerApi {
/**
* 根据客户id删除所选客户
*/
@Override
@DeleteMapping("/deleteCustomer")
public ResponseResult deleteCustomer(@RequestBody Long[] ids){
return new ResponseResult<List<String>>().SUCCESS(customerService.updateCustomerById(ids));
List<String> list = customerService.updateCustomerById(ids);
if (list == null){
return new ResponseResult(CommonCode.INVALID_PARAM);
}else if (Objects.equals(list.get(0),PromptSuccess.getDeleteSuccess())){
return ResponseResult.SUCCESS();
}else if (Objects.equals(list.get(0),PromptSuccess.getDeleteFail())){
return new ResponseResult(CommonCode.DELETE_FAIL);
}
else {
return new ResponseResult<List<String>>().SUCCESS_DATA(list);
}
}
/**
* 保存个人类型客户信息
*/
@PostMapping("/savePersonal")
@Override
public ResponseResult savePersonal(@RequestBody CustomerPersonalTO customerPersonalTO) {
public ResponseResult savePersonal(@RequestBody @Valid CustomerPersonalTO customerPersonalTO) {
boolean result = customerService.saveCustomerPersonal(customerPersonalTO.getCustomerEntity(), customerPersonalTO.getPersonalCustomerEntity());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL);
}
/**
* 保存企业类型客户信息
*/
@PostMapping("/saveCompany")
@Override
public ResponseResult saveCompany(@RequestBody CustomerCompanyTO customerCompanyTO) {
public ResponseResult saveCompany(@RequestBody @Valid CustomerCompanyTO customerCompanyTO) {
boolean result = customerService.saveCustomerCompany(customerCompanyTO.getCustomerEntity(), customerCompanyTO.getCompanyCustomerEntity());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL);
}
/**
* 更新个人类型客户信息
*/
@PostMapping("/updatePersonal")
@Override
public ResponseResult updatePersonal(@RequestBody CustomerPersonalTO customerPersonalTO) {
boolean result = customerService.updateCustomerPersonal(customerPersonalTO.getCustomerEntity(), customerPersonalTO.getPersonalCustomerEntity());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL);
}
/**
* 更新企业类型客户信息
*/
@PostMapping("/updateCompany")
@Override
public ResponseResult updateCompany(@RequestBody CustomerCompanyTO customerCompanyTO) {
boolean result = customerService.updateCustomerCompany(customerCompanyTO.getCustomerEntity(), customerCompanyTO.getCompanyCustomerEntity());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL);
}
/**
* 导出数据到excel
*/
@Override
@GetMapping("/excelExport")
public void excelExportCustomer(HttpServletResponse response){
@ -123,7 +131,6 @@ public class CustomerController implements CustomerControllerApi {
/**
* 导出excel模板
*/
@Override
@GetMapping("/excelTemplate")
public void excelTemplate(HttpServletResponse response){
@ -134,9 +141,9 @@ public class CustomerController implements CustomerControllerApi {
* 导入excel数据
*/
@PostMapping("/excelImport")
@Override
public void excelImportCustomer(MultipartFile file){
public ResponseResult excelImportCustomer(MultipartFile file){
customerService.excelImportCustomer(file);
boolean result = customerService.excelImportCustomer(file);
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.IMPORT_ERROR);
}
}

@ -25,7 +25,7 @@ public interface CustomerDao extends BaseMapper<CustomerEntity> {
CustomerEntity queryCustomerById(Long id);
void updateCustomerById(@Param("ids") List<Long> ids);
boolean updateCustomerById(@Param("ids") List<Long> ids);
List<String> queryCustomerNameById(@Param("ids") List<Long> ids);

@ -39,7 +39,7 @@ public interface CustomerService extends IService<CustomerEntity> {
void excelExportCustomer(HttpServletResponse response);
void excelImportCustomer(MultipartFile excel);
boolean excelImportCustomer(MultipartFile excel);
void excelTemplate(HttpServletResponse response);
}

@ -15,13 +15,14 @@ import com.daqing.framework.domain.crms.PersonalCustomerEntity;
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.EmployeeEntity;
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.CommonCode;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import com.daqing.framework.utils.SnowflakeIdUtils;
import com.daqing.framework.utils.excel.ExcelUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -62,25 +63,21 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
// 时间参数校验
this.timeCheckout(customerRequest.getCreateTime(), customerRequest.getStartTime(), customerRequest.getEndTime(), customerRequest);
// 分页参数校验
Page<Object> pages = this.pageCheckout(page, size);
// 查询所有客户的基本信息
IPage<CustomerEntity> customerEntityIPage = customerDao.queryList(pages, customerRequest);
// 获取所有的客户基本信息
List<CustomerEntity> customers = customerEntityIPage.getRecords();
// 获取所有的客户经理id
Long[] ids = customers.stream().map(CustomerEntity::getId).toArray(Long[]::new);
Long[] ids = customers.stream().map(CustomerEntity::getManager).toArray(Long[]::new);
if (ids != null && ids.length != 0) {
//TODO 远程调用查询客户经理信息的接口
ResponseResult responseResult = hrmsFeignService.getEmployeeAndDeptById(ids);
List<EmployeeTO> employeeTO = (List<EmployeeTO>) responseResult.getData();
// 将客户信息和客户经理及部门信息拼装起来
List<CustomerTO> customerTOS = this.jointCustomerEmployee(customers, employeeTO);
// 属性拷贝,将泛型为CustomerEntity类型的IPage的属性拷贝给泛型为CustomerTO类型的IPage,才能赋值给PageUtils
IPage<CustomerTO> iPage = new Page<>();
BeanUtils.copyProperties(customerEntityIPage, iPage);
@ -100,22 +97,58 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
@Override
public ResponseResult queryCustomerById(Long id) {
if (id == null){
return new ResponseResult(CommonCode.INVALID_PARAM);
}
// 员工基本信息
CustomerEntity customer = customerDao.queryCustomerById(id);
if (customer == null) {
return new ResponseResult(CommonCode.INEXISTENCE);
}
// 判断该客户的类型
if (Objects.equals(customer.getType(), CrmsConstant.CustomerType.PERSONAL_CUSTOMER.getType())) {
PersonalCustomerEntity personalCustomerEntity = personalCustomerDao.queryPersonalCustomerById(id);
// 封装个人类型客户信息
CustomerPersonalDTO customerPersonalDTO = this.setPersonal(customer,personalCustomerEntity);
return new ResponseResult<CustomerPersonalDTO>().SUCCESS(customerPersonalDTO);
} else {
CompanyCustomerEntity companyCustomerEntity = companyCustomerDao.queryCompanyCustomerById(id);
// 封装企业类型客户信息
CustomerCompanyDTO customerCompanyDTO = this.setCompany(customer, companyCustomerEntity);
return new ResponseResult<CustomerCompanyDTO>().SUCCESS(customerCompanyDTO);
}
}
/**
* 根据id查询客户的信息(导入到excel中)
*/
public ResponseResult getCustomerById(Long id) {
if (id == null){
return new ResponseResult(CommonCode.INVALID_PARAM);
}
// 员工基本信息
CustomerEntity customer = customerDao.queryCustomerById(id);
if (customer == null) {
return new ResponseResult<CustomerEntity>().SUCCESS(null);
return new ResponseResult(CommonCode.INEXISTENCE);
}
String name = PromptSuccess.getNoBeing();
if (customer.getManager() != null){
ResponseResult<EmployeeEntity> employee = hrmsFeignService.getEmployeeById(customer.getManager());
if (employee.getData() != null){
// 客户经理姓名
name = hrmsFeignService.getEmployeeById(customer.getManager()).getData().getName();
}
}
// 客户经理姓名
String name = hrmsFeignService.getEmployeeById(customer.getManager()).getData().getName();
// 判断该客户的类型
if (Objects.equals(customer.getType(), CrmsConstant.CustomerType.PERSONAL_CUSTOMER.getType())) {
PersonalCustomerEntity personalCustomerEntity = personalCustomerDao.queryPersonalCustomerById(id);
//封装个人类型客户信息
// 封装个人类型客户信息
CustomerPersonalVO customerPersonalVO = this.setPersonal(customer, name, personalCustomerEntity);
return new ResponseResult<CustomerPersonalVO>().SUCCESS(customerPersonalVO);
} else {
CompanyCustomerEntity companyCustomerEntity = companyCustomerDao.queryCompanyCustomerById(id);
//封装企业类型客户信息
// 封装企业类型客户信息
CustomerCompanyVO customerCompanyVO = this.setCompany(customer, name, companyCustomerEntity);
return new ResponseResult<CustomerCompanyVO>().SUCCESS(customerCompanyVO);
}
@ -129,12 +162,18 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
*/
@Override
public List<String> updateCustomerById(Long[] ids) {
if (ids == null || ids.length == 0){
return null;
}
//TODO 远程调用审批模块判断所选客户是否在审批,返回正在审批的客户的id集合Long[] idArray
List<Long> idArray = new ArrayList<>();// 假设为返回的正在审批的客户id集合
if (idArray.size() == 0 || idArray == null) {
customerDao.updateCustomerById(Arrays.asList(ids));
return new ArrayList<>();
boolean customer = customerDao.updateCustomerById(Arrays.asList(ids));
List<String> success = new ArrayList<>();
success.add(PromptSuccess.getDeleteSuccess());
List<String> fail = new ArrayList<>();
fail.add(PromptSuccess.getDeleteFail());
return customer ? success : fail;
} else {
return customerDao.queryCustomerNameById(idArray);
}
@ -149,14 +188,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
@Transactional
@Override
public boolean saveCustomerPersonal(CustomerEntity customerEntity, PersonalCustomerEntity personalCustomerEntity) {
customerEntity.setId(SnowflakeIdUtils.getRandomid());
//TODO 设置客户编号
customerEntity.setCode(((int)(Math.random()*100+1))+"");
customerEntity.setCreateTime(new Date());
customerEntity.setMotifyTime(new Date());
personalCustomerEntity.setId(SnowflakeIdUtils.getRandomid());
boolean customer = customerDao.saveCustomer(customerEntity);
personalCustomerEntity.setCustomerId(customerEntity.getId());
return customerDao.saveCustomer(customerEntity) && personalCustomerDao.savePersonalCustomer(personalCustomerEntity);
boolean personal = personalCustomerDao.savePersonalCustomer(personalCustomerEntity);
return customer && personal;
}
/**
@ -168,14 +207,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
@Transactional
@Override
public boolean saveCustomerCompany(CustomerEntity customerEntity, CompanyCustomerEntity companyCustomerEntity) {
customerEntity.setId(SnowflakeIdUtils.getRandomid());
//TODO 设置客户编号
customerEntity.setCode(((int)(Math.random()*100+1))+"");
customerEntity.setCreateTime(new Date());
customerEntity.setMotifyTime(new Date());
companyCustomerEntity.setId(SnowflakeIdUtils.getRandomid());
boolean customer = customerDao.saveCustomer(customerEntity);
companyCustomerEntity.setCustomerId(customerEntity.getId());
return customerDao.saveCustomer(customerEntity) && companyCustomerDao.saveCompanyCustomer(companyCustomerEntity);
boolean company = companyCustomerDao.saveCompanyCustomer(companyCustomerEntity);
return customer && company;
}
/**
@ -187,9 +226,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
@Transactional
@Override
public boolean updateCustomerPersonal(CustomerEntity customerEntity, PersonalCustomerEntity personalCustomerEntity) {
if (customerEntity.getId() == null){
return false;
}
customerEntity.setMotifyTime(new Date());
boolean customer = customerDao.updateCustomer(customerEntity);
personalCustomerEntity.setCustomerId(customerEntity.getId());
return customerDao.updateCustomer(customerEntity) && personalCustomerDao.updatePersonalCustomer(personalCustomerEntity);
boolean personal = personalCustomerDao.updatePersonalCustomer(personalCustomerEntity);
return customer && personal;
}
/**
@ -201,9 +245,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
@Transactional
@Override
public boolean updateCustomerCompany(CustomerEntity customerEntity, CompanyCustomerEntity companyCustomerEntity) {
if (customerEntity.getId() == null){
return false;
}
customerEntity.setMotifyTime(new Date());
boolean customer = customerDao.updateCustomer(customerEntity);
companyCustomerEntity.setCustomerId(customerEntity.getId());
return customerDao.updateCustomer(customerEntity) && companyCustomerDao.updateCompanyCustomer(companyCustomerEntity);
boolean company = companyCustomerDao.updateCompanyCustomer(companyCustomerEntity);
return customer && company;
}
/**
@ -219,7 +268,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
List<CustomerPersonalVO> personalList = new ArrayList<>();
List<Long> longList = customerDao.listCustomerId();
for (Long id : longList) {
ResponseResult responseResult = this.queryCustomerById(id);
ResponseResult responseResult = this.getCustomerById(id);
if ((responseResult.getData()).getClass() == CustomerCompanyVO.class){
companyList.add((CustomerCompanyVO) responseResult.getData());
}else {
@ -256,8 +305,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
*/
@Transactional
@Override
public void excelImportCustomer(MultipartFile excel) {
public boolean excelImportCustomer(MultipartFile excel) {
//TODO 导入excel数据到数据库,思路耗时太长,有待优化
if (excel == null){
ExceptionCast.cast(CrmsCode.NOT_NULL);
}
try {
List<Object> personalList = ExcelUtil.readExcel(excel, new CustomerPersonalVO(), 1);
List<Object> companyList = ExcelUtil.readExcel(excel, new CustomerCompanyVO(), 2);
@ -298,8 +350,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
}
this.saveCustomerCompany(customer,cc);
}
return true;
}catch (Exception e){
ExceptionCast.cast(CrmsCode.CUSTOMER_IMPORT_EXSIT);
return false;
}
}
@ -312,7 +366,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
*/
private void timeCheckout(Integer createTime, String startTime, String endTime, CustomerRequest customerRequest) {
// 没有选择自定义时间且选择了固定的"3个月内、6个月内、9个月内...."时间
if (startTime == null && endTime == null && createTime != null) {
if ((startTime == null || startTime.length() == 0) && (endTime == null || endTime.length() == 0) && createTime != null) {
if (createTime == 3 || createTime == 6 || createTime == 9 || createTime == 12) {
String pastTime = this.pastTime(createTime);
customerRequest.setStartTime(pastTime);
@ -348,7 +402,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
* @param size 每页条数
*/
private Page<Object> pageCheckout(Integer page, Integer size) {
Integer count = this.count(new QueryWrapper<CustomerEntity>().eq("del_or_not", CrmsConstant.NOT_DELETE));//查询客户有效总条数
// 查询客户有效总条数
Integer count = this.count(new QueryWrapper<CustomerEntity>().eq("del_or_not", CrmsConstant.NOT_DELETE));
if (size == null || size < 1) {
size = 10;
}
@ -373,95 +428,77 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
private List<CustomerTO> jointCustomerEmployee(List<CustomerEntity> customers, List<EmployeeTO> employeeTO) {
List<CustomerTO> customerTOS = new ArrayList<>();// 用于拼装客户信息和员工及部门信息的集合
CustomerTO customerTO;
// 将客户信息和客户经理及部门信息拼装起来
for (CustomerEntity customer : customers) {
// 每一个客户对应一个不同的对象
customerTO = new CustomerTO();
for (EmployeeTO anEmployeeTO : employeeTO) {
if (Objects.equals(customer.getManager(), anEmployeeTO.getId())) {
customerTO.setId(customer.getId());
customerTO.setCode(customer.getCode());
customerTO.setName(customer.getName());
customerTO.setPhone(customer.getPhone());
customerTO.setType(customer.getType());
BeanUtils.copyProperties(customer,customerTO);
customerTO.setManager(anEmployeeTO.getEmpName());
customerTO.setDepartments(anEmployeeTO.getDeptNames());
customerTOS.add(customerTO);
}
}
if (!Objects.equals(customerTO.getId(), customer.getId())) {
customerTO.setId(customer.getId());
customerTO.setCode(customer.getCode());
customerTO.setName(customer.getName());
customerTO.setPhone(customer.getPhone());
customerTO.setType(customer.getType());
BeanUtils.copyProperties(customer,customerTO);
customerTOS.add(customerTO);
}
}
return customerTOS;
}
/**
* 封装个人类型的客户信息
*
* @param customer 客户基本信息
* @param name 客户经理姓名
* @param personal 个人类型信息
* @return
*/
private CustomerPersonalVO setPersonal(CustomerEntity customer, String name, PersonalCustomerEntity personal) {
private CustomerPersonalDTO setPersonal(CustomerEntity customer, PersonalCustomerEntity personal) {
//BeanUtils能批量封装相同字段名称和类型的属性的值
CustomerPersonalVO customerPersonalVO = new CustomerPersonalVO();
customerPersonalVO.setCode(customer.getCode());
customerPersonalVO.setType(customer.getType());
customerPersonalVO.setManager(name);
customerPersonalVO.setName(customer.getName());
customerPersonalVO.setAddr(customer.getAddr());
customerPersonalVO.setPhone(customer.getPhone());
customerPersonalVO.setIdCard(personal.getIdCard());
customerPersonalVO.setAge(personal.getAge());
customerPersonalVO.setGender(personal.getGender());
customerPersonalVO.setMaritalStatus(personal.getMaritalStatus());
customerPersonalVO.setEducation(personal.getEducation());
customerPersonalVO.setEmployer(personal.getEmployer());
customerPersonalVO.setPosition(personal.getPosition());
customerPersonalVO.setWorkingYears(personal.getWorkingYears());
customerPersonalVO.setSocialSecurityNum(personal.getSocialSecurityNum());
customerPersonalVO.setLivingSituation(personal.getLivingSituation());
customerPersonalVO.setResidenceAddr(personal.getResidenceAddr());
customerPersonalVO.setBusinessSource(personal.getBusinessSource());
customerPersonalVO.setEmergencyLinkman(personal.getEmergencyLinkman());
customerPersonalVO.setEmergencyLinkmanRelationship(personal.getEmergencyLinkmanRelationship());
customerPersonalVO.setEmergencyLinkmanPhone(personal.getEmergencyLinkmanPhone());
return customerPersonalVO;
CustomerPersonalDTO personalDTO = new CustomerPersonalDTO();
BeanUtils.copyProperties(customer,personalDTO);
BeanUtils.copyProperties(personal,personalDTO);
return personalDTO;
}
/**
* 封装企业类型的客户信息
*
* @param customer 客户基本信息
* @param name 客户经理姓名
* @param company 企业类型信息
* @return
*/
private CustomerCompanyDTO setCompany(CustomerEntity customer, CompanyCustomerEntity company) {
CustomerCompanyDTO companyDTO = new CustomerCompanyDTO();
BeanUtils.copyProperties(customer,companyDTO);
BeanUtils.copyProperties(company,companyDTO);
return companyDTO;
}
/**
* 封装企业类型的客户信息(excel)
*/
private CustomerCompanyVO setCompany(CustomerEntity customer, String name, CompanyCustomerEntity company) {
CustomerCompanyVO customerCompanyVO = new CustomerCompanyVO();
customerCompanyVO.setCode(customer.getCode());
customerCompanyVO.setType(customer.getType());
BeanUtils.copyProperties(customer,customerCompanyVO);
BeanUtils.copyProperties(company,customerCompanyVO);
customerCompanyVO.setManager(name);
customerCompanyVO.setName(customer.getName());
customerCompanyVO.setAddr(customer.getAddr());
customerCompanyVO.setPhone(customer.getPhone());
customerCompanyVO.setRegisteredCapital(company.getRegisteredCapital());
customerCompanyVO.setIndustry(company.getIndustry());
customerCompanyVO.setYears(company.getYears());
customerCompanyVO.setRegion(company.getRegion());
customerCompanyVO.setShareholder(company.getShareholder());
customerCompanyVO.setAffiliatedCompany(company.getAffiliatedCompany());
customerCompanyVO.setEmployeeNumber(company.getEmpNum());
customerCompanyVO.setLinkman(company.getLinkman());
customerCompanyVO.setBusinessSource(company.getBusinessSource());
return customerCompanyVO;
}
/**
* 封装个人类型的客户信息(excel)
*/
private CustomerPersonalVO setPersonal(CustomerEntity customer, String name, PersonalCustomerEntity personal) {
//BeanUtils能批量封装相同字段名称和类型的属性的值
CustomerPersonalVO customerPersonalVO = new CustomerPersonalVO();
BeanUtils.copyProperties(customer,customerPersonalVO);
BeanUtils.copyProperties(personal,customerPersonalVO);
customerPersonalVO.setManager(name);
return customerPersonalVO;
}
}

@ -28,8 +28,8 @@
<!-- 插入企业类型客户信息 -->
<insert id="saveCompanyCustomer" parameterType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
INSERT INTO crms_company_customer
(id,registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source,customer_id)
values (#{id},#{registeredCapital},#{industry},#{years},#{region},#{shareholder},#{affiliatedCompany},#{empNum},#{linkman},
(registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source,customer_id)
values (#{registeredCapital},#{industry},#{years},#{region},#{shareholder},#{affiliatedCompany},#{empNum},#{linkman},
#{businessSource},#{customerId});
</insert>

@ -70,10 +70,10 @@
</select>
<!-- 插入客户基本信息 -->
<insert id="saveCustomer" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
<insert id="saveCustomer" keyProperty="id" useGeneratedKeys="true" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
INSERT INTO crms_customer
(id,code,type,manager,name,addr,phone,del_or_not,status,create_time,motify_time)
VALUES (#{id},#{code},#{type},#{manager},#{name},#{addr},#{phone},0,0,#{createTime},#{motifyTime})
(code,type,manager,name,addr,phone,del_or_not,status,create_time,motify_time)
VALUES (#{code},#{type},#{manager},#{name},#{addr},#{phone},0,0,#{createTime},#{motifyTime})
</insert>
<!-- 更新客户基本信息 -->

@ -36,9 +36,9 @@
<!-- 插入个人类型的客户信息 -->
<insert id="savePersonalCustomer" parameterType="com.daqing.framework.domain.crms.PersonalCustomerEntity">
INSERT INTO crms_personal_customer
(id,customer_id,id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,living_situation
(customer_id,id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,living_situation
,residence_addr,business_source,emergency_linkman,emergency_linkman_relationship,emergency_linkman_phone)
VALUES (#{id},#{customerId},#{idCard},#{age},#{gender},#{maritalStatus},#{education},#{employer},#{position},#{workingYears},
VALUES (#{customerId},#{idCard},#{age},#{gender},#{maritalStatus},#{education},#{employer},#{position},#{workingYears},
#{socialSecurityNum},#{livingSituation},#{residenceAddr},#{businessSource},#{emergencyLinkman},#{emergencyLinkmanRelationship},
#{emergencyLinkmanPhone});
</insert>

@ -28,8 +28,8 @@
<!-- 插入企业类型客户信息 -->
<insert id="saveCompanyCustomer" parameterType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
INSERT INTO crms_company_customer
(id,registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source,customer_id)
values (#{id},#{registeredCapital},#{industry},#{years},#{region},#{shareholder},#{affiliatedCompany},#{empNum},#{linkman},
(registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source,customer_id)
values (#{registeredCapital},#{industry},#{years},#{region},#{shareholder},#{affiliatedCompany},#{empNum},#{linkman},
#{businessSource},#{customerId});
</insert>

@ -70,10 +70,10 @@
</select>
<!-- 插入客户基本信息 -->
<insert id="saveCustomer" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
<insert id="saveCustomer" keyProperty="id" useGeneratedKeys="true" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
INSERT INTO crms_customer
(id,code,type,manager,name,addr,phone,del_or_not,status,create_time,motify_time)
VALUES (#{id},#{code},#{type},#{manager},#{name},#{addr},#{phone},0,0,#{createTime},#{motifyTime})
(code,type,manager,name,addr,phone,del_or_not,status,create_time,motify_time)
VALUES (#{code},#{type},#{manager},#{name},#{addr},#{phone},0,0,#{createTime},#{motifyTime})
</insert>
<!-- 更新客户基本信息 -->

@ -36,9 +36,9 @@
<!-- 插入个人类型的客户信息 -->
<insert id="savePersonalCustomer" parameterType="com.daqing.framework.domain.crms.PersonalCustomerEntity">
INSERT INTO crms_personal_customer
(id,customer_id,id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,living_situation
(customer_id,id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,living_situation
,residence_addr,business_source,emergency_linkman,emergency_linkman_relationship,emergency_linkman_phone)
VALUES (#{id},#{customerId},#{idCard},#{age},#{gender},#{maritalStatus},#{education},#{employer},#{position},#{workingYears},
VALUES (#{customerId},#{idCard},#{age},#{gender},#{maritalStatus},#{education},#{employer},#{position},#{workingYears},
#{socialSecurityNum},#{livingSituation},#{residenceAddr},#{businessSource},#{emergencyLinkman},#{emergencyLinkmanRelationship},
#{emergencyLinkmanPhone});
</insert>

@ -14,7 +14,7 @@ import javax.validation.Valid;
/**
* @auther River
* @auther River
* @date 2020/9/22 15:27
*/
@RestController

@ -18,9 +18,9 @@ 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
spring.redis.host=127.0.0.1
spring.redis.host=192.168.232.128
spring.redis.port=6379
spring.redis.password=123456
spring.redis.password=
spring.redis.database=0
spring.redis.timeout=30000
spring.redis.jedis.pool.max-active=8

@ -62,7 +62,7 @@
</exclusions>
</dependency>
<!--<dependency>
<!-- <dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.5.RELEASE</version>

@ -0,0 +1,33 @@
package com.daqing.financial.hrms.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/**
* 实现基本的跨域请求
*
* @auther River
* @date 2020/9/25 15:09
*/
@Configuration
public class CorsConfig {
@Bean
public CorsFilter corsFilter() {
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
final CorsConfiguration corsConfiguration = new CorsConfiguration();
/*是否允许请求带有验证信息*/
corsConfiguration.setAllowCredentials(true);
/*允许访问的客户端域名*/
corsConfiguration.addAllowedOrigin("*");
/*允许服务端访问的客户端请求头*/
corsConfiguration.addAllowedHeader("*");
/*允许访问的方法名,GET POST等*/
corsConfiguration.addAllowedMethod("*");
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
return new CorsFilter(urlBasedCorsConfigurationSource);
}
}

@ -104,9 +104,18 @@ public class DeptController implements DeptControllerApi {
/**
*所有部门及员工
*/
@Override
/*@Override
@GetMapping("/trees")
public ResponseResult trees() {
return new ResponseResult<List<DepartmentVO>>().SUCCESS(deptService.listDepartmentAndEmployeeTree());
}*/
/**
* 该部门下所有子部门及部门下员工
*/
@Override
@GetMapping("/children")
public ResponseResult children(Long id){
return new ResponseResult<DepartmentVO>().SUCCESS(deptService.getDepartmentAndEmployee(id));
}
}

@ -91,7 +91,7 @@ public class EmployeeController implements EmployeeControllerApi {
* @param ids
* @return
*/
@Override
//@Override
@GetMapping("/getEmployeeAndDeptById")
public ResponseResult getEmployeeAndDeptById(@RequestParam("ids") Long[] ids) {
List<EmployeeTO> employeeTO = employeeService.getEmployeeAndDeptById(Arrays.asList(ids));

@ -25,4 +25,6 @@ public interface DeptDao extends BaseMapper<DeptEntity> {
List<DepartmentVO> listDepartment();
List<DepartmentVO> getDepartmentByParentId(Long parentId);
}

@ -24,6 +24,8 @@ public interface DeptService extends IService<DeptEntity> {
boolean deleteByIds(Long[] ids);
List<DepartmentVO> listDepartmentAndEmployeeTree();
/*List<DepartmentVO> listDepartmentAndEmployeeTree();*/
DepartmentVO getDepartmentAndEmployee(Long id);
}

@ -7,6 +7,7 @@ import com.daqing.financial.hrms.dao.EmployeeDao;
import com.daqing.financial.hrms.service.DeptService;
import com.daqing.framework.domain.hrms.DepartmentVO;
import com.daqing.framework.domain.hrms.DeptEntity;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.request.DeptAddRequest;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.exception.ExceptionCast;
@ -64,7 +65,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
//实体类
DeptEntity deptEntity = new DeptEntity();
//设置id
deptEntity.setId(SnowflakeIdUtils.getRandomid());
//deptEntity.setId(SnowflakeIdUtils.getRandomid());
//属性拷贝,将上级部门id(如果有)、部门名称设置到实体类
BeanUtils.copyProperties(deptAddRequest, deptEntity);
//2、判断部门上级id是否为空,为空则此部门是一级部门,否则查询并计算部门层级,并判断部门层级是否大于5级或小于1级
@ -154,11 +155,10 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
* 获取所有的部门及部门下的员工信息
* @return
*/
@Override
/* @Override
public List<DepartmentVO> listDepartmentAndEmployeeTree() {
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L);
}
private List<DepartmentVO> getListDepartmentAndEmployeeTree(List<DepartmentVO> list, Long parentId){
return list.stream()
.filter(dept -> parentId.equals(dept.getParentId())) // 过滤出部门id为所选id的部门信息(也为递归的结果条件,找不到所对应的部门id)
@ -168,5 +168,24 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
})
.sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序
.collect(Collectors.toList());
}*/
/**
* 获取该部门下子部门及部门下的员工
*/
@Override
public DepartmentVO getDepartmentAndEmployee(Long id) {
DepartmentVO departmentVO = new DepartmentVO();
if (id == null){
List<DepartmentVO> departments = deptDao.getDepartmentByParentId(0L);
departmentVO.setChildren(departments);
return departmentVO;
}else {
List<DepartmentVO> departments = deptDao.getDepartmentByParentId(id);
List<EmployeeVO> employeeS = employeeDao.listEmployeeByDeptId(id);
departmentVO.setChildren(departments);
departmentVO.setEmployee(employeeS);
return departmentVO;
}
}
}

@ -55,5 +55,4 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
return this.getBaseMapper().listEmployeeName();
}
}

@ -36,4 +36,9 @@
FROM hrms_dept
</select>
<select id="getDepartmentByParentId" parameterType="long" resultType="com.daqing.framework.domain.hrms.DepartmentVO">
SELECT id,name,parent_id,sort
FROM hrms_dept WHERE parent_id = #{parentId}
</select>
</mapper>

@ -35,7 +35,10 @@
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON d.id = ed.dept_id
WHERE e.id
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.id
IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
@ -44,7 +47,12 @@
<!-- 根据id查询员工姓名 -->
<select id="getEmployeeById" parameterType="long" resultType="com.daqing.framework.domain.hrms.EmployeeEntity">
SELECT name FROM hrms_employee WHERE id = #{id}
SELECT e.name name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.id = #{id}
</select>
<!-- 根据部门id获取该部门下面所有的员工 -->
@ -55,15 +63,22 @@
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
WHERE d.id = #{id}
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND d.id = #{id}
</select>
<!-- 查询所有的员工姓名和id -->
<select id="listEmployeeName" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT id,name
FROM hrms_employee
SELECT e.id id,e.name name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
</select>
<!-- //TODO 修改查询员工为user表的del_or_not = 0的员工 -->
<select id="pageByCondition" resultMap="employeeMap">
SELECT e.id eid,e.name emp_name,d.name
,u.account,e.job_number,u.create_time,p.name pos_name

@ -36,4 +36,9 @@
FROM hrms_dept
</select>
<select id="getDepartmentByParentId" parameterType="long" resultType="com.daqing.framework.domain.hrms.DepartmentVO">
SELECT id,name,parent_id,sort
FROM hrms_dept WHERE parent_id = #{parentId}
</select>
</mapper>

@ -35,7 +35,10 @@
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON d.id = ed.dept_id
WHERE e.id
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.id
IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
@ -44,7 +47,12 @@
<!-- 根据id查询员工姓名 -->
<select id="getEmployeeById" parameterType="long" resultType="com.daqing.framework.domain.hrms.EmployeeEntity">
SELECT name FROM hrms_employee WHERE id = #{id}
SELECT e.name name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.id = #{id}
</select>
<!-- 根据部门id获取该部门下面所有的员工 -->
@ -55,15 +63,22 @@
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
WHERE d.id = #{id}
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND d.id = #{id}
</select>
<!-- 查询所有的员工姓名和id -->
<select id="listEmployeeName" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT id,name
FROM hrms_employee
SELECT e.id id,e.name name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
</select>
<!-- //TODO 修改查询员工为user表的del_or_not = 0的员工 -->
<select id="pageByCondition" resultMap="employeeMap">
SELECT e.id eid,e.name emp_name,d.name
,u.account,e.job_number,u.create_time,p.name pos_name

@ -16,11 +16,16 @@ public enum CommonCode implements ResultCode {
SUCCESS(true, 10000, "操作成功!"),
FAIL(false, 11111, "操作失败!"),
INEXISTENCE(false,10004,"抱歉,当前客户信息已不存在!"),
UPDATE_FAIL(false,10005,"更新信息失败!"),
SAVE_FAIL(false,10006,"新增信息失败!"),
DELETE_FAIL(false,10007,"删除失败!"),
UNAUTHENTICATED(false, 10001, "此操作需要登陆系统!"),
UNAUTHORISE(false, 10002, "权限不足,无权操作!"),
INVALID_PARAM(false, 10003, "非法参数!"),
USER_IS_NOT_EXIST(false, 10004, "用户不存在或用户已禁用!"),
PASSWORD_IS_ERROR(false, 10005, "密码错误!"),
IMPORT_ERROR(false,10008,"导入数据失败!"),
SERVER_ERROR(false, 99999, "抱歉,系统繁忙,请稍后重试!");
/**

@ -0,0 +1,32 @@
package com.daqing.framework.model.response;
/**
* 提示信息
*
* @auther River
* @date 2020/9/27 11:56
*/
public class PromptSuccess {
private static final String DELETE_SUCCESS = "删除成功!";
private static final String DELETE_FAIL = "删除失败!";
private static final String NO_BEING = "该员工已不存在";
public static String getDeleteSuccess(){
return PromptSuccess.DELETE_SUCCESS;
}
public static String getDeleteFail(){
return PromptSuccess.DELETE_FAIL;
}
public static String getNoBeing(){
return PromptSuccess.NO_BEING;
}
}

@ -56,6 +56,10 @@ public class ResponseResult<T> {
return new ResponseResult<>(true, 10000, t, "操作成功!");
}
public ResponseResult SUCCESS_DATA(T t){
return new ResponseResult<>(false,20000,t,"操作失败!");
}
public static ResponseResult FAIL() {
return new ResponseResult(CommonCode.FAIL);
}

@ -41,9 +41,9 @@ public class JwtUtils {
}
public static void main(String[] args) {
System.out.println(validateJWT(createJWT("1","123",100000)));
//byte[] encodedKey = Base64.decode("DQJWT");
//System.out.println(encodedKey);
//System.out.printf(createJWT("1","111", 10000000));
boolean isTrue = validateJWT("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxIiwic3ViIjoiMTExIiwiaXNzIjoidXNlciIsImlhdCI6MTYwMTM0MzYyNywiZXhwIjoxNjAxMzUzNjI3fQ.q5Ssg2LM1OzzgvVWqLhgP_Hko0-pfeNO5bvpUE5KQ-s");
System.out.println(isTrue);
}
/**

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -23,47 +25,58 @@ public class CompanyCustomerEntity implements Serializable {
/**
* 主键
*/
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 注册资金
*/
@ApiModelProperty(value = "注册资金")
private String registeredCapital;
/**
* 所属行业
*/
@ApiModelProperty(value = "所属行业")
private String industry;
/**
* 成立年限
*/
@ApiModelProperty(value = "成立年限")
private Integer years;
/**
* 所在区域
*/
@ApiModelProperty(value = "所在区域")
private String region;
/**
* 股东名称
*/
@ApiModelProperty(value = "股东名称")
private String shareholder;
/**
* 关联企业
*/
@ApiModelProperty(value = "关联企业")
private String affiliatedCompany;
/**
* 员工个数
*/
@ApiModelProperty(value = "员工个数")
private String empNum;
/**
* 联系人
*/
@ApiModelProperty(value = "联系人")
private String linkman;
/**
* 业务来源
*/
@ApiModelProperty(value = "业务来源")
private String businessSource;
/**
* 客户基本信息表id
*/
@ApiModelProperty(value = "客户基本信息表id")
private Long customerId;
}

@ -6,8 +6,12 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 记录客户基本信息
*
@ -23,55 +27,71 @@ public class CustomerEntity implements Serializable {
/**
* 主键
*/
@NotNull(message = "id不能为空")
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 客户编号
*/
@ApiModelProperty(value = "客户编号")
private String code;
/**
* 客户类型1企业类型0个人类型
*/
@NotNull(message = "客户类型不能为空")
@ApiModelProperty(value = "客户类型")
private Integer type;
/**
* 客户的经理人id
*/
@ApiModelProperty(value = "客户经理人id")
private Long manager;
/**
* 客户名称
*/
@ApiModelProperty(value = "客户名称")
private String name;
/**
* 联系地址
*/
@ApiModelProperty(value = "联系地址")
private String addr;
/**
* 联系电话
*/
@NotNull(message = "联系电话不能为空")
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 密码
*/
@ApiModelProperty(value = "密码")
private String password;
/**
* 微信唯一标识
*/
@ApiModelProperty(value = "微信唯一标识")
private String wechatId;
/**
* 0未删除1已删除
*/
@ApiModelProperty(value = "是否删除")
private Integer delOrNot;
/**
* 0启用1禁用
*/
@ApiModelProperty(value = "是否禁用")
private Integer status;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private Date motifyTime;
}

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -25,71 +27,88 @@ public class PersonalCustomerEntity implements Serializable {
/**
* 主键
*/
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 客户基本信息表id
*/
@ApiModelProperty(value = "客户基本表id")
private Long customerId;
/**
* 身份证号
*/
@ApiModelProperty(value = "身份证号")
private String idCard;
/**
* 年龄
*/
@ApiModelProperty(value = "年龄")
private Integer age;
/**
* 性别10
*/
@ApiModelProperty(value = "性别")
private Integer gender;
/**
* 婚姻状况1已婚0
* 婚姻状况,0:未婚,1:已婚,2:离异,3:
*/
@ApiModelProperty(value = "婚姻状况")
private Integer maritalStatus;
/**
* 学历
* 学历,0:本科,1:大专,2:高职,3:中专,4:其他
*/
private String education;
@ApiModelProperty(value = "学历")
private Integer education;
/**
* 工作单位
*/
@ApiModelProperty(value = "工作单位")
private String employer;
/**
* 职务
*/
@ApiModelProperty(value = "职务")
private String position;
/**
* 工作年限
*/
@ApiModelProperty(value = "工作年限")
private Integer workingYears;
/**
* 社保账号
*/
@ApiModelProperty(value = "社保账号")
private String socialSecurityNum;
/**
* 居住情况
*/
@ApiModelProperty(value = "居住情况")
private String livingSituation;
/**
* 户籍地址
*/
@ApiModelProperty(value = "户籍地址")
private String residenceAddr;
/**
* 业务来源
*/
@ApiModelProperty(value = "业务来源")
private String businessSource;
/**
* 紧急联系人
*/
@ApiModelProperty(value = "紧急联系人")
private String emergencyLinkman;
/**
* 紧急联系人关系
*/
@ApiModelProperty(value = "紧急联系人关系")
private String emergencyLinkmanRelationship;
/**
* 紧急联系人电话
*/
@ApiModelProperty(value = "紧急联系人电话")
private String emergencyLinkmanPhone;
}

@ -0,0 +1,92 @@
package com.daqing.framework.domain.crms.ext;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
* @auther River
* @date 2020/9/29 11:00
*/
@Data
@ToString
public class CustomerCompanyDTO implements Serializable {
/**
* 客户编号
*/
@ApiModelProperty(value = "客户编号")
private String code;
/**
* 客户类型1企业类型0个人类型
*/
@ApiModelProperty(value = "企业类型")
private Integer type;
/**
* 客户经理
*/
@ApiModelProperty(value = "客户经理")
private Long manager;
/**
* 客户名称
*/
@ApiModelProperty(value = "客户名称")
private String name;
/**
* 联系地址
*/
@ApiModelProperty(value = "联系地址")
private String addr;
/**
* 联系电话
*/
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 注册资金
*/
@ApiModelProperty(value = "注册资金")
private String registeredCapital;
/**
* 所属行业
*/
@ApiModelProperty(value = "所属行业")
private String industry;
/**
* 成立年限
*/
@ApiModelProperty(value = "成立年限")
private Integer years;
/**
* 所在区域
*/
@ApiModelProperty(value = "所在区域")
private String region;
/**
* 股东名称
*/
@ApiModelProperty(value = "股东名称")
private String shareholder;
/**
* 关联企业
*/
@ApiModelProperty(value = "关联企业")
private String affiliatedCompany;
/**
* 员工个数
*/
@ApiModelProperty(value = "员工个数")
private String empNum;
/**
* 联系人
*/
@ApiModelProperty(value = "联系人")
private String linkman;
/**
* 业务来源
*/
@ApiModelProperty(value = "业务来源")
private String businessSource;
}

@ -2,6 +2,7 @@ package com.daqing.framework.domain.crms.ext;
import com.daqing.framework.domain.crms.CompanyCustomerEntity;
import com.daqing.framework.domain.crms.CustomerEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -18,9 +19,11 @@ public class CustomerCompanyTO implements Serializable {
/**
* 客户基本信息
*/
@ApiModelProperty(value = "客户基本信息")
private CustomerEntity customerEntity;
/**
* 企业类型信息
*/
@ApiModelProperty(value = "客户企业信息")
private CompanyCustomerEntity companyCustomerEntity;
}

@ -2,13 +2,15 @@ package com.daqing.framework.domain.crms.ext;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.Email;
import java.io.Serializable;
/**
* 企业类型客户返回信息包装类
* 企业类型客户返回信息包装类(excel)
*
* @auther River
* @date 2020/9/14 10:48
@ -81,7 +83,7 @@ public class CustomerCompanyVO extends BaseRowModel implements Serializable {
* 员工个数
*/
@ExcelProperty(value = "员工个数",index = 12)
private String employeeNumber;
private String empNum;
/**
* 联系人
*/

@ -0,0 +1,101 @@
package com.daqing.framework.domain.crms.ext;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
* @auther River
* @date 2020/9/29 11:01
*/
@Data
@ToString
public class CustomerPersonalDTO implements Serializable {
/**
* 客户编号
*/
private String code;
/**
* 客户类型1企业类型0个人类型
*/
private Integer type;
/**
* 客户经理
*/
private Long manager;
/**
* 客户名称
*/
private String name;
/**
* 联系地址
*/
private String addr;
/**
* 联系电话
*/
private String phone;
/**
* 身份证号
*/
private String idCard;
/**
* 年龄
*/
private Integer age;
/**
* 性别10
*/
private Integer gender;
/**
* 婚姻状况1已婚0未婚
*/
private Integer maritalStatus;
/**
* 学历
*/
private Integer education;
/**
* 工作单位
*/
private String employer;
/**
* 职务
*/
private String position;
/**
* 工作年限
*/
private Integer workingYears;
/**
* 社保账号
*/
private String socialSecurityNum;
/**
* 居住情况
*/
private String livingSituation;
/**
* 户籍地址
*/
private String residenceAddr;
/**
* 业务来源
*/
private String businessSource;
/**
* 紧急联系人
*/
private String emergencyLinkman;
/**
* 紧急联系人关系
*/
private String emergencyLinkmanRelationship;
/**
* 紧急联系人电话
*/
private String emergencyLinkmanPhone;
}

@ -2,6 +2,7 @@ package com.daqing.framework.domain.crms.ext;
import com.daqing.framework.domain.crms.CustomerEntity;
import com.daqing.framework.domain.crms.PersonalCustomerEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -18,10 +19,12 @@ public class CustomerPersonalTO implements Serializable {
/**
* 客户基本信息
*/
@ApiModelProperty(value = "客户基本信息")
private CustomerEntity customerEntity;
/**
* 客户个人信息
*/
@ApiModelProperty(value = "客户个人信息")
private PersonalCustomerEntity personalCustomerEntity;
}

@ -8,7 +8,7 @@ import lombok.ToString;
import java.io.Serializable;
/**
* 个人类型返回信息包装类
* 个人类型返回信息包装类(excel)
*
* @auther River
* @date 2020/9/11 17:28
@ -65,13 +65,13 @@ public class CustomerPersonalVO extends BaseRowModel implements Serializable {
/**
* 婚姻状况1已婚0未婚
*/
@ExcelProperty(value = "婚姻状况(1:已婚,0:未婚)",index = 9)
@ExcelProperty(value = "婚姻状况(0:未婚,1:已婚,2:离异,3:再婚)",index = 9)
private Integer maritalStatus;
/**
* 学历
*/
@ExcelProperty(value = "学历",index = 10)
private String education;
@ExcelProperty(value = "学历(0:本科,1:大专,2:高职,3:中专,4:其他)",index = 10)
private Integer education;
/**
* 工作单位
*/

@ -1,7 +1,6 @@
package com.daqing.framework.domain.crms.ext;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -21,34 +20,41 @@ public class CustomerTO implements Serializable {
/**
* id
*/
@ApiModelProperty(value = "id")
private Long id;
/**
* 客户编号
*/
@ApiModelProperty(value = "客户编号")
private String code;
/**
* 客户姓名
*/
@ApiModelProperty(value = "客户名称")
private String name;
/**
* 联系电话
*/
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 客户类型
*/
@ApiModelProperty(value = "客户类型")
private Integer type;
/**
* 客户经理
*/
@ApiModelProperty(value = "客户经理")
private String manager;
/**
* 所属部门
*/
@ApiModelProperty(value = "所属部门")
private List<String> departments;
}

@ -1,9 +1,15 @@
package com.daqing.framework.domain.crms.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
/**
@ -20,22 +26,27 @@ public class CustomerRequest implements Serializable {
/**
* 客户编号或者名称
*/
@ApiModelProperty(value = "客户编号或者名称")
private String codeOrName;
/**
* 客户类型
*/
@ApiModelProperty(value = "客户类型")
private Integer customerType;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Integer createTime;
/**
* 起始时间
*/
@ApiModelProperty(value = "起始时间")
private String startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
private String endTime;
}

@ -17,7 +17,8 @@ public enum CrmsCode implements ResultCode {
CUSTOMER_IMPORT_EXSIT(false,20001,"导入数据失败,请检查文件和数据格式或稍后再试!"),
CUSTOMER_EXPORT_EXSIT(false,20002,"导出数据失败,请稍后再试!"),
CUSTOMER_EXPORTTEMPLATE_EXSIT(false,20003,"导出excel模板失败,请稍后再试!");
CUSTOMER_EXPORTTEMPLATE_EXSIT(false,20003,"导出excel模板失败,请稍后再试!"),
NOT_NULL(false,20004,"上传的文件不能为空");
/**
* 操作是否成功

@ -25,19 +25,23 @@ public class DepartmentVO implements Serializable{
/**
* 主键
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 部门名称
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private String name;
/**
* 上级部门id
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Long parentId;
/**
* 排序
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Integer sort;
/**
* 子部门

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ -26,11 +27,12 @@ public class DeptEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.INPUT)
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门名称")
private String name;
/**
* 上级部门id

@ -1,7 +1,5 @@
package com.daqing.framework.domain.hrms.ext;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import lombok.Data;
import lombok.ToString;

@ -84,7 +84,7 @@ public class ApiGlobalFilter implements GlobalFilter, Ordered {
* @return userPhone
*/
private Boolean verifyJWT(String token){
/* String id = RedisUtil.get("dq:token:"+token);
/*String id = RedisUtil.get("dq:token:"+token);
if(id == null || "".equals(id)){
return false;
}*/

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save