Commit 09500c12 authored by chenzhao's avatar chenzhao

还款导出支持筛选导出

parent 0de87884
...@@ -7,4 +7,10 @@ import java.util.List; ...@@ -7,4 +7,10 @@ import java.util.List;
@Data @Data
public class RepaymentBatchDto { public class RepaymentBatchDto {
private List<String> sequenceNbrList; private List<String> sequenceNbrList;
private String companyName;
private String loanPeriod;
private String messageState;
private String period;
private String repayDate;
private String repayState;
} }
...@@ -162,7 +162,7 @@ public class RepaymentController extends BaseController { ...@@ -162,7 +162,7 @@ public class RepaymentController extends BaseController {
@PostMapping(value = "/exportRepaymentExcel") @PostMapping(value = "/exportRepaymentExcel")
@ApiOperation(httpMethod = "POST", value = "导出还款Excel", notes = "导出还款Excel") @ApiOperation(httpMethod = "POST", value = "导出还款Excel", notes = "导出还款Excel")
public ResponseModel<?> exportRepaymentExcel(@RequestBody RepaymentBatchDto repaymentBatchDto, HttpServletResponse response) { public ResponseModel<?> exportRepaymentExcel(@RequestBody RepaymentBatchDto repaymentBatchDto, HttpServletResponse response) {
repaymentService.exportRepaymentExcel(repaymentBatchDto.getSequenceNbrList(), response); repaymentService.exportRepaymentExcel(repaymentBatchDto, response);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
......
...@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.vo.RepaymentExcelVO; ...@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.vo.RepaymentExcelVO;
import com.yeejoin.amos.boot.module.hygf.biz.vo.RouthPathVO; import com.yeejoin.amos.boot.module.hygf.biz.vo.RouthPathVO;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
...@@ -356,12 +357,19 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R ...@@ -356,12 +357,19 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
} }
} }
public void exportRepaymentExcel(List<String> sequenceNbrList, HttpServletResponse response) { public void exportRepaymentExcel(RepaymentBatchDto repaymentBatchDto, HttpServletResponse response) {
LambdaQueryWrapper<Repayment> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Repayment> wrapper = new LambdaQueryWrapper<>();
//如果是空值导出全部 //如果是空值导出全部
List<Repayment> repaymentList; List<Repayment> repaymentList;
if (CollectionUtil.isNotEmpty(sequenceNbrList)) {
wrapper.in(Repayment::getSequenceNbr, sequenceNbrList); if (Objects.nonNull(repaymentBatchDto)) {
wrapper.in(CollectionUtil.isNotEmpty(repaymentBatchDto.getSequenceNbrList()),Repayment::getSequenceNbr, repaymentBatchDto.getSequenceNbrList());
wrapper.eq(StringUtils.isNotEmpty(repaymentBatchDto.getCompanyName()),Repayment::getCompanyName,repaymentBatchDto.getCompanyName());
wrapper.eq(StringUtils.isNotEmpty(repaymentBatchDto.getRepayState()),Repayment::getRepayState,repaymentBatchDto.getRepayState());
wrapper.like(StringUtils.isNotEmpty(repaymentBatchDto.getPeriod()),Repayment::getPeriod,repaymentBatchDto.getPeriod());
wrapper.like(StringUtils.isNotEmpty(repaymentBatchDto.getLoanPeriod()),Repayment::getLoanPeriod,repaymentBatchDto.getLoanPeriod());
wrapper.eq(StringUtils.isNotEmpty(repaymentBatchDto.getMessageState()),Repayment::getMessageState,repaymentBatchDto.getMessageState());
wrapper.eq(StringUtils.isNotEmpty(repaymentBatchDto.getRepayDate()),Repayment::getRepayDate,repaymentBatchDto.getRepayDate());
repaymentList = list(wrapper); repaymentList = list(wrapper);
}else { }else {
repaymentList = baseMapper.getAllData(); repaymentList = baseMapper.getAllData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment