Merge remote-tracking branch 'origin/master'

master
chen 4 years ago
commit 0f42d6b9a4
  1. 12
      .idea/compiler.xml
  2. 5
      .idea/encodings.xml
  3. 6
      dq-financial-api/src/main/java/com/daqing/financial/hrms/DeptControllerApi.java
  4. BIN
      dq-financial-api/target/classes/com/daqing/financial/DqFinancialApiApplication.class
  5. BIN
      dq-financial-api/target/classes/com/daqing/financial/config/SwaggerConfig.class
  6. BIN
      dq-financial-api/target/classes/com/daqing/financial/crms/CustomerControllerApi.class
  7. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrauth/UserLoginControllerApi.class
  8. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/DeptControllerApi.class
  9. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/EmployeeControllerApi.class
  10. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/PermissionControllerApi.class
  11. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/PositionControllerApi.class
  12. 7
      dq-financial-crms/pom.xml
  13. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java
  14. 18
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  15. 2
      dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml
  16. BIN
      dq-financial-crms/target/classes/META-INF/dq-financial-crms.kotlin_module
  17. 79
      dq-financial-crms/target/classes/bootstrap.properties
  18. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/DqFinancialCrmsApplication.class
  19. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/CorsConfig.class
  20. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/IPageConfig.class
  21. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/controller/CustomerController.class
  22. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CompanyCustomerDao.class
  23. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CustomerDao.class
  24. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/feign/HrmsFeignService.class
  25. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/CustomerService.class
  26. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/impl/CustomerServiceImpl.class
  27. 36
      dq-financial-crms/target/classes/mapper/crms/CompanyCustomerDao.xml
  28. 9
      dq-financial-crms/target/classes/mapper/crms/CustomerDao.xml
  29. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  30. 66
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
  31. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgStatisticsController.java
  32. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java
  33. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEfficiencyMapper.java
  34. 12
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgStatisticsRequest.java
  35. 76
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java
  36. 69
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java
  37. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListRefuseResponse.java
  38. 10
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java
  39. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java
  40. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgEfficiencyService.java
  41. 55
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  42. 449
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java
  43. 110
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgStatisticsServiceImpl.java
  44. 22
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml
  45. 10
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEfficiencyMapper.xml
  46. 6
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgStatisticsMapper.xml
  47. 70
      dq-financial-hrms-auth/target/classes/bootstrap.properties
  48. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/aspect/Operation.class
  49. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/aspect/SysLogAspect.class
  50. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/controller/UserLoginController.class
  51. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/dao/LoginLogMapper.class
  52. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/dao/SystemLogMapper.class
  53. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/dao/UserLoginDao.class
  54. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/LoginLogService.class
  55. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/UserLoginService.class
  56. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.class
  57. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.class
  58. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/util/IpUtils.class
  59. 41
      dq-financial-hrms-auth/target/classes/mapper/hrmsauth/UserLoginMapper.xml
  60. 8
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java
  61. 3
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/DeptDao.java
  62. 3
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java
  63. 13
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java
  64. 42
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  65. 4
      dq-financial-hrms/src/main/resources/mapper/hrms/DeptDao.xml
  66. 76
      dq-financial-hrms/target/classes/bootstrap.properties
  67. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/DqFinancialHrmsApplication.class
  68. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/config/CorsConfig.class
  69. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/config/IPageConfig.class
  70. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/DeptController.class
  71. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/EmployeeController.class
  72. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PermissionController.class
  73. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PositionController.class
  74. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/UserController.class
  75. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/DeptDao.class
  76. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/EmployeeDao.class
  77. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/PermissionDao.class
  78. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/PositionDao.class
  79. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/RoleDao.class
  80. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/RolePermissionDao.class
  81. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/UserDao.class
  82. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/DeptService.class
  83. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/EmployeeService.class
  84. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/PermissionService.class
  85. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/PositionService.class
  86. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/UserService.class
  87. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/DeptServiceImpl.class
  88. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.class
  89. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/PermissionServiceImpl.class
  90. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/PositionServiceImpl.class
  91. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/UserServiceImpl.class
  92. 50
      dq-financial-hrms/target/classes/mapper/hrms/DeptDao.xml
  93. 528
      dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml
  94. 18
      dq-financial-hrms/target/classes/mapper/hrms/PermissionDao.xml
  95. 15
      dq-financial-hrms/target/classes/mapper/hrms/PositionDao.xml
  96. 3
      dq-financial-hrms/target/classes/mapper/hrms/RoleDao.xml
  97. 7
      dq-financial-hrms/target/classes/mapper/hrms/RolePermissionDao.xml
  98. 32
      dq-financial-hrms/target/classes/mapper/hrms/UserDao.xml
  99. 151
      dq-framework-common/dq-framework-common.iml
  100. 4
      dq-framework-common/src/main/java/com/daqing/framework/model/response/PromptSuccess.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -7,16 +7,16 @@
<sourceOutputDir name="target/generated-sources/annotations" /> <sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<module name="dq-financial-crms-auth" />
<module name="dq-framework-common" />
<module name="dq-financial-crms" /> <module name="dq-financial-crms" />
<module name="dq-framework-utils" /> <module name="dq-framework-utils" />
<module name="dq-financial-api" />
<module name="dq-framework-model" />
<module name="dq-financial-hrms" />
<module name="dq-framework-common" />
<module name="dq-govern-gateway" /> <module name="dq-govern-gateway" />
<module name="dq-financial-crms-auth" /> <module name="dq-financial-hrms" />
<module name="dq-financial-guarantee" /> <module name="dq-framework-model" />
<module name="dq-financial-hrms-auth" /> <module name="dq-financial-hrms-auth" />
<module name="dq-financial-api" />
<module name="dq-financial-guarantee" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel> <bytecodeTargetLevel>

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8"> <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-financial-api" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-financial-api/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-financial-api/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-financial-crms" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-financial-crms" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-financial-crms/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-financial-crms/src/main/java" charset="UTF-8" />
@ -13,8 +15,11 @@
<file url="file://$PROJECT_DIR$/dq-financial-hrms-auth/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-financial-hrms-auth/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-financial-hrms/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-financial-hrms/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-financial-hrms/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-financial-hrms/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-framework-common" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-framework-common/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-framework-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-framework-model" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-framework-model/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-framework-model/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-framework-utils" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-framework-utils/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-framework-utils/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-govern-gateway" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-govern-gateway" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dq-govern-gateway/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/dq-govern-gateway/src/main/java" charset="UTF-8" />

@ -70,6 +70,12 @@ public interface DeptControllerApi {
@ApiOperation(value = "查询该部门下所有子部门及部门下的的员工", notes = "查询该部门下所有子部门及部门下的的员工") @ApiOperation(value = "查询该部门下所有子部门及部门下的的员工", notes = "查询该部门下所有子部门及部门下的的员工")
ResponseResult children(Long id); ResponseResult children(Long id);
/**
* 获取所有部门id和名称(用户团队效率的部门筛选)
*/
@ApiOperation(value = "获取所有部门id和名称(用户团队效率的部门筛选)", notes = "获取所有部门id和名称(用户团队效率的部门筛选)")
ResponseResult listDepartment();
/** /**
* 根据部门id查询该部门下所有员工 * 根据部门id查询该部门下所有员工
*/ */

@ -24,6 +24,7 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.daqing.financial</groupId> <groupId>com.daqing.financial</groupId>
<artifactId>dq-financial-api</artifactId> <artifactId>dq-financial-api</artifactId>
@ -65,6 +66,12 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version> <version>3.8.1</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.4.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>

@ -68,7 +68,7 @@ public class CompanyCustomerRequest implements Serializable {
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "联系人")
private String linkman; private String linkman;
@ApiModelProperty(value = "联系人的联系电话") @ApiModelProperty(value = "联系人电话")
private String linkPhone; private String linkPhone;
@ApiModelProperty(value = "经营地址") @ApiModelProperty(value = "经营地址")

@ -239,7 +239,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
/** /**
* 插入企业类型客户信息 * 插入企业类型客户信息
*/ */
@Transactional /*@Transactional
public boolean saveCustomerCompany(CustomerCompanyTOI customerCompanyTOI) { public boolean saveCustomerCompany(CustomerCompanyTOI customerCompanyTOI) {
CustomerEntity customerEntity = new CustomerEntity(); CustomerEntity customerEntity = new CustomerEntity();
CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity();
@ -261,7 +261,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
boolean company = companyCustomerDao.saveCompanyCustomer(companyCustomerEntity); boolean company = companyCustomerDao.saveCompanyCustomer(companyCustomerEntity);
return customer && company; return customer && company;
} }
*/
/** /**
* 更新个人类型客户信息 * 更新个人类型客户信息
*/ */
@ -385,23 +385,25 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
} }
// 企业类型 // 企业类型
for (Object company : companyList) { for (Object company : companyList) {
CustomerCompanyTOI customerCompanyTOI = new CustomerCompanyTOI(); CompanyCustomerRequest companyCustomerRequest = new CompanyCustomerRequest();
manager = new ManagerName(); manager = new ManagerName();
customerCompanyTOI.setType(1); companyCustomerRequest.setType(1);
BeanUtils.copyProperties(company, customerCompanyTOI); companyCustomerRequest.setIsExistRelated(0);
BeanUtils.copyProperties(company, companyCustomerRequest);
BeanUtils.copyProperties(company, manager); BeanUtils.copyProperties(company, manager);
// 根据客户经理名称找到对应的员工id // 根据客户经理名称找到对应的员工id
if (nameList != null && manager.getManager() != null) { if (nameList != null && manager.getManager() != null) {
for (EmployeeVO employeeVO : nameList) { for (EmployeeVO employeeVO : nameList) {
if (Objects.equals(manager.getManager(), employeeVO.getName())) { if (Objects.equals(manager.getManager(), employeeVO.getName())) {
customerCompanyTOI.setManager(employeeVO.getId()); companyCustomerRequest.setManager(employeeVO.getId());
} }
} }
if (customerCompanyTOI.getManager() == null) { if (companyCustomerRequest.getManager() == null) {
return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在"); return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
} }
} }
this.saveCustomerCompany(customerCompanyTOI); this.insertCompany(companyCustomerRequest);
// this.saveCustomerCompany(customerCompanyTOI);
} }
return ResponseResult.SUCCESS(); return ResponseResult.SUCCESS();
} catch (Exception e) { } catch (Exception e) {

@ -33,7 +33,7 @@
<!-- 根据客户基本信息id查询企业类型客户的信息 --> <!-- 根据客户基本信息id查询企业类型客户的信息 -->
<select id="queryCompanyCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CompanyCustomerEntity"> <select id="queryCompanyCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
SELECT registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source SELECT *
FROM crms_company_customer FROM crms_company_customer
WHERE customer_id = #{id} WHERE customer_id = #{id}
</select> </select>

@ -1,7 +1,8 @@
# 开发和测试环境(dev)
#服务名称 #服务名称
spring.application.name=dq-financial-crms spring.application.name=dq-financial-crms
#配置中心地址 #配置中心地址
spring.cloud.nacos.config.server-addr=192.168.31.142:8848 spring.cloud.nacos.config.server-addr=192.168.31.140:8848
spring.cloud.nacos.config.namespace=1f69d47e-0aeb-4a1e-8ab4-0e84dfb86354 spring.cloud.nacos.config.namespace=1f69d47e-0aeb-4a1e-8ab4-0e84dfb86354
#spring.cloud.nacos.config.group=prod #spring.cloud.nacos.config.group=prod
@ -16,3 +17,79 @@ 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].data-id=other.yml
spring.cloud.nacos.config.ext-config[2].group=dev spring.cloud.nacos.config.ext-config[2].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true spring.cloud.nacos.config.ext-config[2].refresh=true
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=123456
spring.redis.database=0
spring.redis.timeout=30000
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
#请求处理的超时时间
ribbon.ReadTimeout: 120000
#请求连接的超时时间
ribbon.ConnectTimeout: 120000
# 正式环境(prod)
#服务名称
#spring.application.name=dq-financial-crms
###配置中心地址
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848
#spring.cloud.nacos.config.namespace=25ce05e2-a0eb-4842-92e4-d8b550a489dd
##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=prod
#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=prod
#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=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=dq123456
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0
# 测试环境(prod)
#服务名称
#spring.application.name=dq-financial-crms
##配置中心地址
#spring.cloud.nacos.config.server-addr=127.0.0.1:8848
#spring.cloud.nacos.config.namespace=1912aa66-6e18-4680-8943-5b8fae71414c
##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=prod
#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=prod
#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=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0

