Jelajahi Sumber

Merge branch 'refs/heads/feat-20250730-userexport' into pre

lixuesong 2 hari lalu
induk
melakukan
c9ebc58399

+ 6 - 3
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageExportServiceImpl.java

@@ -609,17 +609,19 @@ public class WmScorePackageExportServiceImpl implements WmScorePackageExportServ
 		List<WmScorePackage> pkgs = getRegionPackages(startDate, endDate, dis, user, operatorRoleIds);
 
 		if (CollUtil.isEmpty(pkgs)) {
-			throw new BizException(
+			log.warn(
 					String.format(
 							"%s至%s没有区域发包记录,不支持导出",
 							DateTimeFormatter.ofPattern(DatePattern.CHINESE_DATE_PATTERN).format(startDate),
 							DateTimeFormatter.ofPattern(DatePattern.CHINESE_DATE_PATTERN).format(endDate)));
+			throw new BizException("数据导出失败,您选择时间范围暂无数据,请修改后重试");
 		}
 
 		// 获取子集包
 		List<WmScorePackage> childrenPkgs = getChildPackages(pkgs);
 		if (CollUtil.isEmpty(childrenPkgs)) {
-			throw new BizException("没有找到可导出的个人包记录");
+			log.warn("没有找到可导出的个人包记录");
+			throw new BizException("数据导出失败,您选择时间范围暂无数据,请修改后重试");
 		}
 
 		List<String> cPkgIds = childrenPkgs.stream()
@@ -644,7 +646,8 @@ public class WmScorePackageExportServiceImpl implements WmScorePackageExportServ
 						.collect(Collectors.toList()));
 
 		if (CollUtil.isEmpty(taskTypeQties)) {
-			throw new BizException("没有找到可导出的任务下发记录");
+			log.warn("没有找到可导出的任务下发记录");
+			throw new BizException("数据导出失败,您选择时间范围暂无数据,请修改后重试");
 		}
 
 		Map<Integer, List<WmPackageTaskTypeQty>> pttMap = taskTypeQties.stream()

+ 1 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/util/ExportUtils.java

@@ -48,7 +48,7 @@ public final class ExportUtils {
 		String ret = ERROR_MSG_UNKNOWN;
 		try {
 			// 写入excel文件
-			EasyExcel.write(fullPath).sheet(exportType.getDescription())
+			EasyExcel.write(fullPath, head).sheet(exportType.getDescription())
 					.doWrite(data);
 			log.info("{}导出生成缓存文件:{}", exportType.getDescription(), fullPath);