实现流水明细导出模型与详情查询
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.ccdi.project.domain.excel;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 流水明细导出对象
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Data
|
||||
public class CcdiBankStatementExcel {
|
||||
|
||||
/** 交易时间 */
|
||||
@Excel(name = "交易时间")
|
||||
private String trxDate;
|
||||
|
||||
/** 本方账户 */
|
||||
@Excel(name = "本方账户")
|
||||
private String leAccountNo;
|
||||
|
||||
/** 本方主体 */
|
||||
@Excel(name = "本方主体")
|
||||
private String leAccountName;
|
||||
|
||||
/** 对方名称 */
|
||||
@Excel(name = "对方名称")
|
||||
private String customerAccountName;
|
||||
|
||||
/** 对方账户 */
|
||||
@Excel(name = "对方账户")
|
||||
private String customerAccountNo;
|
||||
|
||||
/** 摘要 */
|
||||
@Excel(name = "摘要")
|
||||
private String userMemo;
|
||||
|
||||
/** 交易类型 */
|
||||
@Excel(name = "交易类型")
|
||||
private String cashType;
|
||||
|
||||
/** 交易金额 */
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal displayAmount;
|
||||
}
|
||||
@@ -2,9 +2,13 @@ package com.ruoyi.ccdi.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.ccdi.project.domain.dto.CcdiBankStatementQueryDTO;
|
||||
import com.ruoyi.ccdi.project.domain.excel.CcdiBankStatementExcel;
|
||||
import com.ruoyi.ccdi.project.domain.vo.CcdiBankStatementDetailVO;
|
||||
import com.ruoyi.ccdi.project.domain.vo.CcdiBankStatementFilterOptionsVO;
|
||||
import com.ruoyi.ccdi.project.domain.vo.CcdiBankStatementListVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水明细查询Service接口
|
||||
*
|
||||
@@ -29,4 +33,20 @@ public interface ICcdiBankStatementService {
|
||||
*/
|
||||
Page<CcdiBankStatementListVO> selectStatementPage(Page<CcdiBankStatementListVO> page,
|
||||
CcdiBankStatementQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询导出列表
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 导出列表
|
||||
*/
|
||||
List<CcdiBankStatementExcel> selectStatementListForExport(CcdiBankStatementQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询流水详情
|
||||
*
|
||||
* @param bankStatementId 流水ID
|
||||
* @return 详情
|
||||
*/
|
||||
CcdiBankStatementDetailVO getStatementDetail(Long bankStatementId);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.ruoyi.ccdi.project.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.ccdi.project.domain.dto.CcdiBankStatementQueryDTO;
|
||||
import com.ruoyi.ccdi.project.domain.excel.CcdiBankStatementExcel;
|
||||
import com.ruoyi.ccdi.project.domain.vo.CcdiBankStatementDetailVO;
|
||||
import com.ruoyi.ccdi.project.domain.vo.CcdiBankStatementFilterOptionsVO;
|
||||
import com.ruoyi.ccdi.project.domain.vo.CcdiBankStatementListVO;
|
||||
import com.ruoyi.ccdi.project.mapper.CcdiBankStatementMapper;
|
||||
@@ -12,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.Collections;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -42,6 +45,22 @@ public class CcdiBankStatementServiceImpl implements ICcdiBankStatementService {
|
||||
return bankStatementMapper.selectStatementPage(page, normalizedQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CcdiBankStatementExcel> selectStatementListForExport(CcdiBankStatementQueryDTO queryDTO) {
|
||||
CcdiBankStatementQueryDTO normalizedQuery = queryDTO == null ? new CcdiBankStatementQueryDTO() : queryDTO;
|
||||
normalizeQuery(normalizedQuery);
|
||||
List<CcdiBankStatementListVO> rows = bankStatementMapper.selectStatementListForExport(normalizedQuery);
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return rows.stream().map(this::toExcel).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CcdiBankStatementDetailVO getStatementDetail(Long bankStatementId) {
|
||||
return bankStatementMapper.selectStatementDetailById(bankStatementId);
|
||||
}
|
||||
|
||||
private void normalizeQuery(CcdiBankStatementQueryDTO queryDTO) {
|
||||
queryDTO.setTransactionStartTime(normalizeText(queryDTO.getTransactionStartTime()));
|
||||
queryDTO.setTransactionEndTime(normalizeText(queryDTO.getTransactionEndTime()));
|
||||
@@ -109,4 +128,17 @@ public class CcdiBankStatementServiceImpl implements ICcdiBankStatementService {
|
||||
.collect(Collectors.toList());
|
||||
return normalized.isEmpty() ? null : normalized;
|
||||
}
|
||||
|
||||
private CcdiBankStatementExcel toExcel(CcdiBankStatementListVO row) {
|
||||
CcdiBankStatementExcel excel = new CcdiBankStatementExcel();
|
||||
excel.setTrxDate(row.getTrxDate());
|
||||
excel.setLeAccountNo(row.getLeAccountNo());
|
||||
excel.setLeAccountName(row.getLeAccountName());
|
||||
excel.setCustomerAccountName(row.getCustomerAccountName());
|
||||
excel.setCustomerAccountNo(row.getCustomerAccountNo());
|
||||
excel.setUserMemo(row.getUserMemo());
|
||||
excel.setCashType(row.getCashType());
|
||||
excel.setDisplayAmount(row.getDisplayAmount());
|
||||
return excel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user