@ -7,6 +7,7 @@
<resultMap type="com.daqing.framework.domain.crms.CompanyCustomerEntity" id="companyCustomerMap"> <resultMap type="com.daqing.framework.domain.crms.CompanyCustomerEntity" id="companyCustomerMap">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="registeredCapital" column="registered_capital"/> <result property="registeredCapital" column="registered_capital"/>
<result property="socialUnifiedCode" column="social_unified_code"/>
<result property="industry" column="industry"/> <result property="industry" column="industry"/>
<result property="years" column="years"/> <result property="years" column="years"/>
<result property="region" column="region"/> <result property="region" column="region"/>
@ -14,9 +15,21 @@
<result property="affiliatedCompany" column="affiliated_company"/> <result property="affiliatedCompany" column="affiliated_company"/>
<result property="empNum" column="emp_num"/> <result property="empNum" column="emp_num"/>
<result property="linkman" column="linkman"/> <result property="linkman" column="linkman"/>
<result property="linkPhone" column="link_phone"/>
<result property="businessSource" column="business_source"/> <result property="businessSource" column="business_source"/>
<result property="businessScope" column="business_scope"/>
<result property="businessAddr" column="business_addr"/>
<result property="registerTime" column="register_time"/>
<result property="registerAddr" column="register_addr"/>
<result property="legalIdNumber" column="legal_id_number"/>
<result property="legalHukouAddr" column="legal_hukou_addr"/>
<result property="legalPhone" column="legal_phone"/>
<result property="legalHomeAddr" column="legal_home_addr"/>
<result property="legalGender" column="legal_gender"/>
<result property="legalName" column="legal_name"/>
<result property="isExistRelated" column="is_exist_related"/>
<result property="customerId" column="customer_id"/> <result property="customerId" column="customer_id"/>
</resultMap> </resultMap>
<!-- 根据客户基本信息id查询企业类型客户的信息 --> <!-- 根据客户基本信息id查询企业类型客户的信息 -->
<select id="queryCompanyCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CompanyCustomerEntity"> <select id="queryCompanyCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
@ -41,4 +54,25 @@
WHERE customer_id = #{customerId} WHERE customer_id = #{customerId}
</update> </update>
<!-- 根据客户编号/客户名称获取企业信息 -->
<select id="queryCompanyInfo" parameterType="com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest" resultType="com.daqing.framework.domain.crms.response.CompanyCustomerResponse">
SELECT cu.*,cc.*
FROM crms_company_customer cu
left join crms_customer cc on cu.customer_id = cc.id
<where>
cc.del_or_not=0 and cc.status=0
<if test="applyAmountInfo.code != null and applyAmountInfo.code != '' ">
AND cc.code LIKE CONCAT('%',#{applyAmountInfo.code},'%')
</if>
<if test="applyAmountInfo.name != null and applyAmountInfo.name != '' ">
AND cc.name LIKE CONCAT('%',#{applyAmountInfo.name},'%')
</if>
<if test="applyAmountInfo.companyId != null and applyAmountInfo.companyId != '' ">
AND cu.id = #{applyAmountInfo.companyId}
</if>
</where>
</select>
</mapper> </mapper>

@ -90,4 +90,13 @@
WHERE del_or_not = 0; WHERE del_or_not = 0;
</select> </select>
<!-- 获取所有客户编号和客户名称 -->
<select id="queryCompanyCodeAndName" parameterType="int" resultMap="customerMap">
SELECT code,`name` from crms_customer where `type` =#{type} and del_or_not = 0 and status = 0
</select>
<!-- 获取最新添加的数据的客户编码 -->
<select id="getCodeByType" parameterType="integer" resultType="string">
SELECT code FROM crms_customer WHERE type = #{type} AND del_or_not = 0 ORDER BY create_time DESC LIMIT 0,1
</select>
</mapper> </mapper>

@ -18,6 +18,7 @@ import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.service.IDgApplyAmountListService; import com.daqing.financial.guarantee.service.IDgApplyAmountListService;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.DgApplyField;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.UserEntity; import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.domain.hrms.ext.EmployeeTO; import com.daqing.framework.domain.hrms.ext.EmployeeTO;
@ -327,6 +328,25 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
} }
/**
* 获取业务申请所有字段
*/
@GetMapping("/queryFieldField")
@ApiOperation(value = "获取业务申请所有字段")
public ResponseResult queryApplyField(){
return ResponseResult.SUCCESS(applyAmountInfoService.queryApplyField());
}
/**
* 修改业务申请字段
*/
@ApiOperation(value = "修改业务申请字段")
@PostMapping("/updateApplyField")
public ResponseResult updateApplyField(@RequestBody DgApplyField dgApplyField){
Boolean result = applyAmountInfoService.updateApplyField(dgApplyField);
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
} }

