Browse Source

feat: excel版报告导出2

李学松 2 years ago
parent
commit
dd6a082b60

+ 1 - 33
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/ExcelReportExportController.java

@@ -1,22 +1,3 @@
-/*
- *
- *      Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the pig4cloud.com developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: hnqz
- *
- */
-
 package com.qunzhixinxi.hnqz.admin.controller;
 
 import cn.hutool.core.util.StrUtil;
@@ -75,22 +56,9 @@ import java.util.stream.Collectors;
 @RestController
 @AllArgsConstructor
 @RequestMapping("/report/excel/export")
-@Api(value = "reportExport", tags = "导出管理模块")
+@Api(value = "excelReportExport", tags = "导出管理模块")
 public class ExcelReportExportController {
 
-	private final WmTaskService wmTaskService;
-
-	private final WmScorePackageService wmScorePackageService;
-
-	private final WmReportService wmReportService;
-
-	private final ReportExportService reportExportService;
-
-	private final SysDeptService sysDeptService;
-
-	private final JavaMailSender sender;
-
-	private final UpmsConfig upmsConfig;
 	private final RedisTemplate<String,String> redisTemplate;
 	private final RabbitMqClient rabbitMqClient;
 

+ 2 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmScorePackageService.java

@@ -177,8 +177,9 @@ public interface WmScorePackageService extends IService<WmScorePackage> {
 	 * 查询excel报告导出状态
 	 *
 	 * @param wmScorePackage
+	 * @param excelReportCacheKey
 	 */
-	void getExcelReportOpt(WmScorePackage wmScorePackage);
+	void getExcelReportOpt(WmScorePackage wmScorePackage, String excelReportCacheKey);
 
 	/**
 	 * 校验积分包是否可以结算

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

@@ -2149,6 +2149,9 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
 		scorePackage.setReportMqName(CacheConstants.EXPORT_ZB_REPORT_CACHE);
 		getReportOpt(scorePackage);
 
+		// 封装excel报告状态
+		this.getExcelReportOpt(scorePackage, CacheConstants.EXCEL_EXPORT_ZB_REPORT_CACHE);
+
 		// 接单对象范围名称
 		if (StrUtil.isNotBlank(scorePackage.getPackageUserScope())) {
 			String packageUserScopeName = wmTeamService.getPackageUserScopeName(scorePackage.getPackageUserScope());
@@ -2312,7 +2315,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
 		getReportOpt(wmScorePackage);
 
 		// 封装excel报告状态
-		this.getExcelReportOpt(wmScorePackage);
+		this.getExcelReportOpt(wmScorePackage, CacheConstants.EXCEL_EXPORT_NBA_REPORT_CACHE);
 
 		return wmScorePackage;
 	}
@@ -2365,14 +2368,15 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
 	 * 查询excel报告导出状态
 	 *
 	 * @param wmScorePackage 列表
+	 * @param excelReportCacheKey 缓存key
 	 */
 	@Override
-	public void getExcelReportOpt(WmScorePackage wmScorePackage) {
+	public void getExcelReportOpt(WmScorePackage wmScorePackage, String excelReportCacheKey) {
 
 		WmReportOpt opt = new WmReportOpt();
 
 		// 获取生成记录
-		String key = String.format(CacheConstants.EXCEL_EXPORT_NBA_REPORT_CACHE, wmScorePackage.getId());
+		String key = String.format(excelReportCacheKey, wmScorePackage.getId());
 		String o = redisTemplate.opsForValue().get(key);
 
 		if (StrUtil.isNotEmpty(o)) {