|
|
@ -748,18 +748,41 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
baseMapper.updateById(repaymentHistory); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
if (!bankContractNos.isEmpty()) { |
|
|
|
for (String bankContractNo : bankContractNos) { |
|
|
|
String updateTime = baseMapper.getMaxUpdateTimeByBankContractNo(bankContractNo); |
|
|
|
if (StringUtils.isNotBlank(updateTime)) { |
|
|
|
map.put(bankContractNo, updateTime); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!map.isEmpty()) { |
|
|
|
for (Map.Entry<String, String> entry : map.entrySet()) { |
|
|
|
String updateTime = entry.getValue(); |
|
|
|
// Map<String, String> map = new HashMap<>();
|
|
|
|
// if (!bankContractNos.isEmpty()) {
|
|
|
|
// for (String bankContractNo : bankContractNos) {
|
|
|
|
// String updateTime = baseMapper.getMaxUpdateTimeByBankContractNo(bankContractNo);
|
|
|
|
// if (StringUtils.isNotBlank(updateTime)) {
|
|
|
|
// map.put(bankContractNo, updateTime);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (!map.isEmpty()) {
|
|
|
|
// for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
|
// String updateTime = entry.getValue();
|
|
|
|
// try {
|
|
|
|
// Date u = sdf.parse(updateTime);
|
|
|
|
// Date today = new Date();
|
|
|
|
// String f = sdf.format(today);
|
|
|
|
// Date date = sdf.parse(f);
|
|
|
|
// if (u.compareTo(date) >= 0) {
|
|
|
|
// Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
|
|
|
|
// cal_1.setTime(date);
|
|
|
|
// cal_1.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
|
// u = cal_1.getTime();
|
|
|
|
// }
|
|
|
|
// int i = loanRepaymentPlanDetailsService.updateTime(entry.getKey(), u, useOrgSid);
|
|
|
|
// } catch (ParseException e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//获取资方最大实还日期
|
|
|
|
List<UpdateTimeByBankName> bankNames = baseMapper.selUpdateTimeByBankName(histories); |
|
|
|
if (!bankNames.isEmpty()) { |
|
|
|
for (UpdateTimeByBankName updateTimeByBankName : bankNames) { |
|
|
|
String updateTime = updateTimeByBankName.getUpdateDate(); |
|
|
|
String bankName = updateTimeByBankName.getBankName(); |
|
|
|
try { |
|
|
|
Date u = sdf.parse(updateTime); |
|
|
|
Date today = new Date(); |
|
|
@ -771,7 +794,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
cal_1.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
u = cal_1.getTime(); |
|
|
|
} |
|
|
|
int i = loanRepaymentPlanDetailsService.updateTime(entry.getKey(), u, useOrgSid); |
|
|
|
int i = loanRepaymentPlanDetailsService.updateTimeByBankName(bankName, u, useOrgSid); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
@ -842,6 +865,36 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean noImportUpdate(NoImportQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
String useOrgSid = orgSidByPath.getData(); |
|
|
|
List<NoImportVo> voList = baseMapper.selPlanDetailsByBank(query.getBankSid(), useOrgSid); |
|
|
|
if (!voList.isEmpty()) { |
|
|
|
List<String> stringList = |
|
|
|
voList.stream().map(NoImportVo::getSid).collect(Collectors.toList()); |
|
|
|
LocalDate localDate = LocalDate.now().minusDays(1); |
|
|
|
String formatDate = localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
|
|
|
int i = baseMapper.updateTimeByPlanSids(stringList, formatDate); |
|
|
|
} |
|
|
|
//判断当期是否逾期
|
|
|
|
List<HistoryOverDueVo> overDueVoList = loanRepaymentPlanDetailsService.overDueVoList(useOrgSid); |
|
|
|
if (!overDueVoList.isEmpty()) { |
|
|
|
List<String> planSids = new ArrayList<>(); |
|
|
|
overDueVoList.stream().forEach(v -> { |
|
|
|
if (v.getOverdueState().equals("0")) { |
|
|
|
planSids.add(v.getPlanSid()); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (!planSids.isEmpty()) { |
|
|
|
int i = loanRepaymentPlanDetailsService.updateOverDueState(planSids); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
private void pushLateVoucher(String pushUseOrgSid) { |
|
|
|
List<LoanPlanDetailsVoForLateVoucher> records = loanRepaymentPlanDetailsService.selListForLateVoucher(pushUseOrgSid); |
|
|
|
List<String> planSids = new ArrayList<>(); |
|
|
@ -1669,35 +1722,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
return records; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean noImportUpdate(NoImportQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
String useOrgSid = orgSidByPath.getData(); |
|
|
|
List<NoImportVo> voList = baseMapper.selPlanDetailsByBank(query.getBankSid(), useOrgSid); |
|
|
|
if (!voList.isEmpty()) { |
|
|
|
List<String> stringList = |
|
|
|
voList.stream().map(NoImportVo::getSid).collect(Collectors.toList()); |
|
|
|
LocalDate localDate = LocalDate.now().minusDays(1); |
|
|
|
String formatDate = localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
|
|
|
int i = baseMapper.updateTimeByPlanSids(stringList, formatDate); |
|
|
|
} |
|
|
|
//判断当期是否逾期
|
|
|
|
List<HistoryOverDueVo> overDueVoList = loanRepaymentPlanDetailsService.overDueVoList(useOrgSid); |
|
|
|
if (!overDueVoList.isEmpty()) { |
|
|
|
List<String> planSids = new ArrayList<>(); |
|
|
|
overDueVoList.stream().forEach(v -> { |
|
|
|
if (v.getOverdueState().equals("0")) { |
|
|
|
planSids.add(v.getPlanSid()); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (!planSids.isEmpty()) { |
|
|
|
int i = loanRepaymentPlanDetailsService.updateOverDueState(planSids); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<RecordCountVo> exportStatisticsExcel(RepaymentStatisticsQuery pagerQuery) { |
|
|
|
QueryWrapper<LoanRepaymentHistory> qw = new QueryWrapper<>(); |
|
|
|