Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dq-financial-crms/src/main/resources/bootstrap.properties
#	dq-financial-guarantee/src/main/resources/bootstrap.properties
#	dq-financial-hrms-auth/src/main/resources/bootstrap.properties
#	dq-financial-hrms/src/main/resources/bootstrap.properties
#	dq-govern-gateway/src/main/resources/bootstrap.properties
master
river 4 years ago
commit f44e278b10
  1. 6
      dq-financial-crms/pom.xml
  2. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/DqFinancialCrmsApplication.java
  3. 26
      dq-financial-crms/src/main/java/com/daqing/financial/crms/config/IPageConfig.java
  4. 6
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java
  5. 7
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCustomerRelatedController.java
  6. 9
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java
  7. 8
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerWorkbenchController.java
  8. 6
      dq-financial-guarantee/pom.xml
  9. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/DqFinancialGuaranteeApplication.java
  10. 36
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/config/IPageConfig.java
  11. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java
  12. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java
  13. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  14. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java
  15. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgComplianceInvestigationController.java
  16. 37
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyForController.java
  17. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java
  18. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
  19. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgFormDesignController.java
  20. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java
  21. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java
  22. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanCommitteeConsiderController.java
  23. 14
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java
  24. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgMessageInvestigationController.java
  25. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java
  26. 13
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java
  27. 9
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessUserController.java
  28. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgStatisticsController.java
  29. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgWorkConferenceConsiderController.java
  30. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java
  31. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java
  32. 112
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlRepaymentEntryListRes.java
  33. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java
  34. 46
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java
  35. 12
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
  36. 12
      dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml
  37. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/DqFinancialHrmsAuthApplication.java
  38. 96
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/annotation/Log.java
  39. 278
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/aspect/Operation.java
  40. 388
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/aspect/SysLogAspect.java
  41. 6
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/RolePermissionController.java
  42. 6
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/SystemLogController.java
  43. 19
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java
  44. 132
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/BusinessType.java
  45. 104
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/OperationType.java
  46. 118
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/OperationUnit.java
  47. 6
      dq-financial-hrms/pom.xml
  48. 7
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/DqFinancialHrmsApplication.java
  49. 26
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/config/IPageConfig.java
  50. 6
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  51. 12
      dq-framework-common/pom.xml
  52. 47
      dq-framework-common/src/main/java/com/daqing/framework/annotation/Log.java
  53. 129
      dq-framework-common/src/main/java/com/daqing/framework/aspect/Operation.java
  54. 185
      dq-framework-common/src/main/java/com/daqing/framework/aspect/SysLogAspect.java
  55. 66
      dq-framework-common/src/main/java/com/daqing/framework/enums/BusinessType.java
  56. 48
      dq-framework-common/src/main/java/com/daqing/framework/enums/Constants.java
  57. 52
      dq-framework-common/src/main/java/com/daqing/framework/enums/OperationType.java
  58. 59
      dq-framework-common/src/main/java/com/daqing/framework/enums/OperationUnit.java
  59. 22
      dq-framework-common/src/main/java/com/daqing/framework/feign/HrauthFeignService.java
  60. 21
      dq-framework-common/src/main/java/com/daqing/framework/feign/HrmsFeignService.java
  61. 73
      dq-framework-common/src/main/java/com/daqing/framework/model/EmployeeEntity.java
  62. 105
      dq-framework-common/src/main/java/com/daqing/framework/model/SystemLog.java
  63. 102
      dq-framework-common/src/main/java/com/daqing/framework/model/UserEntity.java
  64. 67
      dq-framework-common/src/main/java/com/daqing/framework/util/IpUtils.java
  65. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java
  66. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java
  67. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgBusinessCompany.java
  68. 4
      dq-govern-gateway/src/main/resources/jwt.properties

@ -21,12 +21,6 @@
<dependencies>
<dependency>
<groupId>com.daqing.financial</groupId>
<artifactId>dq-financial-hrms-auth</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.daqing.financial</groupId>
<artifactId>dq-financial-api</artifactId>

@ -6,7 +6,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
@EnableFeignClients(basePackages = "com.daqing.financial.crms.feign")
@EnableFeignClients({"com.daqing.framework.feign","com.daqing.financial.crms.feign"})
@EnableDiscoveryClient
@SpringBootApplication
@ComponentScan("com.daqing")

