fix: 人情账单,增加借款时长。

This commit is contained in:
tianyongbao
2024-08-09 13:55:58 +08:00
parent 1cb507c8d1
commit be6864c2cd
2 changed files with 12 additions and 0 deletions

View File

@@ -35,4 +35,8 @@ public class InstallmentHistoryVo extends InstallmentHistory
@ApiModelProperty(value="剩余利息)")
private Double outstandingInterest;
@ApiModelProperty(value="借款天数")
private String loanDays;
}

View File

@@ -19,6 +19,7 @@ import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
@@ -61,6 +62,13 @@ public class InstallmentHistoryServiceImpl implements IInstallmentHistoryService
//修改名称加卡号
DecimalFormat decimalFormat = new DecimalFormat("#.##");
for (InstallmentHistoryVo installmentHistory : installmentHistoryVoList) {
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 {