Browse Source

Merge remote-tracking branch 'origin/master'

master
God 1 year ago
parent
commit
e1c9f5eaed
  1. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanrepaymenthistory/LoanRepaymentHistoryFeign.java
  2. 2
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryMapper.java
  3. 1
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryMapper.xml
  4. 69
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanrepaymenthistory/LoanRepaymentHistoryFeign.java

@ -31,7 +31,7 @@ import java.util.List;
fallback = LoanRepaymentHistoryFeignFallback.class)
public interface LoanRepaymentHistoryFeign {
@ApiOperation("当月还款记录列表")
@ApiOperation("资方划扣还款明细列表")
@PostMapping("/monthListPage")
public ResultBean<PagerVo<LoanRepaymentHistoryVo>> monthListPage(@RequestBody PagerQuery<LoanRepaymentHistoryQuery> pq);

2
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryMapper.java

@ -42,7 +42,7 @@ public interface LoanRepaymentHistoryMapper extends BaseMapper<LoanRepaymentHist
IPage<TransferPaymentVo> transferPaymentList(IPage<LoanRepaymentHistory> page, @Param(Constants.WRAPPER) QueryWrapper<LoanRepaymentHistory> qw);
IPage<RepaymentStatisticsVo> repaymentStatistics(IPage<LoanRepaymentHistory> page, @Param(Constants.WRAPPER) QueryWrapper<LoanRepaymentHistory> qw);
List<RepaymentStatisticsVo> repaymentStatistics(@Param(Constants.WRAPPER) QueryWrapper<LoanRepaymentHistory> qw);
List<String> selnewUpdateTimeByPlanSid(@Param("sid") String sid);

1
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryMapper.xml

@ -100,6 +100,7 @@
select *
from loan_repayment_history
where planDetailSid = #{planSid}
and returnWayKey != '02'
</select>
<select id="selUpdateStateList" resultType="java.lang.String">
SELECT

69
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java

@ -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) {

Loading…
Cancel
Save