@ -1,13 +1,13 @@
//package com.daqing.financial.crms.config;
//
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class IPageConfig {
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// return new PaginationInterceptor();
// }
//}
package com.daqing.financial.crms.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class IPageConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -4,11 +4,11 @@ package com.daqing.financial.crms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.crms.service.ICrmsCompanyPersonalService;
import com.daqing.financial.crms.service.ICrmsCustomerRelatedService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.CrmsCompanyPersonal;
import com.daqing.framework.domain.crms.CrmsCustomerRelated;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;

@ -2,11 +2,10 @@ package com.daqing.financial.crms.controller;
import com.daqing.financial.crms.service.ICrmsCustomerRelatedService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.crms.CrmsCompanyPersonal;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.CrmsCustomerRelated;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -3,17 +3,14 @@ package com.daqing.financial.crms.controller;
import com.daqing.financial.crms.CustomerControllerApi;
import com.daqing.financial.crms.model.request.CompanyCustomerRequest;
import com.daqing.financial.crms.service.CustomerService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.crms.CompanyCustomerEntity;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.CustomerEntity;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTOI;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTOU;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTOI;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTOU;
import com.daqing.framework.domain.crms.request.CustomerRequest;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;

@ -3,15 +3,13 @@ package com.daqing.financial.crms.controller;
import com.daqing.financial.crms.CustomerWorkbenchControllerApi;
import com.daqing.financial.crms.model.request.CompanyCustomerRequest;
import com.daqing.financial.crms.service.CustomerWorkbenchService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTOI;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTOU;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTOI;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTOU;
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;

@ -20,12 +20,6 @@
</properties>
<dependencies>
<dependency>
<groupId>com.daqing.financial</groupId>
<artifactId>dq-financial-hrms-auth</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!--redis-->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -1,23 +1,21 @@
package com.daqing.financial.guarantee;
import com.daqing.financial.hrauth.config.SecurityConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableFeignClients(basePackages = "com.daqing.financial.guarantee.feign")
@EnableFeignClients({"com.daqing.framework.feign","com.daqing.financial.guarantee.feign"})
@EnableDiscoveryClient
@SpringBootApplication
@EnableScheduling
@EnableSwagger2
@ComponentScan(basePackages = "com.daqing")
@Import({SecurityConfig.class})
//@Import({SecurityConfig.class})
public class DqFinancialGuaranteeApplication {
public static void main(String[] args) {

@ -1,18 +1,18 @@
//package com.daqing.financial.guarantee.config;
//
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @auther River
// * @date 2020/11/5 14:38
// */
//
//@Configuration
//public class IPageConfig {
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// return new PaginationInterceptor();
// }
//}
package com.daqing.financial.guarantee.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @auther River
* @date 2020/11/5 14:38
*/
@Configuration
public class IPageConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -3,10 +3,9 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.response.AlInsuranceListRes;
import com.daqing.financial.guarantee.service.IAlInsuranceListService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.financial.hrauth.model.HrmsAccessRecordsLog;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;

@ -3,10 +3,10 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq;
import com.daqing.financial.guarantee.service.IAlRepaymentEntryService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.guarantee.AlRepaymentEntry;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;

@ -12,11 +12,11 @@ import com.daqing.financial.guarantee.model.response.BusinessApplicationExportRe
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.service.IDgApplyAmountListService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.DgApplyField;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.JwtUtils;

@ -4,9 +4,9 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.*;
import com.daqing.financial.guarantee.model.response.AssetsDetailResponse;
import com.daqing.financial.guarantee.service.IDgAssetsInvestigationService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;

@ -6,10 +6,9 @@ import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationReq
import com.daqing.financial.guarantee.model.response.DgComplianceInvestigationInfoResponse;
import com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse;
import com.daqing.financial.guarantee.service.IDgComplianceInvestigationService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.guarantee.DgComplianceInvestigation;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -1,18 +1,19 @@
package com.daqing.financial.guarantee.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.guarantee.model.request.CopySendRequest;
import com.daqing.financial.guarantee.service.IDgCopyForService;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.guarantee.DgCopyFor;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
@ -48,4 +49,26 @@ public class DgCopyForController {
}
}
@Log(detail = "抄送",level = 4,operationUnit = OperationUnit.COPYFOR,operationType = OperationType.SELECT)
@ApiOperation("查询抄送详情")
@GetMapping("/queryCopySendDetail")
public R queryCopySendDetail(Integer businessId, Integer processId, Integer status){
//审批状态已审核显示抄送按钮
if (status==2){
DgCopyFor one = copyForService.getOne(new QueryWrapper<DgCopyFor>().
eq("business_id", businessId).eq("process_id", processId));
//对象不存在,直接返回,不显示
if (ObjectUtil.isNull(one)) {
return R.ok().success(false);
}
String picUrl = one.getPicUrl();
//详情不存在,返回true,显示按钮
boolean exsit = StringUtils.isEmpty(picUrl);
return exsit ? R.ok() : R.ok().success(false);
}
//其他情况不显示抄送按钮
return R.ok().success(false);
}
}

@ -6,9 +6,9 @@ import com.daqing.financial.guarantee.model.response.CopyForMeResponse;
import com.daqing.financial.guarantee.service.IDgCopyUserService;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.guarantee.util.TaskNodeUtil;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@ -13,9 +13,9 @@ import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.financial.guarantee.util.DateUtils;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.guarantee.util.TaskNodeUtil;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.excel.EasyExcelUtil;

@ -3,9 +3,9 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.DgFormDesignRequest;
import com.daqing.financial.guarantee.model.response.DgFormDesignListResponse;
import com.daqing.financial.guarantee.service.IDgFormDesignService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -1,22 +1,14 @@
package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgGuaranteeAssignUserMapper;
import com.daqing.financial.guarantee.model.request.ApprovalGuaranteeRequest;
import com.daqing.financial.guarantee.model.request.GuaranteeRequest;
import com.daqing.financial.guarantee.model.request.InvestigateGuaranteeRequest;
import com.daqing.financial.guarantee.model.response.GuaranteeDetailResponse;
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
@ -26,9 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@ -5,12 +5,10 @@ import com.daqing.financial.guarantee.model.request.GuaranteeLetterQueryRequest;
import com.daqing.financial.guarantee.model.request.GuaranteeLetterUpdateStatusRequest;
import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse;
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.DateUtil;

@ -4,13 +4,11 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.DgLoanCommitteeConsiderRequest;
import com.daqing.financial.guarantee.model.response.DgLoanCommitteeConsiderResponse;
import com.daqing.financial.guarantee.service.IDgLoanCommitteeConsiderService;
import com.daqing.financial.guarantee.service.IDgLoanNoticeService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@ -2,20 +2,13 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.*;
import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse;
import com.daqing.financial.guarantee.model.response.LoanNoticeListResponse;
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService;
import com.daqing.financial.guarantee.service.IDgLoanNoticeService;
import com.daqing.financial.guarantee.service.impl.DgGuaranteeLetterAssignUserServiceImpl;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.DateUtil;
import com.daqing.framework.utils.NumberToCN;
import com.daqing.framework.utils.PageUtils;
import com.deepoove.poi.XWPFTemplate;
@ -28,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
/**

@ -2,12 +2,11 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.*;
import com.daqing.financial.guarantee.model.response.AssetsDetailResponse;
import com.daqing.financial.guarantee.model.response.MessageDetailResponse;
import com.daqing.financial.guarantee.service.IDgMessageInvestigationService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;

@ -5,11 +5,9 @@ import com.daqing.financial.guarantee.model.request.PaymentConfirmationQueryRequ
import com.daqing.financial.guarantee.model.request.PaymentConfirmationUpdateRequest;
import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResponse;
import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;

@ -1,29 +1,22 @@
package com.daqing.financial.guarantee.controller;
import com.alibaba.fastjson.JSONObject;
import com.daqing.financial.guarantee.model.request.ProcessManageRequest;
import com.daqing.financial.guarantee.model.request.UpdateUserVisualReq;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.model.response.DgProessManageRes;
import com.daqing.financial.guarantee.service.IDgProcessManageService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.guarantee.DgProcessManage;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.ext.UserDeptVO;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import java.util.*;

@ -2,17 +2,14 @@ package com.daqing.financial.guarantee.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.model.request.CopySendUserRequest;
import com.daqing.financial.guarantee.service.IDgProcessManageService;
import com.daqing.financial.guarantee.service.IDgProcessUserService;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.domain.guarantee.DgProcessManage;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.guarantee.DgProcessUser;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -4,9 +4,9 @@ import com.daqing.financial.guarantee.model.request.DgStatisticsRequest;
import com.daqing.financial.guarantee.model.response.DgStatisticsListRefuseResponse;
import com.daqing.financial.guarantee.model.response.DgStatisticsListResponse;
import com.daqing.financial.guarantee.service.IDgStatisticsService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -3,12 +3,11 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.DgWorkConferenceConsiderRequest;
import com.daqing.financial.guarantee.service.IDgWorkConferenceConsiderService;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.model.response.AlRepaymentCountRes;
import com.daqing.financial.guarantee.model.response.AlRepaymentEntryListRes;
import com.daqing.financial.guarantee.model.response.AlRepaymentEntryRes;
import com.daqing.financial.guarantee.model.response.AlRepaymentRes;
import com.daqing.framework.domain.guarantee.AlRepaymentEntry;
@ -22,7 +23,7 @@ import java.util.List;
@Mapper
public interface AlRepaymentEntryMapper extends BaseMapper<AlRepaymentEntry> {
IPage<AlRepaymentEntry> pageByCondition(Page page, String customerNumberOrName, Integer status,Integer insuranceId);
IPage<AlRepaymentEntryListRes> pageByCondition(Page page, String customerNumberOrName, Integer status, Integer insuranceId);
List<AlRepaymentRes> selectListByIds(List<String> ids);

@ -261,7 +261,7 @@ public class BusinessApplicationRequest implements Serializable {
* 注册时间
*/
@ApiModelProperty(value = "注册时间")
private String registerTime;
private Date registerTime;
/**
* 注册地址

@ -0,0 +1,112 @@
package com.daqing.financial.guarantee.model.response;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 还款记录表
* </p>
*
* @author Qyq
* @since 2021-03-17
*/
@Data
public class AlRepaymentEntryListRes implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 保后外键id
*/
private Integer insuranceId;
/**
* 应还款日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date repaymentDate;
/**
* 实际还款日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date actualRepaymentDate;
/**
* 逾期天数
*/
private Integer overdueDays;
/**
* 还款总额
*/
private BigDecimal totalRepayment;
/**
* 本次还款
*/
private BigDecimal currentRepayment;
/**
* 利息
*/
private BigDecimal interest;
/**
* 其他费用
*/
private BigDecimal otherExpenses;
/**
* 减免金额
*/
private BigDecimal deductionAmount;
/**
* 还款备注
*/
private String repaymentNotes;
/**
* 还款状态1->待还款2->已还款3->已逾期4->未到期
*/
private Integer repaymentStatus;
/**
* 提交人id
*/
private Integer submitterId;
/**
* 提交人名称
*/
private String submitterName;
/**
* 创建时间
*/
@TableField(fill= FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(fill= FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 担保额度
*/
private Double guaranteeAmount;
}

@ -8,6 +8,7 @@ import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController;
import com.daqing.financial.guarantee.mapper.AlInsuranceListMapper;
import com.daqing.financial.guarantee.mapper.AlRepaymentEntryMapper;
import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq;
import com.daqing.financial.guarantee.model.response.AlRepaymentEntryListRes;
import com.daqing.financial.guarantee.model.response.AlRepaymentEntryRes;
import com.daqing.financial.guarantee.model.response.AlRepaymentRes;
import com.daqing.financial.guarantee.service.IAlRepaymentEntryService;
@ -72,7 +73,7 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpl<AlRepaymentEntryMap
if (size <= 0) {
size = 10;
}
IPage<AlRepaymentEntry> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,status,insuranceId);
IPage<AlRepaymentEntryListRes> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,status,insuranceId);
return new PageUtils(positionVO);
}

@ -831,39 +831,61 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperOne = new QueryWrapper<>();
queryWrapperOne.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserOne = baseMapper.selectOne(queryWrapperOne);
Integer userId = guaranteeLetterAssignUserOne.getUserId();
//没有操作过则法规部经理操作
if (ObjectUtil.isNull(userId)){
Integer operatingStatus = guaranteeLetterAssignUserOne.getOperatingStatus();
//待处理则法规部经理操作
if (operatingStatus.equals(1)){
return this.regulatoryDepartmentManagerOperating(businessId,currentUser,auditOpinion,status);
}
//操作过,拥有a角,则a角操作
//已处理,拥有a角,则a角操作
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))){
//a角数据是否被操作过
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTwo = new QueryWrapper<>();
queryWrapperTwo.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTwo = baseMapper.selectOne(queryWrapperTwo);
Integer userIdA = guaranteeLetterAssignUserTwo.getUserId();
//没有操作过则a角操作
if (ObjectUtil.isNull(userIdA)){
Integer operatingStatusA = guaranteeLetterAssignUserTwo.getOperatingStatus();
//待处理则a角操作
if (operatingStatusA.equals(1)){
return this.aRoleOperating(businessId,currentUser,auditOpinion,status);
}
//操作过,拥有b角,则b角操作
//已处理,拥有b角,则b角操作
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))){
//b角数据是否被操作过
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperThree = new QueryWrapper<>();
queryWrapperThree.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserThree = baseMapper.selectOne(queryWrapperThree);
Integer userIdB = guaranteeLetterAssignUserThree.getUserId();
//没有操作过则b角操作
if (ObjectUtil.isNull(userIdB)){
Integer operatingStatusB = guaranteeLetterAssignUserThree.getOperatingStatus();
//待处理则b角操作
if (operatingStatusB.equals(1)){
return this.bRoleOperating(businessId,currentUser,auditOpinion,status);
}
//操作过,拥有资产部经理,则资产部经理操作
//已处理,拥有资产部经理,则资产部经理操作
if (roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID))){
return this.assetManagerOperating(businessId,currentUser,auditOpinion,status);
}
}
}
//已处理,拥有b角,则b角操作
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))){
//b角数据是否被操作过
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperThree = new QueryWrapper<>();
queryWrapperThree.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserThree = baseMapper.selectOne(queryWrapperThree);
Integer operatingStatusB = guaranteeLetterAssignUserThree.getOperatingStatus();
//待处理则b角操作
if (operatingStatusB.equals(1)){
return this.bRoleOperating(businessId,currentUser,auditOpinion,status);
}
//已处理,拥有资产部经理,则资产部经理操作
if (roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID))){
return this.assetManagerOperating(businessId,currentUser,auditOpinion,status);
}
}
//已处理,拥有资产部经理,则资产部经理操作
if (roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID))){
return this.assetManagerOperating(businessId,currentUser,auditOpinion,status);
}
}
//角色为资产部经理则确认担保函操作和驳回操作

