Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dq-financial-crms/pom.xml
#	dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
#	dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgEfficiencyService.java
master
shijie 4 years ago
commit a6a938e6cd
  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. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java
  13. 18
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  14. 2
      dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml
  15. BIN
      dq-financial-crms/target/classes/META-INF/dq-financial-crms.kotlin_module
  16. 81
      dq-financial-crms/target/classes/bootstrap.properties
  17. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/DqFinancialCrmsApplication.class
  18. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/CorsConfig.class
  19. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/IPageConfig.class
  20. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/controller/CustomerController.class
  21. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CompanyCustomerDao.class
  22. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CustomerDao.class
  23. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/feign/HrmsFeignService.class
  24. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/CustomerService.class
  25. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/impl/CustomerServiceImpl.class
  26. 58
      dq-financial-crms/target/classes/mapper/crms/CompanyCustomerDao.xml
  27. 9
      dq-financial-crms/target/classes/mapper/crms/CustomerDao.xml
  28. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  29. 158
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
  30. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgStatisticsController.java
  31. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java
  32. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEfficiencyMapper.java
  33. 12
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgStatisticsRequest.java
  34. 30
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PersonalEfficiencyListRequest.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. 22
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/NumResponse.java
  39. 12
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java
  40. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java
  41. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgEfficiencyService.java
  42. 55
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  43. 37
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java
  44. 112
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgStatisticsServiceImpl.java
  45. 71
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/R.java
  46. 13
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ResultCode.java
  47. 36
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/TaskNodeUtil.java
  48. 22
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml
  49. 10
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEfficiencyMapper.xml
  50. 6
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgStatisticsMapper.xml
  51. 70
      dq-financial-hrms-auth/target/classes/bootstrap.properties
  52. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/aspect/Operation.class
  53. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/aspect/SysLogAspect.class
  54. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/controller/UserLoginController.class
  55. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/dao/LoginLogMapper.class
  56. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/dao/SystemLogMapper.class
  57. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/dao/UserLoginDao.class
  58. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/LoginLogService.class
  59. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/UserLoginService.class
  60. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.class
  61. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.class
  62. BIN
      dq-financial-hrms-auth/target/classes/com/daqing/financial/hrauth/util/IpUtils.class
  63. 41
      dq-financial-hrms-auth/target/classes/mapper/hrmsauth/UserLoginMapper.xml
  64. 8
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java
  65. 3
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/DeptDao.java
  66. 3
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java
  67. 13
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java
  68. 42
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  69. 4
      dq-financial-hrms/src/main/resources/mapper/hrms/DeptDao.xml
  70. 76
      dq-financial-hrms/target/classes/bootstrap.properties
  71. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/DqFinancialHrmsApplication.class
  72. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/config/CorsConfig.class
  73. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/config/IPageConfig.class
  74. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/DeptController.class
  75. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/EmployeeController.class
  76. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PermissionController.class
  77. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PositionController.class
  78. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/UserController.class
  79. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/DeptDao.class
  80. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/EmployeeDao.class
  81. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/PermissionDao.class
  82. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/PositionDao.class
  83. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/RoleDao.class
  84. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/RolePermissionDao.class
  85. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/UserDao.class
  86. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/DeptService.class
  87. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/EmployeeService.class
  88. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/PermissionService.class
  89. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/PositionService.class
  90. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/UserService.class
  91. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/DeptServiceImpl.class
  92. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.class
  93. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/PermissionServiceImpl.class
  94. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/PositionServiceImpl.class
  95. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/UserServiceImpl.class
  96. 50
      dq-financial-hrms/target/classes/mapper/hrms/DeptDao.xml
  97. 546
      dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml
  98. 18
      dq-financial-hrms/target/classes/mapper/hrms/PermissionDao.xml
  99. 15
      dq-financial-hrms/target/classes/mapper/hrms/PositionDao.xml
  100. 3
      dq-financial-hrms/target/classes/mapper/hrms/RoleDao.xml
  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" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="dq-financial-crms-auth" />
