fix: 贷款账单,bug修复。

This commit is contained in:
tianyongbao
2025-10-19 15:02:38 +08:00
parent 49c91e45a9
commit 9e90cd97d1
2 changed files with 34 additions and 2 deletions

View File

@@ -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");
//还款

View File

@@ -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;
}
/**