@ -142,6 +142,7 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
insert = baseMapper.insert(dgPaymentConfirmationConsider);
}else {
paymentConfirmationTemp.setAuditOpinion("");
paymentConfirmationTemp.setImgFile(imgFile);
paymentConfirmationTemp.setStatus(StatusCode.SP_IN_REVIEW);
paymentConfirmationTemp.setOperatingStatus(StatusCode.CZ_ON_HAND);
insert = baseMapper.updateById(paymentConfirmationTemp);
@ -260,6 +261,7 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
paymentConfirmationConsider.setConsiderId(currentUser);
paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
paymentConfirmationConsider.setImgFile(imgFile);
int update = baseMapper.updateById(paymentConfirmationConsider);
//同时往审核流程进程表新增一条记录
@ -307,6 +309,7 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
paymentConfirmationConsider.setConsiderId(currentUser);
paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
paymentConfirmationConsider.setImgFile(imgFile);
int update = baseMapper.updateById(paymentConfirmationConsider);
//同时往审核流程进程表新增一条记录
String account = DgApplyAmountInfoController.getAccount();
@ -344,6 +347,7 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
paymentConfirmationConsider.setConsiderId(currentUser);
paymentConfirmationConsider.setStatus(StatusCode.SP_REJECT);
paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
paymentConfirmationConsider.setImgFile(imgFile);
int update = baseMapper.updateById(paymentConfirmationConsider);
//同时往审核流程进程表新增一条记录
String account = DgApplyAmountInfoController.getAccount();
@ -397,12 +401,12 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
QueryWrapper<DgPaymentConfirmationConsider> queryWrapperOne = new QueryWrapper<>();
queryWrapperOne.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
DgPaymentConfirmationConsider paymentConfirmationConsiderOne = baseMapper.selectOne(queryWrapperOne);
Integer userId = paymentConfirmationConsiderOne.getConsiderId();
//没有操作过则财务部经理操作
if (ObjectUtil.isNull(userId)){
Integer operatingStatus = paymentConfirmationConsiderOne.getOperatingStatus();
//待处理则财务部经理操作
if (operatingStatus.equals(1)){
return this.financeDepartmentOperating(businessId,currentUser,auditOpinion,status,imgFile);
}
//操作过,拥有法规部经理,则法规部经理操作
//已处理,拥有法规部经理,则法规部经理操作
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))){
return this.regulationDepartmentOperating(businessId,currentUser,auditOpinion,status,imgFile);
}

@ -20,20 +20,20 @@
<result column="update_time" property="updateTime" />
</resultMap>
<select id="pageByCondition" resultType="com.daqing.framework.domain.guarantee.AlRepaymentEntry">
select * from al_repayment_entry
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.AlRepaymentEntryListRes">
select re.*,il.guarantee_amount as guaranteeAmount from al_repayment_entry re left join al_insurance_list il on il.id=re.insurance_id
<where>
<if test="status != null">
repayment_status = #{status}
re.repayment_status = #{status}
</if>
<if test="customerNumberOrName != null and customerNumberOrName != '' ">
AND repayment_date = #{customerNumberOrName}
AND re.repayment_date = #{customerNumberOrName}
</if>
<if test="insuranceId != null">
AND insurance_id = #{insuranceId}
AND re.insurance_id = #{insuranceId}
</if>
</where>
order by create_time desc
order by re.create_time desc
</select>
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.AlRepaymentRes">

@ -7,7 +7,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableFeignClients(basePackages = "com.daqing.financial.hrauth.feign")
@EnableFeignClients({"com.daqing.framework.feign","com.daqing.financial.hrauth.feign"})
@EnableDiscoveryClient
@SpringBootApplication
@EnableScheduling

@ -1,48 +1,48 @@
package com.daqing.financial.hrauth.annotation;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import java.lang.annotation.*;
/**
* @author Rogers
* 操作日志注解
* @create 2020-07-03
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Log {
/**
* 方法描述,可使用占位符获取参数:{{tel}}
*/
String detail() default "";
/**
* 日志等级:自己定此处分为1-9
*/
int level() default 0;
/**
* 操作类型(enum):主要是select,insert,update,delete
*/
OperationType operationType() default OperationType.UNKNOWN;
/**
* 被操作的对象(此处使用enum):可以是任何对象如表名(user)或者是工具(redis)
*/
OperationUnit operationUnit() default OperationUnit.UNKNOWN;
/** 该属性需要访问的微服务名称 */
// String serverId();
//
// /** 表名 */
// String tableName();
}
//package com.daqing.financial.hrauth.annotation;
//
//
//import com.daqing.financial.hrauth.enums.OperationType;
//import com.daqing.financial.hrauth.enums.OperationUnit;
//
//import java.lang.annotation.*;
//
///**
// * @author Rogers
// * 操作日志注解
// * @create 2020-07-03
// */
//@Target({ElementType.METHOD})
//@Retention(RetentionPolicy.RUNTIME)
//@Documented
//public @interface Log {
//
// /**
// * 方法描述,可使用占位符获取参数:{{tel}}
// */
// String detail() default "";
//
// /**
// * 日志等级:自己定,此处分为1-9
// */
// int level() default 0;
//
// /**
// * 操作类型(enum):主要是select,insert,update,delete
// */
// OperationType operationType() default OperationType.UNKNOWN;
//
// /**
// * 被操作的对象(此处使用enum):可以是任何对象,如表名(user),或者是工具(redis)
// */
// OperationUnit operationUnit() default OperationUnit.UNKNOWN;
//
// /** 该属性需要访问的微服务名称 */
//// String serverId();
////
//// /** 表名 */
//// String tableName();
//
//
//}
//
//

