fix: 贷款账单,bug修复。
This commit is contained in:
@@ -184,7 +184,7 @@ public class InstallmentHistoryDetailServiceImpl implements IInstallmentHistoryD
|
|||||||
transferRecord.setAmount(installmentHistoryDetail.getPrincipal());
|
transferRecord.setAmount(installmentHistoryDetail.getPrincipal());
|
||||||
transferRecord.setCommission(installmentHistoryDetail.getInterest());
|
transferRecord.setCommission(installmentHistoryDetail.getInterest());
|
||||||
transferRecord.setId(IdWorker.getId());
|
transferRecord.setId(IdWorker.getId());
|
||||||
transferRecord.setCreateTime(new Date());
|
transferRecord.setCreateTime(installmentHistoryDetail.getRepaymentDate());
|
||||||
//借贷
|
//借贷
|
||||||
transferRecord.setType("5");
|
transferRecord.setType("5");
|
||||||
//还款
|
//还款
|
||||||
|
|||||||
@@ -53,7 +53,39 @@ public class InstallmentHistoryServiceImpl implements IInstallmentHistoryService
|
|||||||
@Override
|
@Override
|
||||||
public InstallmentHistoryVo selectInstallmentHistoryById(Long id)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user