throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("查询部中心原始流水统计失败"); | throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("查询部中心原始流水统计失败"); | ||||
} | } | ||||
} | } | ||||
// private AflPaccountRefundCountFindPageViewResponse toResponse(Pagination pagination) { | |||||
// final AflPaccountRefundCountFindPageViewResponse response = new AflPaccountRefundCountFindPageViewResponse(); | |||||
// BeanTools.copyProperties(pagination, response); | |||||
// if (isEmpty(pagination.getResult())) { | |||||
// return response; | |||||
// } | |||||
// response.setData(pagination.getResult(AflPaccountRefundCountVo.class)); | |||||
// return response; | |||||
// } | |||||
// private Pagination select(AflPaccountRefundCountFindPageViewRequest request) throws ServiceHandleException { | |||||
// if (request.getPageSize() > 100) { | |||||
// throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("请求每页数量过大 " + request.getPageSize()); | |||||
// } | |||||
// AflPaccountRefundCountFindPageRequest queryRequest = new AflPaccountRefundCountFindPageRequest(); | |||||
// BeanUtil.copyProperties(request, queryRequest); | |||||
// return aflPaccountRefundCountRepo.page(queryRequest); | |||||
// } | |||||
private AflPaccountRefundCountFindPageViewResponse toResponse(Page<AflPaccountRefundCount> page, AflPaccountRefundCountFindPageViewRequest request) { | private AflPaccountRefundCountFindPageViewResponse toResponse(Page<AflPaccountRefundCount> page, AflPaccountRefundCountFindPageViewRequest request) { | ||||
final AflPaccountRefundCountFindPageViewResponse response = new AflPaccountRefundCountFindPageViewResponse(); | final AflPaccountRefundCountFindPageViewResponse response = new AflPaccountRefundCountFindPageViewResponse(); | ||||
} | } | ||||
return aflPaccountRefundCountRepo.findAll(((root, query, cb) -> { | return aflPaccountRefundCountRepo.findAll(((root, query, cb) -> { | ||||
List<Predicate> list = Lists.newArrayList(); | List<Predicate> list = Lists.newArrayList(); | ||||
if (!StringUtils.isEmpty(request.getAgentId())) { | |||||
list.add(cb.equal(root.<Integer>get("agentId"), request.getAgentId())); | |||||
if (!StringUtils.isEmpty(request.getAgencyId())) { | |||||
list.add(cb.equal(root.<Integer>get("agentId"), request.getAgencyId())); | |||||
} | } | ||||
if (request.getAccountDateEnd()!=null) { | if (request.getAccountDateEnd()!=null) { | ||||
list.add(cb.le(root.<Integer>get("accountDate"), request.getAccountDateEnd())); | list.add(cb.le(root.<Integer>get("accountDate"), request.getAccountDateEnd())); |
/** 记账日期 */ | /** 记账日期 */ | ||||
private Integer accountDate ; | private Integer accountDate ; | ||||
/** 渠道编号 */ | /** 渠道编号 */ | ||||
private String agentId ; | |||||
private String agencyId; | |||||
/** 渠道名称 */ | /** 渠道名称 */ | ||||
private String agentName ; | private String agentName ; | ||||
this.accountDate = accountDate; | this.accountDate = accountDate; | ||||
} | } | ||||
public String getAgentId() { | |||||
return agentId; | |||||
public String getAgencyId() { | |||||
return agencyId; | |||||
} | } | ||||
public void setAgentId(String agentId) { | |||||
this.agentId = agentId; | |||||
public void setAgencyId(String agencyId) { | |||||
this.agencyId = agencyId; | |||||
} | } | ||||
public String getAgentName() { | public String getAgentName() { |
public String export(AflPaccountRefundCountFindPageViewRequest request, Logger logger) throws ServiceHandleException { | public String export(AflPaccountRefundCountFindPageViewRequest request, Logger logger) throws ServiceHandleException { | ||||
String pathFile =null; | String pathFile =null; | ||||
try { | try { | ||||
// AflPaccountRefundCountFindPageRequest queryRequest = new AflPaccountRefundCountFindPageRequest(); | |||||
// BeanUtil.copyProperties(request, queryRequest); | |||||
// List<AflPaccountRefundCountVo> aflPaccountRefundCountVos = aflPaccountRefundCountRepo.list(queryRequest); | |||||
List<AflPaccountRefundCount> select = select(request); | List<AflPaccountRefundCount> select = select(request); | ||||
List<AflPaccountRefundCountVo> aflPaccountRefundCountVos = select.stream().map(this::toVo).collect(Collectors.toList()); | List<AflPaccountRefundCountVo> aflPaccountRefundCountVos = select.stream().map(this::toVo).collect(Collectors.toList()); | ||||
if (aflPaccountRefundCountVos==null||aflPaccountRefundCountVos.size()==0) { | if (aflPaccountRefundCountVos==null||aflPaccountRefundCountVos.size()==0) { | ||||
private List<AflPaccountRefundCount> select(AflPaccountRefundCountFindPageViewRequest request) throws ServiceHandleException { | private List<AflPaccountRefundCount> select(AflPaccountRefundCountFindPageViewRequest request) throws ServiceHandleException { | ||||
return aflPaccountRefundCountRepo.findAll(((root, query, cb) -> { | return aflPaccountRefundCountRepo.findAll(((root, query, cb) -> { | ||||
List<Predicate> list = Lists.newArrayList(); | List<Predicate> list = Lists.newArrayList(); | ||||
if (!StringUtils.isEmpty(request.getAgentId())) { | |||||
list.add(cb.equal(root.<Integer>get("agentId"), request.getAgentId())); | |||||
if (!StringUtils.isEmpty(request.getAgencyId())) { | |||||
list.add(cb.equal(root.<Integer>get("agentId"), request.getAgencyId())); | |||||
} | } | ||||
if (request.getAccountDateEnd()!=null) { | if (request.getAccountDateEnd()!=null) { | ||||
list.add(cb.le(root.<Integer>get("accountDate"), request.getAccountDateEnd())); | list.add(cb.le(root.<Integer>get("accountDate"), request.getAccountDateEnd())); |