@ -1,141 +1,141 @@
package com.daqing.financial.hrauth.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.dao.SystemLogMapper;
import com.daqing.financial.hrauth.feign.HrauthFeignService;
import com.daqing.financial.hrauth.service.TokenService;
import com.daqing.financial.hrauth.service.UserLoginService;
import com.daqing.financial.hrauth.util.IpUtils;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.domain.hrms.SystemLog;
import com.daqing.framework.domain.hrms.Token;
import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @ClassName Operation
* @Description 操作日志类
* @Date 2020/9/29 10:06
* @Version 1.0
*/
@Slf4j
@Component
@EnableDiscoveryClient
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class Operation {
@Resource
private SystemLogMapper systemLogMapper;
@Autowired
private TokenService tokenService;
@Autowired
private UserLoginService userLoginService;
@Autowired
private HrauthFeignService hrauthFeignService;
@Async
public void addOperationLog(JoinPoint joinPoint, Object res, long time, UserEntity systemUser, EmployeeEntity employeeEntity) {
// synchronized (SysLogAspect.class) {//获得登录用户信息
// User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
SystemLog operationLog = new SystemLog();
operationLog.setJobNumber(employeeEntity.getJobNumber());
//获取内网地址IpUtils.intranetIp()
//获取外网地址IpUtils.internetIp()
// operationLog.setIpAddressLan("");
// operationLog.setIpAddressWan("");
operationLog.setIpAddressLan(IpUtils.intranetIp());
//获取不到外网IP设置内网IP
if (StringUtils.isBlank(IpUtils.internetIp())) {
operationLog.setIpAddressWan(IpUtils.intranetIp());
} else {
operationLog.setIpAddressWan(IpUtils.internetIp());
}
// operationLog.setRunTime(time);
//operationLog.setRunTime(0L);
operationLog.setReturnValue(JSONObject.toJSONString(res));
operationLog.setId(UUID.randomUUID().toString());
operationLog.setArgs(JSONObject.toJSONString(joinPoint.getArgs()));
operationLog.setCreateTime(new Date());
operationLog.setMethod(signature.getDeclaringTypeName() + "." + signature.getName());
operationLog.setUserId(systemUser.getId() + "");
operationLog.setUserName(employeeEntity.getName());
Log annotation = signature.getMethod().getAnnotation(Log.class);
if (annotation != null) {
operationLog.setLogLevel(annotation.level());
operationLog.setLogDescribe(getDetail(((MethodSignature) joinPoint.getSignature()).getParameterNames(), joinPoint.getArgs(), annotation));
operationLog.setOperationType(annotation.operationType().getValue());
operationLog.setOperationUnit(annotation.operationUnit().getValue());
}
//这里保存日志
//package com.daqing.financial.hrauth.aspect;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.daqing.financial.hrauth.annotation.Log;
//import com.daqing.financial.hrauth.dao.SystemLogMapper;
//import com.daqing.financial.hrauth.feign.HrauthFeignService;
//import com.daqing.financial.hrauth.service.TokenService;
//import com.daqing.financial.hrauth.service.UserLoginService;
//import com.daqing.financial.hrauth.util.IpUtils;
//import com.daqing.framework.domain.hrms.EmployeeEntity;
//import com.daqing.framework.domain.hrms.SystemLog;
//import com.daqing.framework.domain.hrms.Token;
//import com.daqing.framework.domain.hrms.UserEntity;
//import com.daqing.framework.model.response.ResponseResult;
//import com.daqing.framework.util.RedisUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//import org.springframework.context.annotation.EnableAspectJAutoProxy;
//import org.springframework.scheduling.annotation.Async;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.Map;
//import java.util.UUID;
//
///**
// * @ClassName Operation
// * @Description 操作日志类
// * @Date 2020/9/29 10:06
// * @Version 1.0
// */
//@Slf4j
//@Component
//@EnableDiscoveryClient
//@EnableAspectJAutoProxy(proxyTargetClass = true)
//public class Operation {
//
// @Resource
// private SystemLogMapper systemLogMapper;
// @Autowired
// private TokenService tokenService;
// @Autowired
// private UserLoginService userLoginService;
// @Autowired
// private HrauthFeignService hrauthFeignService;
//
// @Async
// public void addOperationLog(JoinPoint joinPoint, Object res, long time, UserEntity systemUser, EmployeeEntity employeeEntity) {
//// synchronized (SysLogAspect.class) {//获得登录用户信息
//// User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
// MethodSignature signature = (MethodSignature) joinPoint.getSignature();
// SystemLog operationLog = new SystemLog();
// operationLog.setJobNumber(employeeEntity.getJobNumber());
// //获取内网地址IpUtils.intranetIp()
// //获取外网地址IpUtils.internetIp()
//// operationLog.setIpAddressLan("");
//// operationLog.setIpAddressWan("");
// operationLog.setIpAddressLan(IpUtils.intranetIp());
// //获取不到外网IP设置内网IP
// if (StringUtils.isBlank(IpUtils.internetIp())) {
// operationLog.setIpAddressWan(IpUtils.intranetIp());
// } else {
// operationLog.setIpAddressWan(IpUtils.internetIp());
// }
//// operationLog.setRunTime(time);
// //operationLog.setRunTime(0L);
// operationLog.setReturnValue(JSONObject.toJSONString(res));
// operationLog.setId(UUID.randomUUID().toString());
// operationLog.setArgs(JSONObject.toJSONString(joinPoint.getArgs()));
// operationLog.setCreateTime(new Date());
// operationLog.setMethod(signature.getDeclaringTypeName() + "." + signature.getName());
// operationLog.setUserId(systemUser.getId() + "");
// operationLog.setUserName(employeeEntity.getName());
// Log annotation = signature.getMethod().getAnnotation(Log.class);
// if (annotation != null) {
// operationLog.setLogLevel(annotation.level());
// operationLog.setLogDescribe(getDetail(((MethodSignature) joinPoint.getSignature()).getParameterNames(), joinPoint.getArgs(), annotation));
// operationLog.setOperationType(annotation.operationType().getValue());
// operationLog.setOperationUnit(annotation.operationUnit().getValue());
// }
//
// //这里保存日志
//// log.info("######记录日志:{}######", operationLog.toString());
// //int b = systemLogMapper.insert(operationLog);
// ResponseResult insert = hrauthFeignService.insert(operationLog);
// log.info("######记录日志:{}######", operationLog.toString());
//int b = systemLogMapper.insert(operationLog);
ResponseResult insert = hrauthFeignService.insert(operationLog);
log.info("######记录日志:{}######", operationLog.toString());
if (insert.getCode()== 40007) {
log.error("#####新增###记录日志失败:{}####", operationLog);
}
// if (insert.getCode()== 40007) {
// log.error("#####新增###记录日志失败:{}####", operationLog);
// }
//// }
// }
//
// /**
// * 对当前登录用户和占位符处理
// *
// * @param argNames 方法参数名称数组
// * @param args 方法参数数组
// * @param annotation 注解信息
// * @return 返回处理后的描述
// */
// private String getDetail(String[] argNames, Object[] args, Log annotation) {
// //获得登录用户信息
// //User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String token = request.getHeader("token");
// String userId = RedisUtil.get("dq:token:"+token);
// String userEntityStr = RedisUtil.get("dq:userId:"+userId);
// UserEntity systemUser = JSON.parseObject(userEntityStr,UserEntity.class);
// //Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("token", token));
// //UserEntity systemUser = userLoginService.getOne(new QueryWrapper<UserEntity>().eq("id",userToken.getUserId()));
//
// Map<Object, Object> map = new HashMap<>(4);
// for (int i = 0; i < argNames.length; i++) {
// map.put(argNames[i], args[i]);
// }
//
// String detail = annotation.detail();
// try {
// detail = "'" + systemUser.getAccount() + "'=》" + annotation.detail();
// for (Map.Entry<Object, Object> entry : map.entrySet()) {
// Object k = entry.getKey();
// Object v = entry.getValue();
// detail = detail.replace("{{" + k + "}}", JSONObject.toJSONString(v));
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
}
/**
* 对当前登录用户和占位符处理
*
* @param argNames 方法参数名称数组
* @param args 方法参数数组
* @param annotation 注解信息
* @return 返回处理后的描述
*/
private String getDetail(String[] argNames, Object[] args, Log annotation) {
//获得登录用户信息
//User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
String userId = RedisUtil.get("dq:token:"+token);
String userEntityStr = RedisUtil.get("dq:userId:"+userId);
UserEntity systemUser = JSON.parseObject(userEntityStr,UserEntity.class);
//Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("token", token));
//UserEntity systemUser = userLoginService.getOne(new QueryWrapper<UserEntity>().eq("id",userToken.getUserId()));
Map<Object, Object> map = new HashMap<>(4);
for (int i = 0; i < argNames.length; i++) {
map.put(argNames[i], args[i]);
}
String detail = annotation.detail();
try {
detail = "'" + systemUser.getAccount() + "'=》" + annotation.detail();
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object k = entry.getKey();
Object v = entry.getValue();
detail = detail.replace("{{" + k + "}}", JSONObject.toJSONString(v));
}
} catch (Exception e) {
e.printStackTrace();
}
return detail;
}
}
// return detail;
// }
//}