<module name="dq-framework-common" />
<module name="dq-financial-crms" />
<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-financial-crms-auth" />
<module name="dq-financial-guarantee" />
<module name="dq-financial-hrms" />
<module name="dq-framework-model" />
<module name="dq-financial-hrms-auth" />
<module name="dq-financial-api" />
<module name="dq-financial-guarantee" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<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-crms" 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/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-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-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-utils" 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/src/main/java" charset="UTF-8" />

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

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

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

@ -33,7 +33,7 @@
<!-- 根据客户基本信息id查询企业类型客户的信息 -->
<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
WHERE customer_id = #{id}
</select>

@ -1,7 +1,8 @@
# 开发和测试环境(dev)
#服务名称
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.group=prod
@ -15,4 +16,80 @@ spring.cloud.nacos.config.ext-config[1].refresh=true
spring.cloud.nacos.config.ext-config[2].data-id=other.yml
spring.cloud.nacos.config.ext-config[2].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true
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

@ -5,18 +5,31 @@
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.crms.CompanyCustomerEntity" id="companyCustomerMap">
<result property="id" column="id"/>
<result property="registeredCapital" column="registered_capital"/>
<result property="industry" column="industry"/>
<result property="years" column="years"/>
<result property="region" column="region"/>
<result property="shareholder" column="shareholder"/>
<result property="affiliatedCompany" column="affiliated_company"/>
<result property="empNum" column="emp_num"/>
<result property="linkman" column="linkman"/>
<result property="businessSource" column="business_source"/>
<result property="customerId" column="customer_id"/>
</resultMap>
<result property="id" column="id"/>
<result property="registeredCapital" column="registered_capital"/>
<result property="socialUnifiedCode" column="social_unified_code"/>
<result property="industry" column="industry"/>
<result property="years" column="years"/>
<result property="region" column="region"/>
<result property="shareholder" column="shareholder"/>
<result property="affiliatedCompany" column="affiliated_company"/>
<result property="empNum" column="emp_num"/>
<result property="linkman" column="linkman"/>
<result property="linkPhone" column="link_phone"/>
<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"/>
</resultMap>
<!-- 根据客户基本信息id查询企业类型客户的信息 -->
<select id="queryCompanyCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
@ -41,4 +54,25 @@
WHERE customer_id = #{customerId}
</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>

@ -90,4 +90,13 @@
WHERE del_or_not = 0;
</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>

@ -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.IDgApplyAmountListService;
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.hrms.UserEntity;
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();
}
}