@ -4,11 +4,9 @@ import com.alibaba.fastjson.JSONObject;
import com.daqing.financial.guarantee.feign.HrmsFeignService; import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest; import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.model.request.PersonalEfficiencyListRequest; import com.daqing.financial.guarantee.model.request.PersonalEfficiencyListRequest;
import com.daqing.financial.guarantee.model.response.NumResponse;
import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse; import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse;
import com.daqing.financial.guarantee.service.IDgEfficiencyService; import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.financial.guarantee.util.DateUtils; import com.daqing.financial.guarantee.util.DateUtils;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.guarantee.util.TaskNodeUtil; import com.daqing.financial.guarantee.util.TaskNodeUtil;
import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.model.response.ResponseResult;
@ -64,7 +62,7 @@ public class DgEfficiencyController {
@ApiOperation(value = "个人效率记录列表 ") @ApiOperation(value = "个人效率记录列表 ")
@PostMapping("/personalEfficiencyList") @PostMapping("/personalEfficiencyList")
public R personalEfficiencyList( public ResponseResult personalEfficiencyList(
@ApiParam(name = "personalEfficiencyListRequest", value = "个人效率列表查询对象") @ApiParam(name = "personalEfficiencyListRequest", value = "个人效率列表查询对象")
@RequestBody PersonalEfficiencyListRequest personalEfficiencyListRequest){ @RequestBody PersonalEfficiencyListRequest personalEfficiencyListRequest){
List<PersonalEfficiencyListResponse> responseList = dgEfficiencyService.queryPersonalEfficiencyList(); List<PersonalEfficiencyListResponse> responseList = dgEfficiencyService.queryPersonalEfficiencyList();
@ -89,54 +87,23 @@ public class DgEfficiencyController {
} }
} }
} }
NumResponse numResponse = new NumResponse();
//转换任务节点,并统计操作状态个数
responseList.forEach(personalEfficiencyListResponse -> {
String taskNode = personalEfficiencyListResponse.getTaskNode();
if (taskNode!=null){
String converter = TaskNodeUtil.converter(taskNode);
personalEfficiencyListResponse.setTaskNode(converter);
}
if (personalEfficiencyListResponse.getOperatingStatus()!=null){
switch (personalEfficiencyListResponse.getOperatingStatus()){
case 0:
numResponse.setInitiateNum(numResponse.getInitiateNum()+1);
break;
case 1:
numResponse.setPendingNum(numResponse.getPendingNum()+1);
break;
case 2:
numResponse.setProcessedNum(numResponse.getProcessedNum()+1);
break;
default:
numResponse.setInitiateNum(0);
numResponse.setPendingNum(0);
numResponse.setProcessedNum(0);
break;
}
}
});
//根据条件筛选数据 //根据条件筛选数据
//迭代器进行筛选
if (personalEfficiencyListRequest.getOperatingStatus()!=null){ if (personalEfficiencyListRequest.getOperatingStatus()!=null){
// 已发起 // 已发起
if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)){ if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)){
responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)); responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)).collect(Collectors.toList());
// responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)).collect(Collectors.toList());
// 待处理 // 待处理
}else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)){ }else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)){
responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)); responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)).collect(Collectors.toList());
// responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)).collect(Collectors.toList());
// 已处理 // 已处理
}else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){ }else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){
responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)); responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)).collect(Collectors.toList());
// responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)).collect(Collectors.toList());
} }
} }
// 时间筛选(固定时间) // 时间筛选(固定时间)
if (personalEfficiencyListRequest.getCreateFixedTime() != null && personalEfficiencyListRequest.getStartTime() == null && personalEfficiencyListRequest.getEndTime() == null) { if (personalEfficiencyListRequest.getCreateFixedTime() != null && personalEfficiencyListRequest.getStartTime() == null && personalEfficiencyListRequest.getEndTime() == null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
switch (personalEfficiencyListRequest.getCreateFixedTime()) { switch (personalEfficiencyListRequest.getCreateFixedTime()) {
case 0: case 0:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getDayBegin())); personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getDayBegin()));
@ -177,7 +144,26 @@ public class DgEfficiencyController {
} }
} }
} }
return R.ok().data("responseList",responseList).data("statistics",numResponse); //转换任务节点,并统计操作状态个数
responseList.forEach(personalEfficiencyListResponse -> {
String taskNode = personalEfficiencyListResponse.getTaskNode();
if (taskNode!=null){
String converter = TaskNodeUtil.converter(taskNode);
personalEfficiencyListResponse.setTaskNode(converter);
}
if (personalEfficiencyListResponse.getOperatingStatus()!=null){
switch (personalEfficiencyListResponse.getOperatingStatus()){
case 0:
personalEfficiencyListResponse.setInitiateNum(personalEfficiencyListResponse.getInitiateNum()+1);
case 1:
personalEfficiencyListResponse.setPendingNum(personalEfficiencyListResponse.getPendingNum()+1);
case 2:
personalEfficiencyListResponse.setProcessedNum(personalEfficiencyListResponse.getProcessedNum()+1);
}
}
});
return ResponseResult.SUCCESS(responseList);
} }
public static long getLongDate(String stringDate){ public static long getLongDate(String stringDate){

@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletResponse;
*/ */
@RestController @RestController
@RequestMapping("/guarantee/statistics") @RequestMapping("/guarantee/statistics")
@Api(value = "担保业务统计",tags = "提供业务统计增删改查的方法") @Api(value = "担保业务统计", tags = "提供业务统计增删改查的方法")
public class DgStatisticsController { public class DgStatisticsController {
@Autowired @Autowired
@ -33,18 +33,18 @@ public class DgStatisticsController {
* 列表 * 列表
*/ */
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "业务统计列表",notes = "业务统计列表",response = DgStatisticsListResponse.class) @ApiOperation(value = "业务统计列表", notes = "业务统计列表", response = DgStatisticsListResponse.class)
public ResponseResult list(@RequestParam("page") Integer page, public ResponseResult list(@RequestParam("page") Integer page,
@RequestParam("size") Integer size, DgStatisticsRequest dgStatisticsRequest) { @RequestParam("size") Integer size, DgStatisticsRequest dgStatisticsRequest) {
return ResponseResult.SUCCESS(iDgStatisticsService.list(page,size,dgStatisticsRequest)); return ResponseResult.SUCCESS(iDgStatisticsService.list(page, size, dgStatisticsRequest));
} }
/** /**
* 列表导出 * 列表导出
*/ */
@ApiOperation(value = "统计列表导出",notes = "统计列表导出") @ApiOperation(value = "统计列表导出", notes = "统计列表导出")
@GetMapping("/excelExport") @GetMapping("/excelExport")
public ResponseResult excelExport(HttpServletResponse response){ public ResponseResult excelExport(HttpServletResponse response) {
Boolean result = iDgStatisticsService.excelExport(response); Boolean result = iDgStatisticsService.excelExport(response);
@ -55,18 +55,18 @@ public class DgStatisticsController {
* 拒绝列表 * 拒绝列表
*/ */
@GetMapping("/listRefuse") @GetMapping("/listRefuse")
@ApiOperation(value = "业务统计拒绝列表",notes = "业务统计拒绝列表",response = DgStatisticsListRefuseResponse.class) @ApiOperation(value = "业务统计拒绝列表", notes = "业务统计拒绝列表", response = DgStatisticsListRefuseResponse.class)
public ResponseResult listRefuse(@RequestParam("page") Integer page, public ResponseResult listRefuse(@RequestParam("page") Integer page,
@RequestParam("size") Integer size, DgStatisticsRequest dgStatisticsRequest) { @RequestParam("size") Integer size, DgStatisticsRequest dgStatisticsRequest) {
return ResponseResult.SUCCESS(iDgStatisticsService.listRefuse(page,size,dgStatisticsRequest)); return ResponseResult.SUCCESS(iDgStatisticsService.listRefuse(page, size, dgStatisticsRequest));
} }
/** /**
* 拒绝列表导出 * 拒绝列表导出
*/ */
@ApiOperation(value = "统计拒绝列表导出",notes = "统计拒绝列表导出") @ApiOperation(value = "统计拒绝列表导出", notes = "统计拒绝列表导出")
@GetMapping("/excelExportRefuse") @GetMapping("/excelExportRefuse")
public ResponseResult excelExportRefuse(HttpServletResponse response){ public ResponseResult excelExportRefuse(HttpServletResponse response) {
Boolean result = iDgStatisticsService.excelExportRefuse(response); Boolean result = iDgStatisticsService.excelExportRefuse(response);

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.model.response.DgApplyAmountInfoResponse; import com.daqing.financial.guarantee.model.response.DgApplyAmountInfoResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgApplyField;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -30,7 +31,7 @@ public interface DgApplyAmountInfoMapper extends BaseMapper<DgApplyAmountInfo> {
List<BusinessApplicationListResponse> selectListByIds(List<String> ids); List<BusinessApplicationListResponse> selectListByIds(List<String> ids);
int selectBusinessTaday(@Param("dateTime") String dateTime); DgApplyField queryApplyField();
String selectMaxBusinessTaday(String dateTime); Boolean updateApplyField(@Param("af") DgApplyField dgApplyField);
} }

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @auther River * @auther River
@ -19,4 +20,6 @@ public interface DgEfficiencyMapper extends BaseMapper<DgApplyAmountInfo> {
List<DgTeamEfficiencyPO> queryList(@Param("et") DgEfficiencyTeamRequest dgEfficiencyTeamRequest); List<DgTeamEfficiencyPO> queryList(@Param("et") DgEfficiencyTeamRequest dgEfficiencyTeamRequest);
List<Integer> queryBusinessId(@Param("et") DgEfficiencyTeamRequest dgEfficiencyTeamRequest); List<Integer> queryBusinessId(@Param("et") DgEfficiencyTeamRequest dgEfficiencyTeamRequest);
Map<String, Integer> getBusinessCount();
} }

@ -18,8 +18,8 @@ import java.util.Date;
@ToString @ToString
public class DgStatisticsRequest implements Serializable { public class DgStatisticsRequest implements Serializable {
@ApiModelProperty("部门id") @ApiModelProperty("部门名称")
private Integer deptId; private String deptId;
@ApiModelProperty("业务类型") @ApiModelProperty("业务类型")
private String type; private String type;
@ -30,17 +30,13 @@ public class DgStatisticsRequest implements Serializable {
@ApiModelProperty("申请时间,固定类型,0:今天,1:昨天,2:本周,3:本月,4:本年") @ApiModelProperty("申请时间,固定类型,0:今天,1:昨天,2:本周,3:本月,4:本年")
private Integer createFixedTime; private Integer createFixedTime;
@ApiModelProperty("申请时间,自定义时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createCustomTime;
@ApiModelProperty("客户名称或者编号") @ApiModelProperty("客户名称或者编号")
private String codeOrName; private String codeOrName;
@ApiModelProperty("辅助字段,不用管,起始时间") @ApiModelProperty("起始时间")
private String startTime; private String startTime;
@ApiModelProperty("辅助字段,不用管,结束时间") @ApiModelProperty("结束时间")
private String endTime; private String endTime;
} }

@ -0,0 +1,76 @@
package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* 业务统计拒绝列表导出到excel实体类
*
* @auther River
* @date 2021/1/4 15:11
*/
@Data
@ToString
public class DgStatisticsExcelRefuseResponse extends BaseRowModel implements Serializable {
@ApiModelProperty("业务编号")
@ExcelProperty(value = "业务编号",index = 0)
private String businessCode;
@ApiModelProperty("客户姓名")
@ExcelProperty(value = "客户姓名",index = 1)
private String name;
@ApiModelProperty("客户联系方式")
@ExcelProperty(value = "联系电话",index = 2)
private String phone;
@ApiModelProperty("业务类型")
@ExcelProperty(value = "产品类型",index = 3)
private String businessType;
@ApiModelProperty("申请额度")
@ExcelProperty(value = "金额",index = 4)
private Double applyAmount;
@ApiModelProperty("申请期限")
@ExcelProperty(value = "期数",index = 5)
private String applyTime;
@ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("拒绝人")
@ExcelProperty(value = "当前审批人",index = 7)
private String refuseName;
@ApiModelProperty("拒绝节点id")
@ExcelProperty(value = "任务节点",index = 8)
private Integer processId;
@ApiModelProperty("拒绝时间")
@ExcelProperty(value = "拒绝时间",index = 9)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date refuseTime;
@ApiModelProperty("拒绝原因")
@ExcelProperty(value = "拒绝原因",index = 10)
private String refuseOpinion;
@ApiModelProperty("提单人姓名")
@ExcelProperty(value = "提单人",index = 11)
private String employeeName;
@ApiModelProperty("部门")
@ExcelProperty(value = "所属部门",index = 12)
private String department;
}

@ -0,0 +1,69 @@
package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* 业务统计列表导出到excel实体类
*
* @auther River
* @date 2021/1/4 14:48
*/
@Data
@ToString
public class DgStatisticsExcelResponse extends BaseRowModel implements Serializable {
@ApiModelProperty("业务编号")
@ExcelProperty(value = "业务编号",index = 0)
private String businessCode;
@ApiModelProperty("客户姓名")
@ExcelProperty(value = "客户姓名",index = 1)
private String name;
@ApiModelProperty("客户联系方式")
@ExcelProperty(value = "联系电话",index = 2)
private String phone;
@ApiModelProperty("业务类型")
@ExcelProperty(value = "产品类型",index = 3)
private String businessType;
@ApiModelProperty("申请额度")
@ExcelProperty(value = "金额",index = 4)
private Double applyAmount;
@ApiModelProperty("申请期限")
@ExcelProperty(value = "期数",index = 5)
private String applyTime;
@ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("完成任务节点id")
@ExcelProperty(value = "完成任务节点id",index = 7)
private Integer processId;
@ApiModelProperty("最新操作时间")
@ExcelProperty(value = "任务分配时间",index = 8)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date operationTime;
@ApiModelProperty("提单人姓名")
@ExcelProperty(value = "提单人",index = 9)
private String employeeName;
@ApiModelProperty("部门")
@ExcelProperty(value = "所属部门",index = 10)
private String department;
}

@ -45,27 +45,27 @@ public class DgStatisticsListRefuseResponse extends BaseRowModel implements Seri
@ExcelProperty(value = "期数",index = 5) @ExcelProperty(value = "期数",index = 5)
private String applyTime; private String applyTime;
@ApiModelProperty("创建时间") @ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6) @ExcelProperty(value = "申请日期",index = 6)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime; private Date createTime;
@ApiModelProperty("拒绝人") @ApiModelProperty("拒绝人")
@ExcelProperty(value = "当前审批人",index = 7) @ExcelProperty(value = "当前审批人",index = 7)
private String empName; private String refuseName;
@ApiModelProperty("节点状态") @ApiModelProperty("拒绝节点id")
@ExcelProperty(value = "任务节点",index = 8) @ExcelProperty(value = "任务节点",index = 8)
private String status; private Integer processId;
@ApiModelProperty("拒绝时间") @ApiModelProperty("拒绝时间")
@ExcelProperty(value = "任务分配时间",index = 9) @ExcelProperty(value = "拒绝时间",index = 9)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dateTime; private Date refuseTime;
@ApiModelProperty("拒绝原因") @ApiModelProperty("拒绝原因")
@ExcelProperty(value = "拒绝原因",index = 10) @ExcelProperty(value = "拒绝原因",index = 10)
private String remark; private String refuseOpinion;
@ApiModelProperty("提单人姓名") @ApiModelProperty("提单人姓名")
@ExcelProperty(value = "提单人",index = 11) @ExcelProperty(value = "提单人",index = 11)

@ -6,9 +6,12 @@ import com.daqing.framework.utils.excel.ApprovalStatusConverter;
import com.daqing.framework.utils.excel.BusinessStatusConverter; import com.daqing.framework.utils.excel.BusinessStatusConverter;
import com.daqing.framework.utils.excel.OperatingStatusConverter; import com.daqing.framework.utils.excel.OperatingStatusConverter;
import com.daqing.framework.utils.excel.TaskNodeConverter; import com.daqing.framework.utils.excel.TaskNodeConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* @Author chen * @Author chen
* @DATE 2020/12/28 16:31 * @DATE 2020/12/28 16:31
@ -35,7 +38,8 @@ public class PersonalEfficiencyListResponse {
@ApiModelProperty("申请日期") @ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 3) @ExcelProperty(value = "申请日期",index = 3)
private String applicationDate; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date applicationDate;
@ApiModelProperty("累计耗时") @ApiModelProperty("累计耗时")
@ExcelProperty(value = "累计耗时",index = 4) @ExcelProperty(value = "累计耗时",index = 4)
@ -46,8 +50,8 @@ public class PersonalEfficiencyListResponse {
private String completeTime; private String completeTime;
@ApiModelProperty("任务节点") @ApiModelProperty("任务节点")
@ExcelProperty(value = "任务节点",index = 6,converter = TaskNodeConverter.class) @ExcelProperty(value = "任务节点",index = 6)
private String taskNode; private Double taskNode;
@ApiModelProperty("审批状态") @ApiModelProperty("审批状态")
@ExcelProperty(value = "审批状态",index = 7,converter = ApprovalStatusConverter.class) @ExcelProperty(value = "审批状态",index = 7,converter = ApprovalStatusConverter.class)

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest; import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse; import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgApplyField;
import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.PageUtils;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -34,4 +35,8 @@ public interface IDgApplyAmountInfoService extends IService<DgApplyAmountInfo> {
int approvalBusinessApplication(Integer id, Integer status, String remark, Integer companyId); int approvalBusinessApplication(Integer id, Integer status, String remark, Integer companyId);
String getRoles(); String getRoles();
DgApplyField queryApplyField();
Boolean updateApplyField(DgApplyField dgApplyField);
} }

@ -2,12 +2,10 @@ package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest; import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -17,7 +15,8 @@ import java.util.Map;
public interface IDgEfficiencyService extends IService<DgApplyAmountInfo> { public interface IDgEfficiencyService extends IService<DgApplyAmountInfo> {
Map approvalNum(); Map approvalNum();
HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest); HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest);
List<PersonalEfficiencyListResponse> queryPersonalEfficiencyList(); Map<String, Integer> getBusinessCount();
} }

@ -10,7 +10,10 @@ import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.feign.HrmsFeignService; import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.*; import com.daqing.financial.guarantee.mapper.*;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest; import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.*; import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.model.response.DgApplyAmountInfoResponse;
import com.daqing.financial.guarantee.model.response.DgEnclosureInfoResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.util.ArraysUtil; import com.daqing.financial.guarantee.util.ArraysUtil;
import com.daqing.financial.guarantee.util.AuditProcessUtil; import com.daqing.financial.guarantee.util.AuditProcessUtil;
@ -37,7 +40,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/** /**
@ -50,7 +52,8 @@ import java.util.*;
*/ */
@Slf4j @Slf4j
@Service @Service
public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoMapper, DgApplyAmountInfo> implements IDgApplyAmountInfoService { public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoMapper, DgApplyAmountInfo>
implements IDgApplyAmountInfoService {
@Resource @Resource
private DgApplyAmountInfoMapper dgApplyAmountInfoMapper; private DgApplyAmountInfoMapper dgApplyAmountInfoMapper;
@ -92,6 +95,27 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
return RedisUtil.get("dq:userRole:" + userId); return RedisUtil.get("dq:userRole:" + userId);
} }
/**
* 查询业务申请所有字段
*/
@Override
public DgApplyField queryApplyField() {
return this.getBaseMapper().queryApplyField();
}
/**
* 修改业务申请字段名称
*/
@Override
public Boolean updateApplyField(DgApplyField dgApplyField) {
dgApplyField.setId(1);
dgApplyField.setUpdateTime(new Date());
return this.getBaseMapper().updateApplyField(dgApplyField);
}
@Override @Override
@Transactional @Transactional
public int businessApplication(BusinessApplicationRequest businessApplication) { public int businessApplication(BusinessApplicationRequest businessApplication) {
@ -120,30 +144,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述 dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型 dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setCustomerType(businessApplication.getCustomerType());//客户类型 dgApplyAmountInfo.setCustomerType(businessApplication.getCustomerType());//客户类型
//设置业务编号,查询今天是否申请过业务 dgApplyAmountInfo.setBusinessCode(RandomUtil.getRandomNum(12));
String businessCode=null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateTime=sdf.format(new Date());
String timeCode=dateTime.replaceAll("-","");
int count = dgApplyAmountInfoMapper.selectBusinessTaday(dateTime);
if(count ==0){//今天没有申请过业务,所以编号从001开始
if(businessApplication.getBusinessType().equals("融资担保")){//融资业务:RZ-20201231001
businessCode="RZ-"+timeCode+"001";
}else{//非融资业务:FRZ-20201231001
businessCode="FRZ-"+timeCode+"001";
}
}else{
//查询最大业务编号
String code = dgApplyAmountInfoMapper.selectMaxBusinessTaday(dateTime);
int codeNumber = Integer.parseInt(code.substring(code.length() - 3));
String newBusinessCode = String.format("%03d", (codeNumber + 1));
if(businessApplication.getBusinessType().equals("融资担保")){//融资业务:RZ-20201231001
businessCode="RZ-"+timeCode+newBusinessCode;
}else{//非融资业务:FRZ-20201231001
businessCode="FRZ-"+timeCode+newBusinessCode;
}
}
dgApplyAmountInfo.setBusinessCode(businessCode);
dgApplyAmountInfoMapper.insert(dgApplyAmountInfo); dgApplyAmountInfoMapper.insert(dgApplyAmountInfo);

@ -1,34 +1,27 @@
package com.daqing.financial.guarantee.service.impl; package com.daqing.financial.guarantee.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController;
import com.daqing.financial.guarantee.mapper.*; import com.daqing.financial.guarantee.mapper.DgAuditProcessMapper;
import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationRequest; import com.daqing.financial.guarantee.mapper.DgEfficiencyMapper;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest; import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.model.response.*; import com.daqing.financial.guarantee.model.response.EfficiencyApprovalResponse;
import com.daqing.financial.guarantee.service.IDgEfficiencyService; import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.financial.guarantee.util.DateUtils; import com.daqing.financial.guarantee.util.DateUtils;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgAuditProcess;
import com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO;
import com.daqing.framework.domain.guarantee.po.DgWorkConferencePO;
import com.daqing.framework.domain.guarantee.po.StatusPO;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.util.RedisUtil;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @auther River * @auther River
* @date 2020/11/10 11:34 * @date 2020/11/10 11:34
@ -39,43 +32,9 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
@Autowired @Autowired
private DgApplyAmountInfoController dgApplyAmountInfoController; private DgApplyAmountInfoController dgApplyAmountInfoController;
@Autowired
private DgApplyAmountInfoMapper applyAmountInfoMapper;
@Autowired @Autowired
private DgAuditProcessMapper dgAuditProcessMapper; private DgAuditProcessMapper dgAuditProcessMapper;
@Autowired
private DgApplyAmountListMapper applyAmountListMapper;
@Autowired
private DgGuaranteeAssignUserMapper guaranteeAssignUserMapper;
@Autowired
private DgAssetsInvestigationMapper assetsInvestigationMapper;
@Autowired
private DgMessageInvestigationMapper messageInvestigationMapper;
@Autowired
private DgComplianceInvestigationMapper complianceInvestigationMapper;
@Autowired
private DgWorkConferenceConsiderMapper workConferenceConsiderMapper;
@Autowired
private DgLoanCommitteeConsiderMapper loanCommitteeConsiderMapper;
@Autowired
private DgGuaranteeLetterAssignUserMapper guaranteeLetterAssignUserMapper;
@Autowired
private DgPaymentConfirmationConsiderMapper paymentConfirmationConsiderMapper;
@Autowired
private DgLoanNoticeMapper loanNoticeMapper;
/** /**
* 团队效率 * 团队效率
*/ */
@ -83,8 +42,9 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
public HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest) { public HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest) {
// 时间筛选(固定时间) // 时间筛选(固定时间)
if (dgEfficiencyTeamRequest.getCreateFixedTime() != null && dgEfficiencyTeamRequest.getStartTime() == null && if (dgEfficiencyTeamRequest.getCreateFixedTime() != null && (dgEfficiencyTeamRequest.getStartTime() == null ||
dgEfficiencyTeamRequest.getEndTime() == null) { dgEfficiencyTeamRequest.getStartTime().length() == 0) && (dgEfficiencyTeamRequest.getEndTime() == null ||
dgEfficiencyTeamRequest.getEndTime().length() == 0)) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
switch (dgEfficiencyTeamRequest.getCreateFixedTime()) { switch (dgEfficiencyTeamRequest.getCreateFixedTime()) {
case 0: case 0:
@ -143,7 +103,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
time = DateUtils.dateDiff(dgTeamEfficiencyList.get(i - 1).getCreateTime(), dgTeamEfficiencyList.get(i).getCreateTime()) + ""; time = DateUtils.dateDiff(dgTeamEfficiencyList.get(i - 1).getCreateTime(), dgTeamEfficiencyList.get(i).getCreateTime()) + "";
processId = dgTeamEfficiencyList.get(i).getProcessId(); processId = dgTeamEfficiencyList.get(i).getProcessId();
departmentIdList = dgTeamEfficiencyList.get(i).getDepartmentId(); departmentIdList = dgTeamEfficiencyList.get(i).getDepartmentId();
map.put(processId, time + "(1)"); map.put(processId, time + ",1");
String[] departmentIds = departmentIdList.split(","); String[] departmentIds = departmentIdList.split(",");
for (String departmentId : departmentIds) { for (String departmentId : departmentIds) {
// 没有当前部门的数据,直接新建一个 // 没有当前部门的数据,直接新建一个
@ -153,15 +113,14 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 有当前部门数据,则再判断是否有当前节点数据 // 有当前部门数据,则再判断是否有当前节点数据
HashMap<Integer, String> existMap = hashMap.get(Integer.parseInt(departmentId)); HashMap<Integer, String> existMap = hashMap.get(Integer.parseInt(departmentId));
if (existMap.get(processId) == null) { if (existMap.get(processId) == null) {
existMap.put(processId, time + "(1)"); existMap.put(processId, time + ",1");
} else { } else {
// 计算当前部门在当前节点的操作次数 // 计算当前部门在当前节点的操作次数
int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf("(") + 1, int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf(",") + 1)) + 1;
existMap.get(processId).indexOf(")"))) + 1;
// 计算当前部门在当前节点的累计时间 // 计算当前部门在当前节点的累计时间
String existTime = existMap.get(processId).substring(0, existMap.get(processId).indexOf("(")); String existTime = existMap.get(processId).substring(0, existMap.get(processId).indexOf(","));
// 累计时间加上本次时间 // 累计时间加上本次时间
existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "(" + count + ")"); existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count);
} }
hashMap.put(Integer.parseInt(departmentId), existMap); hashMap.put(Integer.parseInt(departmentId), existMap);
} }
@ -178,6 +137,15 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
} }
} }
/**
* 统计不同业务状态下业务数量
*/
@Override
public Map<String, Integer> getBusinessCount() {
return this.getBaseMapper().getBusinessCount();
}
/** /**
* 查询审批数目的值的数组 * 查询审批数目的值的数组
* *
@ -197,365 +165,4 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
map.put("approvalNumArr", approvalList); map.put("approvalNumArr", approvalList);
return map; return map;
} }
@Override
public List<PersonalEfficiencyListResponse> queryPersonalEfficiencyList() {
int size = 100;
List<PersonalEfficiencyListResponse> efficiencyList = new ArrayList<>();
//获取当前登录用户id
int currentUser = Integer.parseInt(this.getUserId());
//获取当前用户拥有的角色ids
String roleIds = RedisUtil.get("dq:userRole:" + currentUser);
//字符串格式
List<String> roleIdList = new ArrayList<>();
if (roleIds != null) {
String[] ids = roleIds.split(",");
roleIdList = Arrays.asList(ids);
}
//数字格式
List<Integer> roleList = new ArrayList<>();
if (roleIds != null) {
String[] roleId = roleIds.split(",");
for (String id : roleId) {
roleList.add(Integer.parseInt(id));
}
}
//查询用户处理过的业务
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>();
wrapper.eq("user_id", currentUser).groupBy("business_id").select("business_id");
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper);
if (auditProcessList != null && auditProcessList.size() != 0) {
List<Integer> businessIdList = new ArrayList<>();
auditProcessList.forEach(dgAuditProcess -> {
businessIdList.add(dgAuditProcess.getBusinessId());
});
//根据业务id查询业务流程,统计耗时,完成时间
businessIdList.forEach(businessId -> {
//new返回对象
PersonalEfficiencyListResponse efficiencyListResponse = new PersonalEfficiencyListResponse();
efficiencyListResponse.setBusinessId(businessId);
//根据业务id查询业务
DgApplyAmountInfo dgApplyAmountInfo = applyAmountInfoMapper.selectById(businessId);
//业务申请日期
Date createTime = dgApplyAmountInfo.getCreateTime();
//客户公司id
Integer companyId = dgApplyAmountInfo.getCompanyId();
//提单人id
Integer presenterId = dgApplyAmountInfo.getPresenterId();
efficiencyListResponse.setApplicantId(presenterId);
efficiencyListResponse.setApplicationDate(new SimpleDateFormat("yyyy-MM-dd").format(createTime));
efficiencyListResponse.setClientName(String.valueOf(companyId));
//获取累计耗时,完成时间,任务节点
HashMap<String, Object> hashMap = getTime(businessId, currentUser);
Object countTime = hashMap.get("countTime");
Object endTime = hashMap.get("endTime");
efficiencyListResponse.setTimeConsuming(String.valueOf(countTime));
efficiencyListResponse.setCompleteTime(String.valueOf(endTime));
efficiencyList.add(efficiencyListResponse);
});
//获取每个业务id的三种状态
HashMap<Integer, Object> hashMap = Maps.newHashMap();
//角色不为空
//担保业务员角色、担保经理角色
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_YWY_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_JL_ID))) {
//业务申请列表查询
IPage<BusinessApplicationListResponse> positionVO = applyAmountListMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId());
List<BusinessApplicationListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0){
records.forEach(businessApplicationListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = businessApplicationListResponse.getBusinessId();
String name = businessApplicationListResponse.getName();
Integer status = businessApplicationListResponse.getStatus();
Integer operatingStatus = businessApplicationListResponse.getOperatingStatus();
Integer businessStatus = businessApplicationListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setName(name);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(1);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//担保经理角色、担保A角角色、担保B角角色、担保领导角色
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_LD_ID))) {
// 担保部调查列表
IPage<GuaranteeListResponse> positionVO = guaranteeAssignUserMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null);
List<GuaranteeListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(guaranteeListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = guaranteeListResponse.getBusinessId();
Integer status = guaranteeListResponse.getStatus();
String name = guaranteeListResponse.getName();
Integer operatingStatus = guaranteeListResponse.getOperatingStatus();
Integer businessStatus = guaranteeListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(2);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//资产经理角色、资产专员角色、资产领导角色
if (roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.ZC_ZY_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.ZC_LD_ID))) {
// 资产部调查列表
IPage<AssetsInvestigationListResponse> positionVO = assetsInvestigationMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null);
List<AssetsInvestigationListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(assetsInvestigationListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = assetsInvestigationListResponse.getBusinessId();
Integer status = assetsInvestigationListResponse.getStatus();
String name = assetsInvestigationListResponse.getName();
Integer operatingStatus = assetsInvestigationListResponse.getOperatingStatus();
Integer businessStatus = assetsInvestigationListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(3);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//信息经理角色、信息专员角色、信息领导角色
if (roleIdList.contains(String.valueOf(PromptSuccess.XX_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.XX_ZY_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.XX_LD_ID))) {
// 信息部调查列表
IPage<MessageInvestigationListResponse> positionVO = messageInvestigationMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null);
List<MessageInvestigationListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(messageInvestigationListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = messageInvestigationListResponse.getBusinessId();
Integer status = messageInvestigationListResponse.getStatus();
String name = messageInvestigationListResponse.getName();
Integer operatingStatus = messageInvestigationListResponse.getOperatingStatus();
Integer businessStatus = messageInvestigationListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(4);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//担保部A/B角、法规经理角色、法规部C角、法规部分管领导
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_C_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_LD_ID))) {
// 合规调查列表
DgComplianceInvestigationRequest dgComplianceInvestigationRequest = new DgComplianceInvestigationRequest();
IPage<DgComplianceInvestigationResponse> list = complianceInvestigationMapper.list(new Page(1, size), dgComplianceInvestigationRequest, roleList, currentUser);
List<DgComplianceInvestigationResponse> records = list.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(dgComplianceInvestigationResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = dgComplianceInvestigationResponse.getBusinessId();
String name = dgComplianceInvestigationResponse.getName();
Integer status = dgComplianceInvestigationResponse.getAuditStatus();
Integer operatingStatus = dgComplianceInvestigationResponse.getOperationStatus();
Integer businessStatus = dgComplianceInvestigationResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(5);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//工作会
if (roleIdList.contains(String.valueOf(PromptSuccess.GZU_ID))) {
IPage<DgWorkConferencePO> list = workConferenceConsiderMapper.list(new Page(1, size), "", roleList, currentUser);
List<DgWorkConferencePO> records = list.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(dgWorkConferencePO -> {
StatusPO statusPO = new StatusPO();
Integer businessId = dgWorkConferencePO.getBusinessId();
String name = dgWorkConferencePO.getName();
Integer status = dgWorkConferencePO.getAuditStatus();
Integer operatingStatus = dgWorkConferencePO.getOperationStatus();
Integer businessStatus = dgWorkConferencePO.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(6);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//担保部A/B角、贷审会
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DSH_ID))) {
IPage<DgLoanCommitteeConsiderResponse> list = loanCommitteeConsiderMapper.list(new Page(1, size), "", roleList, currentUser);
List<DgLoanCommitteeConsiderResponse> records = list.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(dgLoanCommitteeConsiderResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = dgLoanCommitteeConsiderResponse.getBusinessId();
Integer status = dgLoanCommitteeConsiderResponse.getStatus();
String name = dgLoanCommitteeConsiderResponse.getName();
Integer operatingStatus = dgLoanCommitteeConsiderResponse.getOperatingStatus();
Integer businessStatus = dgLoanCommitteeConsiderResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(7);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//法规经理、担保部A/B角、资产部经理
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID)) ) {
//担保函
IPage<GuaranteeLetterListResponse> iPage = guaranteeLetterAssignUserMapper.pageByCondition(new Page(1, size), currentUser, roleIdList, null, null);
List<GuaranteeLetterListResponse> records = iPage.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(guaranteeLetterListResponse -> {
StatusPO statusPO = new StatusPO();
String name = guaranteeLetterListResponse.getName();
Integer businessId = guaranteeLetterListResponse.getBusinessId();
Integer status = guaranteeLetterListResponse.getStatus();
Integer operatingStatus = guaranteeLetterListResponse.getOperatingStatus();
Integer businessStatus = guaranteeLetterListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(8);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//财务部、法规经理
if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))) {
//回款确认
IPage<PaymentConfirmationListResponse> iPage = paymentConfirmationConsiderMapper.pageByCondition(new Page(1, size), roleIdList, currentUser, null, null);
List<PaymentConfirmationListResponse> records = iPage.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(paymentConfirmationListResponse -> {
StatusPO statusPO = new StatusPO();
String name = paymentConfirmationListResponse.getName();
Integer businessId = paymentConfirmationListResponse.getBusinessId();
Integer status = paymentConfirmationListResponse.getStatus();
Integer operatingStatus = paymentConfirmationListResponse.getOperatingStatus();
Integer businessStatus = paymentConfirmationListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(9);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//法规经理
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))) {
//放款通知
IPage<LoanNoticeListResponse> iPage = loanNoticeMapper.pageByCondition(new Page(1, size), roleIdList, currentUser, null, null);
List<LoanNoticeListResponse> records = iPage.getRecords();
if (records!=null && records.size()!=0) {
records.forEach(loanNoticeListResponse -> {
StatusPO statusPO = new StatusPO();
String name = loanNoticeListResponse.getName();
Integer businessId = loanNoticeListResponse.getBusinessId();
Integer status = loanNoticeListResponse.getStatus();
Integer operatingStatus = loanNoticeListResponse.getOperatingStatus();
Integer businessStatus = loanNoticeListResponse.getBusinessStatus();
statusPO.setBusinessStatus(businessStatus);
statusPO.setOperatingStatus(operatingStatus);
statusPO.setProcessId(10);
statusPO.setName(name);
statusPO.setStatus(status);
hashMap.put(businessId, statusPO);
});
}
}
//再次循环,拼接数据
efficiencyList.forEach(personalEfficiencyListResponse -> {
Integer businessId = personalEfficiencyListResponse.getBusinessId();
Object o = hashMap.get(businessId);
//有数据
if (ObjectUtil.isNotNull(o)){
//强制转换
if (o instanceof StatusPO){
StatusPO statusPO = (StatusPO)o;
String name = statusPO.getName();
Integer operatingStatus = statusPO.getOperatingStatus();
Integer processId = statusPO.getProcessId();
Integer status = statusPO.getStatus();
Integer businessStatus = statusPO.getBusinessStatus();
personalEfficiencyListResponse.setTaskNode(String.valueOf(processId));
personalEfficiencyListResponse.setBusinessStatus(businessStatus);
personalEfficiencyListResponse.setOperatingStatus(operatingStatus);
personalEfficiencyListResponse.setApproveStatus(status);
personalEfficiencyListResponse.setClientName(name);
}
}
String timeConsuming = personalEfficiencyListResponse.getTimeConsuming();
String totalTimeConsuming = countTime(timeConsuming);
personalEfficiencyListResponse.setTimeConsuming(totalTimeConsuming);
});
}
return efficiencyList;
}
//根据业务id和用户id统计耗时
private HashMap<String, Object> getTime(Integer businessId, Integer userId) {
HashMap<String, Object> hashMap = Maps.newHashMap();
//根据业务id查询业务流程表
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>();
wrapper.eq("business_id", businessId).orderByAsc("create_time");
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper);
long countTime = 0L;
if (auditProcessList.size()>1){
//遍历业务流程数据,统计该用户的耗时
for (int i = 1; i <= auditProcessList.size() - 1; i++) {
//从第二条数据开始,获取该数据
DgAuditProcess auditProcess = auditProcessList.get(i);
//该数据是当前用户处理的
if (auditProcess.getUserId().equals(userId)) {
//获取上一流程的时间节点
DgAuditProcess previousProcess = auditProcessList.get(i - 1);
Date previousTime = previousProcess.getCreateTime();
Date currentTime = auditProcess.getCreateTime();
long currentTimeTime = currentTime.getTime();
long previousTimeTime = previousTime.getTime();
//累计耗时,毫秒
countTime = currentTimeTime - previousTimeTime;
}
}
}
//查询结束时间
QueryWrapper<DgAuditProcess> wrapperTime = new QueryWrapper<>();
wrapperTime.eq("business_id", businessId).eq("user_id", userId).orderByDesc("create_time").last("limit 1");
DgAuditProcess auditProcess = dgAuditProcessMapper.selectOne(wrapperTime);
Date endTime = auditProcess.getCreateTime();
hashMap.put("countTime", countTime);
hashMap.put("endTime", new SimpleDateFormat("yyyy-MM-dd").format(endTime));
return hashMap;
}
public static String countTime(String totalTime) {
long time = Long.parseLong(totalTime);
long days = time/ (1000 * 60 * 60 * 24);
long hours = (time% (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
long minutes = (time% (1000 * 60 * 60)) / (1000 * 60);
long seconds = (time% (1000 * 60)) / 1000;
return days + "天" + hours + "小时"+ minutes +"分钟";
}
/**
* 获取当前登录用户信息
*/
private String getUserId() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
return RedisUtil.get("dq:token:" + token);
}
} }

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.feign.HrmsFeignService; import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgStatisticsMapper; import com.daqing.financial.guarantee.mapper.DgStatisticsMapper;
import com.daqing.financial.guarantee.model.request.DgStatisticsRequest; import com.daqing.financial.guarantee.model.request.DgStatisticsRequest;
import com.daqing.financial.guarantee.model.response.DgStatisticsExcelRefuseResponse;
import com.daqing.financial.guarantee.model.response.DgStatisticsExcelResponse;
import com.daqing.financial.guarantee.model.response.DgStatisticsListRefuseResponse; import com.daqing.financial.guarantee.model.response.DgStatisticsListRefuseResponse;
import com.daqing.financial.guarantee.model.response.DgStatisticsListResponse; import com.daqing.financial.guarantee.model.response.DgStatisticsListResponse;
import com.daqing.financial.guarantee.service.IDgStatisticsService; import com.daqing.financial.guarantee.service.IDgStatisticsService;
@ -51,7 +53,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
size = 10; size = 10;
} }
// 时间筛选(固定时间) // 时间筛选(固定时间)
if (dgStatisticsRequest.getCreateFixedTime() != null && dgStatisticsRequest.getCreateCustomTime() == null) { if (dgStatisticsRequest.getCreateFixedTime() != null && dgStatisticsRequest.getStartTime() == null &&
dgStatisticsRequest.getEndTime() == null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
switch (dgStatisticsRequest.getCreateFixedTime()) { switch (dgStatisticsRequest.getCreateFixedTime()) {
case 0: case 0:
@ -79,50 +82,12 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
dgStatisticsRequest.setEndTime(null); dgStatisticsRequest.setEndTime(null);
} }
} }
// 时间筛选(自定义时间)
if (dgStatisticsRequest.getCreateCustomTime() != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dgStatisticsRequest.setStartTime(dateFormat.format(DateUtils.getDayStartTime(dgStatisticsRequest.getCreateCustomTime())));
dgStatisticsRequest.setEndTime(dateFormat.format(DateUtils.getDayEndTime(dgStatisticsRequest.getCreateCustomTime())));
}
// 查询列表 // 查询列表
IPage<DgStatisticsPO> iPage = this.getBaseMapper().list(new Page(page, size), dgStatisticsRequest); IPage<DgStatisticsPO> iPage = this.getBaseMapper().list(new Page(page, size), dgStatisticsRequest);
List<DgStatisticsPO> dgStatisticsPOList = iPage.getRecords(); List<DgStatisticsPO> dgStatisticsPOList = iPage.getRecords();
if (dgStatisticsPOList == null) { if (dgStatisticsPOList == null) {
return null; return null;
} }
// 部门筛选
if (dgStatisticsRequest.getDeptId() != null && dgStatisticsRequest.getEmpId() == null) {
ResponseResult<List<EmployeeVO>> result = hrmsFeignService.listEmployeeByDeptId(dgStatisticsRequest.getDeptId().longValue());
if (result.getData() == null || result.getData().size() == 0) {
return null;
}
for (int i = 0; i < dgStatisticsPOList.size(); i++) {
boolean flag = false;
for (EmployeeVO employeeVO : result.getData()) {
if (Objects.equals(dgStatisticsPOList.get(i).getPresenterId().longValue(), employeeVO.getId())) {
flag = true;
}
}
if (!flag) {
dgStatisticsPOList.remove(i);
i--; // 索引要减一,不然会触发"快速失败"异常
}
}
iPage.setTotal(dgStatisticsPOList.size());
iPage.setSize(iPage.getTotal() % size == 0 ? iPage.getTotal() / size : iPage.getTotal() / size + 1);
}
// 提单人筛选
if (dgStatisticsRequest.getEmpId() != null) {
for (int i = 0; i < dgStatisticsPOList.size(); i++) {
if (!Objects.equals(dgStatisticsPOList.get(i).getPresenterId(), dgStatisticsRequest.getEmpId())) {
dgStatisticsPOList.remove(i);
i--;// 索引要减一,不然会触发"快速失败"异常
}
}
iPage.setTotal(dgStatisticsPOList.size());
iPage.setSize(iPage.getTotal() % size == 0 ? iPage.getTotal() / size : iPage.getTotal() / size + 1);
}
// 获取所有的提单人id // 获取所有的提单人id
Integer[] presenterIds = dgStatisticsPOList.stream().map(DgStatisticsPO::getPresenterId).toArray(Integer[]::new); Integer[] presenterIds = dgStatisticsPOList.stream().map(DgStatisticsPO::getPresenterId).toArray(Integer[]::new);
if (presenterIds.length != 0) { if (presenterIds.length != 0) {
@ -167,8 +132,25 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids); ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
if (empAndDeptList.getData() != null) { if (empAndDeptList.getData() != null) {
List<DgStatisticsListResponse> listResponse = this.jointStatistics(dgStatisticsPOList, empAndDeptList.getData()); List<DgStatisticsListResponse> listResponse = this.jointStatistics(dgStatisticsPOList, empAndDeptList.getData());
List<DgStatisticsExcelResponse> excelResponse = new ArrayList<>();
for (DgStatisticsListResponse dgStatisticsListResponse : listResponse) {
DgStatisticsExcelResponse dgStatisticsExcelResponse = new DgStatisticsExcelResponse();
StringBuilder stringBuilder = new StringBuilder();
if (dgStatisticsListResponse.getDepartment() != null && dgStatisticsListResponse.getDepartment().size() != 0) {
for (int i = 0; i < dgStatisticsListResponse.getDepartment().size(); i++) {
if (i == dgStatisticsListResponse.getDepartment().size() - 1) {
stringBuilder.append(dgStatisticsListResponse.getDepartment().get(i));
} else {
stringBuilder.append(dgStatisticsListResponse.getDepartment().get(i)).append(",");
}
}
}
dgStatisticsExcelResponse.setDepartment(stringBuilder.toString());
BeanUtils.copyProperties(dgStatisticsListResponse, dgStatisticsExcelResponse);
excelResponse.add(dgStatisticsExcelResponse);
}
try { try {
ExcelUtil.writeExcelWithSheets(response, listResponse, "业务统计信息一览表", "statistics", new DgStatisticsListResponse()) ExcelUtil.writeExcelWithSheets(response, excelResponse, "业务统计信息一览表", "statistics", new DgStatisticsExcelResponse())
.finish(); .finish();
} catch (Exception e) { } catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
@ -191,7 +173,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
size = 10; size = 10;
} }
// 时间筛选(固定时间) // 时间筛选(固定时间)
if (dgStatisticsRequest.getCreateFixedTime() != null && dgStatisticsRequest.getCreateCustomTime() == null) { if (dgStatisticsRequest.getCreateFixedTime() != null && dgStatisticsRequest.getStartTime() == null &&
dgStatisticsRequest.getEndTime() == null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
switch (dgStatisticsRequest.getCreateFixedTime()) { switch (dgStatisticsRequest.getCreateFixedTime()) {
case 0: case 0:
@ -219,12 +202,6 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
dgStatisticsRequest.setEndTime(null); dgStatisticsRequest.setEndTime(null);
} }
} }
// 时间筛选(自定义时间)
if (dgStatisticsRequest.getCreateCustomTime() != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dgStatisticsRequest.setStartTime(dateFormat.format(DateUtils.getDayStartTime(dgStatisticsRequest.getCreateCustomTime())));
dgStatisticsRequest.setEndTime(dateFormat.format(DateUtils.getDayEndTime(dgStatisticsRequest.getCreateCustomTime())));
}
// 拒绝列表 // 拒绝列表
IPage<DgStatisticsRefusePO> iPage = this.getBaseMapper().listRefuse(new Page(page, size), dgStatisticsRequest); IPage<DgStatisticsRefusePO> iPage = this.getBaseMapper().listRefuse(new Page(page, size), dgStatisticsRequest);
List<DgStatisticsRefusePO> dgStatisticsRefusePOList = iPage.getRecords(); List<DgStatisticsRefusePO> dgStatisticsRefusePOList = iPage.getRecords();
@ -232,7 +209,7 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
return null; return null;
} }
// 部门筛选 // 部门筛选
if (dgStatisticsRequest.getDeptId() != null && dgStatisticsRequest.getEmpId() == null) { /*if (dgStatisticsRequest.getDeptId() != null && dgStatisticsRequest.getEmpId() == null) {
ResponseResult<List<EmployeeVO>> result = hrmsFeignService.listEmployeeByDeptId(dgStatisticsRequest.getDeptId().longValue()); ResponseResult<List<EmployeeVO>> result = hrmsFeignService.listEmployeeByDeptId(dgStatisticsRequest.getDeptId().longValue());
if (result.getData() == null || result.getData().size() == 0) { if (result.getData() == null || result.getData().size() == 0) {
return null; return null;
@ -251,18 +228,7 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
} }
iPage.setTotal(dgStatisticsRefusePOList.size()); iPage.setTotal(dgStatisticsRefusePOList.size());
iPage.setSize(iPage.getTotal() % size == 0 ? iPage.getTotal() / size : iPage.getTotal() / size + 1); iPage.setSize(iPage.getTotal() % size == 0 ? iPage.getTotal() / size : iPage.getTotal() / size + 1);
} }*/
// 提单人筛选
if (dgStatisticsRequest.getEmpId() != null) {
for (int i = 0; i < dgStatisticsRefusePOList.size(); i++) {
if (!Objects.equals(dgStatisticsRefusePOList.get(i).getPresenterId(), dgStatisticsRequest.getEmpId())) {
dgStatisticsRefusePOList.remove(i);
i--;// 索引要减一,不然会触发"快速失败"异常
}
}
iPage.setTotal(dgStatisticsRefusePOList.size());
iPage.setSize(iPage.getTotal() % size == 0 ? iPage.getTotal() / size : iPage.getTotal() / size + 1);
}
// 获取所有的提单人id // 获取所有的提单人id
Integer[] presenterIds = dgStatisticsRefusePOList.stream().map(DgStatisticsRefusePO::getPresenterId).toArray(Integer[]::new); Integer[] presenterIds = dgStatisticsRefusePOList.stream().map(DgStatisticsRefusePO::getPresenterId).toArray(Integer[]::new);
if (presenterIds.length != 0) { if (presenterIds.length != 0) {
@ -308,19 +274,35 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
if (empAndDeptList.getData() != null) { if (empAndDeptList.getData() != null) {
// 提单人姓名、部门拼装 // 提单人姓名、部门拼装
List<DgStatisticsListRefuseResponse> listResponse = this.jointRefuseStatistics(statisticsRefusePOList, empAndDeptList.getData()); List<DgStatisticsListRefuseResponse> listResponse = this.jointRefuseStatistics(statisticsRefusePOList, empAndDeptList.getData());
List<DgStatisticsExcelRefuseResponse> excelResponse = new ArrayList<>();
for (DgStatisticsListRefuseResponse listRefuseResponse : listResponse) {
DgStatisticsExcelRefuseResponse excelRefuseResponse = new DgStatisticsExcelRefuseResponse();
StringBuilder stringBuilder = new StringBuilder();
if (listRefuseResponse.getDepartment() != null && listRefuseResponse.getDepartment().size() != 0) {
for (int i = 0; i < listRefuseResponse.getDepartment().size(); i++) {
if (i == listRefuseResponse.getDepartment().size() - 1) {
stringBuilder.append(listRefuseResponse.getDepartment().get(i));
} else {
stringBuilder.append(listRefuseResponse.getDepartment().get(i)).append(",");
}
}
}
excelRefuseResponse.setDepartment(stringBuilder.toString());
BeanUtils.copyProperties(listRefuseResponse, excelRefuseResponse);
excelResponse.add(excelRefuseResponse);
}
try { try {
ExcelUtil.writeExcelWithSheets(response, listResponse, "业务统计拒绝信息一览表", "statisticsRefuse", new DgStatisticsListRefuseResponse()) ExcelUtil.writeExcelWithSheets(response, excelResponse, "业务统计拒绝信息一览表", "statisticsRefuse", new DgStatisticsExcelRefuseResponse())
.finish(); .finish();
} catch (Exception e) { } catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
} }
return true; }
return false;
} else { } else {
return false; return false;
} }
} }
return false;
}
private List<DgStatisticsListResponse> jointStatistics(List<DgStatisticsPO> dgStatisticsPOList, List<EmployeeTO> empAndDeptList) { private List<DgStatisticsListResponse> jointStatistics(List<DgStatisticsPO> dgStatisticsPOList, List<EmployeeTO> empAndDeptList) {
// 用于拼装业务统计列表 // 用于拼装业务统计列表

@ -60,15 +60,21 @@
</foreach> </foreach>
</select> </select>
<select id="selectBusinessTaday" parameterType="java.lang.String" resultType="java.lang.Integer"> <select id="queryApplyField" resultType="com.daqing.framework.domain.guarantee.DgApplyField">
select count(0) from dg_apply_amount_info where create_time LIKE CONCAT('%',#{dateTime},'%') SELECT * FROM dg_apply_field
</select> </select>
<select id="selectMaxBusinessTaday" parameterType="java.lang.String" resultType="java.lang.String"> <update id="updateApplyField" parameterType="com.daqing.framework.domain.guarantee.DgApplyField">
select business_code UPDATE dg_apply_field SET
from dg_apply_amount_info customer_type = #{af.customerType},customer_code = #{af.customerCode},customer_name = #{af.customerName},customer_unicode = #{af.customerUnicode},customer_phone = #{af.customerPhone},register_time = #{af.registerTime},
where create_time LIKE CONCAT('%',#{dateTime},'%') register_fund =#{af.registerFund},register_addr = #{af.registerAddr},employee_number = #{af.employeeNumber},business_addr = #{af.businessAddr},business_type = #{af.businessType},business_scope = #{af.businessScope},
order by id desc limit 1 legal_person_name = #{af.legalPersonName},legal_person_sex = #{af.legalPersonSex},legal_person_card = #{af.legalPersonCard},legal_person_phone = #{af.legalPersonPhone},legal_person_account = #{af.legalPersonAccount},
</select> legal_person_addr = #{af.legalPersonAddr},legal_person_affiliated_person = #{af.legalPersonAffiliatedPerson},loans_amount = #{af.loansAmount},loans_time_limit = #{af.loansTimeLimit},loans_bank = #{af.loansBank} ,
loans_use = #{af.loansUse},loans_else_use = #{af.loansElseUse},loans_measure = #{af.loansMeasure},accessory_business_license = #{af.accessoryBusinessLicense},
accessory_id_card = #{af.accessoryIdCard},accessory_marriage_certificate = #{af.accessoryMarriageCertificate},accessory_person_card = #{af.accessoryPersonCard},accessory_constitution = #{af.accessoryConstitution},
accessory_audit = #{af.accessoryAudit},accessory_credit = #{af.accessoryCredit},accessory_couple_credit = #{af.accessoryCoupleCredit},accessory_commitment = #{af.accessoryCommitment},accessory_prove = #{af.accessoryProve},
accessory_conference = #{af.accessoryConference},accessory_assess = #{af.accessoryAssess},update_time = #{af.updateTime}
WHERE id = #{af.id}
</update>
</mapper> </mapper>

@ -43,4 +43,14 @@
ORDER BY p.create_time ASC ORDER BY p.create_time ASC
</select> </select>
<!-- 统计不同业务状态下业务的数量 -->
<select id="getBusinessCount" resultType="java.util.Map">
SELECT
SUM(CASE WHEN (business_status = 0) THEN 1 ELSE 0 END) AS '0',
SUM(CASE WHEN (business_status = 1) THEN 1 ELSE 0 END) AS '1',
SUM(CASE WHEN (business_status = 2) THEN 1 ELSE 0 END) AS '2',
SUM(CASE WHEN (business_status = 3) THEN 1 ELSE 0 END) AS '3'
FROM dg_business_process_status
</select>
</mapper> </mapper>

@ -36,6 +36,9 @@
<if test="sr.type != null and sr.type != ''"> <if test="sr.type != null and sr.type != ''">
AND a.business_type = #{sr.type} AND a.business_type = #{sr.type}
</if> </if>
<if test="sr.empId != null">
AND a.presenter_id = #{sr.empId}
</if>
<if test="sr.startTime != null and sr.startTime != ''"> <if test="sr.startTime != null and sr.startTime != ''">
AND a.create_time &gt;= #{sr.startTime} AND a.create_time &gt;= #{sr.startTime}
</if> </if>
@ -68,6 +71,9 @@
<if test="sr.type != null and sr.type != ''"> <if test="sr.type != null and sr.type != ''">
AND a.business_type = #{sr.type} AND a.business_type = #{sr.type}
</if> </if>
<if test="sr.empId != null">
AND a.presenter_id = #{sr.empId}
</if>
<if test="sr.startTime != null and sr.startTime != ''"> <if test="sr.startTime != null and sr.startTime != ''">
AND a.create_time &gt;= #{sr.startTime} AND a.create_time &gt;= #{sr.startTime}
</if> </if>

@ -1,8 +1,7 @@
# 开发和测试环境(dev)
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
spring.application.name=dq-financial-hrms-auth spring.application.name=dq-financial-hrms-auth
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ
spring.cloud.nacos.config.server-addr=192.168.31.142:8848 spring.cloud.nacos.config.server-addr=192.168.31.140:8848
spring.cloud.nacos.config.namespace=7632bdaa-3381-4669-b3f9-2fc73be451e8 spring.cloud.nacos.config.namespace=7632bdaa-3381-4669-b3f9-2fc73be451e8
#spring.cloud.nacos.config.group=prod #spring.cloud.nacos.config.group=prod
@ -18,12 +17,71 @@ 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].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true spring.cloud.nacos.config.ext-config[2].refresh=true
spring.redis.host=192.168.232.128 spring.redis.host=127.0.0.1
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password= spring.redis.password=123456
spring.redis.database=0 spring.redis.database=0
spring.redis.timeout=30000 spring.redis.timeout=30000
spring.redis.jedis.pool.max-active=8 spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=8 spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0 spring.redis.jedis.pool.min-idle=0
#正式环境(prod)
#spring.application.name=dq-financial-hrms-auth
#
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848
#spring.cloud.nacos.config.namespace=b590c830-7ada-44b7-968f-e8d0c81990c4
##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=prod
#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=prod
#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=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=dq123456
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0
#测试环境(prod)
#spring.application.name=dq-financial-hrms-auth
#
#spring.cloud.nacos.config.server-addr=127.0.0.1:8848
#spring.cloud.nacos.config.namespace=d4e087eb-2a9b-4ef1-9f22-76269a30d081
##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=prod
#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=prod
#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=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0

@ -1,41 +0,0 @@
<?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.hrauth.dao.UserLoginDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.UserEntity" id="userMap">
<result property="id" column="id"/>
<result property="account" column="account"/>
<result property="phoneAccount" column="phone_account"/>
<result property="password" column="password"/>
<result property="loginNum" column="login_num"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
<update id="updatePasswordByPhoneAccount">
update hrms_user set password = #{password} where phone_account = #{phoneAccount}
</update>
<select id="getUser" parameterType="string" resultType="com.daqing.framework.domain.hrms.UserEntity">
SELECT account,password FROM hrms_user WHERE account = #{account}
</select>
<select id="selectCount" resultType="java.lang.Integer">
select count(1) from hrms_user where phone_account = #{phoneAccount}
</select>
<select id="login" parameterType="com.daqing.framework.domain.hrms.request.LoginRequest" resultType="com.daqing.framework.domain.hrms.UserEntity">
select id,account,phone_account,password,login_num from hrms_user
where del_or_not = 0 and status = 0
<if test="phone != null and phone != '' ">
and phone_account = #{phone}
</if>
<if test="wechatId != null and wechatId != '' ">
and wechat_id = #{wechatId}
</if>
</select>
<select id="selectByPhoneAccount" resultType="com.daqing.framework.domain.hrms.UserEntity">
SELECT id,account FROM hrms_user WHERE phone_account = #{phoneAccount}
</select>
</mapper>

@ -134,6 +134,14 @@ public class DeptController implements DeptControllerApi {
return ResponseResult.SUCCESS(deptService.listEmployeeByDeptId(deptId)); return ResponseResult.SUCCESS(deptService.listEmployeeByDeptId(deptId));
} }
/**
* 获取所有的部门id和名称(用户团队效率的部门筛选)
*/
@GetMapping("/listDepartment")
public ResponseResult listDepartment(){
return ResponseResult.SUCCESS(deptService.listDepartment());
}
/** /**
* 根据员工id获取对应部门下所有的客户经理 * 根据员工id获取对应部门下所有的客户经理
*/ */

@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 记录部门信息 * 记录部门信息
@ -34,4 +35,6 @@ public interface DeptDao extends BaseMapper<DeptEntity> {
List<EmployeeVO> listEmployeeById(Long id); List<EmployeeVO> listEmployeeById(Long id);
List<EmployeeVO> listEmployeeByDeptId(Long deptId); List<EmployeeVO> listEmployeeByDeptId(Long deptId);
List<Map<Long, String>> listDepartments();
} }

@ -8,6 +8,7 @@ import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.request.DeptAddRequest; import com.daqing.framework.domain.hrms.request.DeptAddRequest;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 记录部门信息 * 记录部门信息
@ -37,5 +38,7 @@ public interface DeptService extends IService<DeptEntity> {
List<EmployeeVO> listEmployeeByDeptId(Long deptId); List<EmployeeVO> listEmployeeByDeptId(Long deptId);
List<DepartmentVO> listEmployeeTrees(String account); List<DepartmentVO> listEmployeeTrees(String account);
List<Map<Long, String>> listDepartment();
} }

