|
|
@ -626,6 +626,8 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//保存还款记录
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
Set<String> setMsg = new HashSet<>(); |
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
if (!dto.isEmpty()) { |
|
|
|
for (RepaymentExcelInfo repaymentExcelInfo : dto) { |
|
|
|
List<LoanRepaymentPlanDetails> planDetails = loanRepaymentPlanDetailsService.selPlanByNoAndPeriod(repaymentExcelInfo.getBankContractNo(), repaymentExcelInfo.getPeriod()); |
|
|
@ -639,25 +641,44 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
check = loanRepaymentPlanDetailsService.InsertForCheckPaymentAndBankOther(planDetail.getSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(check)) { |
|
|
|
if (!check.equals("0")) { |
|
|
|
LoanRepaymentHistory repaymentHistory = new LoanRepaymentHistory(); |
|
|
|
repaymentHistory.setBuckle("未申请"); |
|
|
|
repaymentHistory.setBuckleKey("001"); |
|
|
|
repaymentHistory.setScheduleSid(planDetail.getScheduleSid()); |
|
|
|
repaymentHistory.setPlanDetailSid(planDetail.getSid()); |
|
|
|
repaymentHistory.setReturnWay("直还"); |
|
|
|
repaymentHistory.setReturnWayKey("01"); |
|
|
|
try { |
|
|
|
repaymentHistory.setActualDate(sdf.parse(repaymentExcelInfo.getRealReturnTime())); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
BigDecimal realMoney = new BigDecimal(repaymentExcelInfo.getRealMoney()); |
|
|
|
BigDecimal divide = realMoney.divide(new BigDecimal(planDetails.size()), 2, BigDecimal.ROUND_HALF_UP); |
|
|
|
repaymentHistory.setActualMoney(divide); |
|
|
|
repaymentHistory.setDataTime(new DateTime()); |
|
|
|
baseMapper.insert(repaymentHistory); |
|
|
|
if (check.equals("0")) { |
|
|
|
setMsg.add("资方合同号" + planDetail.getBankContractNo() + "第" + planDetail.getPeriod() + "期"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (setMsg.size() > 0) { |
|
|
|
for (String s : setMsg) { |
|
|
|
sb.append(s).append("、"); |
|
|
|
} |
|
|
|
if (sb.length() > 0) { |
|
|
|
sb.delete(sb.length() - 1, sb.length()); |
|
|
|
} |
|
|
|
sb.append("为非退还垫款导入直还数据,导入失败!"); |
|
|
|
return rb.setMsg(sb.toString()); |
|
|
|
} else { |
|
|
|
for (RepaymentExcelInfo repaymentExcelInfo : dto) { |
|
|
|
List<LoanRepaymentPlanDetails> planDetails = loanRepaymentPlanDetailsService.selPlanByNoAndPeriod(repaymentExcelInfo.getBankContractNo(), repaymentExcelInfo.getPeriod()); |
|
|
|
if (!planDetails.isEmpty()) { |
|
|
|
for (LoanRepaymentPlanDetails planDetail : planDetails) { |
|
|
|
LoanRepaymentHistory repaymentHistory = new LoanRepaymentHistory(); |
|
|
|
repaymentHistory.setBuckle("未申请"); |
|
|
|
repaymentHistory.setBuckleKey("001"); |
|
|
|
repaymentHistory.setScheduleSid(planDetail.getScheduleSid()); |
|
|
|
repaymentHistory.setPlanDetailSid(planDetail.getSid()); |
|
|
|
repaymentHistory.setReturnWay("直还"); |
|
|
|
repaymentHistory.setReturnWayKey("01"); |
|
|
|
try { |
|
|
|
repaymentHistory.setActualDate(sdf.parse(repaymentExcelInfo.getRealReturnTime())); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
BigDecimal realMoney = new BigDecimal(repaymentExcelInfo.getRealMoney()); |
|
|
|
BigDecimal divide = realMoney.divide(new BigDecimal(planDetails.size()), 2, BigDecimal.ROUND_HALF_UP); |
|
|
|
repaymentHistory.setActualMoney(divide); |
|
|
|
repaymentHistory.setDataTime(new DateTime()); |
|
|
|
baseMapper.insert(repaymentHistory); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -806,7 +827,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
String isOther = loanRepaymentScheduleService.returnBankOrOtherBankByPlanSid(pSid).getData(); |
|
|
|
String reAdvances = ""; |
|
|
|
if (isOther.equals("0")) { |
|
|
|
reAdvances = loanRepaymentPlanDetailsService.reAdvancesOrPaymentMoney(pSid); |
|
|
|
reAdvances = loanRepaymentPlanDetailsService.reAdvancesOrPaymentMoney(pSid); |
|
|
|
} else if (isOther.equals("1")) { |
|
|
|
reAdvances = loanRepaymentPlanDetailsService.reAdvancesOrPaymentMoneyOther(pSid); |
|
|
|
} |
|
|
@ -1817,7 +1838,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<RecordCountVo> exportStatisticsExcel(RepaymentStatisticsQuery pagerQuery) { |
|
|
|
QueryWrapper<LoanRepaymentHistory> qw = new QueryWrapper<>(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
@ -2304,6 +2324,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
} |
|
|
|
|
|
|
|
public List<AppRepaymentHistoryRecord> selSchSidAndVinNo(String scheduleSid, String vinNo) { |
|
|
|
return baseMapper.selSchSidAndVinNo(scheduleSid,vinNo); |
|
|
|
return baseMapper.selSchSidAndVinNo(scheduleSid, vinNo); |
|
|
|
} |
|
|
|
} |
|
|
|