@ -3,18 +3,26 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.excel.EasyExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 流程效率
@ -59,4 +67,154 @@ public class DgEfficiencyController {
List result = dgEfficiencyService.notice();
return ResponseResult.SUCCESS(result);
}
@ApiOperation(value = "个人效率记录列表 ")
@PostMapping("/personalEfficiencyList")
public ResponseResult personalEfficiencyList(
@ApiParam(name = "personalEfficiencyListRequest", value = "个人效率列表查询对象")
@RequestBody PersonalEfficiencyListRequest personalEfficiencyListRequest){
List<PersonalEfficiencyListResponse> responseList = dgEfficiencyService.queryPersonalEfficiencyList();
if(responseList.size()>0){
List<Integer> arr = new ArrayList<>();
for (PersonalEfficiencyListResponse res : responseList) {
arr.add(res.getApplicantId());
}
//根据提单人id查询其部门名称
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr);
List<LinkedHashMap> employeeMessage = null;
if(responseResult.getData() != null){
employeeMessage = (List<LinkedHashMap>) responseResult.getData();
}
for (PersonalEfficiencyListResponse response:responseList) {
for(LinkedHashMap res : employeeMessage){
if(response.getApplicantId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值
response.setApplicant(JSONObject.toJSONString(res.get("account")).replace("\"",""));
}
}
}
}
//根据条件筛选数据
if (personalEfficiencyListRequest.getOperatingStatus()!=null){
// 已发起
if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)){
responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)).collect(Collectors.toList());
// 待处理
}else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)){
responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)).collect(Collectors.toList());
// 已处理
}else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){
responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)).collect(Collectors.toList());
}
}
// 时间筛选(固定时间)
if (personalEfficiencyListRequest.getCreateFixedTime() != null && personalEfficiencyListRequest.getStartTime() == null && personalEfficiencyListRequest.getEndTime() == null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
switch (personalEfficiencyListRequest.getCreateFixedTime()) {
case 0:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getDayBegin()));
personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getDayEnd()));// 今天
break;
case 1:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfYesterday()));
personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfYesterDay()));// 昨天
break;
case 2:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfWeek()));
personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfWeek()));// 本周
break;
case 3:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfMonth()));
personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfMonth()));// 本月
break;
case 4:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfYear()));
personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfYear()));// 本年
break;
default:
personalEfficiencyListRequest.setStartTime(null);
personalEfficiencyListRequest.setEndTime(null);
}
//获取毫秒数
long longStart = getLongDate(personalEfficiencyListRequest.getStartTime());
long longEnd = getLongDate(personalEfficiencyListRequest.getEndTime());
//迭代器进行筛选
Iterator<PersonalEfficiencyListResponse> iterator = responseList.iterator();
while (iterator.hasNext()){
PersonalEfficiencyListResponse next = iterator.next();
String applicationDate = next.getApplicationDate();
long longDate = getLongDate(applicationDate);
//当前日期小于开始日期或当前日期大于结束日期,删除该元素
if (longDate<longStart||longDate>longEnd){
iterator.remove();
}
}
}
//转换任务节点,并统计操作状态个数
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){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = sdf.parse(stringDate);
return date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
return 0L;
}
@ApiOperation(value = "个人效率记录列表导出")
@GetMapping("/personalEfficiencyListExport")
public void personalEfficiencyListExport(HttpServletResponse httpServletResponse){
List<PersonalEfficiencyListResponse> responseList = dgEfficiencyService.queryPersonalEfficiencyList();
if(responseList.size()>0){
List<Integer> arr = new ArrayList<>();
for (PersonalEfficiencyListResponse res : responseList) {
arr.add(res.getApplicantId());
}
//根据提单人id查询其部门名称
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr);
List<LinkedHashMap> employeeMessage = null;
if(responseResult.getData() != null){
employeeMessage = (List<LinkedHashMap>) responseResult.getData();
}
for (PersonalEfficiencyListResponse response:responseList) {
for(LinkedHashMap res : employeeMessage){
if(response.getApplicantId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值
response.setApplicant(JSONObject.toJSONString(res.get("account")).replace("\"",""));
}
}
}
}
try {
EasyExcelUtil.download(httpServletResponse,PersonalEfficiencyListResponse.class,responseList,"个人效率记录列表","第一页");
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletResponse;
*/
@RestController
@RequestMapping("/guarantee/statistics")
@Api(value = "担保业务统计",tags = "提供业务统计增删改查的方法")
@Api(value = "担保业务统计", tags = "提供业务统计增删改查的方法")
public class DgStatisticsController {
@Autowired
@ -33,18 +33,18 @@ public class DgStatisticsController {
* 列表
*/
@GetMapping("/list")
@ApiOperation(value = "业务统计列表",notes = "业务统计列表",response = DgStatisticsListResponse.class)
@ApiOperation(value = "业务统计列表", notes = "业务统计列表", response = DgStatisticsListResponse.class)
public ResponseResult list(@RequestParam("page") Integer page,
@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")
public ResponseResult excelExport(HttpServletResponse response){
public ResponseResult excelExport(HttpServletResponse response) {
Boolean result = iDgStatisticsService.excelExport(response);
@ -55,18 +55,18 @@ public class DgStatisticsController {
* 拒绝列表
*/
@GetMapping("/listRefuse")
@ApiOperation(value = "业务统计拒绝列表",notes = "业务统计拒绝列表",response = DgStatisticsListRefuseResponse.class)
@ApiOperation(value = "业务统计拒绝列表", notes = "业务统计拒绝列表", response = DgStatisticsListRefuseResponse.class)
public ResponseResult listRefuse(@RequestParam("page") Integer page,
@RequestParam("size") Integer size, DgStatisticsRequest dgStatisticsRequest) {
return ResponseResult.SUCCESS(iDgStatisticsService.listRefuse(page,size,dgStatisticsRequest));
@RequestParam("size") Integer size, DgStatisticsRequest dgStatisticsRequest) {
return ResponseResult.SUCCESS(iDgStatisticsService.listRefuse(page, size, dgStatisticsRequest));
}
/**
* 拒绝列表导出
*/
@ApiOperation(value = "统计拒绝列表导出",notes = "统计拒绝列表导出")
@ApiOperation(value = "统计拒绝列表导出", notes = "统计拒绝列表导出")
@GetMapping("/excelExportRefuse")
public ResponseResult excelExportRefuse(HttpServletResponse response){
public ResponseResult excelExportRefuse(HttpServletResponse 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.DgApplyAmountInfoResponse;
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.Param;
@ -30,7 +31,7 @@ public interface DgApplyAmountInfoMapper extends BaseMapper<DgApplyAmountInfo> {
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 java.util.List;
import java.util.Map;
/**
* @auther River
@ -19,4 +20,6 @@ public interface DgEfficiencyMapper extends BaseMapper<DgApplyAmountInfo> {
List<DgTeamEfficiencyPO> queryList(@Param("et") DgEfficiencyTeamRequest dgEfficiencyTeamRequest);
List<Integer> queryBusinessId(@Param("et") DgEfficiencyTeamRequest dgEfficiencyTeamRequest);
Map<String, Integer> getBusinessCount();
}

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

@ -0,0 +1,30 @@
package com.daqing.financial.guarantee.model.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
/**
* @Author chen
* @DATE 2020/12/31 15:35
* @Version 1.0
*/
@Data
@ToString
public class PersonalEfficiencyListRequest {
@ApiModelProperty("申请时间,固定类型,0:今天,1:昨天,2:本周,3:本月,4:本年")
private Integer createFixedTime;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("起始时间")
private String startTime;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("操作状态")
private Integer operatingStatus;
}

@ -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)
private String applyTime;
@ApiModelProperty("创建时间")
@ApiModelProperty("申请日期")
@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;
@ApiModelProperty("拒绝人")
@ExcelProperty(value = "当前审批人",index = 7)
private String empName;
private String refuseName;
@ApiModelProperty("节点状态")
@ApiModelProperty("拒绝节点id")
@ExcelProperty(value = "任务节点",index = 8)
private String status;
private Integer processId;
@ApiModelProperty("拒绝时间")
@ExcelProperty(value = "任务分配时间",index = 9)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date dateTime;
@ExcelProperty(value = "拒绝时间",index = 9)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date refuseTime;
@ApiModelProperty("拒绝原因")
@ExcelProperty(value = "拒绝原因",index = 10)
private String remark;
private String refuseOpinion;
@ApiModelProperty("提单人姓名")
@ExcelProperty(value = "提单人",index = 11)

@ -0,0 +1,22 @@
package com.daqing.financial.guarantee.model.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author chen
* @DATE 2021/1/5 11:32
* @Version 1.0
*/
@Data
public class NumResponse {
@ApiModelProperty("发起数")
private Integer initiateNum = 0;
@ApiModelProperty("待处理数")
private Integer pendingNum = 0;
@ApiModelProperty("已处理数 ")
private Integer processedNum = 0;
}

@ -1,9 +1,11 @@
package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.daqing.framework.utils.excel.ApprovalStatusConverter;
import com.daqing.framework.utils.excel.BusinessStatusConverter;
import com.daqing.framework.utils.excel.OperatingStatusConverter;
import com.daqing.framework.utils.excel.TaskNodeConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -18,6 +20,14 @@ import java.util.Date;
@Data
public class PersonalEfficiencyListResponse {
@ExcelIgnore
@ApiModelProperty(value = " 业务id")
private Integer businessId;
@ExcelIgnore
@ApiModelProperty(value = "提单人")
private Integer applicantId;
@ApiModelProperty(value = "提单人")
@ExcelProperty(value = "提单人",index = 1)
private String applicant;
@ -44,7 +54,7 @@ public class PersonalEfficiencyListResponse {
private Double taskNode;
@ApiModelProperty("审批状态")
@ExcelProperty(value = "审状态",index = 7,converter = ApprovalStatusConverter.class)
@ExcelProperty(value = "审状态",index = 7,converter = ApprovalStatusConverter.class)
private Integer approveStatus;
@ApiModelProperty("业务状态")

@ -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.response.BusinessApplicationDetailResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgApplyField;
import com.daqing.framework.utils.PageUtils;
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);
String getRoles();
DgApplyField queryApplyField();
Boolean updateApplyField(DgApplyField dgApplyField);
}

@ -16,7 +16,10 @@ import java.util.Map;
public interface IDgEfficiencyService extends IService<DgApplyAmountInfo> {
Map approvalNum();
HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest);
List notice();
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.mapper.*;
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.util.ArraysUtil;
import com.daqing.financial.guarantee.util.AuditProcessUtil;
@ -37,7 +40,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -50,7 +52,8 @@ import java.util.*;
*/
@Slf4j
@Service
public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoMapper, DgApplyAmountInfo> implements IDgApplyAmountInfoService {
public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoMapper, DgApplyAmountInfo>
implements IDgApplyAmountInfoService {
@Resource
private DgApplyAmountInfoMapper dgApplyAmountInfoMapper;
@ -92,6 +95,27 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
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
@Transactional
public int businessApplication(BusinessApplicationRequest businessApplication) {
@ -120,30 +144,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setCustomerType(businessApplication.getCustomerType());//客户类型
//设置业务编号,查询今天是否申请过业务
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);
dgApplyAmountInfo.setBusinessCode(RandomUtil.getRandomNum(12));
dgApplyAmountInfoMapper.insert(dgApplyAmountInfo);

@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO;
import java.text.SimpleDateFormat;
import java.util.*;
@ -33,6 +34,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
@Autowired
private DgApplyAmountInfoController dgApplyAmountInfoController;
@Autowired
private DgAuditProcessMapper dgAuditProcessMapper;
@ -63,8 +65,9 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
public HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest) {
// 时间筛选(固定时间)
if (dgEfficiencyTeamRequest.getCreateFixedTime() != null && dgEfficiencyTeamRequest.getStartTime() == null &&
dgEfficiencyTeamRequest.getEndTime() == null) {
if (dgEfficiencyTeamRequest.getCreateFixedTime() != null && (dgEfficiencyTeamRequest.getStartTime() == null ||
dgEfficiencyTeamRequest.getStartTime().length() == 0) && (dgEfficiencyTeamRequest.getEndTime() == null ||
dgEfficiencyTeamRequest.getEndTime().length() == 0)) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
switch (dgEfficiencyTeamRequest.getCreateFixedTime()) {
case 0:
@ -123,7 +126,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
time = DateUtils.dateDiff(dgTeamEfficiencyList.get(i - 1).getCreateTime(), dgTeamEfficiencyList.get(i).getCreateTime()) + "";
processId = dgTeamEfficiencyList.get(i).getProcessId();
departmentIdList = dgTeamEfficiencyList.get(i).getDepartmentId();
map.put(processId, time + "(1)");
map.put(processId, time + ",1");
String[] departmentIds = departmentIdList.split(",");
for (String departmentId : departmentIds) {
// 没有当前部门的数据,直接新建一个
@ -133,15 +136,14 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 有当前部门数据,则再判断是否有当前节点数据
HashMap<Integer, String> existMap = hashMap.get(Integer.parseInt(departmentId));
if (existMap.get(processId) == null) {
existMap.put(processId, time + "(1)");
existMap.put(processId, time + ",1");
} else {
// 计算当前部门在当前节点的操作次数
int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf("(") + 1,
existMap.get(processId).indexOf(")"))) + 1;
int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf(",") + 1)) + 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);
}
@ -157,8 +159,19 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
return hashMap;
}
}
/**
* 统计不同业务状态下业务数量
*/
@Override
public Map<String, Integer> getBusinessCount() {
return this.getBaseMapper().getBusinessCount();
}
/**
* 查询审批数目的值的数组
*
* @return
*/
@Override
@ -166,12 +179,12 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
//获取当前用户id
String userId = dgApplyAmountInfoController.getUserId();
//近十天的日期数组
List<String>timeList = dgAuditProcessMapper.selectTenDays(Integer.parseInt(userId));
List<String> timeList = dgAuditProcessMapper.selectTenDays(Integer.parseInt(userId));
//近十天审批数目的值的数组
List<Integer>approvalList = dgAuditProcessMapper.selectApprovalNum(Integer.parseInt(userId));
List<Integer> approvalList = dgAuditProcessMapper.selectApprovalNum(Integer.parseInt(userId));
Map map = new HashMap();
map.put("timeArr",timeList);
map.put("approvalNumArr",approvalList);
map.put("timeArr", timeList);
map.put("approvalNumArr", approvalList);
return map;
}

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgStatisticsMapper;
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.DgStatisticsListResponse;
import com.daqing.financial.guarantee.service.IDgStatisticsService;
@ -51,7 +53,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
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");
switch (dgStatisticsRequest.getCreateFixedTime()) {
case 0:
@ -79,50 +82,12 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
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);
List<DgStatisticsPO> dgStatisticsPOList = iPage.getRecords();
if (dgStatisticsPOList == 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
Integer[] presenterIds = dgStatisticsPOList.stream().map(DgStatisticsPO::getPresenterId).toArray(Integer[]::new);
if (presenterIds.length != 0) {
@ -167,8 +132,25 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
if (empAndDeptList.getData() != null) {
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 {
ExcelUtil.writeExcelWithSheets(response, listResponse, "业务统计信息一览表", "statistics", new DgStatisticsListResponse())
ExcelUtil.writeExcelWithSheets(response, excelResponse, "业务统计信息一览表", "statistics", new DgStatisticsExcelResponse())
.finish();
} catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
@ -191,7 +173,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
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");
switch (dgStatisticsRequest.getCreateFixedTime()) {
case 0:
@ -219,12 +202,6 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
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);
List<DgStatisticsRefusePO> dgStatisticsRefusePOList = iPage.getRecords();
@ -232,7 +209,7 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
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());
if (result.getData() == null || result.getData().size() == 0) {
return null;
@ -251,18 +228,7 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
}
iPage.setTotal(dgStatisticsRefusePOList.size());
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
Integer[] presenterIds = dgStatisticsRefusePOList.stream().map(DgStatisticsRefusePO::getPresenterId).toArray(Integer[]::new);
if (presenterIds.length != 0) {
@ -308,18 +274,34 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
if (empAndDeptList.getData() != null) {
// 提单人姓名、部门拼装
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 {
ExcelUtil.writeExcelWithSheets(response, listResponse, "业务统计拒绝信息一览表", "statisticsRefuse", new DgStatisticsListRefuseResponse())
ExcelUtil.writeExcelWithSheets(response, excelResponse, "业务统计拒绝信息一览表", "statisticsRefuse", new DgStatisticsExcelRefuseResponse())
.finish();
} catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
}
return true;
} else {
return false;
}
return false;
} else {
return false;
}
return false;
}
private List<DgStatisticsListResponse> jointStatistics(List<DgStatisticsPO> dgStatisticsPOList, List<EmployeeTO> empAndDeptList) {

@ -0,0 +1,71 @@
package com.daqing.financial.guarantee.util;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author chen
* @DATE 2021/1/5 11:43
* @Version 1.0
*/
@Data
public class R {
@ApiModelProperty(value = " 是否成功")
private Boolean success;
@ApiModelProperty(value = "返回码")
private Integer code;
@ApiModelProperty(value = "返回消息")
private String message;
@ApiModelProperty(value = "返回数据")
private Map<String, Object> data = new HashMap<String, Object>();
private R(){}
public static R ok(){
R r = new R();
r.setSuccess(true);
r.setCode(ResultCode.SUCCESS);
r.setMessage(ResultCode.SUCCESS_MESSAGE);
return r;
}
public static R error(){
R r = new R();
r.setSuccess(false);
r.setCode(ResultCode.FAILURE);
r.setMessage(ResultCode.FAILURE_MESSAGE);
return r;
}
public R success(Boolean success){
this.setSuccess(success);
return this;
}
public R message(String message){
this.setMessage(message);
return this;
}
public R code(Integer code){
this.setCode(code);
return this;
}
public R data(String key, Object value){
this.data.put(key, value);
return this;
}
public R data(Map<String, Object> map){
this.setData(map);
return this;
}
}

@ -0,0 +1,13 @@
package com.daqing.financial.guarantee.util;
/**
* @Author chen
* @DATE 2021/1/5 11:43
* @Version 1.0
*/
public interface ResultCode {
Integer SUCCESS = 10000;// 成功
Integer FAILURE = 20000;//失败
String SUCCESS_MESSAGE = "成功";
String FAILURE_MESSAGE = "失败";
}

@ -0,0 +1,36 @@
package com.daqing.financial.guarantee.util;
/**
* @Author chen
* @DATE 2021/1/4 9:38
* @Version 1.0
*/
public class TaskNodeUtil {
public static String converter(String taskNode){
switch (taskNode){
case "1":
return "业务申请";
case "2":
return "担保部调查";
case "3":
return "资产部调查";
case "4":
return "信息部调查";
case "5":
return "合规调查";
case "6":
return "工作会";
case "7":
return "贷审会";
case "8":
return "担保函";
case "9":
return "回款确认";
case "10":
return "放款通知";
default:
return "";
}
}
}

@ -60,15 +60,21 @@
</foreach>
</select>
<select id="selectBusinessTaday" parameterType="java.lang.String" resultType="java.lang.Integer">
select count(0) from dg_apply_amount_info where create_time LIKE CONCAT('%',#{dateTime},'%')
<select id="queryApplyField" resultType="com.daqing.framework.domain.guarantee.DgApplyField">
SELECT * FROM dg_apply_field
</select>
<select id="selectMaxBusinessTaday" parameterType="java.lang.String" resultType="java.lang.String">
select business_code
from dg_apply_amount_info
where create_time LIKE CONCAT('%',#{dateTime},'%')
order by id desc limit 1
</select>
<update id="updateApplyField" parameterType="com.daqing.framework.domain.guarantee.DgApplyField">
UPDATE dg_apply_field SET
customer_type = #{af.customerType},customer_code = #{af.customerCode},customer_name = #{af.customerName},customer_unicode = #{af.customerUnicode},customer_phone = #{af.customerPhone},register_time = #{af.registerTime},
register_fund =#{af.registerFund},register_addr = #{af.registerAddr},employee_number = #{af.employeeNumber},business_addr = #{af.businessAddr},business_type = #{af.businessType},business_scope = #{af.businessScope},
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},
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>

@ -43,4 +43,14 @@
ORDER BY p.create_time ASC
</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>

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

@ -1,8 +1,7 @@
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
# 开发和测试环境(dev)
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.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].refresh=true
spring.redis.host=192.168.232.128
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=
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
#正式环境(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));
}
/**
* 获取所有的部门id和名称(用户团队效率的部门筛选)
*/
@GetMapping("/listDepartment")
public ResponseResult listDepartment(){
return ResponseResult.SUCCESS(deptService.listDepartment());
}
/**
* 根据员工id获取对应部门下所有的客户经理
*/

@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
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> 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 java.util.List;
import java.util.Map;
/**
* 记录部门信息
@ -37,5 +38,7 @@ public interface DeptService extends IService<DeptEntity> {
List<EmployeeVO> listEmployeeByDeptId(Long deptId);
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 javax.annotation.Resource;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@ -255,6 +252,14 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
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) {
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.ext.*;
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.RolePermissionResponse;
import com.daqing.framework.exception.ExceptionCast;
@ -402,7 +403,46 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
public Boolean excelExport(HttpServletResponse response) {
try {
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();
return true;
} catch (Exception e) {

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

@ -1,7 +1,7 @@
#服务名称
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.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].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.port=6379
#spring.redis.password=123456
#spring.redis.password=
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8

@ -19,7 +19,13 @@
</select>
<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 id="getByPositionId" resultType="com.daqing.framework.domain.hrms.DeptEntity">
SELECT
@ -41,4 +47,46 @@
FROM hrms_dept WHERE parent_id = #{parentId}
</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>

@ -3,7 +3,7 @@
<mapper namespace="com.daqing.financial.hrms.dao.EmployeeDao">
<!-- 可根据自己的需求,是否要使用 -->
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.EmployeeEntity" id="employeeMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
@ -18,8 +18,123 @@
<result property="headPortaritUrl" column="head_portarit_url"/>
<result property="userId" column="user_id"/>
</resultMap>
<resultMap type="com.daqing.framework.domain.hrms.ext.EmployeeTO" id="employeeTO">
<!-- 不含部门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">
<id property="id" column="eid"/>
<result property="empName" column="emp_name"/>
<collection property="deptNames" ofType="string">
@ -69,6 +184,50 @@
AND d.id = #{id}
</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 -->
<select id="listEmployeeName" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT e.id id,e.name name
@ -89,13 +248,382 @@
LEFT JOIN hrms_employee_position ep ON e.id = ep.emp_id
LEFT JOIN hrms_position p ON p.id = ep.position_id
<where>
<if test="employee.name != null and employee.name != ''">
e.`name` LIKE CONCAT('%',#{employee.name},'%')
<if test="employee.name != null and employee.name != ''">
e.`name` LIKE CONCAT('%',#{employee.name},'%')
</if>
<if test="employee.jobNumber != null and employee.jobNumber != ''">
AND e.job_number = #{employee.jobNumber}
</if>
AND u.del_or_not = 0
</where>
</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.jobNumber != null and employee.jobNumber != ''">
AND e.job_number = #{employee.jobNumber}
<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>
AND u.del_or_not = 0
</where>
</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>

@ -9,6 +9,7 @@
<result property="code" column="code"/>
<result property="name" column="name"/>
<result property="url" column="url"/>
<result property="menuUrl" column="menu_url"/>
<result property="parentId" column="parent_id"/>
<result property="level" column="level"/>
<result property="menuOrNot" column="menu_or_not"/>
@ -19,5 +20,22 @@
<result property="motifyTime" column="motify_time"/>
</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>

@ -81,5 +81,20 @@
p.id != #{id}
</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>

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

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

Loading…
Cancel
Save