@ -20,10 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays; import java.util.*;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -255,6 +252,14 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
return this.getListEmployeeTrees(deptDao.listDepartment(), 0L, account); return this.getListEmployeeTrees(deptDao.listDepartment(), 0L, account);
} }
/**
* 获取所有的部门id和名称(用于团队效率部门筛选)
*/
@Override
public List<Map<Long, String>> listDepartment() {
return this.getBaseMapper().listDepartments();
}
private List<DepartmentVO> getListEmployeeTrees(List<DepartmentVO> list, Long parentId, String account) { private List<DepartmentVO> getListEmployeeTrees(List<DepartmentVO> list, Long parentId, String account) {
return list.stream() return list.stream()

@ -13,6 +13,7 @@ import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.*; import com.daqing.framework.domain.hrms.*;
import com.daqing.framework.domain.hrms.ext.*; import com.daqing.framework.domain.hrms.ext.*;
import com.daqing.framework.domain.hrms.request.EmployeeRequest; import com.daqing.framework.domain.hrms.request.EmployeeRequest;
import com.daqing.framework.domain.hrms.response.EmployeeExcelResponse;
import com.daqing.framework.domain.hrms.response.HrmsCode; import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.domain.hrms.response.RolePermissionResponse; import com.daqing.framework.domain.hrms.response.RolePermissionResponse;
import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.exception.ExceptionCast;
@ -402,7 +403,46 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
public Boolean excelExport(HttpServletResponse response) { public Boolean excelExport(HttpServletResponse response) {
try { try {
List<EmployeeListVO> list = this.getBaseMapper().excelList(); List<EmployeeListVO> list = this.getBaseMapper().excelList();
ExcelUtil.writeExcelWithSheets(response, list, "员工信息一览表", "employee", new EmployeeListVO()) List<EmployeeExcelResponse> excelResponse = new ArrayList<>();
for (EmployeeListVO employee : list) {
EmployeeExcelResponse employeeExcelResponse = new EmployeeExcelResponse();
if (employee.getDepartmentNameList() != null && employee.getDepartmentNameList().size() != 0) {
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < employee.getDepartmentNameList().size(); i++) {
if (i == employee.getDepartmentNameList().size() - 1) {
stringBuilder.append(employee.getDepartmentNameList().get(i));
} else {
stringBuilder.append(employee.getDepartmentNameList().get(i)).append(",");
}
}
employeeExcelResponse.setDepartmentNameList(stringBuilder.toString());
}
if (employee.getPositionNameList() != null && employee.getPositionNameList().size() != 0) {
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < employee.getPositionNameList().size(); i++) {
if (i == employee.getPositionNameList().size() - 1) {
stringBuilder.append(employee.getPositionNameList().get(i));
} else {
stringBuilder.append(employee.getPositionNameList().get(i)).append(",");
}
}
employeeExcelResponse.setPositionNameList(stringBuilder.toString());
}
if (employee.getRoleNameList() != null && employee.getRoleNameList().size() != 0) {
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < employee.getRoleNameList().size(); i++) {
if (i == employee.getRoleNameList().size() - 1) {
stringBuilder.append(employee.getRoleNameList().get(i));
} else {
stringBuilder.append(employee.getRoleNameList().get(i)).append(",");
}
}
employeeExcelResponse.setRoleNameList(stringBuilder.toString());
}
BeanUtils.copyProperties(employee, employeeExcelResponse);
excelResponse.add(employeeExcelResponse);
}
ExcelUtil.writeExcelWithSheets(response, excelResponse, "员工信息一览表", "employee", new EmployeeExcelResponse())
.finish(); .finish();
return true; return true;
} catch (Exception e) { } catch (Exception e) {

@ -85,4 +85,8 @@
AND d.id = #{deptId} AND d.id = #{deptId}
</select> </select>
<select id="listDepartments" resultType="java.util.Map">
SELECT id,name FROM hrms_dept
</select>
</mapper> </mapper>

@ -1,7 +1,7 @@
#服务名称 #服务名称
spring.application.name=dq-financial-hrms spring.application.name=dq-financial-hrms
#配置中心地址 #配置中心地址
spring.cloud.nacos.config.server-addr=192.168.31.142:8848 spring.cloud.nacos.config.server-addr=192.168.31.140:8848
spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6 spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6
#spring.cloud.nacos.config.group=prod #spring.cloud.nacos.config.group=prod
@ -17,9 +17,81 @@ 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].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true spring.cloud.nacos.config.ext-config[2].refresh=true
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=123456
spring.redis.database=0
spring.redis.timeout=30000
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
#请求处理的超时时间
ribbon.ReadTimeout: 120000
#请求连接的超时时间
ribbon.ConnectTimeout: 30000
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
# 正式环境(prod)
#服务名称
#spring.application.name=dq-financial-hrms
##配置中心地址
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848
#spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43
##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=prod
#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=prod
#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=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=dq123456
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0
#
#spring.servlet.multipart.max-file-size=10MB
#spring.servlet.multipart.max-request-size=10MB
# 测试环境(prod)
#服务名称
#spring.application.name=dq-financial-hrms
##配置中心地址
#spring.cloud.nacos.config.server-addr=127.0.0.1:8848
#spring.cloud.nacos.config.namespace=ed20f51f-6038-44e6-8e28-7ac72625e7b0
##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=prod
#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=prod
#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=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1 #spring.redis.host=127.0.0.1
#spring.redis.port=6379 #spring.redis.port=6379
#spring.redis.password=123456 #spring.redis.password=
#spring.redis.database=0 #spring.redis.database=0
#spring.redis.timeout=30000 #spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8 #spring.redis.jedis.pool.max-active=8

@ -19,7 +19,13 @@
</select> </select>
<select id="getEmpDeptCount" parameterType="java.lang.Long" resultType="java.lang.Integer"> <select id="getEmpDeptCount" parameterType="java.lang.Long" resultType="java.lang.Integer">
SELECT count(1) FROM hrms_employee_dept WHERE dept_id = #{deptId} SELECT count(1) FROM hrms_employee_dept AS ed
LEFT JOIN hrms_employee AS e
ON ed.employee_id = e.id
LEFT JOIN hrms_user AS u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND dept_id = #{deptId}
</select> </select>
<select id="getByPositionId" resultType="com.daqing.framework.domain.hrms.DeptEntity"> <select id="getByPositionId" resultType="com.daqing.framework.domain.hrms.DeptEntity">
SELECT SELECT
@ -41,4 +47,46 @@
FROM hrms_dept WHERE parent_id = #{parentId} FROM hrms_dept WHERE parent_id = #{parentId}
</select> </select>
<select id="listDepartmentIdAndName" resultType="com.daqing.framework.domain.hrms.DepartmentVO">
SELECT id,name FROM hrms_dept
</select>
<select id="listEmployeeById" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT DISTINCT e.id id,e.name name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON d.id = ed.dept_id
WHERE u.del_or_not = 0
AND d.id IN
( SELECT d.id
FROM hrms_dept d
LEFT JOIN hrms_employee_dept ed
ON d.id = ed.dept_id
LEFT JOIN hrms_employee e
ON e.id = ed.employee_id
WHERE e.id = #{id}
)
</select>
<select id="listEmployeeByDeptId" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT e.id id,e.name name
FROM hrms_employee e
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND d.id = #{deptId}
</select>
<select id="listDepartments" resultType="java.util.Map">
SELECT id,name FROM hrms_dept
</select>
</mapper> </mapper>

@ -19,6 +19,121 @@
<result property="userId" column="user_id"/> <result property="userId" column="user_id"/>
</resultMap> </resultMap>
<!-- 不含部门id时列表 -->
<resultMap id="employeeList" type="com.daqing.framework.domain.hrms.ext.EmployeeListVO">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="jobNumber" column="job_number"/>
<association property="account" javaType="string">
<result column="account"/>
</association>
<association property="createTime" javaType="java.util.Date">
<result column="create_time"/>
</association>
<association property="status" javaType="integer">
<result column="status"/>
</association>
<collection property="departmentNameList" ofType="string" column="id" select="departmentList"/>
<collection property="positionNameList" ofType="string" column="id" select="positionList"/>
<collection property="roleNameList" ofType="string" column="id" select="roleList"/>
</resultMap>
<!-- 含有部门时列表 -->
<resultMap id="employeeAndDeptList" type="com.daqing.framework.domain.hrms.ext.EmployeeListVO">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="jobNumber" column="job_number"/>
<association property="account" javaType="string">
<result column="account"/>
</association>
<association property="createTime" javaType="java.util.Date">
<result column="create_time"/>
</association>
<association property="status" javaType="integer">
<result column="status"/>
</association>
<collection property="departmentNameList" ofType="string" column="id" select="departmentList"/>
<collection property="positionNameList" ofType="string" column="id" select="positionList"/>
<collection property="roleNameList" ofType="string" column="id" select="roleList"/>
</resultMap>
<!-- 员工详情(人力后台展示) -->
<resultMap id="employeeInfo" type="com.daqing.framework.domain.hrms.ext.EmployeeInfoVO">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="jobNumber" column="job_number"/>
<result property="gender" column="gender"/>
<result property="birthday" column="birthday"/>
<result property="phone" column="phone"/>
<result property="companyMail" column="company_mail"/>
<association property="account" javaType="string">
<result column="account"/>
</association>
<association property="status" javaType="integer">
<result column="status"/>
</association>
<collection property="departments" ofType="com.daqing.framework.domain.hrms.DeptEntity">
<id property="id" column="dept_id"/>
<result property="name" column="dept_name"/>
</collection>
<collection property="positions" ofType="com.daqing.framework.domain.hrms.PositionEntity">
<id property="id" column="position_id"/>
<result property="name" column="position_name"/>
</collection>
<collection property="roles" ofType="com.daqing.framework.domain.hrms.RoleEntity">
<id property="id" column="role_id"/>
<result property="name" column="role_name"/>
</collection>
</resultMap>
<!-- 员工详情(人力工作台展示) -->
<resultMap id="employeeInfoByUserId" type="com.daqing.framework.domain.hrms.ext.EmployeeAndUserVO">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="jobNumber" column="job_number"/>
<result property="gender" column="gender"/>
<result property="birthday" column="birthday"/>
<result property="phone" column="phone"/>
<result property="companyMail" column="company_mail"/>
<result property="spareMail" column="spare_mail"/>
<result property="officePhone" column="office_phone"/>
<result property="positionDescription" column="position_description"/>
<result property="headPortaritUrl" column="head_portarit_url"/>
<result property="userId" column="user_id"/>
<association property="account" javaType="string">
<result column="account"/>
</association>
<association property="password" javaType="string">
<result column="password"/>
</association>
<association property="loginNum" javaType="integer">
<result column="login_num"/>
</association>
<association property="lasttime" javaType="java.util.Date">
<result column="lasttime"/>
</association>
<association property="phoneAccount" javaType="string">
<result column="phone_account"/>
</association>
<association property="wechatId" javaType="string">
<result column="wechat_id"/>
</association>
<collection property="departments" ofType="string">
<result column="dept_name"/>
</collection>
<collection property="positions" ofType="string">
<result column="position_name"/>
</collection>
<collection property="roles" ofType="string">
<result column="role_name"/>
</collection>
</resultMap>
<!-- 映射user实体类和数据库表主键,使之能获取到新增的主键 -->
<resultMap type="com.daqing.framework.domain.hrms.UserEntity" id="userMap">
<result property="id" column="id"/>
</resultMap>
<resultMap type="com.daqing.framework.domain.hrms.ext.EmployeeTO" id="employeeTO"> <resultMap type="com.daqing.framework.domain.hrms.ext.EmployeeTO" id="employeeTO">
<id property="id" column="eid"/> <id property="id" column="eid"/>
<result property="empName" column="emp_name"/> <result property="empName" column="emp_name"/>
@ -69,6 +184,50 @@
AND d.id = #{id} AND d.id = #{id}
</select> </select>
<!-- 根据部门id获取该部门下面所有的员工 -->
<select id="listEmployeeByDeptIdAndEmpId" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT e.id,e.name
FROM hrms_employee e
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND d.id = #{id}
<if test="name != null and name != ''">
AND e.name LIKE CONCAT('%',#{name},'%')
</if>
<if test="empIds != null and empIds != ''">
AND e.id NOT IN
<foreach collection="empIds" item="empId" open="(" separator="," close=")">
#{empId}
</foreach>
</if>
</select>
<!-- 根据部门id获取该部门下面所有的员工 -->
<select id="employeeListByDeptId" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.UserDeptVO">
SELECT
u.id,
e.name as account , GROUP_CONCAT(er.role_id SEPARATOR ',') roleId
FROM
hrms_employee e
LEFT JOIN hrms_employee_dept ed ON e.id = ed.employee_id
LEFT JOIN hrms_dept d ON ed.dept_id = d.id
LEFT JOIN hrms_user u ON e.user_id = u.id
left join hrms_employee_role er on e.user_id = er.user_id
WHERE
u.del_or_not = 0
AND d.id = #{id}
<if test="account != null">
AND e.name LIKE CONCAT('%',#{account},'%')
</if>
GROUP BY u.id
</select>
<!-- 查询所有的员工姓名和id --> <!-- 查询所有的员工姓名和id -->
<select id="listEmployeeName" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO"> <select id="listEmployeeName" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT e.id id,e.name name SELECT e.id id,e.name name
@ -98,4 +257,373 @@
AND u.del_or_not = 0 AND u.del_or_not = 0
</where> </where>
</select> </select>
<select id="pageList" parameterType="com.daqing.framework.domain.hrms.request.EmployeeRequest"
resultMap="employeeList">
SELECT e.id id,e.name name,u.account account,e.job_number job_number,
u.create_time create_time,u.status status
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
<if test="employee.codeOrName != null and employee.codeOrName != ''">
AND (e.name LIKE CONCAT('%',#{employee.codeOrName},'%') OR u.account LIKE
CONCAT('%',#{employee.codeOrName},'%')
OR e.job_number LIKE CONCAT('%',#{employee.codeOrName},'%'))
</if>
</select>
<select id="excelList" resultMap="employeeList">
SELECT e.id id,e.name name,u.account account,e.job_number job_number,
u.create_time create_time,u.status status
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
</select>
<select id="pageListByDept" parameterType="com.daqing.framework.domain.hrms.request.EmployeeRequest"
resultMap="employeeList">
SELECT e.id id,e.name name,u.account account,e.job_number job_number,
u.create_time create_time,u.status status
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
WHERE u.del_or_not = 0
<if test="employee.id != null and employee.id != ''">
AND d.id = #{employee.id}
</if>
<if test="employee.codeOrName != null and employee.codeOrName != ''">
AND (e.name LIKE CONCAT('%',#{employee.codeOrName},'%') OR u.account LIKE
CONCAT('%',#{employee.codeOrName},'%')
OR e.job_number LIKE CONCAT('%',#{employee.codeOrName},'%'))
</if>
</select>
<select id="departmentList" parameterType="long" resultType="string">
SELECT d.name
FROM hrms_dept d
LEFT JOIN hrms_employee_dept ed
ON d.id = ed.dept_id
LEFT JOIN hrms_employee e
ON ed.employee_id = e.id
WHERE e.id = #{id}
</select>
<select id="positionList" parameterType="long" resultType="string">
SELECT p.name
FROM hrms_position p
LEFT JOIN hrms_employee_position ep
ON p.id = ep.position_id
LEFT JOIN hrms_employee e
ON ep.emp_id = e.id
WHERE e.id = #{id}
</select>
<select id="roleList" parameterType="long" resultType="string">
SELECT r.name
FROM hrms_role r
LEFT JOIN hrms_employee_role er
ON r.id = er.role_id
LEFT JOIN hrms_user u
ON u.id = er.user_id
LEFT JOIN hrms_employee e
ON e.user_id = u.id
WHERE e.id = #{id}
</select>
<!-- 根据employee id得到 user_id-->
<select id="queryIds" parameterType="long" resultType="long">
SELECT user_id FROM hrms_employee e
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}
</foreach>
</select>
<!-- 删除:del_or_not = 1 -->
<delete id="deleteByIds" parameterType="long">
UPDATE hrms_user SET del_or_not = 1 WHERE id IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
</delete>
<select id="getStatus" parameterType="long" resultType="integer">
SELECT u.status status FROM hrms_user u
LEFT JOIN hrms_employee e
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.id = #{id}
</select>
<!-- 启用或者禁用 -->
<update id="startOrStop" parameterType="com.daqing.framework.domain.hrms.UserEntity">
UPDATE hrms_user SET status = #{status},disable_start_time = #{disableStartTime},
disable_end_time = #{disableEndTime},disable_cause = #{disableCause}
WHERE id = #{id}
</update>
<!-- 禁用详情-->
<select id="forbidInfo" parameterType="long" resultType="com.daqing.framework.domain.hrms.UserEntity">
SELECT disable_start_time,disable_end_time,disable_cause
FROM hrms_user WHERE id = #{id}
</select>
<!-- 所有的禁用时间 -->
<select id="listDisableTime" resultType="com.daqing.framework.domain.hrms.UserEntity">
SELECT id,disable_start_time,disable_end_time,disable_cause
FROM hrms_user WHERE status = 1 OR status = 2
</select>
<!-- 获取user_id-->
<select id="getUserId" resultType="long">
SELECT user_id FROM hrms_employee WHERE id = #{id}
</select>
<!-- 重置密码 -->
<update id="updatePassword">
UPDATE hrms_user SET password = #{password} WHERE id = #{id}
</update>
<select id="getInfo" resultMap="employeeInfo" parameterType="long">
SELECT e.id id,e.name name,e.job_number job_number,e.phone phone,e.gender gender,
e.birthday birthday,e.company_mail company_mail,u.account account,u.status status,
d.id dept_id,d.name dept_name,r.id role_id,r.name role_name,po.id position_id,
po.name position_name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
LEFT JOIN hrms_employee_dept ed
ON ed.employee_id = e.id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
LEFT JOIN hrms_employee_role er
ON er.user_id = u.id
LEFT JOIN hrms_role r
ON er.role_id = r.id
LEFT JOIN hrms_employee_position ep
ON ep.emp_id = e.id
LEFT JOIN hrms_position po
ON ep.position_id = po.id
WHERE u.del_or_not = 0
AND e.id = #{id}
</select>
<update id="updateEmployee" parameterType="com.daqing.framework.domain.hrms.EmployeeEntity">
UPDATE hrms_employee SET name = #{name},job_number = #{jobNumber},gender = #{gender},birthday = #{birthday},
phone = #{phone},company_mail = #{companyMail}
WHERE id = #{id}
</update>
<update id="updateUser">
UPDATE hrms_user SET account = #{account},motify_time = #{modifyTime} WHERE id = #{id}
</update>
<delete id="deleteDepartment" parameterType="long">
DELETE FROM hrms_employee_dept WHERE employee_id = #{id}
</delete>
<delete id="deletePosition" parameterType="long">
DELETE FROM hrms_employee_position WHERE emp_id = #{id}
</delete>
<delete id="deleteRole" parameterType="long">
DELETE FROM hrms_employee_role WHERE user_id = #{id}
</delete>
<insert id="insertDepartment">
INSERT INTO hrms_employee_dept
(employee_id,dept_id)
VALUES
<foreach collection="deptIds" item="deptId" separator=",">
(#{id},#{deptId})
</foreach>
</insert>
<insert id="insertPosition">
INSERT INTO hrms_employee_position
(emp_id,position_id)
VALUES
<foreach collection="positionIds" item="positionId" separator=",">
(#{id},#{positionId})
</foreach>
</insert>
<insert id="insertRole">
INSERT INTO hrms_employee_role
(user_id,role_id)
VALUES
<foreach collection="roleIds" item="roleId" separator=",">
(#{id},#{roleId})
</foreach>
</insert>
<insert id="insertUsrRole">
INSERT INTO hrms_employee_role
(user_id,role_id)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<insert id="insertUserRole">
INSERT INTO hrms_employee_role
(user_id,role_id)
VALUES (#{userId},#{roleId})
</insert>
<insert id="saveUserRole">
INSERT INTO hrms_employee_role
(user_id,role_id)
VALUES (#{userId},#{roleId})
</insert>
<insert id="insertEmployee" keyProperty="id" useGeneratedKeys="true"
parameterType="com.daqing.framework.domain.hrms.EmployeeEntity">
INSERT INTO hrms_employee (name,job_number,gender,birthday,phone,company_mail,user_id)
VALUES (#{name},#{jobNumber},#{gender},#{birthday},#{phone},#{companyMail},#{userId})
</insert>
<insert id="insertUser" keyProperty="id" useGeneratedKeys="true"
parameterType="com.daqing.framework.domain.hrms.UserEntity">
INSERT INTO hrms_user (account,create_time,motify_time) VALUES (#{account},#{createTime},#{motifyTime})
</insert>
<select id="getEmployeeByUserId" parameterType="long" resultMap="employeeInfoByUserId">
SELECT e.id id,e.name name,e.job_number job_number,e.phone phone,e.gender gender,
e.birthday birthday,e.company_mail company_mail,e.spare_mail spare_mail,
e.office_phone office_phone,e.position_description position_description,
e.head_portarit_url head_portarit_url,e.user_id user_id,u.account account,
u.password password,u.login_num login_num,u.lasttime lasttime,u.phone_account
phone_account,u.wechat_id wechat_id,d.name dept_name,r.name role_name,
po.name position_name
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
LEFT JOIN hrms_employee_dept ed
ON ed.employee_id = e.id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
LEFT JOIN hrms_employee_role er
ON er.user_id = u.id
LEFT JOIN hrms_role r
ON er.role_id = r.id
LEFT JOIN hrms_employee_position ep
ON ep.emp_id = e.id
LEFT JOIN hrms_position po
ON ep.position_id = po.id
WHERE u.del_or_not = 0
AND u.id = #{id}
</select>
<update id="updateEmployeeAndUser" parameterType="com.daqing.framework.domain.hrms.EmployeeEntity">
UPDATE hrms_employee SET gender = #{gender},office_phone = #{officePhone},phone = #{phone},
company_mail = #{companyMail},spare_mail = #{spareMail}
<if test="headPortaritUrl != null and headPortaritUrl != ''">
,head_portarit_url = #{headPortaritUrl}
</if>
WHERE id = #{id}
</update>
<!-- 根据id查询员工头像 -->
<select id="getEmployeeEntityByUserId" parameterType="long"
resultType="com.daqing.framework.domain.hrms.EmployeeEntity">
SELECT head_portarit_url
FROM hrms_employee
WHERE user_id = #{userId}
</select>
<!-- 新增员工时判断姓名、工号、账号是否存在 -->
<select id="employeeNameCount" parameterType="string" resultType="integer">
SELECT COUNT(e.id)
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.name = #{name}
</select>
<select id="userAccountCount" parameterType="string" resultType="integer">
SELECT COUNT(id) FROM hrms_user WHERE del_or_not = 0 AND account = #{account}
</select>
<select id="employeeJobNumberCount" parameterType="string" resultType="integer">
SELECT COUNT(e.id)
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.job_number = #{jobNumber}
</select>
<select id="getEmployeeRepetitionByEmpId" parameterType="long"
resultType="com.daqing.framework.domain.hrms.ext.EmployeeRepetition">
SELECT e.name name,e.job_number job_number,u.account account
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND e.id = #{empId}
</select>
<select id="getAccountAndDeptNameById"
resultType="com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse">
select hu.id, hu.account, GROUP_CONCAT(hd.`name` SEPARATOR '/')deptName
from hrms_employee_dept ed
LEFT JOIN hrms_dept hd on hd.id=ed.dept_id
LEFT JOIN hrms_employee he on he.id=ed.employee_id
LEFT JOIN hrms_user hu on hu.id = he.user_id
where hu.id IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
GROUP BY hu.id
</select>
<!-- 根据userId查询对应的员工姓名 -->
<select id="listEmpNameByUserId" parameterType="integer" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT u.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
AND u.id IN
<foreach collection="userIds" open="(" separator="," close=")" item="userId">
#{userId}
</foreach>
</select>
<select id="getListEmployeeTrees" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.UserDeptVO">
SELECT
u.id,
e.name as account
FROM
hrms_employee e
LEFT JOIN hrms_employee_dept ed ON e.id = ed.employee_id
LEFT JOIN hrms_dept d ON ed.dept_id = d.id
LEFT JOIN hrms_user u ON e.user_id = u.id
WHERE
u.del_or_not = 0
AND d.id = #{id}
<if test="account != null">
AND e.name LIKE CONCAT('%',#{account},'%')
</if>
</select>
<select id="selectUserRole" resultType="java.lang.Integer">
select COUNT(0) from hrms_employee_role where user_id=#{userId} and role_id=#{roleId}
</select>
<select id="countUserIdAndRoleId" resultType="integer">
SELECT COUNT(id) FROM hrms_employee_role WHERE user_id = #{userId} AND role_id = #{roleId}
</select>
</mapper> </mapper>

@ -9,6 +9,7 @@
<result property="code" column="code"/> <result property="code" column="code"/>
<result property="name" column="name"/> <result property="name" column="name"/>
<result property="url" column="url"/> <result property="url" column="url"/>
<result property="menuUrl" column="menu_url"/>
<result property="parentId" column="parent_id"/> <result property="parentId" column="parent_id"/>
<result property="level" column="level"/> <result property="level" column="level"/>
<result property="menuOrNot" column="menu_or_not"/> <result property="menuOrNot" column="menu_or_not"/>
@ -19,5 +20,22 @@
<result property="motifyTime" column="motify_time"/> <result property="motifyTime" column="motify_time"/>
</resultMap> </resultMap>
<select id="listPermissionByRoleIds" parameterType="long" resultType="com.daqing.framework.domain.hrms.response.RolePermissionResponse">
SELECT rp.permission_id, hp.name permissionName, hp.parent_id, hp.sort
FROM hrms_role_permission rp
LEFT JOIN hrms_permission hp
ON hp.id=rp.permission_id
WHERE rp.role_id IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
</select>
<select id="queryPermissionsByIds" resultType="com.daqing.framework.domain.hrms.PermissionEntity">
select * from hrms_permission
where id in
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
</select>
</mapper> </mapper>

@ -81,5 +81,20 @@
p.id != #{id} p.id != #{id}
</select> </select>
<select id="listPositionIdAndName" resultType="com.daqing.framework.domain.hrms.ext.PositionVO">
SELECT id,name FROM hrms_position
</select>
<select id="listPositionIdAndNameByDeptId" resultType="com.daqing.framework.domain.hrms.ext.PositionVO" parameterType="long">
SELECT p.id id,p.name name
FROM hrms_position p
LEFT JOIN hrms_dept_position dp
ON p.id = dp.position_id
LEFT JOIN hrms_dept d
ON d.id = dp.dept_id
WHERE d.id IN
<foreach collection="deptIds" open="(" separator="," close=")" item="deptId">
#{deptId}
</foreach>
</select>
</mapper> </mapper>

@ -12,5 +12,8 @@
<result property="motifyTime" column="motify_time"/> <result property="motifyTime" column="motify_time"/>
</resultMap> </resultMap>
<select id="listRoleIdAndName" resultType="com.daqing.framework.domain.hrms.ext.RoleVO">
SELECT id,name FROM hrms_role
</select>
</mapper> </mapper>

@ -9,6 +9,13 @@
<result property="roleId" column="role_id"/> <result property="roleId" column="role_id"/>
<result property="permissionId" column="permission_id"/> <result property="permissionId" column="permission_id"/>
</resultMap> </resultMap>
<select id="queryPermissionsByRoleIds" resultType="com.daqing.framework.domain.hrms.RolePermissionEntity">
select permission_id from hrms_role_permission
where role_id in
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
</select>
</mapper> </mapper>

@ -21,5 +21,37 @@
<result property="motifyTime" column="motify_time"/> <result property="motifyTime" column="motify_time"/>
</resultMap> </resultMap>
<select id="getPasswordById" parameterType="long" resultType="string">
SELECT password FROM hrms_user WHERE del_or_not = 0 AND id = #{id}
</select>
<select id="getAccountById" parameterType="long" resultType="string">
SELECT account FROM hrms_user WHERE del_or_not = 0 AND id = #{id}
</select>
<update id="updatePassword">
UPDATE hrms_user SET password = #{password} WHERE id = #{id}
</update>
<select id="getPhoneAccount" parameterType="long" resultType="string">
SELECT phone_account FROM hrms_user WHERE del_or_not = 0 AND id = #{id}
</select>
<update id="updatePhoneAccount">
UPDATE hrms_user SET phone_account = #{phoneAccount} WHERE id = #{id}
</update>
<update id="updateWeChat">
UPDATE hrms_user SET wechat_id = #{weChatId} WHERE id = #{id}
</update>
<select id="getEmployeeIdByUserId" parameterType="long" resultType="long">
SELECT e.id id
FROM hrms_employee e
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE del_or_not = 0
AND u.id = #{userId}
</select>
</mapper> </mapper>

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module version="4"> <module version="4">
<component name="ExternalSystem" externalSystem="Maven" />
<component name="FacetManager"> <component name="FacetManager">
<facet type="Spring" name="Spring"> <facet type="Spring" name="Spring">
<configuration /> <configuration />
@ -11,154 +10,4 @@
</configuration> </configuration>
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.17" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.0.7.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.0.7.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-generator:3.0.7.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.0.7.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.0.7.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.0.7.1" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.3" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.7.0" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.13" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.13" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.5" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.7.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.7.0" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.6.14" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.7.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.7.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.7.0" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.3" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.7.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.28" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.24" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.24" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.24" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.17.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.9.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:24.0-jre" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-compat-qual:2.0.0" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.1.3" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.14" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-nacos-discovery:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.1.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.1.1" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.1.1" level="project" />
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.1.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-ribbon:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.60" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.60" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.1.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon:2.3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.ribbon:ribbon-transport:2.3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty-contexts:0.4.9" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty-servo:0.4.9" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.hystrix:hystrix-core:1.4.3" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.inject:javax.inject:1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty:0.4.9" level="project" />
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-core:2.3.0" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-httpclient:2.3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.httpcomponents:httpclient:4.2.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.httpcomponents:httpcore:4.2.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-client:1.19.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-core:1.19.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.ws.rs:jsr311-api:1.1.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey.contribs:jersey-apache-client4:1.19.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.servo:servo-core:0.10.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.servo:servo-internal:0.10.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-commons-util:0.1.1" level="project" />
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-loadbalancer:2.3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-statistics:0.1.1" level="project" />
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.2.0" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-nacos-config:2.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.auth0:java-jwt:3.3.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.70" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.1.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.1.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.1.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.1.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.38.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.38.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.38.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.38.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.38.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.38.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.2.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.2" level="project" />
</component>
</module> </module>

@ -98,9 +98,9 @@ public class PromptSuccess {
public static final String DB_B_NAME = "担保部B角"; // 担保部B角 public static final String DB_B_NAME = "担保部B角"; // 担保部B角
public static final String PERSONAL_START_CODE = "DQCZ-0001"; public static final String PERSONAL_START_CODE = "DQCZ-0000";
public static final String COMPANY_START_CODE = "DQCQ-0001"; public static final String COMPANY_START_CODE = "DQCQ-0000";
public static final String PERSONAL_CODE = "DQCZ-"; public static final String PERSONAL_CODE = "DQCZ-";

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

Loading…
Cancel
Save