From 7ddcc0cdd5470ff1ba0ae7e03fd886f671ccfdc4 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Wed, 13 Oct 2021 21:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=90=8E=E7=AE=A1=E7=90=86=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dq-financial-api/pom.xml | 5 + .../financial/config/Base64Encoder.java | 32 + .../impl/CustomerAppletServiceImpl.java | 10 +- .../service/impl/CustomerServiceImpl.java | 5 +- .../src/main/resources/bootstrap.properties | 8 +- dq-financial-guarantee/pom.xml | 52 ++ .../controller/AlCollectionController.java | 70 +- .../AlCollectionGroupController.java | 69 ++ .../AlCollectionStatisticsController.java | 160 +++++ .../controller/AlInsuranceListController.java | 116 ++-- .../controller/AlReimbursementController.java | 50 ++ .../AlRepaymentEntryController.java | 30 +- .../DgApplyAmountInfoController.java | 10 +- .../DgAssetsInvestigationController.java | 2 +- .../DgGuaranteeAssignUserController.java | 2 +- ...DgGuaranteeLetterAssignUserController.java | 3 +- .../controller/DgLoanNoticeController.java | 3 +- .../DgMessageInvestigationController.java | 2 +- .../controller/DgProcessManageController.java | 2 +- .../mapper/AlCollectionGroupMapper.java | 18 + .../mapper/AlCollectionStatisticsMapper.java | 56 ++ .../mapper/AlInsuranceListMapper.java | 14 +- .../mapper/AlReimbursementMapper.java | 26 + .../mapper/AlRepaymentEntryMapper.java | 4 +- .../model/request/AlCollectionRequest.java | 18 +- .../model/request/AlRepaymentEntryReq.java | 115 --- .../model/request/CollectionProgressReq.java | 52 ++ .../model/request/EditStatisticsListReq.java | 20 + .../model/request/ExcelImpInsuranceVO.java | 112 +++ .../guarantee/model/request/GenerateReq.java | 28 + .../model/request/ImportInsuranceVO.java | 34 + .../model/request/InsuranceSaveReq.java | 22 + .../model/request/StatisticsListReq.java | 40 ++ .../model/response/AlInsuranceListRes.java | 147 ---- .../response/CollectionGroupListResp.java | 26 + .../response/CollectionProgressResp.java | 93 +++ .../guarantee/model/response/LegalVo.java | 16 + .../response/MoreOverdueDetailResponse.java | 10 + .../model/response/OtherStatistics.java | 38 + .../model/response/PersonLiableResp.java | 13 + .../guarantee/model/response/Personnel.java | 20 + .../model/response/StatisticsGroupVo.java | 19 + .../service/AlCollectionGroupService.java | 16 + .../AlCollectionStatisticsService.java | 53 ++ .../service/AlReimbursementService.java | 16 + .../service/IAlInsuranceListService.java | 24 +- .../service/IAlRepaymentEntryService.java | 12 +- .../impl/AlCollectionGroupServiceImpl.java | 21 + .../service/impl/AlCollectionServiceImpl.java | 7 +- .../AlCollectionStatisticsServiceImpl.java | 418 +++++++++++ .../impl/AlInsuranceListServiceImpl.java | 656 ++++++++++++++++-- .../impl/AlReimbursementServiceImpl.java | 21 + .../impl/AlRepaymentEntryServiceImpl.java | 257 +++++-- .../impl/DgApplyAmountInfoServiceImpl.java | 12 +- .../DgAssetsInvestigationServiceImpl.java | 22 +- .../service/impl/DgEfficiencyServiceImpl.java | 10 +- .../DgGuaranteeAssignUserServiceImpl.java | 18 +- .../service/impl/DgLoanNoticeServiceImpl.java | 9 +- .../DgMessageInvestigationServiceImpl.java | 20 +- .../impl/DgProcessManageServiceImpl.java | 12 +- .../financial/guarantee/util/ArraysUtil.java | 2 +- .../guarantee/util/ExcelAttribute.java | 25 + .../guarantee/util/ExcelImportHelper.java | 310 +++++++++ .../financial/guarantee/util/ImgUtil.java | 10 +- .../src/main/resources/bootstrap.properties | 19 +- .../src/main/resources/excel-config.xml | 0 .../guarantee/AlCollectionGroupMapper.xml | 5 + .../mapper/guarantee/AlCollectionMapper.xml | 6 +- .../AlCollectionStatisticsMapper.xml | 207 ++++++ .../guarantee/AlInsuranceListMapper.xml | 27 +- .../guarantee/AlReimbursementMapper.xml | 43 ++ .../guarantee/AlRepaymentEntryMapper.xml | 8 +- .../mapper/guarantee/DgAuditProcessMapper.xml | 3 +- .../DqFinancialGuaranteeApplicationTests.java | 13 - dq-financial-hrms-auth/pom.xml | 19 +- .../config/CustomExpiredSessionStrategy.java | 2 +- .../hrauth/handle/MyAuthenticationToken.java | 2 +- .../financial/hrauth/util/CommonUtil.java | 13 +- .../util/MultiReadHttpServletRequest.java | 5 +- .../util/MultiReadHttpServletResponse.java | 4 +- .../financial/hrauth/util/PKCS7Encoder.java | 5 +- .../financial/hrauth/util/WXBizDataCrypt.java | 15 +- .../src/main/resources/bootstrap.properties | 8 +- .../hrms/controller/PermissionController.java | 2 + .../src/main/resources/bootstrap.properties | 8 +- dq-framework-common/pom.xml | 7 + .../framework/exception/CustomException.java | 2 +- .../com/daqing/framework/model/Constant.java | 6 +- .../framework/model/response/CommonCode.java | 6 +- .../model/response/PromptSuccess.java | 8 +- .../com/daqing/framework/util/ArraysUtil.java | 2 +- dq-framework-model/pom.xml | 13 + .../domain/crms/response/CrmsCode.java | 6 +- .../domain/guarantee/AlCollection.java | 45 +- .../domain/guarantee/AlCollectionGroup.java | 48 ++ .../guarantee/AlCollectionStatistics.java | 119 ++++ .../domain/guarantee/AlInsuranceList.java | 146 ++-- .../domain/guarantee/AlReimbursement.java | 80 +++ .../domain/guarantee/AlRepaymentEntry.java | 99 ++- .../domain/guarantee/GuaranteeCode.java | 6 +- .../domain/hrms/response/HrmsCode.java | 7 +- dq-framework-utils/pom.xml | 3 + .../daqing/framework/utils/NumberToCN.java | 2 +- .../framework/utils/SnowflakeIdUtils.java | 4 +- .../framework/utils/excel/EasyExcelUtil.java | 4 +- .../framework/utils/excel/ExcelUtil.java | 3 +- .../utils/excel/ExcelWriterFactroy.java | 2 +- .../utils/excel/SourceStatusConverter.java | 69 ++ .../framework/utils/oss/OssFileUtils.java | 8 +- .../src/main/resources/bootstrap.properties | 4 +- .../src/main/resources/jwt.properties | 3 + pom.xml | 5 + 112 files changed, 3797 insertions(+), 847 deletions(-) create mode 100644 dq-financial-api/src/main/java/com/daqing/financial/config/Base64Encoder.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionGroupController.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionStatisticsController.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlReimbursementController.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionGroupMapper.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionStatisticsMapper.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlReimbursementMapper.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/CollectionProgressReq.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/EditStatisticsListReq.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ExcelImpInsuranceVO.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GenerateReq.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ImportInsuranceVO.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InsuranceSaveReq.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/StatisticsListReq.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionGroupListResp.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionProgressResp.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/LegalVo.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/OtherStatistics.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonLiableResp.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/Personnel.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/StatisticsGroupVo.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionGroupService.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionStatisticsService.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlReimbursementService.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionGroupServiceImpl.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionStatisticsServiceImpl.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlReimbursementServiceImpl.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelAttribute.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelImportHelper.java create mode 100644 dq-financial-guarantee/src/main/resources/excel-config.xml create mode 100644 dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionGroupMapper.xml create mode 100644 dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionStatisticsMapper.xml create mode 100644 dq-financial-guarantee/src/main/resources/mapper/guarantee/AlReimbursementMapper.xml delete mode 100644 dq-financial-guarantee/src/test/java/com/daqing/financial/guarantee/dqfinancialguarantee/DqFinancialGuaranteeApplicationTests.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollectionGroup.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollectionStatistics.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlReimbursement.java create mode 100644 dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/SourceStatusConverter.java diff --git a/dq-financial-api/pom.xml b/dq-financial-api/pom.xml index bc2f749a..ca011e0c 100644 --- a/dq-financial-api/pom.xml +++ b/dq-financial-api/pom.xml @@ -14,6 +14,10 @@ 系统API统一定义 + + UTF-8 + + @@ -41,6 +45,7 @@ org.apache.maven.plugins maven-compiler-plugin + 3.8.1 1.8 1.8 diff --git a/dq-financial-api/src/main/java/com/daqing/financial/config/Base64Encoder.java b/dq-financial-api/src/main/java/com/daqing/financial/config/Base64Encoder.java new file mode 100644 index 00000000..c6a5a3dd --- /dev/null +++ b/dq-financial-api/src/main/java/com/daqing/financial/config/Base64Encoder.java @@ -0,0 +1,32 @@ +package com.daqing.financial.config; + +import org.apache.commons.codec.binary.Base64; + +/** + * @author cool + * @version V1.0 + * @className Base64Encoder + * @description Problem In Chair, Not In Computer. + * @createDate 2018年07月09日 + */ +public class Base64Encoder { + + /** + * @param bytes + * @return + */ + public static byte[] decode(final String bytes) { + return Base64.decodeBase64(bytes); + } + + /** + * 二进制数据编码为BASE64字符串 + * + * @param bytes + * @return + * @throws Exception + */ + public static String encode(final byte[] bytes) { + return new String(Base64.encodeBase64(bytes)); + } +} diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java index 4c1e9ea1..4f8a6017 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java @@ -156,10 +156,7 @@ public class CustomerAppletServiceImpl extends ServiceImpl 0 && user) { - return true; - } - return false; + return customer && company > 0 && user; } /** @@ -313,10 +310,7 @@ public class CustomerAppletServiceImpl extends ServiceImpl 0) { - return true; - } - return false; + return customer && company > 0; } /** diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java index b732cb70..5394da9d 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java @@ -662,10 +662,7 @@ public class CustomerServiceImpl extends ServiceImpl 0) { - return true; - } - return false; + return customer && company > 0; } /** diff --git a/dq-financial-crms/src/main/resources/bootstrap.properties b/dq-financial-crms/src/main/resources/bootstrap.properties index 092df239..1664596a 100644 --- a/dq-financial-crms/src/main/resources/bootstrap.properties +++ b/dq-financial-crms/src/main/resources/bootstrap.properties @@ -14,18 +14,18 @@ spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-idle=8 spring.redis.jedis.pool.min-idle=0 #本地测试环境 -#spring.cloud.nacos.config.namespace=1520c5ea-5f15-4ac1-9eb1-d25924825b99 +spring.cloud.nacos.config.namespace=1520c5ea-5f15-4ac1-9eb1-d25924825b99 #线上测试环境 -spring.cloud.nacos.config.namespace=5698e60a-9d0b-433f-a69f-12b0a2d23128 +#spring.cloud.nacos.config.namespace=5698e60a-9d0b-433f-a69f-12b0a2d23128 #线上生产环境 #spring.cloud.nacos.config.namespace=6054a175-069a-492d-8679-820758416406 #请求处理的超时时间 -ribbon.ReadTimeout: 120000 +ribbon.ReadTimeout= 120000 #请求连接的超时时间 -ribbon.ConnectTimeout: 120000 +ribbon.ConnectTimeout= 120000 ribbon.eureka.enabled=true # 正式环境(prod) diff --git a/dq-financial-guarantee/pom.xml b/dq-financial-guarantee/pom.xml index 786e03bc..0d7d8e23 100644 --- a/dq-financial-guarantee/pom.xml +++ b/dq-financial-guarantee/pom.xml @@ -17,9 +17,52 @@ 1.8 Greenwich.SR3 + + + + + + + + + + cn.afterturn + easypoi-base + 4.1.3 + + + + cn.afterturn + easypoi-web + 4.1.3 + + + cn.afterturn + easypoi-annotation + 4.1.3 + + org.springframework.boot @@ -101,6 +144,15 @@ org.springframework.boot spring-boot-maven-plugin + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionController.java index 23e3ae13..9cdeac11 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionController.java @@ -8,11 +8,17 @@ import com.daqing.financial.guarantee.model.response.AlCollectionResponse; import com.daqing.financial.guarantee.model.response.MoreOverdueDetailResponse; import com.daqing.financial.guarantee.model.response.OverdueDetailResponse; import com.daqing.financial.guarantee.service.IAlCollectionService; +import com.daqing.framework.annotation.Log; import com.daqing.framework.domain.guarantee.AlCollection; +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.util.ArraysUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -38,76 +44,74 @@ public class AlCollectionController { @Autowired private IAlCollectionService alCollectionService; - /** - * 催收管理列表 - */ @GetMapping("/list") @ApiOperation(value = "催收管理列表", notes = "催收管理列表", response = AlCollectionResponse.class) - public ResponseResult list(@RequestParam("page") Integer page, @RequestParam("size") Integer size, - @RequestParam(name = "codeOrName", required = false) String codeOrName, - @RequestParam(name = "status", required = false) Integer status) { + public ResponseResult list( + @RequestParam("page") Integer page, @RequestParam("size") Integer size, + @RequestParam(name = "codeOrName", required = false) String codeOrName, + @RequestParam(name = "status", required = false) Integer status) { return ResponseResult.SUCCESS(alCollectionService.list(page, size, codeOrName, status)); } - /** - * 催收 - */ @PostMapping("/collection") - @ApiOperation(value = "催收", notes = "催收") + @ApiOperation(value = "催收", notes = "新增催收") public ResponseResult collection(@RequestBody @Valid AlCollectionRequest alCollectionRequest) { - Boolean result = alCollectionService.collection(alCollectionRequest); return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); } - /** - * 催收时展示的详情 - */ + @Log(detail = "更新催收信息",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) + @PostMapping("/updateCollection") + @ApiOperation(value = "编辑催收信息") + public ResponseResult updateCollection(@RequestBody @Valid AlCollectionRequest alCollectionRequest){ + AlCollection collection = new AlCollection(); + BeanUtils.copyProperties(alCollectionRequest, collection); + collection.setEnclosureFile(ArraysUtil.toString(alCollectionRequest.getEnclosureFiles())); + boolean update = alCollectionService.updateById(collection); + return update ? ResponseResult.SUCCESS("编辑成功!"):ResponseResult.FAIL(60007,"编辑失败!"); + } + + @Log(detail = "删除催收信息",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.DELETE) + @PostMapping("/delCollection") + @ApiOperation(value = "删除催收信息") + public ResponseResult delCollection(@RequestParam String id){ + boolean remove = alCollectionService.removeById(id); + return remove ? ResponseResult.SUCCESS("删除成功!"):ResponseResult.FAIL(60008,"删除失败!"); + } + @GetMapping("/overdue/detail") @ApiOperation(value = "催收时展示的详情", notes = "催收时展示的详情", response = OverdueDetailResponse.class) public ResponseResult overdueDetail(@RequestParam("insuranceId") Integer insuranceId) { - return ResponseResult.SUCCESS(alCollectionService.overdueDetail(insuranceId)); } - /** - * 催收列表 - */ @PostMapping("/collection/list") @ApiOperation(value = "催收列表", notes = "催收列表", response = AlCollectionListResponse.class) public ResponseResult collectionList(@RequestBody AlCollectionListRequest alCollectionListRequest) { - return ResponseResult.SUCCESS(alCollectionService.collectionList(alCollectionListRequest)); } - /** - * 查看时的催收详情 - */ @GetMapping("/examine/detail") @ApiOperation(value = "查看时的催收详情", notes = "查看时的催收详情", response = MoreOverdueDetailResponse.class) public ResponseResult moreOverdueDetail(@RequestParam("id") Integer id) { - return ResponseResult.SUCCESS(alCollectionService.moreOverdueDetail(id)); } - /** - * 催收管理列表导出 - */ @ApiOperation(value = "催收管理列表导出", notes = "催收管理列表导出") @GetMapping("/list/export/excel") - public ResponseResult listExportExcel(@RequestParam("insuranceIds") List insuranceIds, HttpServletResponse response) throws IOException { - + public ResponseResult listExportExcel( + @RequestParam("insuranceIds") List insuranceIds, + HttpServletResponse response) throws IOException { alCollectionService.listExportExcel(insuranceIds, response); return ResponseResult.SUCCESS(); } - /** - * 催收列表导出 - */ @ApiOperation(value = "催收列表导出", notes = "催收列表导出") @GetMapping("/collection/list/export/excel") - public ResponseResult collectionListExportExcel(@RequestParam("ids") List ids,@RequestParam("insuranceId")Integer insuranceId, HttpServletResponse response) throws IOException { - + public ResponseResult collectionListExportExcel( + @RequestParam("ids") List ids, + @RequestParam("insuranceId")Integer insuranceId, + HttpServletResponse response) throws IOException { alCollectionService.collectionListExportExcel(ids,insuranceId, response); return ResponseResult.SUCCESS(); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionGroupController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionGroupController.java new file mode 100644 index 00000000..c930f4e0 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionGroupController.java @@ -0,0 +1,69 @@ +package com.daqing.financial.guarantee.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.daqing.financial.guarantee.service.AlCollectionGroupService; +import com.daqing.financial.guarantee.util.R; +import com.daqing.framework.domain.guarantee.AlCollectionGroup; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.HashMap; +import java.util.List; + +/** + *

+ * 保后清收组 前端控制器 + *

+ * + * @author lr + * @since 2021-08-12 + */ +@RestController +@Api(value = "保后清收组", tags = "清收组管理") +@RequestMapping("/al-collection-group") +public class AlCollectionGroupController { + + @Autowired + private AlCollectionGroupService collectionGroupService; + + @ApiOperation(value = "添加或更新清收组") + @PostMapping("/saveOrUpdate") + public R saveOrUpdate( + @ApiParam(name = "collectionGroup", value = "清收组信息", required = true) + @RequestBody AlCollectionGroup collectionGroup) { + String groupName = collectionGroup.getGroupName(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("group_name",groupName); + AlCollectionGroup one = collectionGroupService.getOne(queryWrapper); + if (ObjectUtil.isNotNull(one)){ + return R.error().message("组名已存在"); + } + boolean add = collectionGroupService.saveOrUpdate(collectionGroup); + return add ? R.ok() : R.error(); + } + + @ApiOperation(value = "清收组列表",response = IPage.class) + @GetMapping("/list") + public R list() { + List groupList = collectionGroupService.list(); + return R.ok().data("groupList",groupList); + } + + @ApiOperation(value = "删除清收组") + @PostMapping("/delete") + public R delete( + @ApiParam(name = "id", value = "id", required = true) + @RequestParam Integer id) { + boolean delete = collectionGroupService.removeById(id); + return delete ? R.ok() : R.error(); + } + +} + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionStatisticsController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionStatisticsController.java new file mode 100644 index 00000000..d20c35d9 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionStatisticsController.java @@ -0,0 +1,160 @@ +package com.daqing.financial.guarantee.controller; + + +import com.daqing.financial.guarantee.model.request.CollectionProgressReq; +import com.daqing.financial.guarantee.model.request.EditStatisticsListReq; +import com.daqing.financial.guarantee.model.request.GenerateReq; +import com.daqing.financial.guarantee.model.request.StatisticsListReq; +import com.daqing.financial.guarantee.model.response.CollectionGroupListResp; +import com.daqing.financial.guarantee.model.response.CollectionProgressResp; +import com.daqing.financial.guarantee.model.response.Personnel; +import com.daqing.financial.guarantee.model.response.StatisticsGroupVo; +import com.daqing.financial.guarantee.service.AlCollectionStatisticsService; +import com.daqing.financial.guarantee.util.R; +import com.daqing.framework.annotation.Log; +import com.daqing.framework.domain.guarantee.AlCollectionStatistics; +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; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + *

+ * 前端控制器 + *

+ * + * @author lr + * @since 2021-08-19 + */ +@RestController +@RequestMapping("/al-collection-statistics") +@Api(value = "保后数据统计", tags = "清收情况统计和进度查询") +public class AlCollectionStatisticsController { + + @Autowired + private AlCollectionStatisticsService collectionStatisticsService; + + @Log(detail = "清收进度查询",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @PostMapping("/queryCollectionProgress") + @ApiOperation(value = "清收进度查询",response = CollectionProgressResp.class) + public R queryCollectionProgress(@RequestBody CollectionProgressReq collectionProgressReq){ + List list = collectionStatisticsService.queryCollectionProgress(collectionProgressReq); + int total = collectionStatisticsService.selectCollectionProgressPageTotal(collectionProgressReq); + return R.ok().data("list",list).data("total",total); + } + + @Log(detail = "清收进度查询导出",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/collectionProgressExport") + @ApiOperation(value = "清收进度查询导出") + public void collectionProgressExport( + @ApiParam(name = "ids", value = "业务id", required = true) + @RequestParam("ids") String ids, HttpServletResponse response){ + try { + collectionStatisticsService.batchExport(response,ids); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @ApiOperation(value = "清收组成员列表") + @PostMapping("/collectionGroupList") + public R collectionGroupList(){ + List list = collectionStatisticsService.collectionGroupList(); + return R.ok().data("list",list); + } + + @Log(detail = "生成年度统计表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.INSERT) + @PostMapping("/generateAnnualStatistics") + @ApiOperation(value = "生成年度统计表") + public R generateAnnualStatistics(@Valid @RequestBody GenerateReq generateReq){ + boolean ok = collectionStatisticsService.selectYear(generateReq.getYear()); + if (!ok){ + return R.error().message("生成失败,该年度下无数据!"); + } + boolean exist = collectionStatisticsService.selectGenerateYear(generateReq.getYear()); + if (exist && generateReq.getFlag() == 1){ + return R.error().message("该年度已存在,如需增减人员请在人员选择处选择!"); + } + collectionStatisticsService.generateStatistics(generateReq); + return R.ok(); + } + + @Log(detail = "年度统计列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @PostMapping("/annualStatisticsList") + @ApiOperation(value = "年度统计列表",response = AlCollectionStatistics.class) + public R annualStatisticsList(@Valid @RequestBody StatisticsListReq statisticsListReq){ + List list = collectionStatisticsService.annualStatisticsList(statisticsListReq); + int total = collectionStatisticsService.annualStatisticsListTotal(statisticsListReq); + //数据分组 + StatisticsGroupVo groupList = new StatisticsGroupVo(); + Map> collect = list.stream().collect(Collectors.groupingBy(AlCollectionStatistics::getGroupId)); + groupList.setCollect(collect); + return R.ok().data("list",list).data("groupList",groupList).data("total",total); + } + + @Log(detail = "编辑年度统计列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) + @PostMapping("/editAnnualStatistics") + @ApiOperation(value = "编辑年度统计列表") + public R editAnnualStatistics( + @ApiParam(name = "req", value = "年度统计信息", required = true) + @RequestBody EditStatisticsListReq req){ + boolean update = collectionStatisticsService.updateBatchById(req.getCollectionStatistics()); + return update ? R.ok() : R.error(); + } + + @Log(detail = "年度统计列表导出",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/annualStatisticsListExport") + @ApiOperation(value = "年度统计列表导出") + public void annualStatisticsListExport( + @ApiParam(name = "year", value = "年份", required = true) + @RequestParam("year") String year, + @ApiParam(name = "flag", value = "0为组排名、1为公司排名", required = true) + @RequestParam("flag") String flag, HttpServletResponse response){ + try { + collectionStatisticsService.annualStatisticsListExport(year,flag,response); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Log(detail = "年度列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/annualList") + @ApiOperation(value = "年度列表") + public R annualList(){ + List list = collectionStatisticsService.annualList(); + return R.ok().data("list",list); + } + + @Log(detail = "人员选择",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/personnelSelection") + @ApiOperation(value = "人员选择") + public R personnelSelection( + @ApiParam(name = "year", value = "年份", required = true) + @RequestParam("year") String year){ + List list = collectionStatisticsService.personnelSelection(year); + return R.ok().data("list",list); + } + + @Log(detail = "年度统计删除",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.DELETE) + @PostMapping("/annualStatisticsDeleted") + @ApiOperation(value = "年度统计删除") + public R annualStatisticsDeleted( + @ApiParam(name = "year", value = "年份", required = true) + @RequestParam("year") String year){ + boolean delete = collectionStatisticsService.annualStatisticsDeleted(year); + return delete ? R.ok() : R.error(); + } + +} + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java index 5d17b671..f13412a4 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java @@ -1,8 +1,9 @@ package com.daqing.financial.guarantee.controller; -import com.daqing.financial.guarantee.model.response.AlInsuranceListRes; +import com.daqing.financial.guarantee.model.request.InsuranceSaveReq; import com.daqing.financial.guarantee.service.IAlInsuranceListService; +import com.daqing.financial.guarantee.util.R; import com.daqing.framework.annotation.Log; import com.daqing.framework.enums.OperationType; import com.daqing.framework.enums.OperationUnit; @@ -10,13 +11,16 @@ import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.PageUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; - +import java.util.Map; /** *

@@ -30,57 +34,75 @@ import java.util.List; @RestController @RequestMapping("/al-insurance-list") public class AlInsuranceListController { + @Autowired private IAlInsuranceListService alInsuranceListService; - /** - * 保后管理列表 - * @param - * @return - */ @Log(detail = "保后管理列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) @GetMapping("/insuranceList") @ApiOperation(value = "保后管理列表") - public ResponseResult insuranceList(@RequestParam(value="page",required=false) Integer page, @RequestParam(value="size",required=false) Integer size, - @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName, - @RequestParam(value = "paymentStatus", required = false) Integer paymentStatus){ - + public ResponseResult insuranceList( + @RequestParam(value="page",required=false) Integer page, + @RequestParam(value="size",required=false) Integer size, + @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName, + @RequestParam(value = "paymentStatus", required = false) Integer paymentStatus){ PageUtils data = alInsuranceListService.queryPage(page, size, CustomerNumberOrName, paymentStatus); + return ResponseResult.SUCCESS(data); + } - return new ResponseResult().SUCCESS(data); + @Log(detail = "添加保后业务",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.INSERT) + @ApiOperation(value = "添加保后业务") + @PostMapping("/saveInsurance") + public R saveInsurance( + @ApiParam(name = "insuranceSaveReq", value = "保后业务信息", required = true) + @RequestBody InsuranceSaveReq insuranceSaveReq) { + boolean save = alInsuranceListService.saveInsurance(insuranceSaveReq); + return save ? R.ok() : R.error(); + } + + @Log(detail = "编辑保后业务",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) + @ApiOperation(value = "编辑保后业务") + @PostMapping("/updateInsurance") + public R updateInsurance( + @ApiParam(name = "insuranceSaveReq", value = "保后业务信息", required = true) + @RequestBody InsuranceSaveReq insuranceSaveReq) { + Integer insuranceId = alInsuranceListService.updateInsurance(insuranceSaveReq); + return R.ok().data("insuranceId",insuranceId); + } + + @Log(detail = "删除保后业务",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.DELETE) + @ApiOperation(value = "删除保后业务") + @PostMapping("/deleteInsurance") + public R deleteInsurance( + @ApiParam(name = "insuranceId", value = "保后业务id", required = true) + @RequestParam Integer insuranceId) { + boolean delete = alInsuranceListService.deleteInsurance(insuranceId); + return delete ? R.ok() : R.error(); } - /** - * 担保详细 - * @param id - * @return - */ @Log(detail = "担保详细",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) @GetMapping("/insuranceDetail") @ApiOperation(value = "担保详细") - public ResponseResult insuranceDetail(Integer id){ - AlInsuranceListRes response = alInsuranceListService.insuranceDetail(id); - return ResponseResult.SUCCESS(response); + public R insuranceDetail(Integer id){ + return alInsuranceListService.insuranceDetail(id); + } + + @Log(detail = "代偿情况",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/compensationSituation") + @ApiOperation(value = "代偿情况") + public R compensationSituation(String date,Integer insuranceId){ + return alInsuranceListService.compensationSituation(date,insuranceId); } - /** - * 导出 - */ @Log(detail = "导出保后管理列表",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) @GetMapping("/excelExport") @ApiOperation(value = "导出保后管理列表") - public ResponseResult excelExport(@RequestParam("ids") List ids, HttpServletResponse response) { - - Boolean result = alInsuranceListService.excelExport(ids,response); - - return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); + public void excelExport( + @ApiParam(name = "ids", value = "保后id") + @RequestParam("ids")List ids, HttpServletResponse response) { + alInsuranceListService.excelExport(ids,response); } - /** - * 办理结项 - * @param id - * @return - */ @Log(detail = "办理结项",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) @GetMapping("/updateStatus") @ApiOperation(value = "办理结项") @@ -89,15 +111,29 @@ public class AlInsuranceListController { return result>0 ? ResponseResult.SUCCESS("编辑成功!"):ResponseResult.FAIL(60007,"编辑失败!"); } + @PostMapping("/importInsurance") + @ApiOperation("批量导入保后业务") + public R importQuestion(@RequestParam(name = "file") MultipartFile file ,HttpServletResponse response) throws IOException { + try { + Map importInsurance = alInsuranceListService.importInsurance(file); + return R.ok().data("import",importInsurance); + } catch (Exception e) { + e.printStackTrace(); + } + return R.ok(); + } + /** - * 定时任务处理保后管理内容 每隔五秒执行一次 - * @param - * @return + * 批量导入保后业务失败数据导出 + * @throws Exception e */ - @Scheduled(cron ="*/5 * * * * ?") - @GetMapping("/updateInsuranceList") - public void updateInsuranceList() { - int result = alInsuranceListService.updateInsuranceList(); + @ApiOperation(value = "批量导入保后业务失败数据导出") + @GetMapping("/exportFailure") + public void exportFailureRecord( + @ApiParam(name = "exportCode", value = "importInsurance接口返回的exportCode", required = true) + @RequestParam String exportCode, + HttpServletResponse response) throws Exception { + alInsuranceListService.exportFailureRecord(response, exportCode); } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlReimbursementController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlReimbursementController.java new file mode 100644 index 00000000..10d29ec0 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlReimbursementController.java @@ -0,0 +1,50 @@ +package com.daqing.financial.guarantee.controller; + + +import com.daqing.financial.guarantee.service.AlReimbursementService; +import com.daqing.financial.guarantee.util.R; +import com.daqing.framework.annotation.Log; +import com.daqing.framework.domain.guarantee.AlReimbursement; +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; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 保后代偿清收相关信息 前端控制器 + *

+ * + * @author lr + * @since 2021-08-12 + */ +@Api(tags = {"保后代偿清收相关信息"}) +@RestController +@RequestMapping("/al-reimbursement") +public class AlReimbursementController { + + @Autowired + private AlReimbursementService reimbursementService; + + @GetMapping("/modifyReimbursement") + @ApiOperation(value = "保后代偿清收是否修改") + public R modifyReimbursement( + @RequestParam(value = "id", required = false) Integer id, + @RequestParam(value = "collectionGroupId", required = false) Integer collectionGroupId, + @RequestParam(value = "personLiableId", required = false) Integer personLiableId){ + AlReimbursement reimbursement = reimbursementService.getById(id); + if (!reimbursement.getCollectionGroupId().equals(collectionGroupId)||!reimbursement.getPersonLiableId().equals(personLiableId)){ + return R.ok().message("更换清收人或清收组会影响已生成的的年度统计信息,该清收负责人需手动重新生成!"); + } + return R.ok(); + } +} + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java index 93f8a52c..f8339143 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java @@ -1,7 +1,6 @@ package com.daqing.financial.guarantee.controller; -import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq; import com.daqing.financial.guarantee.service.IAlRepaymentEntryService; import com.daqing.framework.annotation.Log; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; @@ -38,21 +37,17 @@ public class AlRepaymentEntryController { /** * 还款录入 - * @param alRepaymentEntryReq - * @return */ @Log(detail = "还款录入",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.INSERT) @PostMapping("/repaymentEntry") @ApiOperation(value = "还款录入") - public ResponseResult repaymentEntry(@RequestBody @Valid AlRepaymentEntryReq alRepaymentEntryReq){ + public ResponseResult repaymentEntry(@RequestBody @Valid AlRepaymentEntry alRepaymentEntryReq){ int result = alRepaymentEntryService.repaymentEntry(alRepaymentEntryReq); return result>0 ? ResponseResult.SUCCESS("录入成功"):ResponseResult.FAIL(60006,"录入失败"); } /** * 还款详细 - * @param id - * @return */ @Log(detail = "还款详细",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) @GetMapping("/repaymentDetail") @@ -64,8 +59,6 @@ public class AlRepaymentEntryController { /** * 还款记录列表 - * @param - * @return */ @Log(detail = "还款记录列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) @GetMapping("/repaymentList") @@ -80,21 +73,17 @@ public class AlRepaymentEntryController { /** * 编辑还款信息 - * @param alRepaymentEntryReq - * @return */ @Log(detail = "编辑还款信息",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) @PostMapping("/updateRepayment") @ApiOperation(value = "编辑还款信息") - public ResponseResult updateRepayment(@RequestBody @Valid AlRepaymentEntryReq alRepaymentEntryReq){ + public ResponseResult updateRepayment(@RequestBody @Valid AlRepaymentEntry alRepaymentEntryReq){ int result = alRepaymentEntryService.updateRepayment(alRepaymentEntryReq); return result>0 ? ResponseResult.SUCCESS("编辑成功!"):ResponseResult.FAIL(60007,"编辑失败!"); } /** * 批量删除还款信息 - * @param ids - * @return */ @Log(detail = "批量删除还款信息",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.DELETE) @PostMapping("/delRepayment") @@ -120,25 +109,22 @@ public class AlRepaymentEntryController { /** * 还款统计 * @param insuranceId 保后Id guaranteeAmount 担保额度 - * @return */ @Log(detail = "还款统计",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) @GetMapping("/repaymentStatistics") @ApiOperation(value = "还款统计") - public ResponseResult repaymentStatistics(@RequestParam("insuranceId") Integer insuranceId,@RequestParam("guaranteeAmount") Double guaranteeAmount){ - Map map = alRepaymentEntryService.repaymentStatistics(insuranceId,guaranteeAmount); + public ResponseResult repaymentStatistics(@RequestParam("insuranceId") Integer insuranceId){ + Map map = alRepaymentEntryService.repaymentStatistics(insuranceId); return ResponseResult.SUCCESS(map); } /** - * 定时任务处理还款记录内容 - * @param - * @return + * 定时任务处理还款记录内容 朝九晚六工作时间每隔十分钟执行一次 */ - @Scheduled(cron ="*/5 * * * * ?") + /*@Scheduled(cron ="0 0/10 9-18 * * ?") @GetMapping("/updateRepaymentEntry") public void updateRepaymentEntry() { - int result = alRepaymentEntryService.updateRepaymentEntry(); - } + alRepaymentEntryService.updateRepaymentEntry(); + }*/ } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index 6d2ad01e..83488f04 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -169,7 +169,7 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA try (FileInputStream inputStream = new FileInputStream(file); OutputStream outStream = response.getOutputStream(); - BufferedInputStream buffStream = new BufferedInputStream(inputStream);) { + BufferedInputStream buffStream = new BufferedInputStream(inputStream)) { int i = 0; while ((i = buffStream.read(buffer)) != -1) { outStream.write(buffer); @@ -248,9 +248,11 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA if(employeeMessage!= null && employeeMessage.size()>0){ for (BusinessApplicationListResponse response:list) { for(LinkedHashMap res : employeeMessage){ - if(response.getPresenterId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值 - response.setAccount(JSONObject.toJSONString(res.get("account")).replace("\"","")); - response.setDeptName(JSONObject.toJSONString(res.get("deptName")).replace("\"","")); + if (response.getPresenterId()!=null){ + if(response.getPresenterId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值 + response.setAccount(JSONObject.toJSONString(res.get("account")).replace("\"","")); + response.setDeptName(JSONObject.toJSONString(res.get("deptName")).replace("\"","")); + } } if(response != null){ if(response.getAccount()==null){ diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java index b44cce6a..c13a513c 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java @@ -54,7 +54,7 @@ public class DgAssetsInvestigationController { String CustomerNumberOrName=assetsInvestigationRequest.getCustomerNumberOrName(); Integer status=assetsInvestigationRequest.getStatus(); //获取当前登录用户userId - String userId = dgApplyAmountInfoController.getUserId(); + String userId = DgApplyAmountInfoController.getUserId(); //根据角色查询资产部调查列表 String roleIds = RedisUtil.get("dq:userRole:" + userId); PageUtils data = null; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java index 2d2fec5a..249b9c92 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java @@ -53,7 +53,7 @@ public class DgGuaranteeAssignUserController { @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName, @RequestParam(value = "status", required = false) Integer status){ //获取当前登录用户userId - String userId = dgApplyAmountInfoController.getUserId(); + String userId = DgApplyAmountInfoController.getUserId(); //根据角色查询担保部调查列表 String roleIds = RedisUtil.get("dq:userRole:" + userId); PageUtils data = null; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java index 1728137b..5c842fdb 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.Date; import java.util.HashMap; @@ -130,7 +131,7 @@ public class DgGuaranteeLetterAssignUserController { try { httpServletResponse.setContentType("application/msword"); String filePath = name + "担保函申请.docx"; - String fileName = new String(filePath.getBytes(), "ISO-8859-1"); + String fileName = new String(filePath.getBytes(), StandardCharsets.ISO_8859_1); httpServletResponse.addHeader("Content-Disposition", "filename=" + fileName); template.write(httpServletResponse.getOutputStream()); } catch (IOException e) { diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java index 2af9ec3f..e2d63903 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; import java.util.HashMap; /** @@ -116,7 +117,7 @@ public class DgLoanNoticeController { try { httpServletResponse.setContentType("application/msword"); String filePath = name + "放款通知.docx"; - String fileName = new String(filePath.getBytes(), "ISO-8859-1"); + String fileName = new String(filePath.getBytes(), StandardCharsets.ISO_8859_1); httpServletResponse.addHeader("Content-Disposition", "filename=" + fileName); template.write(httpServletResponse.getOutputStream()); } catch (IOException e) { diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgMessageInvestigationController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgMessageInvestigationController.java index deae8b87..85986df9 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgMessageInvestigationController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgMessageInvestigationController.java @@ -54,7 +54,7 @@ public class DgMessageInvestigationController { Integer status=messageInvestigationRequest.getStatus(); //获取当前登录用户userId - String userId = dgApplyAmountInfoController.getUserId(); + String userId = DgApplyAmountInfoController.getUserId(); //根据角色查询担保部调查列表 String roleIds = RedisUtil.get("dq:userRole:" + userId); PageUtils data = null; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java index 782b5c6d..5286d7e6 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java @@ -51,7 +51,7 @@ public class DgProcessManageController { @ApiOperation(value = "流程管理列表") public ResponseResult processManageList(){ //获取当前登录用户id - String userId = dgApplyAmountInfoController.getUserId(); + String userId = DgApplyAmountInfoController.getUserId(); //查询可见范围内的人可见列表 List list = iDgProcessManageService.processManageList(userId); return new ResponseResult().SUCCESS(list); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionGroupMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionGroupMapper.java new file mode 100644 index 00000000..07353196 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionGroupMapper.java @@ -0,0 +1,18 @@ +package com.daqing.financial.guarantee.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.daqing.framework.domain.guarantee.AlCollectionGroup; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 保后清收组 Mapper 接口 + *

+ * + * @author lr + * @since 2021-08-12 + */ +@Mapper +public interface AlCollectionGroupMapper extends BaseMapper { + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionStatisticsMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionStatisticsMapper.java new file mode 100644 index 00000000..d0c90f03 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionStatisticsMapper.java @@ -0,0 +1,56 @@ +package com.daqing.financial.guarantee.mapper; + +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.request.CollectionProgressReq; +import com.daqing.financial.guarantee.model.request.StatisticsListReq; +import com.daqing.financial.guarantee.model.response.CollectionProgressResp; +import com.daqing.framework.domain.guarantee.AlCollectionStatistics; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author lr + * @since 2021-08-19 + */ +@Mapper +public interface AlCollectionStatisticsMapper extends BaseMapper { + + List selectCollectionProgressPage(@Param(value = "cpr") CollectionProgressReq collectionProgressReq); + + int selectCollectionProgressPageTotal(@Param(value = "cpr") CollectionProgressReq collectionProgressReq); + + List selectBatchData(@Param(value = "ids")List idList); + + String selectJobNumber(Integer personLiableId); + + List selectAnnualList(); + + List selectAnnualStatisticsList(@Param(value = "slr")StatisticsListReq statisticsListReq); + + List selectAnnualStatisticsListByPersonSort(); + + int selectAnnualStatisticsListTotal(@Param(value = "slr")StatisticsListReq statisticsListReq); + + int deleteAnnualStatistics(String year); + + int selectStatisticsYear(String year); + + int selectGenerateYear(String year); + + List selectYearPerson(String year); + + void truncate(); + + List selectGroupList(Integer id); + + ArrayList selectPerson(); +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java index 9ba5a064..1950462a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java @@ -3,12 +3,10 @@ package com.daqing.financial.guarantee.mapper; 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.AlInsuranceListRes; +import com.daqing.financial.guarantee.model.response.LegalVo; +import com.daqing.financial.guarantee.model.response.PersonLiableResp; import com.daqing.framework.domain.guarantee.AlInsuranceList; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; /** *

@@ -21,7 +19,11 @@ import java.util.List; @Mapper public interface AlInsuranceListMapper extends BaseMapper { - IPage pageByCondition(Page page, String customerNumberOrName,Integer paymentStatus); + IPage pageByCondition(Page page, String customerNumberOrName,Integer paymentStatus); + + int selectBank(String bank); + + PersonLiableResp selectPersonLiable(String personLiable); - List selectListByIds(@Param("ids")List ids); + LegalVo selectLegal(String customerName); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlReimbursementMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlReimbursementMapper.java new file mode 100644 index 00000000..c54298f2 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlReimbursementMapper.java @@ -0,0 +1,26 @@ +package com.daqing.financial.guarantee.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.daqing.financial.guarantee.model.response.CollectionGroupListResp; +import com.daqing.financial.guarantee.model.response.Personnel; +import com.daqing.framework.domain.guarantee.AlReimbursement; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 保后代偿清收相关信息 Mapper 接口 + *

+ * + * @author lr + * @since 2021-08-12 + */ +@Mapper +public interface AlReimbursementMapper extends BaseMapper { + + List selectListByYear(@Param("year")String year,@Param("ids")List personLiableIds); + + List selectPersonnelList(); +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java index bfed027c..9176e91f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java @@ -32,9 +32,11 @@ public interface AlRepaymentEntryMapper extends BaseMapper { List listAlRepaymentByInsuranceId(Integer id); - List selectRepaymentList(); + List selectRepaymentList(Integer insuranceId); List selectOverDueDays(); List selectBind(); + + Integer compensationSituation(@Param("date")String date, @Param("insuranceId")Integer insuranceId); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java index eea677da..401f4140 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java @@ -24,9 +24,12 @@ public class AlCollectionRequest implements Serializable { @ApiModelProperty("保后id") private Integer insuranceId; - @ApiModelProperty("催收方式:1->电话催收;2->上门/外访") + @ApiModelProperty("id") + private Integer id; + + @ApiModelProperty("催收方式:1->电话催收;2->上门/外访,3其他催收描述") @Min(value = 1, message = "参数格式不正确") - @Max(value = 2, message = "参数格式不正确") + @Max(value = 3, message = "参数格式不正确") private Integer collectionMethod; @ApiModelProperty("催收时间") @@ -38,6 +41,17 @@ public class AlCollectionRequest implements Serializable { @NotNull(message = "请输入催收反馈") private String collectionFeedback; + @ApiModelProperty("拜访人") + @NotNull(message = "拜访人不能为空") + private String visitor; + + @ApiModelProperty("其他催收描述") + private String other; + + @ApiModelProperty("情况说明") + @NotNull(message = "请输入情况说明") + private String situationDescription; + @ApiModelProperty("附件") @NotNull(message = "请上传催收附件") private String[] enclosureFiles; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java deleted file mode 100644 index 87c83bf7..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.daqing.financial.guarantee.model.request; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; - -/** - *

- * 还款记录表 - *

- * - * @author Qyq - * @since 2021-03-17 - */ -@Data -@TableName("al_repayment_entry") -public class AlRepaymentEntryReq implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键id - */ - @ApiModelProperty(value = "主键id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - /** - * 保后外键id - */ - @ApiModelProperty(value = "保后外键id") - private Integer insuranceId; - - /** - * 应还款日 - */ - @NotNull(message = "应还款日不能为空") - @ApiModelProperty(value = "应还款日") - private Date repaymentDate; - - /** - * 实际还款日 - */ - @ApiModelProperty(value = "实际还款日") - private Date actualRepaymentDate; - - /** - * 逾期天数 - */ - @ApiModelProperty(value = "逾期天数") - private Integer overdueDays; - - /** - * 还款总额(元) - */ - @ApiModelProperty(value = "还款总额(元)") - private BigDecimal totalRepayment; - - /** - * 本次还款(元) - */ - @NotNull(message = "本次还款不能为空") - @ApiModelProperty(value = "本次还款(元)") - private BigDecimal currentRepayment; - - /** - * 利息(元) - */ - @NotNull(message = "利息不能为空") - @ApiModelProperty(value = "利息(元)") - private BigDecimal interest; - - /** - * 其他费用(元) - */ - @ApiModelProperty(value = "其他费用(元)") - private BigDecimal otherExpenses; - - /** - * 减免金额(元) - */ - @ApiModelProperty(value = "减免金额(元)") - private BigDecimal deductionAmount; - - /** - * 还款备注 - */ - @ApiModelProperty(value = "还款备注") - private String repaymentNotes; - - /** - * 还款状态:1->待还款;2->已还款;3->已逾期;4->未到期; - */ -/* @ApiModelProperty(value = "还款状态:1->待还款;2->已还款;3->已逾期;4->未到期;") - private Integer repaymentStatus;*/ - - /** - * 创建时间 - */ - @ApiModelProperty(value = "创建时间") - @TableField(fill= FieldFill.INSERT) - private Date createTime; - - /** - * 修改时间 - */ - @ApiModelProperty(value = "修改时间") - @TableField(fill= FieldFill.INSERT_UPDATE) - private Date updateTime; -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/CollectionProgressReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/CollectionProgressReq.java new file mode 100644 index 00000000..a3ed6584 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/CollectionProgressReq.java @@ -0,0 +1,52 @@ +package com.daqing.financial.guarantee.model.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Author chen + * @DATE 2021/8/20 9:58 + * @Version 1.0 + */ +@Data +public class CollectionProgressReq { + + @ApiModelProperty(value = "页号") + private Integer page; + + @ApiModelProperty(value = "页数") + private Integer size; + + @ApiModelProperty(value = "区域") + private String area; + + @ApiModelProperty(value = "经营情况") + private String operation; + + @ApiModelProperty(value = "贷款银行") + private String bank; + + @ApiModelProperty(value = "金额范围符号") + private String amountSymbol; + + @ApiModelProperty(value = "代偿金额") + private BigDecimal compensationAmount; + + @ApiModelProperty(value = "余额范围符号") + private String balanceSymbol; + + @ApiModelProperty(value = "代偿余额") + private BigDecimal compensatoryBalance; + + @ApiModelProperty(value = "代偿开始时间") + private String compensatoryStartTime; + + @ApiModelProperty(value = "代偿结束时间") + private String compensatoryEndTime; + + @ApiModelProperty(value = "查询条件<企业名称、清收负责人、业务编号>") + private String queryCondition; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/EditStatisticsListReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/EditStatisticsListReq.java new file mode 100644 index 00000000..717b22db --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/EditStatisticsListReq.java @@ -0,0 +1,20 @@ +package com.daqing.financial.guarantee.model.request; + +import com.daqing.framework.domain.guarantee.AlCollectionStatistics; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author chen + * @DATE 2021/8/31 17:05 + * @Version 1.0 + */ +@Data +public class EditStatisticsListReq implements Serializable { + + private static final long serialVersionUID = 2L; + + private List collectionStatistics; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ExcelImpInsuranceVO.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ExcelImpInsuranceVO.java new file mode 100644 index 00000000..4c56f335 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ExcelImpInsuranceVO.java @@ -0,0 +1,112 @@ +package com.daqing.financial.guarantee.model.request; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.daqing.financial.guarantee.util.ExcelAttribute; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +/** + * @Author chen + * @DATE 2021/9/2 11:20 + * @Version 1.0 + */ +@Data +public class ExcelImpInsuranceVO { + + //第几行 + @ExcelIgnore + private Long index; + + @ExcelAttribute(sort = 0) + @ApiModelProperty(value = "客户名称") + @ExcelProperty(value = "客户名称",index = 0) + private String customerName; + + @ExcelAttribute(sort = 1) + @ExcelProperty(value = "贷款银行",index = 1) + @ApiModelProperty(value = "贷款银行") + private String bank; + + @ExcelAttribute(sort = 2) + @ExcelProperty(value = "担保额度/贷款金额",index = 2) + @ApiModelProperty(value = "担保额度/贷款金额") + private String guaranteeAmount; + + @ExcelAttribute(sort = 3) + @ExcelProperty(value = "贷款开始日期",index = 3) + @ApiModelProperty(value = "贷款开始日期") + private String loanStartTime; + + @ExcelAttribute(sort = 4) + @ExcelProperty(value = "贷款结束日期",index = 4) + @ApiModelProperty(value = "贷款结束日期") + private String loanEndTime; + + @ExcelAttribute(sort = 5) + @ExcelProperty(value = "担保期限",index = 5) + @ApiModelProperty(value = "担保期限") + private String guaranteeTime; + + @ExcelAttribute(sort = 6) + @ExcelProperty(value = "业务类别",index = 6) + @ApiModelProperty(value = "业务类别") + private String businessType; + + @ExcelAttribute(sort = 7) + @ExcelProperty(value = "贷款用途",index = 7) + @ApiModelProperty(value = "贷款用途") + private String amountWide; + + @ExcelAttribute(sort = 8) + @ExcelProperty(value = "代偿金额",index = 8) + @ApiModelProperty(value = "代偿金额") + private String compensationAmount; + + @ExcelAttribute(sort = 9) + @ExcelProperty(value = "代偿余额",index = 9) + @ApiModelProperty(value = "代偿余额") + private String compensatoryBalance; + + @ExcelAttribute(sort = 10) + @ExcelProperty(value = "代偿时间",index = 10) + @ApiModelProperty(value = "代偿时间") + private String compensatoryTime; + + @ExcelAttribute(sort = 11) + @ExcelProperty(value = "清收负责人",index = 11) + @ApiModelProperty(value = "清收负责人") + private String personLiable; + + @ExcelAttribute(sort = 12) + @ExcelProperty(value = "所属清收组",index = 12) + @ApiModelProperty(value = "所属清收组") + private String collectionGroup; + + @ExcelAttribute(sort = 13) + @ExcelProperty(value = "所在区域",index = 13) + @ApiModelProperty(value = "所在区域") + private String area; + + @ExcelAttribute(sort = 14) + @ExcelProperty(value = "经营情况",index = 14) + @ApiModelProperty(value = "经营情况") + private String operation; + + @ExcelAttribute(sort = 15) + @ExcelProperty(value = "诉讼情况",index = 15) + @ApiModelProperty(value = "诉讼情况") + private String litigation; + + @ExcelAttribute(sort = 16) + @ExcelProperty(value = "抵押情况",index = 16) + @ApiModelProperty(value = "抵押情况") + private String mortgage; + + @ApiModelProperty("失败原因") + @ExcelAttribute(sort = 17) + @ExcelProperty(value = "失败原因",index = 17) + private String failureMsg; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GenerateReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GenerateReq.java new file mode 100644 index 00000000..07e7d355 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GenerateReq.java @@ -0,0 +1,28 @@ +package com.daqing.financial.guarantee.model.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @Author chen + * @DATE 2021/8/26 14:18 + * @Version 1.0 + */ +@Data +public class GenerateReq { + + @ApiModelProperty("年份") + @NotNull(message = "请选择年份") + private String year; + + @ApiModelProperty("人员生成标识") + private int flag; + + @ApiModelProperty("人员ids") + @NotNull(message = "请选择生成人员") + private List personLiableIds; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ImportInsuranceVO.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ImportInsuranceVO.java new file mode 100644 index 00000000..b8d7b433 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ImportInsuranceVO.java @@ -0,0 +1,34 @@ +package com.daqing.financial.guarantee.model.request; + + + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Author chen + * @DATE 2021/9/1 17:53 + * @Version 1.0 + */ +/*public class ImportInsuranceVO implements ExcelConsumeInterface { + + *//** + * when error will 调用 + *//* + @Override + public void error(ExcelError excelError) { + + } + + @Override + public void validData(String workbookId, List sheetDataList, Map excelParam) { + + } + + @Override + public void end(List sheetDataList, Map excelParam) { + + } + +}*/ diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InsuranceSaveReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InsuranceSaveReq.java new file mode 100644 index 00000000..14cd984f --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InsuranceSaveReq.java @@ -0,0 +1,22 @@ +package com.daqing.financial.guarantee.model.request; + +import com.daqing.framework.domain.guarantee.AlInsuranceList; +import com.daqing.framework.domain.guarantee.AlReimbursement; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author chen + * @DATE 2021/8/13 15:59 + * @Version 1.0 + * 保后业务添加实体类 + */ +@Data +public class InsuranceSaveReq { + + @ApiModelProperty(value = "担保信息") + private AlInsuranceList alInsuranceList; + + @ApiModelProperty(value = "保后代偿清收相关信息") + private AlReimbursement alReimbursement; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/StatisticsListReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/StatisticsListReq.java new file mode 100644 index 00000000..187f7dcf --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/StatisticsListReq.java @@ -0,0 +1,40 @@ +package com.daqing.financial.guarantee.model.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + +/** + * @Author chen + * @DATE 2021/8/30 11:21 + * @Version 1.0 + */ +@Data +public class StatisticsListReq { + + @ApiModelProperty(value = "年份") + @NotNull(message = "请选择年份") + private String year; + + @ApiModelProperty(value = "清收组id") + private String groupId; + + @ApiModelProperty(value = "比例范围符号") + private String proportionSymbol; + + @ApiModelProperty(value = "比例") + private String proportion; + + // @ApiModelProperty(value = "清收总额范围符号") + // private String totalCollectionSymbol; + // + // @ApiModelProperty(value = "清收总额") + // private String totalCollection; + + @ApiModelProperty(value = "查询条件<工号、清收负责人、清收企业>") + private String queryCondition; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java deleted file mode 100644 index bf52adf8..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.daqing.financial.guarantee.model.response; - -import com.alibaba.excel.annotation.ExcelIgnore; -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.metadata.BaseRowModel; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.daqing.framework.utils.excel.InsuranceStatusConverter; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; - -/** - *

- * 保后管理列表 - *

- * - * @author Qyq - * @since 2021-03-17 - */ -@Data -@ToString -public class AlInsuranceListRes extends BaseRowModel implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键id - */ - @ExcelIgnore - @ApiModelProperty(value = "企业id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - /** - * 业务编号 - */ - @ExcelProperty(value = "业务编号",index = 0) - @ApiModelProperty(value = "业务编号") - private String businessCode; - - /** - * 客户名称 - */ - @ExcelProperty(value = "客户名称",index = 1) - @ApiModelProperty(value = "客户名称") - private String customerName; - - /** - * 联系电话 - */ - @ExcelProperty(value = "联系电话",index = 2) - @ApiModelProperty(value = "联系电话") - private String phone; - - /** - * 业务类别 - */ - @ExcelProperty(value = "业务类型",index = 3) - @ApiModelProperty(value = "业务类别") - private String businessType; - - /** - * 担保额度(元) - */ - @ExcelProperty(value = "担保额度(元)",index = 4) - @ApiModelProperty(value = "担保额度(元)") - private BigDecimal guaranteeAmount; - - /** - * 担保期限 - */ - @ExcelProperty(value = "担保期限",index = 5) - @ApiModelProperty(value = "担保期限") - private String guaranteeTime; - - /** - * 申请日期 - */ - @ExcelProperty(value = "申请日期",index = 6) - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @ApiModelProperty(value = "申请日期") - private Date applyTime; - - @ExcelIgnore - @ApiModelProperty(value = "贷款银行(用中划线隔开)") - private String bank; - - @ExcelIgnore - @ApiModelProperty(value = "贷款用途") - private String amountWide; - - /** - * 还款额度(元) - */ - @ExcelProperty(value = "还款额度(元)",index = 7) - @ApiModelProperty(value = "还款额度(元)") - private BigDecimal repaymentAmount; - - /** - * 剩余额度(元) - */ - @ExcelProperty(value = "剩余额度(元)",index = 8) - @ApiModelProperty(value = "剩余额度(元)") - private BigDecimal remainAmount; - - /** - * 还款期数 - */ - @ExcelProperty(value = "还款期数",index = 9) - @ApiModelProperty(value = "还款期数") - private String repaymentTime; - - /** - * 所属部门 - */ - @ExcelProperty(value = "所属部门",index = 10) - @ApiModelProperty(value = "所属部门") - private String department; - - /** - * 还款状态:1->还款中;2->已逾期;3->已还清;4->已结项; - */ - @ExcelProperty(value = "还款状态",index = 11,converter = InsuranceStatusConverter.class) - @ApiModelProperty(value = "还款状态:1->还款中;2->已逾期;3->已还清;4->已结项;") - private Integer paymentStatus; - - /** - * 创建时间 - */ - @ExcelIgnore - @ApiModelProperty(value = "创建时间") - private Date createTime; - - /** - * 修改时间 - */ - @ExcelIgnore - @ApiModelProperty(value = "修改时间") - private Date updateTime; -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionGroupListResp.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionGroupListResp.java new file mode 100644 index 00000000..91734fae --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionGroupListResp.java @@ -0,0 +1,26 @@ +package com.daqing.financial.guarantee.model.response; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Author chen + * @DATE 2021/8/26 16:40 + * @Version 1.0 + */ +@Data +public class CollectionGroupListResp { + +/* @ApiModelProperty(value = "组id") + private String id; + + @ApiModelProperty(value = "组名") + private String name;*/ + + @ApiModelProperty(value = "组内人员") + private List personnel; + +} + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionProgressResp.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionProgressResp.java new file mode 100644 index 00000000..bfe45a8f --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CollectionProgressResp.java @@ -0,0 +1,93 @@ +package com.daqing.financial.guarantee.model.response; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Author chen + * @DATE 2021/8/20 15:11 + * @Version 1.0 + */ +@Data +public class CollectionProgressResp { + + @ApiModelProperty(value = "主键id") + @ExcelIgnore + private Integer id; + + @ApiModelProperty(value = "业务编号") + @ExcelProperty(value = "业务编号",index = 0) + private String businessCode; + + @ApiModelProperty(value = "客户名称") + @ExcelProperty(value = "企业名称",index = 1) + private String customerName; + + @ApiModelProperty(value = "法人-姓名") + @ExcelProperty(value = "法定代表人",index = 2) + private String legalName; + + @ApiModelProperty(value = "联系电话") + @ExcelProperty(value = "联系电话",index = 3) + private String phone; + + @ApiModelProperty(value = "贷款银行(用中划线隔开)") + @ExcelProperty(value = "贷款银行",index = 4) + private String bank; + + @ApiModelProperty(value = "贷款金额(元)") + @ExcelProperty(value = "贷款金额(元)",index = 5) + private BigDecimal guaranteeAmount; + + @ApiModelProperty(value = "贷款期限") + @ExcelProperty(value = "贷款期限",index = 6) + private String guaranteeTime; + + @ApiModelProperty(value = "代偿时间") + @ExcelProperty(value = "代偿时间",index = 7) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date compensatoryTime; + + @ApiModelProperty(value = "代偿金额(元)") + @ExcelProperty(value = "代偿金额(元)",index = 8) + private BigDecimal compensationAmount; + + @ApiModelProperty(value = "代偿余额(元)") + @ExcelProperty(value = "代偿余额(元)",index = 9) + private BigDecimal compensatoryBalance; + + @ApiModelProperty(value = "抵押情况") + @ExcelProperty(value = "抵押情况",index = 10) + private String mortgage; + + @ApiModelProperty(value = "诉讼情况") + @ExcelProperty(value = "诉讼情况",index = 11) + private String litigation; + + @ApiModelProperty(value = "经营情况") + @ExcelProperty(value = "经营情况",index = 12) + private String operation; + + @ApiModelProperty(value = "所在区域") + @ExcelProperty(value = "所在区域",index = 13) + private String area; + + @ApiModelProperty(value = "清偿方式") + @ExcelProperty(value = "清偿方式",index = 14) + private String repaymentMethod; + + @ApiModelProperty(value = "清收负责人") + @ExcelProperty(value = "清收负责人",index = 15) + private String personLiable; + + @ApiModelProperty(value = "备注") + @ExcelProperty(value = "备注",index = 16) + private String repaymentNotes; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/LegalVo.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/LegalVo.java new file mode 100644 index 00000000..08bf9e65 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/LegalVo.java @@ -0,0 +1,16 @@ +package com.daqing.financial.guarantee.model.response; + +import lombok.Data; + +/** + * @Author chen + * @DATE 2021/9/3 15:29 + * @Version 1.0 + */ +@Data +public class LegalVo { + + private String legalPhone; + private String legalName; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/MoreOverdueDetailResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/MoreOverdueDetailResponse.java index 5d314805..c2c3a808 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/MoreOverdueDetailResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/MoreOverdueDetailResponse.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; @@ -58,9 +59,18 @@ public class MoreOverdueDetailResponse implements Serializable { @ApiModelProperty("催收反馈") private String collectionFeedback; + @ApiModelProperty("情况说明") + private String situationDescription; + @ApiModelProperty("附件") private String enclosureFile; + @ApiModelProperty("其他描述") + private String other; + + @ApiModelProperty("拜访人") + private String visitor; + @ApiModelProperty("附件") private List enclosureFiles; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/OtherStatistics.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/OtherStatistics.java new file mode 100644 index 00000000..8578fbf5 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/OtherStatistics.java @@ -0,0 +1,38 @@ +package com.daqing.financial.guarantee.model.response; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Author chen + * @DATE 2021/8/30 16:00 + * @Version 1.0 + */ +@Data +public class OtherStatistics { + + @ApiModelProperty(value = "清收企业") + private String enterprise; + + @ApiModelProperty(value = "清收现金") + private BigDecimal cash; + + @ApiModelProperty(value = "清收资产") + private BigDecimal assets; + + @ApiModelProperty(value = "回款时间") + private Date collectionTime; + + @ApiModelProperty(value = "已清收总金额") + private BigDecimal totalAmount; + + @ApiModelProperty(value = "完成比例") + private String proportion; + + @ApiModelProperty(value = "备注") + private String description; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonLiableResp.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonLiableResp.java new file mode 100644 index 00000000..2e31d4c1 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonLiableResp.java @@ -0,0 +1,13 @@ +package com.daqing.financial.guarantee.model.response; + +import lombok.Data; + +/** + * @Author chen + * @DATE 2021/9/6 14:04 + * @Version 1.0 + */ +@Data +public class PersonLiableResp { + private Integer id; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/Personnel.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/Personnel.java new file mode 100644 index 00000000..603fef51 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/Personnel.java @@ -0,0 +1,20 @@ +package com.daqing.financial.guarantee.model.response; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author chen + * @DATE 2021/8/26 18:13 + * @Version 1.0 + */ +@Data +public class Personnel{ + + @ApiModelProperty(value = "人员id") + private String id; + + @ApiModelProperty(value = "人员名字") + private String name; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/StatisticsGroupVo.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/StatisticsGroupVo.java new file mode 100644 index 00000000..c79490c7 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/StatisticsGroupVo.java @@ -0,0 +1,19 @@ +package com.daqing.financial.guarantee.model.response; + +import com.daqing.framework.domain.guarantee.AlCollectionStatistics; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @Author chen + * @DATE 2021/9/15 14:10 + * @Version 1.0 + */ +@Data +public class StatisticsGroupVo { + + private Map> collect; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionGroupService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionGroupService.java new file mode 100644 index 00000000..78efe916 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionGroupService.java @@ -0,0 +1,16 @@ +package com.daqing.financial.guarantee.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.framework.domain.guarantee.AlCollectionGroup; + +/** + *

+ * 保后清收组 服务类 + *

+ * + * @author lr + * @since 2021-08-12 + */ +public interface AlCollectionGroupService extends IService { + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionStatisticsService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionStatisticsService.java new file mode 100644 index 00000000..bc89d2fa --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlCollectionStatisticsService.java @@ -0,0 +1,53 @@ +package com.daqing.financial.guarantee.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.financial.guarantee.model.request.CollectionProgressReq; +import com.daqing.financial.guarantee.model.request.GenerateReq; +import com.daqing.financial.guarantee.model.request.StatisticsListReq; +import com.daqing.financial.guarantee.model.response.CollectionGroupListResp; +import com.daqing.financial.guarantee.model.response.CollectionProgressResp; +import com.daqing.financial.guarantee.model.response.Personnel; +import com.daqing.framework.domain.guarantee.AlCollectionStatistics; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author lr + * @since 2021-08-19 + */ +public interface AlCollectionStatisticsService extends IService { + + List queryCollectionProgress(CollectionProgressReq collectionProgressReq); + + int selectCollectionProgressPageTotal(CollectionProgressReq collectionProgressReq); + + void batchExport(HttpServletResponse response, String ids) throws IOException; + + void generateStatistics(GenerateReq generateReq); + + List collectionGroupList(); + + List annualStatisticsList(StatisticsListReq statisticsListReq); + + List annualList(); + + int annualStatisticsListTotal(StatisticsListReq statisticsListReq); + + void annualStatisticsListExport(String year,String flag,HttpServletResponse response) throws IOException; + + List personnelSelection(String year); + + boolean annualStatisticsDeleted(String year); + + boolean selectYear(String year); + + boolean selectGenerateYear(String year); + + void updateCompleteStatistics(Integer repaymentId); +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlReimbursementService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlReimbursementService.java new file mode 100644 index 00000000..6468b79a --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/AlReimbursementService.java @@ -0,0 +1,16 @@ +package com.daqing.financial.guarantee.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.framework.domain.guarantee.AlReimbursement; + +/** + *

+ * 保后代偿清收相关信息 服务类 + *

+ * + * @author lr + * @since 2021-08-12 + */ +public interface AlReimbursementService extends IService { + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java index 3cabd4a4..d2d58c75 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java @@ -2,12 +2,15 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.financial.guarantee.model.response.AlInsuranceListRes; +import com.daqing.financial.guarantee.model.request.InsuranceSaveReq; +import com.daqing.financial.guarantee.util.R; import com.daqing.framework.domain.guarantee.AlInsuranceList; import com.daqing.framework.utils.PageUtils; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Map; /** *

@@ -21,11 +24,24 @@ public interface IAlInsuranceListService extends IService { PageUtils queryPage(Integer page, Integer size, String customerNumberOrName,Integer paymentStatus); - AlInsuranceListRes insuranceDetail(Integer id); + R insuranceDetail(Integer id); - Boolean excelExport(List ids, HttpServletResponse response); + void excelExport(List ids, HttpServletResponse response); int updateStatus(Integer id); - int updateInsuranceList(); + // int updateInsuranceList(); + + boolean saveInsurance(InsuranceSaveReq insuranceSaveReq); + + Integer updateInsurance(InsuranceSaveReq insuranceSaveReq); + + boolean deleteInsurance(Integer insuranceId); + + R compensationSituation(String date,Integer insuranceId); + + Map importInsurance(MultipartFile file) throws Exception; + + void exportFailureRecord(HttpServletResponse response, String exportCode); + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java index f69d0934..3e6d2c02 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java @@ -2,10 +2,8 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; import com.daqing.framework.utils.PageUtils; -import io.swagger.models.auth.In; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -21,19 +19,21 @@ import java.util.Map; */ public interface IAlRepaymentEntryService extends IService { - int repaymentEntry(AlRepaymentEntryReq alRepaymentEntryReq); + int repaymentEntry(AlRepaymentEntry alRepaymentEntryReq); + + void updateReimbursementData(Integer insuranceId); AlRepaymentEntry repaymentDetail(Integer id); PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, Integer status, Integer insuranceId); - int updateRepayment(AlRepaymentEntryReq alRepaymentEntryReq); + int updateRepayment(AlRepaymentEntry alRepaymentEntryReq); int delRepayment(List ids); Boolean excelExport(List ids,Integer insuranceId, HttpServletResponse response); - Map repaymentStatistics(Integer insuranceId,Double guaranteeAmount); + Map repaymentStatistics(Integer insuranceId); - int updateRepaymentEntry(); + void updateRepaymentEntry(Integer insuranceId); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionGroupServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionGroupServiceImpl.java new file mode 100644 index 00000000..0cfb3f01 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionGroupServiceImpl.java @@ -0,0 +1,21 @@ +package com.daqing.financial.guarantee.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.daqing.financial.guarantee.mapper.AlCollectionGroupMapper; +import com.daqing.financial.guarantee.service.AlCollectionGroupService; +import com.daqing.framework.domain.guarantee.AlCollectionGroup; +import org.springframework.stereotype.Service; + +/** + *

+ * 保后清收组 服务实现类 + *

+ * + * @author lr + * @since 2021-08-12 + */ +@Service +public class AlCollectionGroupServiceImpl extends ServiceImpl implements AlCollectionGroupService { + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java index 96971d88..0ba60f23 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java @@ -129,8 +129,9 @@ public class AlCollectionServiceImpl extends ServiceImpl 0; + } /** @@ -220,7 +221,7 @@ public class AlCollectionServiceImpl extends ServiceImpl0){ String a = measures.substring(1,measures.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); moreOverdueDetailResponse.setEnclosureFiles(demoList); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionStatisticsServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionStatisticsServiceImpl.java new file mode 100644 index 00000000..7dcc5f40 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionStatisticsServiceImpl.java @@ -0,0 +1,418 @@ +package com.daqing.financial.guarantee.service.impl; + + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.daqing.financial.guarantee.mapper.*; +import com.daqing.financial.guarantee.model.request.CollectionProgressReq; +import com.daqing.financial.guarantee.model.request.GenerateReq; +import com.daqing.financial.guarantee.model.request.StatisticsListReq; +import com.daqing.financial.guarantee.model.response.*; +import com.daqing.financial.guarantee.service.AlCollectionStatisticsService; +import com.daqing.framework.domain.guarantee.*; +import com.daqing.framework.utils.excel.EasyExcelUtil; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 服务实现类 + *

+ * + * @author lr + * @since 2021-08-19 + */ +@Service +public class AlCollectionStatisticsServiceImpl extends ServiceImpl implements AlCollectionStatisticsService { + + @Autowired + private AlRepaymentEntryMapper repaymentEntryMapper; + + @Autowired + private AlReimbursementMapper reimbursementMapper; + + @Autowired + private AlInsuranceListMapper insuranceListMapper; + + @Autowired + private AlCollectionGroupMapper collectionGroupMapper; + + @Override + public List queryCollectionProgress(CollectionProgressReq collectionProgressReq) { + collectionProgressReq.setPage((collectionProgressReq.getPage()-1)*collectionProgressReq.getSize()); + List pageList = baseMapper.selectCollectionProgressPage(collectionProgressReq); + for (CollectionProgressResp collectionProgressResp : pageList) { + //查询业务还款信息 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id", collectionProgressResp.getId()); + List repaymentEntryList = repaymentEntryMapper.selectList(wrapper); + ArrayList repaymentNotes = Lists.newArrayList(); + for (AlRepaymentEntry repaymentEntry : repaymentEntryList) { + if (repaymentEntry.getRepaymentCash() != null && repaymentEntry.getRepaymentCash().compareTo(BigDecimal.ZERO) != 0) { + if (!repaymentNotes.contains("现金")) { + repaymentNotes.add("现金"); + } + } + if (repaymentEntry.getRepaymentAssetsAmount() != null && repaymentEntry.getRepaymentAssetsAmount().compareTo(BigDecimal.ZERO) != 0) { + if (!repaymentNotes.contains("资产")) { + repaymentNotes.add("资产"); + } + } + if (repaymentEntry.getRepaymentOtherAmount() != null && repaymentEntry.getRepaymentOtherAmount().compareTo(BigDecimal.ZERO) != 0) { + if (!repaymentNotes.contains("其他")) { + repaymentNotes.add("其他"); + } + } + } + collectionProgressResp.setRepaymentMethod(repaymentNotes.toString()); + } + return pageList; + } + + @Override + public int selectCollectionProgressPageTotal(CollectionProgressReq collectionProgressReq) { + return baseMapper.selectCollectionProgressPageTotal(collectionProgressReq); + } + + @Override + public void batchExport(HttpServletResponse response, String ids) throws IOException { + List idList= new ArrayList<>(); + if(ids!=null && !"".equals(ids)){ + String[] id = ids.split(","); + idList = Arrays.asList(id); + } + List excelDataList = baseMapper.selectBatchData(idList); + for (CollectionProgressResp collectionProgressResp : excelDataList) { + //查询业务还款信息 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id", collectionProgressResp.getId()); + List repaymentEntryList = repaymentEntryMapper.selectList(wrapper); + String note = ""; + for (AlRepaymentEntry repaymentEntry : repaymentEntryList) { + ArrayList repaymentNotes = Lists.newArrayList(); + if (repaymentEntry.getRepaymentCash() != null && repaymentEntry.getRepaymentCash().compareTo(BigDecimal.ZERO) != 0) { + if (!repaymentNotes.contains("现金")) { + repaymentNotes.add("现金"); + } + } + if (repaymentEntry.getRepaymentAssetsAmount() != null && repaymentEntry.getRepaymentAssetsAmount().compareTo(BigDecimal.ZERO) != 0) { + if (!repaymentNotes.contains("资产")) { + repaymentNotes.add("资产"); + } + } + if (repaymentEntry.getRepaymentOtherAmount() != null && repaymentEntry.getRepaymentOtherAmount().compareTo(BigDecimal.ZERO) != 0) { + if (!repaymentNotes.contains("其他")) { + repaymentNotes.add("其他"); + } + } + note = repaymentNotes.toString(); + } + collectionProgressResp.setRepaymentMethod(note); + } + EasyExcelUtil.download(response,CollectionProgressResp.class,excelDataList,"清收工作进度列表","第一页"); + } + + @Override + @Transactional + public void generateStatistics(GenerateReq generateReq) { + //根据年份和负责人id筛选数据 + String year = generateReq.getYear(); + List personLiableIds = generateReq.getPersonLiableIds(); + + + //有人员id生成数据 + if (personLiableIds.size() > 0){ + List reimbursementList = reimbursementMapper.selectListByYear(year,personLiableIds); + for (AlReimbursement reimbursement : reimbursementList){ + AlCollectionStatistics collectionStatistics = new AlCollectionStatistics(); + Integer collectionGroupId = reimbursement.getCollectionGroupId(); + Integer personLiableId = reimbursement.getPersonLiableId(); + String personLiable = reimbursement.getPersonLiable(); + Integer insuranceId = reimbursement.getInsuranceId(); + //查询工号 + String jobNumber = baseMapper.selectJobNumber(reimbursement.getPersonLiableId()); + //查询企业 + AlInsuranceList alInsuranceList = insuranceListMapper.selectById(insuranceId); + String customerName = alInsuranceList.getCustomerName(); + //业务担保额度 + // BigDecimal guaranteeAmount = alInsuranceList.getGuaranteeAmount(); + //统计业务还款记录清收现金和资产 + QueryWrapper repaymentEntryWrapper = new QueryWrapper<>(); + repaymentEntryWrapper.eq("insurance_id",insuranceId).orderByAsc("id"); + List repaymentEntryList = repaymentEntryMapper.selectList(repaymentEntryWrapper); + //清收现金 + BigDecimal repaymentCash = new BigDecimal(0); + //清收资产 + BigDecimal repaymentAssets = new BigDecimal(0); + StringBuilder note = new StringBuilder(); + for (AlRepaymentEntry repaymentEntry: repaymentEntryList){ + //无实际还款日不加入年度统计 + if (repaymentEntry.getActualRepaymentDate()==null){ + continue; + } + if (repaymentEntry.getRepaymentCash()!=null){ + repaymentCash = repaymentCash.add(repaymentEntry.getRepaymentCash()); + } + if (repaymentEntry.getRepaymentAssetsAmount()!=null){ + repaymentAssets = repaymentAssets.add(repaymentEntry.getRepaymentAssetsAmount()); + } + if (repaymentEntry.getRepaymentOtherAmount()!=null){ + //其他金额加入清收资产中 + repaymentAssets = repaymentAssets.add(repaymentEntry.getRepaymentOtherAmount()); + } + collectionStatistics.setCollectionTime(repaymentEntry.getActualRepaymentDate()); + if (repaymentEntry.getRepaymentNotes()!=null){ + note.append(repaymentEntry.getRepaymentNotes()); + } + } + + collectionStatistics.setGroupId(collectionGroupId); + collectionStatistics.setInsuranceId(insuranceId); + collectionStatistics.setPersonLiable(personLiable); + collectionStatistics.setPersonLiableId(personLiableId); + collectionStatistics.setJobNumber(jobNumber); + collectionStatistics.setEnterprise(customerName); + collectionStatistics.setCash(repaymentCash); + collectionStatistics.setAssets(repaymentAssets); + collectionStatistics.setDescription(note.toString()); + baseMapper.insert(collectionStatistics); + } + } + } + + @Override + public List collectionGroupList() { + /*List groupListResp = new ArrayList<>(); + List groups = collectionGroupMapper.selectList(null); + for (AlCollectionGroup group : groups){ + CollectionGroupListResp collectionGroupListResp = new CollectionGroupListResp(); + Integer id = group.getId(); + collectionGroupListResp.setId(id+"group"); + collectionGroupListResp.setName(group.getGroupName()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("collection_group_id",id).select("person_liable","person_liable_id"); + List repaymentEntryList = reimbursementMapper.selectList(wrapper); + List personnelList = new ArrayList<>(); + for (AlReimbursement reimbursement : repaymentEntryList){ + Personnel personnel = new Personnel(); + Integer personLiableId = reimbursement.getPersonLiableId(); + String personLiable = reimbursement.getPersonLiable(); + personnel.setId(id+","+personLiableId); + personnel.setName(personLiable); + if(!personnelList.contains(personnel)){ + personnelList.add(personnel); + } + } + collectionGroupListResp.setPersonnel(personnelList); + groupListResp.add(collectionGroupListResp); + }*/ + + List personnel = reimbursementMapper.selectPersonnelList(); + return personnel; + } + + @Override + public List annualStatisticsList(StatisticsListReq statisticsListReq) { + return baseMapper.selectAnnualStatisticsList(statisticsListReq); + } + + @Override + public int annualStatisticsListTotal(StatisticsListReq statisticsListReq) { + return baseMapper.selectAnnualStatisticsListTotal(statisticsListReq); + } + + @Override + public List annualList() { + return baseMapper.selectAnnualList(); + } + + @Override + public void annualStatisticsListExport(String year,String flag,HttpServletResponse response) throws IOException { + StatisticsListReq statisticsListReq = new StatisticsListReq(); + statisticsListReq.setYear(year); + List statisticsList = baseMapper.selectAnnualStatisticsList(statisticsListReq); + List statisticsLists = new ArrayList<>(); + if ("0".equals(flag)){ + //根据组进行排名 + Map> collect = statisticsList.stream(). + sorted(Comparator.comparing(AlCollectionStatistics::getTotalAmount).reversed()). + collect(Collectors.groupingBy(AlCollectionStatistics::getGroupId)); + int sort = 0; + for (Integer s : collect.keySet()){ + List statisticsList1 = collect.get(s); + ++sort; + for (AlCollectionStatistics alCollectionStatistics : statisticsList1){ + alCollectionStatistics.setSort(sort); + String proportion = alCollectionStatistics.getProportion(); + if (proportion!=null){ + float v1 = alCollectionStatistics.getTotalAmount().floatValue(); + float v2 = Float.parseFloat(proportion); + DecimalFormat df = new DecimalFormat("##.##%");//传入格式模板 + String result = df.format(v1/v2); + alCollectionStatistics.setProportion(result); + } + } + statisticsLists.addAll(statisticsList1); + } + }else { + //根据公司进行排名... + List annualStatisticsListByPersonSort = baseMapper.selectAnnualStatisticsListByPersonSort(); + int sort = 0; + for (AlCollectionStatistics alCollectionStatistics : annualStatisticsListByPersonSort){ + alCollectionStatistics.setSort(++sort); + String proportion = alCollectionStatistics.getProportion(); + if (proportion!=null){ + //获取分母 + String denominator = proportion.substring(proportion.lastIndexOf(",")+1); + float v1 = alCollectionStatistics.getTotalAmount().floatValue(); + float v2 = Float.parseFloat(denominator); + DecimalFormat df = new DecimalFormat("##.##%");//传入格式模板 + String result = df.format(v1/v2); + alCollectionStatistics.setProportion(result); + } + } + statisticsLists.addAll(annualStatisticsListByPersonSort); + } + + // 告诉浏览器用什么软件可以打开此文件 + response.setHeader("content-Type", "application/vnd.ms-excel"); + // 下载文件的默认名称 + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("年度统计列表", "UTF-8") + ".xls"); + //编码 + response.setCharacterEncoding("UTF-8"); + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), AlCollectionStatistics.class, statisticsLists); + workbook.write(response.getOutputStream()); + } + + /** + * 返回该年份已经存在的负责人id + * @param year 年份 + * @return 负责人id + */ + @Override + public List personnelSelection(String year) { + List list = baseMapper.selectYearPerson(year); + /*ArrayList ids = Lists.newArrayList(); + list.forEach(id -> { + List groupList = baseMapper.selectGroupList(id); + groupList.forEach(g -> { + String s = g + ","+id; + ids.add(s); + }); + });*/ + return list; + } + + @Override + public boolean annualStatisticsDeleted(String year) { + int delete = baseMapper.deleteAnnualStatistics(year); + return delete > 0; + } + + @Override + public boolean selectYear(String year) { + int have = baseMapper.selectStatisticsYear(year); + return have > 0; + } + + @Override + public boolean selectGenerateYear(String year) { + int have = baseMapper.selectGenerateYear(year); + return have > 0; + } + + /** + * 还款添加或编辑或删除,根据还款记录id查询保后业务数据更新年度清收数据 + */ + @Override + public void updateCompleteStatistics(Integer insuranceId) { + //查询清收代偿信息 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id",insuranceId); + AlReimbursement reimbursement = reimbursementMapper.selectOne(wrapper); + Integer groupId = reimbursement.getCollectionGroupId(); + Integer personLiableId = reimbursement.getPersonLiableId(); + String personLiable = reimbursement.getPersonLiable(); + //查询该人员是否在统计列表中,在统计列表中,计算该业务下的年度统计情况 + ArrayList list = baseMapper.selectPerson(); + boolean contains = list.contains(personLiableId); + if (contains){ + AlCollectionStatistics collectionStatistics = new AlCollectionStatistics(); + //查询工号 + String jobNumber = baseMapper.selectJobNumber(reimbursement.getPersonLiableId()); + //查询企业 + AlInsuranceList alInsuranceList = insuranceListMapper.selectById(insuranceId); + String customerName = alInsuranceList.getCustomerName(); + //统计该业务下还款记录清收现金和资产 + QueryWrapper repaymentEntryWrapper = new QueryWrapper<>(); + repaymentEntryWrapper.eq("insurance_id",insuranceId).orderByAsc("id"); + List repaymentEntryList = repaymentEntryMapper.selectList(repaymentEntryWrapper); + //无还款记录则删除该年度业务统计 + if (ObjectUtil.isNull(repaymentEntryList)){ + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.eq("insurance_id",insuranceId).eq("group_id",groupId); + baseMapper.delete(deleteWrapper); + }else { + //先清空之前数据 + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.eq("insurance_id",insuranceId).eq("group_id",groupId); + baseMapper.delete(deleteWrapper); + //清收现金 + BigDecimal repaymentCash = new BigDecimal(0); + //清收资产 + BigDecimal repaymentAssets = new BigDecimal(0); + + StringBuilder note = new StringBuilder(); + for (AlRepaymentEntry repayment: repaymentEntryList){ + //无实际还款日不加入年度统计 + if (repayment.getActualRepaymentDate()==null){ + continue; + } + if (repayment.getRepaymentCash()!=null){ + repaymentCash = repaymentCash.add(repayment.getRepaymentCash()); + } + if (repayment.getRepaymentAssetsAmount()!=null){ + repaymentAssets = repaymentAssets.add(repayment.getRepaymentAssetsAmount()); + } + if (repayment.getRepaymentOtherAmount()!=null){ + //其他金额加入清收资产中 + repaymentAssets = repaymentAssets.add(repayment.getRepaymentOtherAmount()); + } + collectionStatistics.setCollectionTime(repayment.getActualRepaymentDate()); + if (repayment.getRepaymentNotes()!=null){ + note.append(repayment.getRepaymentNotes()); + } + } + //添加年度数据 + collectionStatistics.setGroupId(groupId); + collectionStatistics.setInsuranceId(insuranceId); + collectionStatistics.setPersonLiable(personLiable); + collectionStatistics.setPersonLiableId(personLiableId); + collectionStatistics.setJobNumber(jobNumber); + collectionStatistics.setEnterprise(customerName); + collectionStatistics.setCash(repaymentCash); + collectionStatistics.setAssets(repaymentAssets); + collectionStatistics.setDescription(note.toString()); + baseMapper.insert(collectionStatistics); + } + } + } +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java index d5d298c4..cfc0dff0 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java @@ -1,30 +1,42 @@ package com.daqing.financial.guarantee.service.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.daqing.financial.guarantee.mapper.AlInsuranceListMapper; -import com.daqing.financial.guarantee.mapper.AlRepaymentEntryMapper; -import com.daqing.financial.guarantee.model.response.AlInsuranceListRes; -import com.daqing.financial.guarantee.model.response.AlRepaymentCountRes; -import com.daqing.financial.guarantee.model.response.AlRepaymentRes; +import com.daqing.financial.guarantee.mapper.*; +import com.daqing.financial.guarantee.model.request.ExcelImpInsuranceVO; +import com.daqing.financial.guarantee.model.request.InsuranceSaveReq; +import com.daqing.financial.guarantee.model.response.LegalVo; +import com.daqing.financial.guarantee.model.response.PersonLiableResp; +import com.daqing.financial.guarantee.service.AlCollectionStatisticsService; import com.daqing.financial.guarantee.service.IAlInsuranceListService; +import com.daqing.financial.guarantee.service.IAlRepaymentEntryService; +import com.daqing.financial.guarantee.util.ExcelImportHelper; +import com.daqing.financial.guarantee.util.R; import com.daqing.framework.domain.crms.response.CrmsCode; -import com.daqing.framework.domain.guarantee.AlInsuranceList; -import com.daqing.framework.domain.guarantee.AlRepaymentEntry; +import com.daqing.framework.domain.guarantee.*; import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.utils.PageUtils; -import com.daqing.framework.utils.excel.ExcelUtil; -import org.apache.poi.hpsf.Decimal; -import org.springframework.beans.BeanUtils; +import com.daqing.framework.utils.excel.EasyExcelUtil; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; -import java.util.List; - +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.TimeUnit; /** *

@@ -39,6 +51,28 @@ public class AlInsuranceListServiceImpl extends ServiceImpl positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,paymentStatus); + IPage positionVO = this.getBaseMapper().pageByCondition(new Page(page, size), customerNumberOrName, paymentStatus); return new PageUtils(positionVO); } @Override - public AlInsuranceListRes insuranceDetail(Integer id) { - AlInsuranceList alInsuranceList = this.baseMapper.selectById(id); - AlInsuranceListRes res = new AlInsuranceListRes(); - if(alInsuranceList!=null){ - BeanUtils.copyProperties(alInsuranceList,res); - return res; - }else{ - return null; - } + public R insuranceDetail(Integer id) { + AlInsuranceList insuranceList = baseMapper.selectById(id); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id", insuranceList.getId()); + AlReimbursement reimbursement = reimbursementMapper.selectOne(wrapper); + return R.ok().data("insuranceList", insuranceList).data("reimbursement", reimbursement); } @Override - public Boolean excelExport(List ids, HttpServletResponse response) { - ListalInsuranceList = this.baseMapper.selectListByIds(ids); + public void excelExport(List ids, HttpServletResponse response) { + List alInsuranceList = null; + //为空默认导出全部数据 + if (ids.size()==0){ + alInsuranceList = baseMapper.selectList(null); + }else { + alInsuranceList = baseMapper.selectBatchIds(ids); + } try { - ExcelUtil.writeExcelWithSheets(response, alInsuranceList, "保后管理一览表", "repaymentEntry", new AlInsuranceListRes()) - .finish(); - return true; + EasyExcelUtil.download(response, AlInsuranceList.class,alInsuranceList,"保后管理一览表","第一页"); } catch (Exception e) { ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); - return false; } } @@ -82,33 +116,555 @@ public class AlInsuranceListServiceImpl extends ServiceImpl().eq("id",id)); + return this.baseMapper.update(alInsuranceList, new QueryWrapper().eq("id", id)); } @Override - public int updateInsuranceList() { - //统计保后id,还款额度,还款期数 - List list = alRepaymentEntryMapper.selectRepaymentList(); - - //遍历list计算出剩余额度(剩余额度=担保额度-还款额度) - for (AlRepaymentCountRes res:list) { - BigDecimal guaranteeAmount = res.getGuaranteeAmount(); - BigDecimal alreadyPaymentSum = res.getAlreadyPaymentSum(); - Double remainSum = guaranteeAmount.doubleValue() - alreadyPaymentSum.doubleValue(); - res.setRemainSum(BigDecimal.valueOf(remainSum)); - //额度实时更新 - AlInsuranceList alInsuranceList = new AlInsuranceList(); - - if(remainSum==0.00){//剩余额度为0.00,状态为已还清 - alInsuranceList.setPaymentStatus(3);//已还清 + @Transactional + public boolean saveInsurance(InsuranceSaveReq insuranceSaveReq) { + AlInsuranceList alInsuranceList = insuranceSaveReq.getAlInsuranceList(); + AlReimbursement alReimbursement = insuranceSaveReq.getAlReimbursement(); + long time = System.currentTimeMillis(); + alInsuranceList.setBusinessCode("SD-"+time); + //添加固定为手动录入 + alInsuranceList.setSource(1); + alInsuranceList.setApplyTime(new Date()); + //默认数据 + alInsuranceList.setRepaymentAmount(new BigDecimal(0)); + alInsuranceList.setRemainAmount(alInsuranceList.getGuaranteeAmount()); + alInsuranceList.setRepaymentTime(0); + int insert = baseMapper.insert(alInsuranceList); + int ok = 0; + //添加担保信息 + if (insert > 0) { + alReimbursement.setInsuranceId(alInsuranceList.getId()); + ok = reimbursementMapper.insert(alReimbursement); + } + return ok > 0; + } + + @Override + @Transactional + public Integer updateInsurance(InsuranceSaveReq insuranceSaveReq) { + //获取更新数据 + AlInsuranceList alInsuranceList = insuranceSaveReq.getAlInsuranceList(); + AlReimbursement alReimbursement = insuranceSaveReq.getAlReimbursement(); + //更新业务信息 + baseMapper.updateById(alInsuranceList); + //查询清收代偿信息 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id",alInsuranceList.getId()); + AlReimbursement reimbursement = reimbursementMapper.selectOne(wrapper); + //数据存在及更新,流转即添加 + if (ObjectUtil.isNotNull(reimbursement)){ + //之前清收负责人或清收组数据和本次更新不一致,清除之前数据 + if (!reimbursement.getCollectionGroupId().equals(alReimbursement.getCollectionGroupId())||!reimbursement.getPersonLiableId().equals(alReimbursement.getPersonLiableId())){ + //查询之前人员是否在统计列表中,存在则清除 + ArrayList list = collectionStatisticsMapper.selectPerson(); + boolean contains = list.contains(reimbursement.getPersonLiableId()); + if (contains){ + //清空之前统计该业务数据 + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.eq("insurance_id",alInsuranceList.getId()); + int delete = collectionStatisticsMapper.delete(deleteWrapper); + // System.out.println("删除条数"+delete); + if (delete>0){ + //根据业务id更新年度统计 + collectionStatisticsService.updateCompleteStatistics(alInsuranceList.getId()); + } + } + } + //更新清收代偿数据 + alReimbursement.setId(reimbursement.getId()); + reimbursementMapper.updateById(alReimbursement); + }else { + reimbursementMapper.insert(alReimbursement); + } + return alInsuranceList.getId(); + } + + @Override + @Transactional + public boolean deleteInsurance(Integer insuranceId) { + //删除保后 + int delete = baseMapper.deleteById(insuranceId); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id",insuranceId); + //删除清收代偿 + reimbursementMapper.delete(wrapper); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("insurance_id",insuranceId); + //删除还款记录 + alRepaymentEntryMapper.delete(queryWrapper); + //删除催收记录 + QueryWrapper collectionQueryWrapper = new QueryWrapper<>(); + collectionQueryWrapper.eq("insurance_id",insuranceId); + collectionMapper.delete(collectionQueryWrapper); + //删除清收年度统计数据 + QueryWrapper statisticsQueryWrapper = new QueryWrapper<>(); + statisticsQueryWrapper.eq("insurance_id",insuranceId); + collectionStatisticsMapper.delete(statisticsQueryWrapper); + return delete > 0; + } + + /** + * 代偿情况,根据代偿时间返回该日期之后的本次还款金额+其他费用+利息,用于计算代偿余额相关信息 + * @param date 代偿时间 + * @param insuranceId 业务id + * @return 还款金额 + */ + @Override + public R compensationSituation(String date,Integer insuranceId) { + Integer amount = alRepaymentEntryMapper.compensationSituation(date,insuranceId); + return R.ok().data("amount",amount); + } + + @Override + public Map importInsurance(MultipartFile file) throws Exception { + //获取文件数据 + List impInsuranceVOList = ExcelImportHelper.readInsuranceManagement(file); + if (impInsuranceVOList.size() <= 0) { + //小于等于0为上传空模板的情况下 抛出异常 + throw new Exception("模板为空"); + } + //导入失败数据 + List impInsuranceFailVo = new ArrayList<>(); + // 参数合法性校验,只能上传.xlsx后缀的文件 + if (org.apache.commons.lang3.StringUtils.isBlank(file.getOriginalFilename()) + || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).equals(".xlsx")) { + throw new Exception("只能上传.xlsx后缀的文件"); + } + Map map = new HashMap<>(); + Long ii = 1L;//用于记录序列号 + Integer countNum = 0;//用于失败原因排序 eg:1、XXXXX 2、XXXXXXX + + try { + Integer countSuccess = 0;//统计成功次数 + Integer countError = 0;//统计失败次数 + + for (ExcelImpInsuranceVO impInsuranceVO : impInsuranceVOList) { + boolean ret = true; + ++ii; + + String errMsg = ""; + //去除Excel中的全角半角空格,判断空字符再截取 + String customerName = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getCustomerName())){ + customerName = impInsuranceVO.getCustomerName().replaceAll("\\u00A0", "").trim(); + } + + String bank = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getBank())){ + bank = impInsuranceVO.getBank().replaceAll("\\u00A0", "").trim(); + } + + String guaranteeAmount = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getGuaranteeAmount())){ + guaranteeAmount = impInsuranceVO.getGuaranteeAmount().replaceAll("\\u00A0", "").trim(); + } + + String loanStartTime = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getLoanStartTime())){ + loanStartTime = impInsuranceVO.getLoanStartTime().replaceAll("\\u00A0", "").trim(); + } + + String loanEndTime = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getLoanEndTime())){ + loanEndTime = impInsuranceVO.getLoanEndTime().replaceAll("\\u00A0", "").trim(); + } + + String guaranteeTime = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getGuaranteeTime())){ + guaranteeTime = impInsuranceVO.getGuaranteeTime().replaceAll("\\u00A0", "").trim(); + } + + String businessType = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getBusinessType())){ + businessType = impInsuranceVO.getBusinessType().replaceAll("\\u00A0", "").trim(); + } + + String amountWide = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getAmountWide())){ + amountWide = impInsuranceVO.getAmountWide().replaceAll("\\u00A0", "").trim(); + } + + String compensationAmount = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getCompensationAmount())){ + compensationAmount = impInsuranceVO.getCompensationAmount().replaceAll("\\u00A0", "").trim(); + } + + String compensatoryBalance = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getCompensatoryBalance())){ + compensatoryBalance = impInsuranceVO.getCompensatoryBalance().replaceAll("\\u00A0", "").trim(); + } + + String compensatoryTime = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getCompensatoryTime())){ + compensatoryTime = impInsuranceVO.getCompensatoryTime().replaceAll("\\u00A0", "").trim(); + } + + String personLiable = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getPersonLiable())){ + personLiable = impInsuranceVO.getPersonLiable().replaceAll("\\u00A0", "").trim(); + } + + String collectionGroup = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getCollectionGroup())){ + collectionGroup = impInsuranceVO.getCollectionGroup().replaceAll("\\u00A0", "").trim(); + } + + String area = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getArea())){ + area = impInsuranceVO.getArea().replaceAll("\\u00A0", "").trim(); + } + + String operation = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getOperation())){ + operation = impInsuranceVO.getOperation().replaceAll("\\u00A0", "").trim(); + } + + String litigation = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getLitigation())){ + litigation = impInsuranceVO.getLitigation().replaceAll("\\u00A0", "").trim(); + } + + String mortgage = ""; + if (StringUtils.isNotBlank(impInsuranceVO.getMortgage())){ + mortgage = impInsuranceVO.getMortgage().replaceAll("\\u00A0", "").trim(); + } + String legalName = ""; + String legalPhone = ""; + + ExcelImpInsuranceVO failVo = new ExcelImpInsuranceVO(); + failVo.setIndex(ii); + //检验客户 + if ("".equals(customerName)) { + ++countNum; + failVo.setCustomerName(customerName + " *必填项:(客户名称不能为空) "); + errMsg += countNum + "必填项:(客户名称不能为空)"; + ret = false; + } else { + //查询企业信息 + LegalVo legalVo = baseMapper.selectLegal(customerName); + if (ObjectUtil.isNull(legalVo)) { + failVo.setCustomerName(customerName + " *必填项:(客户不存在) "); + errMsg += countNum + "必填项:(客户不存在)"; + ret = false; + } else { + //法定代表人 + legalName = legalVo.getLegalName(); + //联系电话 + legalPhone = legalVo.getLegalPhone(); + } + failVo.setCustomerName(customerName); + } + + if ("".equals(bank)) { + ++countNum; + failVo.setBank(bank + " *必填项:(银行不能为空)"); + errMsg += countNum + " *必填项:(银行不能为空)"; + ret = false; + } else { + int ok = baseMapper.selectBank(bank); + if (ok == 0) { + failVo.setBank(bank + " *必填项:(银行不存在) "); + errMsg += countNum + "必填项:(银行不存在)"; + ret = false; + } + failVo.setBank(bank); + } + + if ("".equals(guaranteeAmount)) { + ++countNum; + failVo.setGuaranteeAmount(guaranteeAmount + " *必填项:(担保额度不能为空)"); + errMsg += countNum + " *必填项:(担保额度不能为空)"; + ret = false; + }else { + boolean numeric = StringUtils.isNumeric(guaranteeAmount); + if(!numeric){ + ++countNum; + failVo.setGuaranteeAmount(guaranteeAmount + " *必填项:(担保额度不能字符)"); + errMsg += countNum + " *必填项:(担保额度不能字符)"; + ret = false; + } + failVo.setGuaranteeAmount(guaranteeAmount); + } + + if ("".equals(loanStartTime)) { + ++countNum; + failVo.setLoanStartTime(loanStartTime + " *必填项:(贷款开始日期不能为空)"); + errMsg += countNum + " *必填项:(贷款开始日期不能为空)"; + ret = false; + }else { + boolean validDate = isValidDate(loanStartTime); + if (!validDate){ + ++countNum; + failVo.setLoanStartTime(loanStartTime + " *必填项:(贷款开始日期格式错误)"); + errMsg += countNum + " *必填项:(贷款开始日期格式错误)"; + ret = false; + } + failVo.setLoanStartTime(loanStartTime); + } + + if ("".equals(loanEndTime)) { + ++countNum; + failVo.setLoanEndTime(loanEndTime + " *必填项:(贷款结束日期不能为空)"); + errMsg += countNum + " *必填项:(贷款结束日期不能为空)"; + ret = false; + }else { + boolean validDate = isValidDate(loanEndTime); + if (!validDate){ + ++countNum; + failVo.setLoanEndTime(loanEndTime + " *必填项:(贷款结束日期格式错误)"); + errMsg += countNum + " *必填项:(贷款结束日期格式错误)"; + ret = false; + } + failVo.setLoanEndTime(loanEndTime); + } + + if ("".equals(guaranteeTime)) { + ++countNum; + failVo.setGuaranteeTime(guaranteeTime + " *必填项:(担保期限不能为空)"); + errMsg += countNum + " *必填项:(担保期限不能为空)"; + ret = false; + }else { + boolean numeric = StringUtils.isNumeric(guaranteeTime); + if(!numeric){ + ++countNum; + failVo.setGuaranteeTime(guaranteeTime + " *必填项:(担保期限格式错误,请输入数字)"); + errMsg += countNum + " *必填项:(担保期限格式错误,请输入数字)"; + ret = false; + } + failVo.setGuaranteeTime(guaranteeTime); + } + + if ("".equals(businessType)) { + ++countNum; + failVo.setBusinessType(businessType + " *必填项:(业务类别不能为空)"); + errMsg += countNum + " *必填项:(业务类别不能为空)"; + ret = false; + } else { + switch (businessType.trim()) { + case "融资担保": + case "担保": + case "借贷": + case "小额贷": + case "企业大贷": + case "其他": + break; + default: + ++countNum; + failVo.setBusinessType(businessType + " *必填项:(业务类别不存在)"); + errMsg += countNum + " *必填项:(业务类别不存在)"; + ret = false; + } + failVo.setBusinessType(businessType); + } + + if ("".equals(amountWide)) { + ++countNum; + failVo.setAmountWide(amountWide + " *必填项:(贷款用途不能为空)"); + errMsg += countNum + " *必填项:(贷款用途不能为空)"; + ret = false; + } else { + switch (amountWide.trim()) { + case "短期周转": + case "购房贷款": + case "装修贷款": + case "购车贷款": + case "教育贷款": + case "投资创业": + case "其他": + break; + default: + ++countNum; + failVo.setAmountWide(amountWide + " *必填项:(贷款用途不存在)"); + errMsg += countNum + " *必填项:(贷款用途不存在)"; + ret = false; + } + failVo.setAmountWide(amountWide); + } + Integer personLiableId = 0; + if ("".equals(personLiable)) { + ++countNum; + failVo.setPersonLiable(personLiable + " *必填项:(清收负责人不能为空)"); + errMsg += countNum + " *必填项:(清收负责人不能为空)"; + ret = false; + } else { + PersonLiableResp personLiableResp = baseMapper.selectPersonLiable(personLiable); + if (ObjectUtil.isNull(personLiableResp)) { + failVo.setPersonLiable(personLiable + " *必填项:(清收负责人不存在) "); + errMsg += countNum + "必填项:(清收负责人不存在)"; + ret = false; + }else { + personLiableId = personLiableResp.getId(); + } + failVo.setPersonLiable(personLiable); + } + + int collectionGroupId = 0; + if ("".equals(collectionGroup)) { + ++countNum; + failVo.setCollectionGroup(collectionGroup + " *必填项:(清收组不能为空)"); + errMsg += countNum + " *必填项:(清收组不能为空)"; + ret = false; + } else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("group_name", collectionGroup); + AlCollectionGroup one = collectionGroupMapper.selectOne(queryWrapper); + if (ObjectUtil.isNull(one)) { + failVo.setCollectionGroup(collectionGroup + " *必填项:(清收组不存在) "); + errMsg += countNum + "必填项:(清收组不存在)"; + ret = false; + }else { + collectionGroupId = one.getId(); + } + failVo.setCollectionGroup(collectionGroup); + } + + if ("".equals(area)) { + ++countNum; + failVo.setArea(area + " *必填项:(所在区域不能为空)"); + errMsg += countNum + " *必填项:(所在区域不能为空)"; + ret = false; + } else { + switch (area.trim()) { + case "萨尔图区": + case "高新区": + case "龙凤区": + case "让胡同路区": + case "大同区": + case "肇县区": + break; + default: + ++countNum; + failVo.setArea(area + " *必填项:(所在区域不存在)"); + errMsg += countNum + " *必填项:(所在区域不存在)"; + ret = false; + } + failVo.setArea(area); + } + + //效验都通过添加数据 + if (ret) { + InsuranceSaveReq insuranceSaveReq = new InsuranceSaveReq(); + AlInsuranceList insuranceList = new AlInsuranceList(); + AlReimbursement reimbursement = new AlReimbursement(); + + insuranceList.setCustomerName(customerName); + insuranceList.setBank(bank); + insuranceList.setLegalName(legalName); + insuranceList.setPhone(legalPhone); + insuranceList.setBusinessType(businessType); + insuranceList.setGuaranteeAmount(new BigDecimal(guaranteeAmount)); + insuranceList.setGuaranteeTime(guaranteeTime); + insuranceList.setLoanStartTime(DateUtil.parse(loanStartTime)); + insuranceList.setLoanEndTime(DateUtil.parse(loanEndTime)); + insuranceList.setAmountWide(amountWide); + + if (!"".equals(compensationAmount)) { + reimbursement.setCompensationAmount(new BigDecimal(compensationAmount)); + } + if (!"".equals(compensatoryBalance)) { + reimbursement.setCompensatoryBalance(new BigDecimal(compensatoryBalance)); + } + + if (!"".equals(compensatoryTime)) { + reimbursement.setCompensatoryTime(DateUtil.parse(compensatoryTime)); + } + + reimbursement.setPersonLiable(personLiable); + reimbursement.setPersonLiableId(personLiableId); + reimbursement.setCollectionGroupId(collectionGroupId); + reimbursement.setArea(area); + reimbursement.setOperation(operation); + reimbursement.setLitigation(litigation); + reimbursement.setMortgage(mortgage); + + insuranceSaveReq.setAlInsuranceList(insuranceList); + insuranceSaveReq.setAlReimbursement(reimbursement); + this.saveInsurance(insuranceSaveReq); + countSuccess++; + } else { + countError++; + failVo.setFailureMsg(errMsg); + //添加失败数据 + impInsuranceFailVo.add(failVo); + } } - alInsuranceList.setId(res.getInsuranceId()); - alInsuranceList.setRepaymentAmount(res.getAlreadyPaymentSum());//还款额度 - alInsuranceList.setRepaymentTime(res.getRepaymentSum());//还款期数 - alInsuranceList.setRemainAmount(res.getRemainSum());//剩余额度 - this.baseMapper.updateById(alInsuranceList); + String exportCode = ""; + // 有导入失败的数据,才会存入redis + if (countError > 0) { + //生成token + exportCode = "FAILURE_IMPORT" + UUID.randomUUID().toString().replace("-", ""); + ValueOperations ops = stringRedisTemplate.opsForValue(); + String failureVOJson = JSON.toJSONString(impInsuranceFailVo); + ops.set(exportCode, failureVOJson, 30 * 60, TimeUnit.SECONDS); + } + map.put("exportCode", exportCode);//返回导出code + map.put("successNum", countSuccess + "");//本次新增成功数量 + map.put("failureNum", countError + "");//本次新增失败数量 + return map; + } catch (RuntimeException e) { + throw new RuntimeException(); + } + + } + + @Override + public void exportFailureRecord(HttpServletResponse response, String exportCode) { + if (StringUtils.isEmpty(exportCode)) { + return; + } + ValueOperations ops = stringRedisTemplate.opsForValue(); + //获取数据 + String record = ops.get(exportCode); + if (StringUtils.isEmpty(record)) { + return; + } + List parse = JSON.parseObject(record, new TypeReference>() { + }); + + parse.sort(Comparator.comparing(ExcelImpInsuranceVO::getIndex)); + + try { + EasyExcelUtil.download(response, ExcelImpInsuranceVO.class,parse,"导入失败数据表","第一页"); + } catch (Exception e) { + ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); } + } - return 1; + public static boolean isValidDate(String str) { + boolean convertSuccess = true; + // 指定日期格式为四位年/两位月份/两位日期,注意yyyy/MM/dd区分大小写; + SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd"); + SimpleDateFormat format1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + if (str.contains("-")) { + str=str.replace("-", "/"); + } + try { + // 设置lenient为false. 否则SimpleDateFormat会比较宽松地验证日期,比如2007/02/29会被接受,并转换成2007/03/01 + if (str.length()==8) { + str=str.substring(0, 5)+"0"+str.substring(5, 7)+"0"+str.charAt(7); + format.setLenient(false); + format.parse(str); + }else if(str.length()==9){ + str=str.substring(0, 5)+"0"+str.substring(5, 9); + format.setLenient(false); + format.parse(str); + }else if(str.length()==10){ + format.setLenient(false); + format.parse(str); + }else { + format1.setLenient(false); + format1.parse(str); + } + } catch (ParseException e) { + // e.printStackTrace(); + // 如果throw java.text.ParseException或者NullPointerException,就说明格式不对 + convertSuccess = false; + } + return convertSuccess; } + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlReimbursementServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlReimbursementServiceImpl.java new file mode 100644 index 00000000..6a011434 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlReimbursementServiceImpl.java @@ -0,0 +1,21 @@ +package com.daqing.financial.guarantee.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.daqing.financial.guarantee.mapper.AlReimbursementMapper; +import com.daqing.financial.guarantee.service.AlReimbursementService; +import com.daqing.framework.domain.guarantee.AlReimbursement; +import org.springframework.stereotype.Service; + +/** + *

+ * 保后代偿清收相关信息 服务实现类 + *

+ * + * @author lr + * @since 2021-08-12 + */ +@Service +public class AlReimbursementServiceImpl extends ServiceImpl implements AlReimbursementService { + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java index 4f393f59..e629d38d 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java @@ -1,5 +1,7 @@ package com.daqing.financial.guarantee.service.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -7,24 +9,26 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; import com.daqing.financial.guarantee.mapper.AlInsuranceListMapper; +import com.daqing.financial.guarantee.mapper.AlReimbursementMapper; 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.AlCollectionStatisticsService; import com.daqing.financial.guarantee.service.IAlRepaymentEntryService; import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.AlInsuranceList; +import com.daqing.framework.domain.guarantee.AlReimbursement; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; -import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser; +import com.daqing.framework.domain.hrms.response.HrmsCode; import com.daqing.framework.exception.ExceptionCast; -import com.daqing.framework.model.StatusCode; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.excel.ExcelUtil; -import io.swagger.models.auth.In; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; @@ -45,41 +49,71 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id",insuranceId); + AlReimbursement reimbursement = reimbursementMapper.selectOne(wrapper); + if (ObjectUtil.isNotNull(reimbursement)){ + //代偿金额和代偿时间不为空,则计算代偿余额 + if (reimbursement.getCompensationAmount()!=null&&reimbursement.getCompensatoryTime()!=null){ + //还款记录都删除,则余额与金额相同 + QueryWrapper repaymentEntryQueryWrapper = new QueryWrapper<>(); + repaymentEntryQueryWrapper.eq("insurance_id",insuranceId); + Integer integer = alRepaymentEntryMapper.selectCount(repaymentEntryQueryWrapper); + if (integer==0){ + reimbursement.setCompensatoryBalance(reimbursement.getCompensationAmount()); + }else { + Integer amount = alRepaymentEntryMapper.compensationSituation(DateUtil.formatDate(reimbursement.getCompensatoryTime()), insuranceId); + BigDecimal compensationAmount = reimbursement.getCompensationAmount(); + compensationAmount = compensationAmount.subtract(new BigDecimal(amount)); + reimbursement.setCompensatoryBalance(compensationAmount); + } + reimbursementMapper.updateById(reimbursement); + } + } } @Override public AlRepaymentEntry repaymentDetail(Integer id) { - AlRepaymentEntry alRepaymentEntry = this.baseMapper.selectById(id); - return alRepaymentEntry; + return baseMapper.selectById(id); } @Override @@ -97,41 +131,33 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpllambdaUpdate() - .set(AlRepaymentEntry::getActualRepaymentDate, entry.getActualRepaymentDate()) //把email设置成null - .set(AlRepaymentEntry::getCurrentRepayment, entry.getCurrentRepayment()) - .set(AlRepaymentEntry::getInterest, entry.getInterest()) - .set(AlRepaymentEntry::getInsuranceId, entry.getInsuranceId()) - .set(AlRepaymentEntry::getOtherExpenses, entry.getOtherExpenses()) - .set(AlRepaymentEntry::getRepaymentDate, entry.getRepaymentDate()) - .set(AlRepaymentEntry::getDeductionAmount, entry.getDeductionAmount()) - .set(AlRepaymentEntry::getOverdueDays, entry.getOverdueDays()) - .set(AlRepaymentEntry::getRepaymentNotes, entry.getRepaymentNotes()) - .set(AlRepaymentEntry::getTotalRepayment, entry.getTotalRepayment()) - .set(AlRepaymentEntry::getSubmitterId, entry.getSubmitterId()) - .set(AlRepaymentEntry::getSubmitterName, entry.getSubmitterName()) - .set(AlRepaymentEntry::getRepaymentStatus, entry.getRepaymentStatus()) - .set(AlRepaymentEntry::getCreateTime, entry.getCreateTime()) - .set(AlRepaymentEntry::getUpdateTime, entry.getUpdateTime()) - .eq(AlRepaymentEntry::getId, entry.getId()) - ); - //return this.baseMapper.updateById(entry); + public int updateRepayment(AlRepaymentEntry alRepaymentEntryReq) { + int update = baseMapper.updateById(alRepaymentEntryReq); + //更新代偿信息 + updateReimbursementData(alRepaymentEntryReq.getInsuranceId()); + //更新业务状态 + updateRepaymentEntry(alRepaymentEntryReq.getInsuranceId()); + //更新统计还款记录数据 + repaymentStatistics(alRepaymentEntryReq.getInsuranceId()); + //更新年度统计 + collectionStatisticsService.updateCompleteStatistics(alRepaymentEntryReq.getInsuranceId()); + return update; } @Override public int delRepayment(List ids) { - return this.baseMapper.deleteBatchIds(ids); + if (ids.size()>0){ + AlRepaymentEntry repaymentEntry = baseMapper.selectById(ids.get(0)); + int i = baseMapper.deleteBatchIds(ids); + //更新统计还款记录数据 + repaymentStatistics(repaymentEntry.getInsuranceId()); + //更新代偿信息 + updateReimbursementData(repaymentEntry.getInsuranceId()); + //更新年度统计 + collectionStatisticsService.updateCompleteStatistics(repaymentEntry.getInsuranceId()); + return i; + } + return 0; } @Override @@ -149,8 +175,8 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpl map = new HashMap<>(); //统计还款期数(统计状态为已还款期数) int count1 = this.baseMapper.selectCount(new QueryWrapper() .eq("repayment_status",2).eq("insurance_id",insuranceId)); @@ -188,15 +214,94 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq("insurance_id",insuranceId); + AlReimbursement reimbursement = reimbursementMapper.selectOne(wrapper); + if (ObjectUtil.isNotNull(reimbursement)){ + map.put("compensationAmount",reimbursement.getCompensationAmount()); + map.put("compensatoryBalance",reimbursement.getCompensatoryBalance()); + } return map; } @Override - public int updateRepaymentEntry() { - Listlist = this.baseMapper.selectBind(); + public void updateRepaymentEntry(Integer insuranceId) { + //根据业务id查询该业务下的还款记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("insurance_id",insuranceId); + List repaymentEntryList = baseMapper.selectList(queryWrapper); + if (repaymentEntryList.size()>0){ + AlInsuranceList alInsuranceList = alInsuranceListMapper.selectById(insuranceId); + int status = 1; + //统计还款数据更新业务的相关状态 + for (AlRepaymentEntry repaymentEntry : repaymentEntryList){ + long times1 = new Date().getTime();//当前时间 + long times2 = repaymentEntry.getRepaymentDate().getTime();//应还款日 + long times3 = 0L; + + if(repaymentEntry.getActualRepaymentDate()!=null){ + times3 = DateUtil.parseDate(repaymentEntry.getActualRepaymentDate()).getTime();//实际还款日 + } + //如果存在当前日期超过应还款日时的数据,则计算逾期天数,并且状态改为已逾期,同时要处理保后管理模块内容 + if(repaymentEntry.getActualRepaymentDate()==null && times1 > times2){ + int days = (int)((times1-times2)/1000/60/60/24); + repaymentEntry.setOverdueDays(days); + repaymentEntry.setRepaymentStatus(3);//已逾期 + baseMapper.updateById(repaymentEntry);//更新逾期天数和状态 + //更新保后管理列表处的状态为已逾期,并且is_overdue设置为0 + // alInsuranceList.setPaymentStatus(2);//已逾期 + // alInsuranceList.setIsOverdue(0);//是否逾期过:0->是;1->否; + }else if(repaymentEntry.getActualRepaymentDate()==null && times1==times2){//应还款日=当前日期,则显示状态为待还款 + repaymentEntry.setRepaymentStatus(1);//待还款 + baseMapper.updateById(repaymentEntry);//更新状态 + }else if(repaymentEntry.getActualRepaymentDate()!=null && times3 <= times1){//实际还款日不超过当前日期时,状态为已还款 + repaymentEntry.setRepaymentStatus(2);//已还款 + baseMapper.updateById(repaymentEntry);//更新状态 + }else if(repaymentEntry.getActualRepaymentDate()==null && times1 <= times2){//当前日期未到应还款日,状态为未到期 + repaymentEntry.setRepaymentStatus(4);//未到期 + baseMapper.updateById(repaymentEntry);//更新状态 + }else if (alInsuranceList.getRemainAmount()!=null && repaymentEntry.getActualRepaymentDate()==null && alInsuranceList.getRemainAmount().doubleValue()>0){ + //如果存在剩余额度,保后管理列表状态为还款中 + alInsuranceList.setPaymentStatus(1);//还款中 + } + + //有逾期数据更换数值 + if (repaymentEntry.getRepaymentStatus()==3){ + status = 3; + } + } + if (status==3){ + alInsuranceList.setPaymentStatus(2);//已逾期 + alInsuranceList.setIsOverdue(0);//是否逾期过:0->是;1->否; + }else { + alInsuranceList.setPaymentStatus(1);//还款中 + } + alInsuranceListMapper.updateById(alInsuranceList); + } + + + /*List list = this.baseMapper.selectBind(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -233,17 +338,19 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id",res.getId()); + AlRepaymentEntry entry = baseMapper.selectOne(queryWrapper); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("id",res.getInsuranceId()); + AlInsuranceList alInsuranceList = alInsuranceListMapper.selectOne(wrapper); //如果存在当前日期超过应还款日时的数据,则计算逾期天数,并且状态改为已逾期,同时要处理保后管理模块内容 if(res.getActualRepaymentDate()==null && times1 > times2){ int days = (int)((times1-times2)/1000/60/60/24); entry.setOverdueDays(days); entry.setRepaymentStatus(3);//已逾期 this.baseMapper.updateById(entry);//更新逾期天数和状态 - //更新保后管理列表处的状态为已逾期,并且is_overdue设置为0 alInsuranceList.setPaymentStatus(2);//已逾期 alInsuranceList.setIsOverdue(0);//是否逾期过:0->是;1->否; @@ -257,13 +364,11 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpl0){//如果存在剩余额度,保后管理列表状态为还款中 - alInsuranceList.setPaymentStatus(1);//还款中 - alInsuranceListMapper.updateById(alInsuranceList); - } + }else if (res.getRemainAmount()!=null && res.getActualRepaymentDate()==null && res.getRemainAmount().doubleValue()>0){ + //如果存在剩余额度,保后管理列表状态为还款中 + alInsuranceList.setPaymentStatus(1);//还款中 + alInsuranceListMapper.updateById(alInsuranceList); } - } - - return 1; + }*/ } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index 1eb80a5b..d007e185 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -248,7 +248,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl0){ String a = measures.substring(1,measures.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); } @@ -360,7 +360,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl arr1List; if(list.get(i)!=null){ String a1 = list.get(i).substring(1,list.get(i).length()-1); - String arr1[]=a1.split(","); + String[] arr1 =a1.split(","); arr1List = Arrays.asList(arr1); arr1List2.add(i,arr1List); }else{ @@ -515,7 +515,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl0){ String a = remarks.substring(1,remarks.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); assetsResponse.setRemarkList(demoList); } @@ -189,7 +189,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl0){ String a = assetsAmounts.substring(1,assetsAmounts.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); assetsResponse.setAssetsAmountList(demoList); } @@ -215,7 +215,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl0){ String a = files.substring(1,files.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); assetsResponse.setFileList(demoList); } @@ -226,7 +226,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl0){ String a = measures.substring(1,measures.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); } @@ -248,7 +248,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl0){ @@ -337,7 +337,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpllambdaUpdate() .set(DgAssetsInvestigation::getApplyContent, approvalAssetsRequest.getApplyContent()) //把email设置成null - .set(DgAssetsInvestigation::getEmpId, Integer.parseInt(dgApplyAmountInfoController.getUserId())) + .set(DgAssetsInvestigation::getEmpId, Integer.parseInt(DgApplyAmountInfoController.getUserId())) .set(DgAssetsInvestigation::getRemark, ArraysUtil.toString(approvalAssetsRequest.getRemark())) .set(DgAssetsInvestigation::getOtherRemark, approvalAssetsRequest.getOtherRemark()) .set(DgAssetsInvestigation::getStatus, dgAssetsInvestigation.getStatus())//approvalAssetsRequest.getStatus() @@ -514,7 +514,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl1){ // 累计时间加上本次时间 - existMap.put(processId, (Integer.parseInt(existTime)) + "," + count); + existMap.put(processId, (Long.parseLong(existTime)) + "," + count); }else{ - existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count); + // existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count); + existMap.put(processId, (Long.parseLong(existTime) + Long.parseLong(time)) + "," + count); } -// existMap.put(processId, (Math.abs(Long.parseLong(existTime) + Long.parseLong(time))) + "," + count); } hashMap.put(Integer.parseInt(departmentId), existMap); @@ -247,7 +247,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl timeList = dgAuditProcessMapper.selectTenDays(Integer.parseInt(userId)); //近十天审批数目的值的数组 @@ -800,7 +800,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl 0) { String a = measures.substring(1, measures.length() - 1); - String arry[] = a.split(","); + String[] arry = a.split(","); List demoList = Arrays.asList(arry); dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); } @@ -162,7 +162,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl arr1List; if (list.get(i) != null) { String a1 = list.get(i).substring(1, list.get(i).length() - 1); - String arr1[] = a1.split(","); + String[] arr1 = a1.split(","); arr1List = Arrays.asList(arr1); arr1List2.add(i, arr1List); } else { @@ -208,7 +208,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl 0) { String a = remarks.substring(1, remarks.length() - 1); - String arry[] = a.split(","); + String[] arry = a.split(","); List demoList = Arrays.asList(arry); assignUser.setRemark(demoList); } @@ -224,7 +224,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl0){ @@ -581,7 +581,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl arr = new ArrayList<>(); + //无需所属部门 + /*ArrayList arr = new ArrayList<>(); arr.add(presenterId); //根据提单人id查询其部门名称 ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); @@ -189,7 +194,7 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl0){ String a = measures.substring(1,measures.length()-1); - String arry[]=a.split(","); + String[] arry =a.split(","); List demoList = Arrays.asList(arry); dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); } @@ -193,7 +193,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl demoList = Arrays.asList(arry); messageDetailResponse.setMessageFileList(demoList); } @@ -235,7 +235,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl arr1List; if(list.get(i)!=null){ String a1 = list.get(i).substring(1,list.get(i).length()-1); - String arr1[]=a1.split(","); + String[] arr1 =a1.split(","); arr1List = Arrays.asList(arr1); arr1List2.add(i,arr1List); }else{ @@ -265,7 +265,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl0){ @@ -329,7 +329,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpllambdaUpdate() - .set(DgMessageInvestigation::getEmpId, Integer.parseInt(dgApplyAmountInfoController.getUserId())) + .set(DgMessageInvestigation::getEmpId, Integer.parseInt(DgApplyAmountInfoController.getUserId())) .set(DgMessageInvestigation::getStatus, dgMessageInvestigation.getStatus())//approvalMessageRequest.getStatus() .set(DgMessageInvestigation::getOperatingStatus, StatusCode.CZ_PROCESSED) .set(DgMessageInvestigation::getRemark, approvalMessageRequest.getRemark()) @@ -482,7 +482,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl0){ - return true; - }else{ - return false; - } + return i > 0; } @Override @@ -100,7 +96,7 @@ public class DgProcessManageServiceImpl extends ServiceImpl0?true:false; + return a > 0; } @@ -108,12 +104,12 @@ public class DgProcessManageServiceImpl extends ServiceImpl().eq("user_id", userId)); - return count>0?true:false; + return count > 0; } @Override public Boolean delBatchUserVisual(List userId) { int count = dgProcessManageVisualMapper.delBatchUserVisual(userId); - return count>0?true:false; + return count > 0; } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ArraysUtil.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ArraysUtil.java index 835c3f50..77033eae 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ArraysUtil.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ArraysUtil.java @@ -158,7 +158,7 @@ public class ArraysUtil { StringBuilder b = new StringBuilder(); b.append('['); for (int i = 0; ; i++) { - b.append(String.valueOf(a[i])); + b.append(a[i]); if (i == iMax) return b.append(']').toString(); b.append(","); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelAttribute.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelAttribute.java new file mode 100644 index 00000000..b50b63bb --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelAttribute.java @@ -0,0 +1,25 @@ +package com.daqing.financial.guarantee.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface ExcelAttribute { + /** + * 对应的列名称 + */ + String name() default ""; + + /** + * excel列的索引 + */ + int sort(); + + /** + * 字段类型对应的格式 + */ + String format() default ""; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelImportHelper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelImportHelper.java new file mode 100644 index 00000000..0a9c09bd --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ExcelImportHelper.java @@ -0,0 +1,310 @@ +package com.daqing.financial.guarantee.util; + +import cn.hutool.core.date.DateUtil; +import com.daqing.financial.guarantee.model.request.ExcelImpInsuranceVO; +import com.deepoove.poi.util.RegexUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.text.DecimalFormat; +import java.text.Format; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * @Author chen + * @DATE 2021/9/2 11:17 + * @Version 1.0 + */ +public class ExcelImportHelper { + + private static final Calendar fromCal = Calendar.getInstance(); + + /** + * 按日期加天数得出全新日期 + * + * @param date 需要加天数的日期 + * @param day 需要增加的天数 + * @return 新的日期 + */ + public static Date addDate(Date date, int day) { + try { + fromCal.setTime(date); + fromCal.add(Calendar.DATE, day); + + return fromCal.getTime(); + } catch (Exception e) { + return null; + } + } + + private static Workbook getWorkbook(MultipartFile file) { + String fileName = file.getOriginalFilename(); + Workbook workbook = null; + + if (fileName.endsWith("xlsx")) { + try { + workbook = new XSSFWorkbook(file.getInputStream()); + } catch (IOException e) { + e.printStackTrace(); + } + } else if (fileName.endsWith("xls")) { + try { + workbook = new HSSFWorkbook(file.getInputStream()); + } catch (IOException e) { + e.printStackTrace(); + } + } + return workbook; + } + + //判断row是否为空 + public static boolean isRowEmpty(Row row) { + if (null == row) { + return true; + } + int firstCellNum = row.getFirstCellNum(); //第一个列位置 + int lastCellNum = row.getLastCellNum(); //最后一列位置 + int nullCellNum = 0; //空列数量 + for (int c = firstCellNum; c < lastCellNum; c++) { + Cell cell = row.getCell(c); + if (null == cell || CellType.BLANK == cell.getCellType()) { + nullCellNum++; + continue; + } + cell.setCellType(CellType.STRING); + String cellValue = cell.getStringCellValue().trim(); + if (StringUtils.isEmpty(cellValue)) { + nullCellNum++; + } + } + //所有列都为空 + return nullCellNum == (lastCellNum - firstCellNum); + } + + /** + * 读取文件数据 + * + * @param file + * @return + */ + public static List readInsuranceManagement(MultipartFile file) throws Exception { + List list = new ArrayList(); + + Workbook workbook = getWorkbook(file); + ExcelImpInsuranceVO impInsuranceVO = null; + // 循环工作表Sheet + for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { + Sheet hssfSheet = workbook.getSheetAt(numSheet); + if (hssfSheet == null) { + continue; + } + + int count = 1; + // 循环行Row//开始行2 + for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { + Row row = hssfSheet.getRow(rowNum); + + if (isRowEmpty(row)) { + count++; + if (count == hssfSheet.getLastRowNum()) { + throw new Exception("导入失败,导入数据为空!"); + } + continue; + } + + Cell customerName;//客户名称 + Cell bank;//贷款银行 + Cell guaranteeAmount;//担保额度 + Cell loanStartTime;//贷款开始日期 + Cell loanEndTime;//贷款结束日期 + Cell guaranteeTime;//担保期限 + Cell businessType;//业务类别 + Cell amountWide;//贷款用途 + Cell compensationAmount;//代偿金额 + Cell compensatoryBalance;//代偿余额 + Cell compensatoryTime;//代偿时间 + Cell personLiable;//清收负责人 + Cell collectionGroup;//所属清收组 + Cell area;//所在区域 + Cell operation;//经营情况 + Cell litigation;//诉讼情况 + Cell mortgage;//抵押情况 + + if (row != null) { + + impInsuranceVO = new ExcelImpInsuranceVO(); + + if (row.getCell(16) != null) { + row.getCell(16).setCellType(CellType.STRING); + mortgage = row.getCell(16); + } else { + mortgage = row.createCell(16); + } + + if (row.getCell(15) != null) { + row.getCell(15).setCellType(CellType.STRING); + litigation = row.getCell(15); + } else { + litigation = row.createCell(15); + } + + if (row.getCell(14) != null) { + row.getCell(14).setCellType(CellType.STRING); + operation = row.getCell(14); + } else { + operation = row.createCell(14); + } + + if (row.getCell(13) != null) { + row.getCell(13).setCellType(CellType.STRING); + area = row.getCell(13); + } else { + area = row.createCell(13); + } + + if (row.getCell(12) != null) { + row.getCell(12).setCellType(CellType.STRING); + collectionGroup = row.getCell(12); + } else { + collectionGroup = row.createCell(12); + } + + if (row.getCell(11) != null) { + row.getCell(11).setCellType(CellType.STRING); + personLiable = row.getCell(11); + } else { + personLiable = row.createCell(11); + } + + if (row.getCell(10) != null) { + row.getCell(10).setCellType(CellType.STRING); + compensatoryTime = row.getCell(10); + } else { + compensatoryTime = row.createCell(10); + } + + if (row.getCell(9) != null) { + row.getCell(9).setCellType(CellType.STRING); + compensatoryBalance = row.getCell(9); + } else { + compensatoryBalance = row.createCell(9); + } + if (row.getCell(8) != null) { + row.getCell(8).setCellType(CellType.STRING); + compensationAmount = row.getCell(8); + } else { + compensationAmount = row.createCell(8); + } + if (row.getCell(7) != null) { + row.getCell(7).setCellType(CellType.STRING); + amountWide = row.getCell(7); + } else { + amountWide = row.createCell(7); + } + + if (row.getCell(6) != null) { + row.getCell(6).setCellType(CellType.STRING); + businessType = row.getCell(6); + } else { + businessType = row.createCell(6); + } + + if (row.getCell(5) != null) { + row.getCell(5).setCellType(CellType.STRING); + guaranteeTime = row.getCell(5); + } else { + guaranteeTime = row.createCell(5); + } + + if (row.getCell(4) != null) { + row.getCell(4).setCellType(CellType.STRING); + loanEndTime = row.getCell(4); + } else { + loanEndTime = row.createCell(4); + } + + if (row.getCell(3) != null) { + row.getCell(3).setCellType(CellType.STRING); + loanStartTime = row.getCell(3); + } else { + loanStartTime = row.createCell(3); + } + + if (row.getCell(2) != null) { + row.getCell(2).setCellType(CellType.STRING); + guaranteeAmount = row.getCell(2); + } else { + guaranteeAmount = row.createCell(3); + } + + if (row.getCell(1) != null) { + row.getCell(1).setCellType(CellType.STRING); + bank = row.getCell(1); + } else { + bank = row.createCell(1); + } + + if (row.getCell(0) != null) { + row.getCell(0).setCellType(CellType.STRING); + customerName = row.getCell(0); + } else { + customerName = row.createCell(0); + } + + impInsuranceVO.setCustomerName(customerName.getStringCellValue()); + impInsuranceVO.setBank(bank.getStringCellValue()); + impInsuranceVO.setGuaranteeAmount(guaranteeAmount.getStringCellValue()); + + Calendar calendar = new GregorianCalendar(1900, 0, -1); + Date d = calendar.getTime(); + + boolean numeric = StringUtils.isNumeric(loanStartTime.getStringCellValue()); + if (numeric && !"".equals(loanStartTime.getStringCellValue())) { + Date d1 = ExcelImportHelper.addDate(d, Integer.parseInt(loanStartTime.getStringCellValue())); + String start = DateUtil.formatDateTime(d1); + impInsuranceVO.setLoanStartTime(start); + } + + boolean numeric1 = StringUtils.isNumeric(loanEndTime.getStringCellValue()); + if (numeric1 && !"".equals(loanEndTime.getStringCellValue())) { + Date d2 = ExcelImportHelper.addDate(d, Integer.parseInt(loanEndTime.getStringCellValue())); + String end = DateUtil.formatDateTime(d2); + impInsuranceVO.setLoanEndTime(end); + } + + impInsuranceVO.setGuaranteeTime(guaranteeTime.getStringCellValue()); + impInsuranceVO.setBusinessType(businessType.getStringCellValue()); + impInsuranceVO.setAmountWide(amountWide.getStringCellValue()); + impInsuranceVO.setCompensationAmount(compensationAmount.getStringCellValue()); + impInsuranceVO.setCompensatoryBalance(compensatoryBalance.getStringCellValue()); + + String compensatory = ""; + boolean numeric2 = StringUtils.isNumeric(compensatoryTime.getStringCellValue()); + if (numeric2 && !"".equals(compensatoryTime.getStringCellValue())) { + Date d3 = ExcelImportHelper.addDate(d, Integer.parseInt(compensatoryTime.getStringCellValue())); + compensatory = DateUtil.formatDateTime(d3); + } + + impInsuranceVO.setCompensatoryTime(compensatory); + impInsuranceVO.setPersonLiable(personLiable.getStringCellValue()); + impInsuranceVO.setCollectionGroup(collectionGroup.getStringCellValue()); + impInsuranceVO.setArea(area.getStringCellValue()); + impInsuranceVO.setOperation(operation.getStringCellValue()); + impInsuranceVO.setLitigation(litigation.getStringCellValue()); + impInsuranceVO.setMortgage(mortgage.getStringCellValue()); + + list.add(impInsuranceVO); + } + } + + } + + return list; + } + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ImgUtil.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ImgUtil.java index ca3630b5..715db3d0 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ImgUtil.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ImgUtil.java @@ -1,6 +1,6 @@ package com.daqing.financial.guarantee.util; -import sun.misc.BASE64Decoder; + import java.io.*; @@ -9,13 +9,13 @@ import java.io.*; * @DATE 2021/1/15 9:45 * @Version 1.0 */ -public class ImgUtil { +/*public class ImgUtil { - /** + *//** * base64字符串转化成图片 * @param imgData 图片编码 * @param imgFilePath 存放到本地路径 - */ + *//* public static boolean generateImage(String imgData, String imgFilePath) throws IOException { // 对字节数组字符串进行Base64解码并生成图片 // 图像数据为空 if (imgData == null) { @@ -46,4 +46,4 @@ public class ImgUtil { return true; } -} +}*/ diff --git a/dq-financial-guarantee/src/main/resources/bootstrap.properties b/dq-financial-guarantee/src/main/resources/bootstrap.properties index b9b275e8..47c0a270 100644 --- a/dq-financial-guarantee/src/main/resources/bootstrap.properties +++ b/dq-financial-guarantee/src/main/resources/bootstrap.properties @@ -6,7 +6,7 @@ spring.cloud.nacos.config.file-extension=yml #redis配置 spring.redis.host=127.0.0.1 spring.redis.port=6379 -spring.redis.password= +spring.redis.password=dq123456 spring.redis.database=0 spring.redis.timeout=30000 spring.redis.jedis.pool.max-active=8 @@ -14,29 +14,32 @@ spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-idle=8 spring.redis.jedis.pool.min-idle=0 + #本地测试环境 #spring.cloud.nacos.config.namespace=1520c5ea-5f15-4ac1-9eb1-d25924825b99 #线上测试环境 -spring.cloud.nacos.config.namespace=5698e60a-9d0b-433f-a69f-12b0a2d23128 +#spring.cloud.nacos.config.namespace=5698e60a-9d0b-433f-a69f-12b0a2d23128 #线上生产环境 -#spring.cloud.nacos.config.namespace=6054a175-069a-492d-8679-820758416406 +spring.cloud.nacos.config.namespace=6054a175-069a-492d-8679-820758416406 #请求处理的超时时间 -ribbon.ReadTimeout: 120000 +ribbon.ReadTimeout= 120000 #请求连接的超时时间 -ribbon.ConnectTimeout: 120000 +ribbon.ConnectTimeout= 120000 ribbon.eureka.enabled=true +#全局忽略判断 +#mybatis-plus.global-config.db-config.field-strategy=ignored # 上传文件总的最大值 spring.servlet.multipart.max-request-size=10MB # 单个文件的最大值 spring.servlet.multipart.max-file-size=10MB -# -##正式环境(prod) -##服务名称 + +#正式环境(prod) +#服务名称 #spring.application.name=dq-financial-guarantee ##配置中心地址 #spring.cloud.nacos.config.server-addr=120.78.127.12:8848 diff --git a/dq-financial-guarantee/src/main/resources/excel-config.xml b/dq-financial-guarantee/src/main/resources/excel-config.xml new file mode 100644 index 00000000..e69de29b diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionGroupMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionGroupMapper.xml new file mode 100644 index 00000000..a008a526 --- /dev/null +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionGroupMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml index b996dc34..77c0aa20 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml @@ -33,11 +33,11 @@ INSERT INTO al_collection (insurance_id,collection_method,collection_time,collection_feedback,enclosure_file - ,overdue_amount,overdue_interest,other_expenses,collection_user,overdue_periods) + ,overdue_amount,overdue_interest,other_expenses,collection_user,overdue_periods,situation_description) VALUES (#{ac.insuranceId},#{ac.collectionMethod},#{ac.collectionTime}, #{ac.collectionFeedback},#{ac.enclosureFile}, #{ac.overdueAmount},#{ac.overdueInterest},#{ac.otherExpenses}, - #{ac.collectionUser},#{ac.overduePeriods}) + #{ac.collectionUser},#{ac.overduePeriods},#{ac.situationDescription}) + + + + + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml index 298ab1d1..d53e5d99 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml @@ -57,7 +57,7 @@ @@ -86,4 +86,10 @@ AND insurance_id = #{insuranceId} + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml index 13137bd6..b37fb7ab 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml @@ -16,8 +16,6 @@ - - SELECT process_id FROM dg_audit_process WHERE business_id = #{businessId} group by process_id order by process_id asc +