@ -1,194 +1,194 @@
package com.daqing.financial.hrauth.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.feign.HrmsFeignService;
import com.daqing.financial.hrauth.service.TokenService;
import com.daqing.financial.hrauth.service.UserLoginService;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.domain.hrms.Token;
import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName SysLogAspect
* @Description 操作日志切面
* @Date 2020/9/30
* @Version 1.0
*/
@Slf4j
@Aspect
@Component
@EnableDiscoveryClient
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class SysLogAspect {
@Resource
private Operation operation;
@Autowired
private TokenService tokenService;
@Autowired
private UserLoginService userLoginService;
@Autowired
private HrmsFeignService hrmsFeignService;
/**
* 此处的切点是注解的方式也可以用包名的方式达到相同的效果
* '@Pointcut("execution(* com.wwj.springboot.service.impl.*.*(..))")'
*/
@Pointcut("@annotation(com.daqing.financial.hrauth.annotation.Log)")
public void operationLog() {
}
/**
* 环绕增强相当于MethodInterceptor
*/
@Around("operationLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
Object res = null;
long time = System.currentTimeMillis();
try {
res = joinPoint.proceed();
time = System.currentTimeMillis() - time;
return res;
} finally {
try {
//User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
String userId = RedisUtil.get("dq:token:"+token);
String userEntityStr = RedisUtil.get("dq:userId:"+userId);
UserEntity systemUser = JSON.parseObject(userEntityStr,UserEntity.class);
//根据userId查询工号以及员工姓名
if(userId !=null || userId != ""){
EmployeeEntity employeeEntity = hrmsFeignService.getEmpmsgById(Long.valueOf(userId));
operation.addOperationLog(joinPoint,res,time,systemUser,employeeEntity);
}
//Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("token", token));
//UserEntity systemUser = userLoginService.getOne(new QueryWrapper<UserEntity>().eq("id",userId));
//operation.addOperationLog(joinPoint,res,time,systemUser,employeeEntity);
//方法执行完成后增加日志
// addOperationLog(joinPoint, res, time);
} catch (Exception e) {
log.error("LogAspect 操作失败:" + e.getMessage());
e.printStackTrace();
}
}
}
/**
* 对当前登录用户和占位符处理
*
* @param argNames 方法参数名称数组
* @param args 方法参数数组
* @param annotation 注解信息
* @return 返回处理后的描述
*/
private String getDetail(String[] argNames, Object[] args, Log annotation) {
//获得登录用户信息
//User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
UserEntity systemUser = (UserEntity) request.getUserPrincipal();
Map<Object, Object> map = new HashMap<>(4);
for (int i = 0; i < argNames.length; i++) {
map.put(argNames[i], args[i]);
}
String detail = annotation.detail();
try {
detail = "'" + systemUser.getAccount() + "'=》" + annotation.detail();
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object k = entry.getKey();
Object v = entry.getValue();
detail = detail.replace("{{" + k + "}}", JSONObject.toJSONString(v));
}
} catch (Exception e) {
e.printStackTrace();
}
return detail;
}
@Before("operationLog()")
public void doBeforeAdvice(JoinPoint joinPoint) {
// System.out.println("进入方法前执行.....");
}
/**
* 处理完请求返回内容
*
* @param ret
*/
@AfterReturning(returning = "ret", pointcut = "operationLog()")
public void doAfterReturning(Object ret) {
// System.out.println("方法的返回值 : " + ret);
}
/**
* 后置异常通知
*/
@AfterThrowing("operationLog()")
public void throwss(JoinPoint jp) {
// System.out.println("方法异常时执行.....");
}
/**
* 后置最终通知,final增强不管是抛出异常或者正常退出都会执行
*/
@After("operationLog()")
public void after(JoinPoint jp) {
// System.out.println("方法最后执行.....");
}
/**
* 获取客户端ip地址
*
* @param request
* @return
*/
public static String getClientIp(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
// 多个路由时,取第一个非unknown的ip
final String[] arr = ip.split(",");
for (final String str : arr) {
if (!"unknown".equalsIgnoreCase(str)) {
ip = str;
break;
}
}
return ip;
}
}
//package com.daqing.financial.hrauth.aspect;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.daqing.financial.hrauth.annotation.Log;
//import com.daqing.financial.hrauth.feign.HrmsFeignService;
//import com.daqing.financial.hrauth.service.TokenService;
//import com.daqing.financial.hrauth.service.UserLoginService;
//import com.daqing.framework.domain.hrms.EmployeeEntity;
//import com.daqing.framework.domain.hrms.Token;
//import com.daqing.framework.domain.hrms.UserEntity;
//import com.daqing.framework.model.response.ResponseResult;
//import com.daqing.framework.util.RedisUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//import org.springframework.context.annotation.EnableAspectJAutoProxy;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @ClassName SysLogAspect
// * @Description 操作日志切面
// * @Date 2020/9/30
// * @Version 1.0
// */
//@Slf4j
//@Aspect
//@Component
//@EnableDiscoveryClient
//@EnableAspectJAutoProxy(proxyTargetClass = true)
//public class SysLogAspect {
//
// @Resource
// private Operation operation;
// @Autowired
// private TokenService tokenService;
// @Autowired
// private UserLoginService userLoginService;
// @Autowired
// private HrmsFeignService hrmsFeignService;
// /**
// * 此处的切点是注解的方式,也可以用包名的方式达到相同的效果
// * '@Pointcut("execution(* com.wwj.springboot.service.impl.*.*(..))")'
// */
// @Pointcut("@annotation(com.daqing.financial.hrauth.annotation.Log)")
// public void operationLog() {
// }
//
//
// /**
// * 环绕增强,相当于MethodInterceptor
// */
// @Around("operationLog()")
// public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
// Object res = null;
// long time = System.currentTimeMillis();
// try {
// res = joinPoint.proceed();
// time = System.currentTimeMillis() - time;
// return res;
// } finally {
// try {
// //User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String token = request.getHeader("token");
// String userId = RedisUtil.get("dq:token:"+token);
// String userEntityStr = RedisUtil.get("dq:userId:"+userId);
// UserEntity systemUser = JSON.parseObject(userEntityStr,UserEntity.class);
//
// //根据userId查询工号以及员工姓名
// if(userId !=null || userId != ""){
// EmployeeEntity employeeEntity = hrmsFeignService.getEmpmsgById(Long.valueOf(userId));
// operation.addOperationLog(joinPoint,res,time,systemUser,employeeEntity);
// }
//
// //Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("token", token));
// //UserEntity systemUser = userLoginService.getOne(new QueryWrapper<UserEntity>().eq("id",userId));
// //operation.addOperationLog(joinPoint,res,time,systemUser,employeeEntity);
// //方法执行完成后增加日志
//// addOperationLog(joinPoint, res, time);
// } catch (Exception e) {
// log.error("LogAspect 操作失败:" + e.getMessage());
// e.printStackTrace();
// }
// }
// }
//
//
// /**
// * 对当前登录用户和占位符处理
// *
// * @param argNames 方法参数名称数组
// * @param args 方法参数数组
// * @param annotation 注解信息
// * @return 返回处理后的描述
// */
// private String getDetail(String[] argNames, Object[] args, Log annotation) {
// //获得登录用户信息
// //User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// UserEntity systemUser = (UserEntity) request.getUserPrincipal();
//
// Map<Object, Object> map = new HashMap<>(4);
// for (int i = 0; i < argNames.length; i++) {
// map.put(argNames[i], args[i]);
// }
//
// String detail = annotation.detail();
// try {
// detail = "'" + systemUser.getAccount() + "'=》" + annotation.detail();
// for (Map.Entry<Object, Object> entry : map.entrySet()) {
// Object k = entry.getKey();
// Object v = entry.getValue();
// detail = detail.replace("{{" + k + "}}", JSONObject.toJSONString(v));
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// return detail;
// }
//
// @Before("operationLog()")
// public void doBeforeAdvice(JoinPoint joinPoint) {
//// System.out.println("进入方法前执行.....");
// }
//
// /**
// * 处理完请求,返回内容
// *
// * @param ret
// */
// @AfterReturning(returning = "ret", pointcut = "operationLog()")
// public void doAfterReturning(Object ret) {
//// System.out.println("方法的返回值 : " + ret);
// }
//
// /**
// * 后置异常通知
// */
// @AfterThrowing("operationLog()")
// public void throwss(JoinPoint jp) {
//// System.out.println("方法异常时执行.....");
// }
//
//
// /**
// * 后置最终通知,final增强,不管是抛出异常或者正常退出都会执行
// */
// @After("operationLog()")
// public void after(JoinPoint jp) {
//// System.out.println("方法最后执行.....");
// }
//
//
// /**
// * 获取客户端ip地址
// *
// * @param request
// * @return
// */
// public static String getClientIp(HttpServletRequest request) {
// String ip = request.getHeader("x-forwarded-for");
// if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
// ip = request.getHeader("Proxy-Client-IP");
// }
// if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
// ip = request.getHeader("WL-Proxy-Client-IP");
// }
// if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
// ip = request.getRemoteAddr();
// }
// // 多个路由时,取第一个非unknown的ip
// final String[] arr = ip.split(",");
// for (final String str : arr) {
// if (!"unknown".equalsIgnoreCase(str)) {
// ip = str;
// break;
// }
// }
// return ip;
// }
//
//}

@ -1,15 +1,15 @@
package com.daqing.financial.hrauth.controller;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.financial.hrauth.service.RolePermissionService;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.hrms.PermissionEntity;
import com.daqing.framework.domain.hrms.RoleEntity;
import com.daqing.framework.domain.hrms.RolePermissionEntity;
import com.daqing.framework.domain.hrms.request.RolePermissionRequest;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.domain.hrms.response.RolePermissionResponse;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;

@ -1,13 +1,13 @@
package com.daqing.financial.hrauth.controller;
import com.daqing.financial.hrauth.SystemLogControllerApi;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.financial.hrauth.service.LoginLogService;
import com.daqing.financial.hrauth.service.SystemLogService;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.hrms.SystemLog;
import com.daqing.framework.domain.hrms.request.UserLoginLogRequest;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;

