|
|
@ -155,7 +155,18 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
NullPointerException nullPointerException = new NullPointerException(); |
|
|
|
} |
|
|
|
String temp = getCellVal(row.getCell(i)).toString().trim(); |
|
|
|
Date dateCellValue = row.getCell(2).getDateCellValue(); |
|
|
|
Date dateCellValue = null; |
|
|
|
String check = new String(); |
|
|
|
if (i == 2) { |
|
|
|
if (StringUtils.isNotBlank(temp)) { |
|
|
|
if (temp.contains("-")) { |
|
|
|
check = "0"; |
|
|
|
} else { |
|
|
|
dateCellValue = row.getCell(2).getDateCellValue(); |
|
|
|
check = "1"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (int j = 0; j < resultCell.length; j++) { |
|
|
|
if (i == resultCell[j]) { |
|
|
|
switch (i) { |
|
|
@ -166,7 +177,11 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
importVo.setPeriod(temp); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
importVo.setRealReturnTime(sdf.format(dateCellValue)); |
|
|
|
if (check.equals("1")) { |
|
|
|
importVo.setRealReturnTime(sdf.format(dateCellValue)); |
|
|
|
} else if (check.equals("0")) { |
|
|
|
importVo.setRealReturnTime(temp); |
|
|
|
} |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
importVo.setRealMoney(temp); |
|
|
@ -476,6 +491,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
qw.ne("h.buckleKey", "002"); |
|
|
|
qw.ne("h.buckleKey", "003"); |
|
|
|
} |
|
|
|
qw.ne("h.returnWayKey","02"); |
|
|
|
String dueStartDate = pagerQuery.getDueStartDate(); |
|
|
|
String dueEndDate = pagerQuery.getDueEndDate(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(dueStartDate), "date_format (p.dueDate,'%Y-%m-%d') >= date_format('" + dueStartDate + "','%Y-%m-%d')"). |
|
|
@ -884,7 +900,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<RepaymentStatisticsVo> repaymentStatistics(PagerQuery<RepaymentStatisticsQuery> pq) { |
|
|
|
IPage<LoanRepaymentHistory> page = PagerUtil.queryToPage(pq); |
|
|
|
PagerVo<RepaymentStatisticsVo> pagerVo = new PagerVo<>(); |
|
|
|
RepaymentStatisticsQuery pagerQuery = pq.getParams(); |
|
|
|
QueryWrapper<LoanRepaymentHistory> qw = new QueryWrapper<>(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
@ -971,8 +987,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
.orderBy(true, true, "a.period") |
|
|
|
.orderBy(true, true, "a.loanContractNo") |
|
|
|
; |
|
|
|
IPage<RepaymentStatisticsVo> pagging = baseMapper.repaymentStatistics(page, qw); |
|
|
|
List<RepaymentStatisticsVo> records = pagging.getRecords(); |
|
|
|
List<RepaymentStatisticsVo> records = baseMapper.repaymentStatistics(qw); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (RepaymentStatisticsVo record : records) { |
|
|
@ -1082,9 +1097,47 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
} |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
pagging.setRecords(records); |
|
|
|
PagerVo<RepaymentStatisticsVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
|
|
|
|
|
|
|
|
if (!records.isEmpty()) { |
|
|
|
List<RepaymentStatisticsVo> lastList = this.pageBySubList(records, (int) pq.getSize(), (int) pq.getCurrent()); |
|
|
|
pagerVo.setRecords(lastList); |
|
|
|
pagerVo.setTotal(records.size()); |
|
|
|
pagerVo.setCurrent(pq.getCurrent()); |
|
|
|
pagerVo.setSize(pq.getSize()); |
|
|
|
if (records.size() % pq.getSize() != 0L) { |
|
|
|
pagerVo.setPages((records.size() / pq.getSize()) + 1); |
|
|
|
} else { |
|
|
|
pagerVo.setPages(records.size() / pq.getSize()); |
|
|
|
} |
|
|
|
pagerVo.setMsg("当前共查询到" + records.size() + "条记录"); |
|
|
|
} |
|
|
|
return pagerVo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页方法 |
|
|
|
*/ |
|
|
|
public List<RepaymentStatisticsVo> pageBySubList(List<RepaymentStatisticsVo> list, int pagesize, int currentPage) { |
|
|
|
int totalcount = list.size(); |
|
|
|
int pagecount = 0; |
|
|
|
List<RepaymentStatisticsVo> subList; |
|
|
|
int m = totalcount % pagesize; |
|
|
|
if (m > 0) { |
|
|
|
pagecount = totalcount / pagesize + 1; |
|
|
|
} else { |
|
|
|
pagecount = totalcount / pagesize; |
|
|
|
} |
|
|
|
if (m == 0) { |
|
|
|
subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage)); |
|
|
|
} else { |
|
|
|
if (currentPage == pagecount) { |
|
|
|
subList = list.subList((currentPage - 1) * pagesize, totalcount); |
|
|
|
} else { |
|
|
|
subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage)); |
|
|
|
} |
|
|
|
} |
|
|
|
return subList; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<RepaymentDetailsListVo> repaymentDetailsList(PagerQuery<RepaymentDetailsListQuery> pq) { |
|
|
|