update:对账消息推送,军保账单统计,退款数据统计

This commit is contained in:
Yuan
2025-10-20 14:39:29 +08:00
parent 9fb2ea9cb4
commit ff5bad9967
35 changed files with 3649 additions and 100 deletions

View File

@@ -0,0 +1,47 @@
package com.saye.hospitalgd.service.FinancialReconciliation;
import java.util.HashMap;
import java.util.List;
/**
* @author thuang
* @version 1.0
* @description: 退款数据统计报表服务接口
* @date 2024/12/19 10:00
*/
public interface RefundStatisticsService {
/**
* 查询退款统计报表数据
* @param map 查询参数
* @return 退款统计数据列表
* @throws Exception
*/
List<HashMap<Object, Object>> findRefundStatistics(HashMap<Object, Object> map) throws Exception;
/**
* 获取退款统计汇总数据
* @param map 查询参数
* @return 退款统计汇总数据
* @throws Exception
*/
HashMap<Object, Object> getRefundSummary(HashMap<Object, Object> map) throws Exception;
/**
* 获取退款趋势数据
* @param map 查询参数
* @return 退款趋势数据列表
* @throws Exception
*/
List<HashMap<Object, Object>> getRefundTrend(HashMap<Object, Object> map) throws Exception;
/**
* 导出退款统计报表
* @param map 查询参数
* @return 导出文件名
* @throws Exception
*/
String exportRefundStatistics(HashMap<Object, Object> map) throws Exception;
}

View File

@@ -0,0 +1,92 @@
package com.saye.hospitalgd.service.FinancialReconciliation.impl;
import com.saye.hospitalgd.commons.excel.RefundStatisticsExportXLSX;
import com.saye.hospitalgd.commons.log.ExceptionDUtil;
import com.saye.hospitalgd.mapper.FinancialReconciliation.RefundStatisticsMapper;
import com.saye.hospitalgd.service.FinancialReconciliation.RefundStatisticsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.util.HashMap;
import java.util.List;
/**
* @author thuang
* @version 1.0
* @description: 退款数据统计报表服务实现类
* @date 2024/12/19 10:00
*/
@Service
@Transactional
public class RefundStatisticsServiceImpl implements RefundStatisticsService {
private static final Logger log = LoggerFactory.getLogger(RefundStatisticsServiceImpl.class);
@Autowired
private RefundStatisticsMapper refundStatisticsMapper;
@Override
public List<HashMap<Object, Object>> findRefundStatistics(HashMap<Object, Object> map) throws Exception {
try {
return refundStatisticsMapper.findRefundStatistics(map);
} catch (Exception e) {
log.info("查询退款统计报表数据失败", e);
throw e;
}
}
@Override
public HashMap<Object, Object> getRefundSummary(HashMap<Object, Object> map) throws Exception {
try {
return refundStatisticsMapper.getRefundSummary(map);
} catch (Exception e) {
log.error("获取退款统计汇总数据失败", e);
throw e;
}
}
@Override
public List<HashMap<Object, Object>> getRefundTrend(HashMap<Object, Object> map) throws Exception {
try {
return refundStatisticsMapper.getRefundTrend(map);
} catch (Exception e) {
log.error("获取退款趋势数据失败", e);
throw e;
}
}
@Override
public String exportRefundStatistics(HashMap<Object, Object> map) throws Exception {
try {
// 获取统计数据
List<HashMap<Object, Object>> dataList = refundStatisticsMapper.findRefundStatistics(map);
// 获取汇总数据
HashMap<Object, Object> summaryData = refundStatisticsMapper.getRefundSummary(map);
// 创建导出文件
String fileName = "退款统计报表_" + System.currentTimeMillis() + ".xlsx";
String filePath = System.getProperty("user.dir") + File.separator + "downloadFile" + File.separator + fileName;
// 确保目录存在
File file = new File(filePath);
File parentDir = file.getParentFile();
if (!parentDir.exists()) {
parentDir.mkdirs();
}
// 导出Excel
RefundStatisticsExportXLSX exportXLSX = new RefundStatisticsExportXLSX();
exportXLSX.exportRefundStatistics(dataList, summaryData, filePath);
return fileName;
} catch (Exception e) {
log.error("导出退款统计报表失败", e);
throw e;
}
}
}