@ -1,43 +1,30 @@
package com.daqing.financial.hrauth.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.daqing.financial.hrauth.UserLoginControllerApi;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.config.WeChatConfig;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.financial.hrauth.feign.HrmsFeignService;
import com.daqing.financial.hrauth.model.XccLoginReq;
import com.daqing.financial.hrauth.service.UserLoginService;
import com.daqing.financial.hrauth.service.UserService;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.domain.hrms.request.*;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.JwtUtils;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.util.SendUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Map;
/**

@ -1,66 +1,66 @@
package com.daqing.financial.hrauth.enums;
/**
* 日志操作类型
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 查询
*/
SELECT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT;
public static String getMsg(BusinessType type){
String result = null;
switch (type) {
case INSERT:
result = "新增";
break;
case UPDATE:
result = "修改";
break;
case DELETE:
result = "删除";
break;
case SELECT:
result = "查询";
break;
case EXPORT:
result = "导出";
break;
case IMPORT:
result = "导入";
break;
case OTHER:
result = "其它";
break;
default:
break;
}
return result;
}
}
//package com.daqing.financial.hrauth.enums;
//
///**
// * 日志操作类型
// */
//public enum BusinessType
//{
// /**
// * 其它
// */
// OTHER,
// /**
// * 新增
// */
// INSERT,
// /**
// * 修改
// */
// UPDATE,
// /**
// * 删除
// */
// DELETE,
// /**
// * 查询
// */
// SELECT,
// /**
// * 导出
// */
// EXPORT,
// /**
// * 导入
// */
// IMPORT;
//
// public static String getMsg(BusinessType type){
// String result = null;
// switch (type) {
// case INSERT:
// result = "新增";
// break;
// case UPDATE:
// result = "修改";
// break;
// case DELETE:
// result = "删除";
// break;
// case SELECT:
// result = "查询";
// break;
// case EXPORT:
// result = "导出";
// break;
// case IMPORT:
// result = "导入";
// break;
// case OTHER:
// result = "其它";
// break;
// default:
// break;
// }
// return result;
// }
//}

@ -1,52 +1,52 @@
package com.daqing.financial.hrauth.enums;
public enum OperationType {
/**
* 操作类型
*/
UNKNOWN("UNKNOWN"),
DELETE("DELETE"),
SELECT("SELECT"),
UPDATE("UPDATE"),
INSERT("INSERT");
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
OperationType(String s) {
this.value = s;
}
public static String getMsg(BusinessType type){
String result = null;
switch (type) {
case INSERT:
result = "新增";
break;
case UPDATE:
result = "修改";
break;
case DELETE:
result = "删除";
break;
case SELECT:
result = "查询";
break;
case OTHER:
result = "其它";
break;
default:
break;
}
return result;
}
}
//package com.daqing.financial.hrauth.enums;
//
//public enum OperationType {
//
// /**
// * 操作类型
// */
// UNKNOWN("UNKNOWN"),
// DELETE("DELETE"),
// SELECT("SELECT"),
// UPDATE("UPDATE"),
// INSERT("INSERT");
//
// private String value;
//
// public String getValue() {
// return value;
// }
//
// public void setValue(String value) {
// this.value = value;
// }
//
// OperationType(String s) {
// this.value = s;
// }
//
//
// public static String getMsg(BusinessType type){
// String result = null;
// switch (type) {
// case INSERT:
// result = "新增";
// break;
// case UPDATE:
// result = "修改";
// break;
// case DELETE:
// result = "删除";
// break;
// case SELECT:
// result = "查询";
// break;
// case OTHER:
// result = "其它";
// break;
// default:
// break;
// }
// return result;
// }
//}

