From d9fe0fab17dd8ad4500dc76677f3833e66499735 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Sun, 19 Oct 2025 15:02:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B4=B7=E6=AC=BE=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=EF=BC=8Cbug=E4=BF=AE=E5=A4=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstallmentHistoryDetailServiceImpl.java | 2 +- .../impl/InstallmentHistoryServiceImpl.java | 34 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryDetailServiceImpl.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryDetailServiceImpl.java index aaf9a6c..2e5229e 100644 --- a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryDetailServiceImpl.java +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryDetailServiceImpl.java @@ -184,7 +184,7 @@ public class InstallmentHistoryDetailServiceImpl implements IInstallmentHistoryD transferRecord.setAmount(installmentHistoryDetail.getPrincipal()); transferRecord.setCommission(installmentHistoryDetail.getInterest()); transferRecord.setId(IdWorker.getId()); - transferRecord.setCreateTime(new Date()); + transferRecord.setCreateTime(installmentHistoryDetail.getRepaymentDate()); //借贷 transferRecord.setType("5"); //还款 diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryServiceImpl.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryServiceImpl.java index b5df2f6..ccbbb73 100644 --- a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryServiceImpl.java +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/InstallmentHistoryServiceImpl.java @@ -53,7 +53,39 @@ public class InstallmentHistoryServiceImpl implements IInstallmentHistoryService @Override public InstallmentHistoryVo selectInstallmentHistoryById(Long id) { - return installmentHistoryMapper.selectInstallmentHistoryById(id); + InstallmentHistoryVo installmentHistory=installmentHistoryMapper.selectInstallmentHistoryById(id); + DecimalFormat decimalFormat = new DecimalFormat("#.##"); + String daysBetween=""; + if(installmentHistory.getCloseDate()!=null){ + daysBetween = DateUtils.timeDistance(installmentHistory.getCloseDate(),installmentHistory.getInstallmentDate()); + }else { + daysBetween = DateUtils.timeDistance(new Date(),installmentHistory.getInstallmentDate()); + } + installmentHistory.setLoanDays(daysBetween); + if(installmentHistory.getBankCode()!=null){ + installmentHistory.setBankNameCode(installmentHistory.getBankName()+"("+ StringUtils.getLastNumberChars(4,installmentHistory.getBankCode()+")")); + }else { + installmentHistory.setBankNameCode(installmentHistory.getBankName()); + } + double interest=installmentHistory.getTotalInterest(); + double interestRate=0; + if(interest>0){ + interestRate=interest/installmentHistory.getInstallmentAmount(); + if(installmentHistory.getPeriod()!=null){ + interestRate=interestRate*12/installmentHistory.getPeriod(); + } + } + + if(installmentHistory.getReceivingAccountCode()!=null){ + installmentHistory.setReceivingAccountNameCode(installmentHistory.getReceivingAccountName()+"("+ StringUtils.getLastNumberChars(4,installmentHistory.getReceivingAccountCode()+")")); + }else { + installmentHistory.setReceivingAccountNameCode(installmentHistory.getReceivingAccountName()); + } + + interestRate=interestRate*100; + String calculateInterestRate= decimalFormat.format(interestRate)+"%"; + installmentHistory.setCalculateInterestRate(calculateInterestRate); + return installmentHistory; } /**