@ -1,59 +1,59 @@
package com.daqing.financial.hrauth.enums;
public enum OperationUnit {
/**
* 被操作的单元
*/
UNKNOWN("unknown"),
APPLYAMOUNTINFO("业务申请"),
GUARANTEE("担保部调查"),
ASSETS("资产部调查"),
MESSAGE("信息部调查"),
COMPLIANCE("合规调查"),
WORKCONFERENCE("工作会"),
LOANCOMMITTEE("贷审会"),
GUARANTEELETTER("担保函"),
PAYMENTCONFIRMATION("财务确认"),
LOANNOTICE("放款通知"),
COPYFOR("抄送"),
EFFICIENCY("流程效率"),
FORMDESIGN("表单设计"),
PROCESSMANAGE("流程管理"),
STATISTICS("业务统计"),
LOGIN("登录"),
ROLEPERMISSION("角色权限管理"),
EMPLOYEE("员工信息"),
COMPANY("企业信息"),
SYSLOG("日志管理"),
INSURANCE("保后管理"),
COLLECTION("催收管理"),
USER("user"),
LOG("log"),
PERMISSION("permission"),
ROLE("role"),
DEVICE("device"),
WITHDRAW("withdraw"),
ATRUSER("atrUser"),
ASSERT("ASSERT"),
COIN("coin"),
NOTICE("notice"),
DATASTATISTIC("datastatistic"),
BlockGroup("blockGroup"),
C2C("c2c"),
USERROLE("userRole");
private String value;
OperationUnit(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
//package com.daqing.financial.hrauth.enums;
//
//public enum OperationUnit {
// /**
// * 被操作的单元
// */
// UNKNOWN("unknown"),
// APPLYAMOUNTINFO("业务申请"),
// GUARANTEE("担保部调查"),
// ASSETS("资产部调查"),
// MESSAGE("信息部调查"),
// COMPLIANCE("合规调查"),
// WORKCONFERENCE("工作会"),
// LOANCOMMITTEE("贷审会"),
// GUARANTEELETTER("担保函"),
// PAYMENTCONFIRMATION("财务确认"),
// LOANNOTICE("放款通知"),
// COPYFOR("抄送"),
// EFFICIENCY("流程效率"),
// FORMDESIGN("表单设计"),
// PROCESSMANAGE("流程管理"),
// STATISTICS("业务统计"),
// LOGIN("登录"),
// ROLEPERMISSION("角色权限管理"),
// EMPLOYEE("员工信息"),
// COMPANY("企业信息"),
// SYSLOG("日志管理"),
// INSURANCE("保后管理"),
// COLLECTION("催收管理"),
// USER("user"),
// LOG("log"),
// PERMISSION("permission"),
// ROLE("role"),
// DEVICE("device"),
// WITHDRAW("withdraw"),
// ATRUSER("atrUser"),
// ASSERT("ASSERT"),
// COIN("coin"),
// NOTICE("notice"),
// DATASTATISTIC("datastatistic"),
// BlockGroup("blockGroup"),
// C2C("c2c"),
// USERROLE("userRole");
//
// private String value;
//
// OperationUnit(String value) {
// this.value = value;
// }
//
// public String getValue() {
// return value;
// }
//
// public void setValue(String value) {
// this.value = value;
// }
//
//}

@ -39,12 +39,6 @@
<artifactId>ooxml-schemas</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.daqing.financial</groupId>
<artifactId>dq-financial-hrms-auth</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>

@ -1,21 +1,18 @@
package com.daqing.financial.hrms;
import com.daqing.financial.hrauth.config.SecurityConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableFeignClients(basePackages = "com.daqing.financial.hrms.feign")
@EnableFeignClients({"com.daqing.framework.feign","com.daqing.financial.hrms.feign"})
@EnableDiscoveryClient
@SpringBootApplication
@ComponentScan(basePackages = "com.daqing")
@EnableScheduling
@Import({SecurityConfig.class})
//@Import({SecurityConfig.class})
public class DqFinancialHrmsApplication {
public static void main(String[] args) {

@ -1,13 +1,13 @@
//package com.daqing.financial.hrms.config;
//
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class IPageConfig {
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// return new PaginationInterceptor();
// }
//}
package com.daqing.financial.hrms.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class IPageConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -1,11 +1,9 @@
package com.daqing.financial.hrms.controller;
import com.daqing.financial.hrauth.annotation.Log;
import com.daqing.financial.hrauth.enums.OperationType;
import com.daqing.financial.hrauth.enums.OperationUnit;
import com.daqing.financial.hrms.EmployeeControllerApi;
import com.daqing.financial.hrms.service.EmployeeService;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.hrms.EmployeeEntity;
@ -15,6 +13,8 @@ import com.daqing.framework.domain.hrms.ext.EmployeeTO;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.request.EmployeeRequest;
import com.daqing.framework.domain.hrms.response.RolePermissionResponse;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;

@ -153,6 +153,18 @@
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.3.8</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<version>2.1.3.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

@ -0,0 +1,47 @@
package com.daqing.framework.annotation;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import java.lang.annotation.*;
/**
* @author Rogers
* 操作日志注解
* @create 2020-07-03
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Log {
/**
* 方法描述,可使用占位符获取参数:{{tel}}
*/
String detail() default "";
/**
* 日志等级:自己定此处分为1-9
*/
int level() default 0;
/**
* 操作类型(enum):主要是select,insert,update,delete
*/
OperationType operationType() default OperationType.UNKNOWN;
/**
* 被操作的对象(此处使用enum):可以是任何对象如表名(user)或者是工具(redis)
*/
OperationUnit operationUnit() default OperationUnit.UNKNOWN;
/** 该属性需要访问的微服务名称 */
// String serverId();
//
// /** 表名 */
// String tableName();
}

@ -0,0 +1,129 @@
package com.daqing.framework.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.feign.HrauthFeignService;
import com.daqing.framework.model.EmployeeEntity;
import com.daqing.framework.model.SystemLog;
import com.daqing.framework.model.UserEntity;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.IpUtils;
import com.daqing.framework.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @ClassName Operation
* @Description 操作日志类
* @Date 2020/9/29 10:06
* @Version 1.0
*/
@Slf4j
@Component
@EnableDiscoveryClient
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class Operation {
@Autowired
private HrauthFeignService hrauthFeignService;
@Async
public void addOperationLog(JoinPoint joinPoint, Object res, long time, UserEntity systemUser, EmployeeEntity employeeEntity) {
// synchronized (SysLogAspect.class) {//获得登录用户信息
// User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
SystemLog operationLog = new SystemLog();
operationLog.setJobNumber(employeeEntity.getJobNumber());
//获取内网地址IpUtils.intranetIp()
//获取外网地址IpUtils.internetIp()
// operationLog.setIpAddressLan("");
// operationLog.setIpAddressWan("");
operationLog.setIpAddressLan(IpUtils.intranetIp());
//获取不到外网IP设置内网IP
if (StringUtils.isBlank(IpUtils.internetIp())) {
operationLog.setIpAddressWan(IpUtils.intranetIp());
} else {
operationLog.setIpAddressWan(IpUtils.internetIp());
}
// operationLog.setRunTime(time);
//operationLog.setRunTime(0L);
operationLog.setReturnValue(JSONObject.toJSONString(res));
operationLog.setId(UUID.randomUUID().toString());
operationLog.setArgs(JSONObject.toJSONString(joinPoint.getArgs()));
operationLog.setCreateTime(new Date());
operationLog.setMethod(signature.getDeclaringTypeName() + "." + signature.getName());
operationLog.setUserId(systemUser.getId() + "");
operationLog.setUserName(employeeEntity.getName());
Log annotation = signature.getMethod().getAnnotation(Log.class);
if (annotation != null) {
operationLog.setLogLevel(annotation.level());
operationLog.setLogDescribe(getDetail(((MethodSignature) joinPoint.getSignature()).getParameterNames(), joinPoint.getArgs(), annotation));
operationLog.setOperationType(annotation.operationType().getValue());
operationLog.setOperationUnit(annotation.operationUnit().getValue());
}
//这里保存日志
// log.info("######记录日志:{}######", operationLog.toString());
//int b = systemLogMapper.insert(operationLog);
ResponseResult insert = hrauthFeignService.insert(operationLog);
log.info("######记录日志:{}######", operationLog.toString());
if (insert.getCode()== 40007) {
log.error("#####新增###记录日志失败:{}####", operationLog);
}
// }
}
/**
* 对当前登录用户和占位符处理
*
* @param argNames 方法参数名称数组
* @param args 方法参数数组
* @param annotation 注解信息
* @return 返回处理后的描述
*/
private String getDetail(String[] argNames, Object[] args, Log annotation) {
//获得登录用户信息
//User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
String userId = RedisUtil.get("dq:token:"+token);
String userEntityStr = RedisUtil.get("dq:userId:"+userId);
UserEntity systemUser = JSON.parseObject(userEntityStr,UserEntity.class);
//Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("token", token));
//UserEntity systemUser = userLoginService.getOne(new QueryWrapper<UserEntity>().eq("id",userToken.getUserId()));
Map<Object, Object> map = new HashMap<>(4);
for (int i = 0; i < argNames.length; i++) {
map.put(argNames[i], args[i]);
}
String detail = annotation.detail();
try {
detail = "'" + systemUser.getAccount() + "'=》" + annotation.detail();
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object k = entry.getKey();
Object v = entry.getValue();
detail = detail.replace("{{" + k + "}}", JSONObject.toJSONString(v));
}
} catch (Exception e) {
e.printStackTrace();
}
return detail;
}
}

@ -0,0 +1,185 @@
package com.daqing.framework.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.feign.HrmsFeignService;
import com.daqing.framework.model.EmployeeEntity;
import com.daqing.framework.model.UserEntity;
import com.daqing.framework.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName SysLogAspect
* @Description 操作日志切面
* @Date 2020/9/30
* @Version 1.0
*/
@Slf4j
@Aspect
@Component
@EnableDiscoveryClient
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class SysLogAspect {
@Resource
private Operation operation;
@Autowired
private HrmsFeignService hrmsFeignService;
/**
* 此处的切点是注解的方式也可以用包名的方式达到相同的效果
* '@Pointcut("execution(* com.wwj.springboot.service.impl.*.*(..))")'
*/
@Pointcut("@annotation(com.daqing.framework.annotation.Log)")
public void operationLog() {
}
/**
* 环绕增强相当于MethodInterceptor
*/
@Around("operationLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
Object res = null;
long time = System.currentTimeMillis();
try {
res = joinPoint.proceed();
time = System.currentTimeMillis() - time;
return res;
} finally {
try {
//User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
String userId = RedisUtil.get("dq:token:"+token);
String userEntityStr = RedisUtil.get("dq:userId:"+userId);
UserEntity systemUser = JSON.parseObject(userEntityStr,UserEntity.class);
//根据userId查询工号以及员工姓名
if(userId !=null && userId != ""){
EmployeeEntity employeeEntity = hrmsFeignService.getEmpmsgById(Long.valueOf(userId));
operation.addOperationLog(joinPoint,res,time,systemUser,employeeEntity);
}
//Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("token", token));
//UserEntity systemUser = userLoginService.getOne(new QueryWrapper<UserEntity>().eq("id",userId));
//operation.addOperationLog(joinPoint,res,time,systemUser,employeeEntity);
//方法执行完成后增加日志
// addOperationLog(joinPoint, res, time);
} catch (Exception e) {
log.error("LogAspect 操作失败:" + e.getMessage());
e.printStackTrace();
}
}
}
/**
* 对当前登录用户和占位符处理
*
* @param argNames 方法参数名称数组
* @param args 方法参数数组
* @param annotation 注解信息
* @return 返回处理后的描述
*/
private String getDetail(String[] argNames, Object[] args, Log annotation) {
//获得登录用户信息
//User systemUser = (User) SecurityUtils.getSubject().getPrincipal();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
UserEntity systemUser = (UserEntity) request.getUserPrincipal();
Map<Object, Object> map = new HashMap<>(4);
for (int i = 0; i < argNames.length; i++) {
map.put(argNames[i], args[i]);
}
String detail = annotation.detail();
try {
detail = "'" + systemUser.getAccount() + "'=》" + annotation.detail();
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object k = entry.getKey();
Object v = entry.getValue();
detail = detail.replace("{{" + k + "}}", JSONObject.toJSONString(v));
}
} catch (Exception e) {
e.printStackTrace();
}
return detail;
}
@Before("operationLog()")
public void doBeforeAdvice(JoinPoint joinPoint) {
// System.out.println("进入方法前执行.....");
}
/**
* 处理完请求返回内容
*
* @param ret
*/
@AfterReturning(returning = "ret", pointcut = "operationLog()")
public void doAfterReturning(Object ret) {
// System.out.println("方法的返回值 : " + ret);
}
/**
* 后置异常通知
*/
@AfterThrowing("operationLog()")
public void throwss(JoinPoint jp) {
// System.out.println("方法异常时执行.....");
}
/**
* 后置最终通知,final增强不管是抛出异常或者正常退出都会执行
*/
@After("operationLog()")
public void after(JoinPoint jp) {
// System.out.println("方法最后执行.....");
}
/**
* 获取客户端ip地址
*
* @param request
* @return
*/
public static String getClientIp(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.trim() == "" || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
// 多个路由时,取第一个非unknown的ip
final String[] arr = ip.split(",");
for (final String str : arr) {
if (!"unknown".equalsIgnoreCase(str)) {
ip = str;
break;
}
}
return ip;
}
}

@ -0,0 +1,66 @@
package com.daqing.framework.enums;
/**
* 日志操作类型
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 查询
*/
SELECT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT;
public static String getMsg(BusinessType type){
String result = null;
switch (type) {
case INSERT:
result = "新增";
break;
case UPDATE:
result = "修改";
break;
case DELETE:
result = "删除";
break;
case SELECT:
result = "查询";
break;
case EXPORT:
result = "导出";
break;
case IMPORT:
result = "导入";
break;
case OTHER:
result = "其它";
break;
default:
break;
}
return result;
}
}

@ -0,0 +1,48 @@
package com.daqing.framework.enums;
import java.util.HashMap;
import java.util.Map;
/**
* <p> 全局常用变量 </p>
*
* @description :
* @author : zhengqing
* @date : 2019/10/12 14:47
*/
public class Constants {
/**
* 接口url
*/
public static Map<String,String> URL_MAPPING_MAP = new HashMap<>();
/**
* 获取项目根目录
*/
public static String PROJECT_ROOT_DIRECTORY = System.getProperty("user.dir");
/**
* 密码加密相关
*/
public static String SALT = "zhengqing";
public static final int HASH_ITERATIONS = 1;
/**
* 请求头 - token
*/
public static final String REQUEST_HEADER = "X-Token";
/**
* 请求头类型
* application/x-www-form-urlencoded form表单格式
* application/json json格式
*/
public static final String REQUEST_HEADERS_CONTENT_TYPE = "application/json";
/**
* 未登录者角色
*/
public static final String ROLE_LOGIN = "role_login";
}

@ -0,0 +1,52 @@
package com.daqing.framework.enums;
public enum OperationType {
/**
* 操作类型
*/
UNKNOWN("UNKNOWN"),
DELETE("DELETE"),
SELECT("SELECT"),
UPDATE("UPDATE"),
INSERT("INSERT");
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
OperationType(String s) {
this.value = s;
}
public static String getMsg(BusinessType type){
String result = null;
switch (type) {
case INSERT:
result = "新增";
break;
case UPDATE:
result = "修改";
break;
case DELETE:
result = "删除";
break;
case SELECT:
result = "查询";
break;
case OTHER:
result = "其它";
break;
default:
break;
}
return result;
}
}

@ -0,0 +1,59 @@
package com.daqing.framework.enums;
public enum OperationUnit {
/**
* 被操作的单元
*/
UNKNOWN("unknown"),
APPLYAMOUNTINFO("业务申请"),
GUARANTEE("担保部调查"),
ASSETS("资产部调查"),
MESSAGE("信息部调查"),
COMPLIANCE("合规调查"),
WORKCONFERENCE("工作会"),
LOANCOMMITTEE("贷审会"),
GUARANTEELETTER("担保函"),
PAYMENTCONFIRMATION("财务确认"),
LOANNOTICE("放款通知"),
COPYFOR("抄送"),
EFFICIENCY("流程效率"),
FORMDESIGN("表单设计"),
PROCESSMANAGE("流程管理"),
STATISTICS("业务统计"),
LOGIN("登录"),
ROLEPERMISSION("角色权限管理"),
EMPLOYEE("员工信息"),
COMPANY("企业信息"),
SYSLOG("日志管理"),
INSURANCE("保后管理"),
COLLECTION("催收管理"),
USER("user"),
LOG("log"),
PERMISSION("permission"),
ROLE("role"),
DEVICE("device"),
WITHDRAW("withdraw"),
ATRUSER("atrUser"),
ASSERT("ASSERT"),
COIN("coin"),
NOTICE("notice"),
DATASTATISTIC("datastatistic"),
BlockGroup("blockGroup"),
C2C("c2c"),
USERROLE("userRole");
private String value;
OperationUnit(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,22 @@
package com.daqing.framework.feign;
import com.daqing.framework.model.SystemLog;
import com.daqing.framework.model.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 这是一个声明式的远程调用
*/
@FeignClient(value = "dq-financial-hrms-auth",contextId = "common-hrms-auth")
public interface HrauthFeignService {
@PostMapping("/hrms/auth/systemLog/insert")
ResponseResult insert(@RequestBody SystemLog operationLog);
}

@ -0,0 +1,21 @@
package com.daqing.framework.feign;
import com.daqing.framework.model.EmployeeEntity;
import com.daqing.framework.model.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 这是一个声明式的远程调用
*/
@Component
@FeignClient(name="dq-financial-hrms",contextId = "common-hrms")
public interface HrmsFeignService {
@GetMapping("hrms/employee/getEmpmsgById")
EmployeeEntity getEmpmsgById(@RequestParam("id") Long id);
}

@ -0,0 +1,73 @@
package com.daqing.framework.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 记录员工的基本信息如姓名电话部门等
*
* @author gongsj
* @email gongsj@gmail.com
* @date 2020-09-07 16:26:04
*/
@Data
@TableName("hrms_employee")
public class EmployeeEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 姓名
*/
private String name;
/**
* 性别10
*/
private Integer gender;
/**
* 生日
*/
private Date birthday;
/**
* 办公电话
*/
private String officePhone;
/**
* 手机号码
*/
private String phone;
/**
* 公司邮箱
*/
private String companyMail;
/**
* 备用邮箱
*/
private String spareMail;
/**
* 职位描述
*/
private String positionDescription;
/**
* 工号
*/
private String jobNumber;
/**
* 头像地址
*/
private String headPortaritUrl;
/**
* 账号表id
*/
private Long userId;
}

@ -0,0 +1,105 @@
package com.daqing.framework.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @ClassName SystemLog
* @Description 操作日志
* @Date 2020/9/29 14:30
* @Version 1.0
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
@TableName("sys_action_log")
@ApiModel("操作日志")
public class SystemLog {
@TableId(value = "id", type = IdType.UUID)
private String id;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
// @TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty("创建时间")
private Date createTime;
/**
* 日志等级
*/
@ApiModelProperty("日志等级")
private Integer logLevel;
/**
* 被操作的对象
*/
@ApiModelProperty("被操作的对象")
private String operationUnit;
/**
* 方法名
*/
@ApiModelProperty("method")
private String method;
/**
* 参数
*/
@ApiModelProperty("参数")
private String args;
/**
* 操作人id
*/
@ApiModelProperty("操作人id")
private String userId;
/**
* 操作人
*/
@ApiModelProperty("操作人")
private String userName;
/**
* 日志描述
*/
@ApiModelProperty("日志描述")
private String logDescribe;
/**
* 操作类型
*/
@ApiModelProperty("操作类型")
private String operationType;
/**
* 方法运行时间
*/
@ApiModelProperty("方法运行时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Long runTime;
/**
* 方法返回值
*/
@ApiModelProperty("方法返回值")
private String returnValue;
/**
* 内网IP地址
*/
@ApiModelProperty("内网IP地址")
private String ipAddressLan;
/**
* 外网IP地址
*/
@ApiModelProperty("外网IP地址")
private String ipAddressWan;
@ApiModelProperty("工号")
private String jobNumber;
}

@ -0,0 +1,102 @@
package com.daqing.framework.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 人资管理系统员工账号信息表用于存储员工账号密码等登录相关数据
*
* @author gongsj
* @email gongsj@gmail.com
* @date 2020-09-07 16:26:04
*/
@Data
@TableName("hrms_user")
public class UserEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 用于登录的账号必填
*/
private String account;
/**
* 用户可以绑定手机账号用于登录
*/
private String phoneAccount;
/**
* 登录密码
*/
private String password;
/**
* 登录次数
*/
private Integer loginNum;
/**
* 上次的登录时间
*/
private Date lasttime;
/**
* 微信的唯一标识
*/
private String wechatId;
/**
* 状态0启用1禁用
*/
private Integer status;
/**
* 禁用开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("禁用开始时间")
private Date disableStartTime;
/**
* 禁用结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("禁用结束时间")
private Date disableEndTime;
/**
* 禁用原因
*/
@ApiModelProperty("禁用原因")
private String disableCause;
/**
* 是否删除0未删除1删除
*/
private Integer delOrNot;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date motifyTime;
/**
* Token
*/
private String token;
/**
* 盐值
*/
//private String salt;
/**
* 头像地址
*/
private String headPortaritUrl;
}

@ -0,0 +1,67 @@
package com.daqing.framework.util;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
/**
* @ClassName IpUtils
* @Description Ip工具类获取ip
* @Date 2020/9/30
* @Version 1.0
*/
public class IpUtils {
/***
* 获取外网IP
* @return
*/
public static String internetIp() {
try {
Enumeration<NetworkInterface> networks = NetworkInterface.getNetworkInterfaces();
InetAddress inetAddress = null;
Enumeration<InetAddress> inetAddresses = null;
while (networks.hasMoreElements()) {
inetAddresses = networks.nextElement().getInetAddresses();
while (inetAddresses.hasMoreElements()) {
inetAddress = inetAddresses.nextElement();
if (inetAddress != null
&& inetAddress instanceof Inet4Address
&& !inetAddress.isSiteLocalAddress()
&& !inetAddress.isLoopbackAddress()
&& inetAddress.getHostAddress().indexOf(":") == -1) {
return inetAddress.getHostAddress();
}
}
}
return null;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 获取内网IP
*
* @return
*/
public static String intranetIp() {
try {
return InetAddress.getLocalHost().getHostAddress();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 获取服务启动host
* @return
*/
public static String getHost(){
return internetIp()==null?intranetIp():internetIp();
}
}

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -92,6 +93,7 @@ public class CompanyCustomerEntity implements Serializable {
@ApiModelProperty(value = "经营地址")
private String businessAddr;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty(value = "注册时间")
private Date registerTime;

@ -1,5 +1,6 @@
package com.daqing.framework.domain.crms.ext;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -96,6 +97,7 @@ public class CustomerCompanyDTO implements Serializable {
@ApiModelProperty(value = "社会统一代码")
private String socialUnifiedCode;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty(value = "注册时间")
private Date registerTime;

@ -77,7 +77,7 @@ public class DgBusinessCompany implements Serializable {
/**
* 注册时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date registerTime;
/**

@ -30,7 +30,9 @@ jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,\
/api-hrms/hrms/permission/getPermission,\
/api-guarantee/guarantee/efficiency/personalEfficiencyListExport,\
/api-guarantee/dg-copy-user/exportCopyForMe,\
/apiHrmsAuth/hrms/auth/userlogin/wxAuthLogin
/apiHrmsAuth/hrms/auth/userlogin/wxAuthLogin,\
/api-guarantee/al-insurance-list/excelExport,\
/api-guarantee/al-repayment-entry/excelExport

Loading…
Cancel
Save