This commit is contained in:
@jyuhsin
2025-12-18 08:42:26 +08:00
parent 238d4ca446
commit 63cd3d74cf
8 changed files with 53 additions and 28 deletions
@@ -263,6 +263,7 @@ public class FamilyActivityStatisticsController {
Map<String, Object> userExportMap = new HashMap<>();
userExportMap.put("name", k);
userExportParams.setType(ExcelType.HSSF);
userExportMap.put("title", userExportParams);
userExportMap.put("entity", currentEntities);
userExportMap.put("data", courseSignUsers);
@@ -275,7 +276,7 @@ public class FamilyActivityStatisticsController {
ExcelExportService service = new ExcelExportService();
service.createSheetForMap(workbook, (ExportParams) map.get("title"), (List<ExcelExportEntity>) map.get("entity"), (Collection<?>) map.get("data"));
}
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xlsx", workbook, response);
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xls", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
@@ -213,9 +213,9 @@ public class FellowshipActivityStatisticsController {
userSignData.put(cv.getString("columnCode"), cv.getString("columnValue"));
} else {
if (StrUtil.isNotBlank(cv.getString("columnValue"))) {
List<JSONObject> columnValue = Json.fromJsonAsList(JSONObject.class, cv.getString("columnValue"));
List<NutMap> columnValue = cv.getAsList("columnValue", NutMap.class);
if (columnValue.size() == 1) {
JSONObject sysFile = columnValue.get(0);
NutMap sysFile = columnValue.get(0);
Sys_file file = dao.fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", sysFile.get("url")));
byte[] imageBytes = SysFileMinIoUtil.getFileBytes(file.getBucket(), file.getStoragePath());
if (imageBytes.length > 0) {
@@ -231,6 +231,7 @@ public class FellowshipActivityStatisticsController {
Map<String, Object> userExportMap = new HashMap<>();
userExportMap.put("name", k);
userExportParams.setType(ExcelType.HSSF);
userExportMap.put("title", userExportParams);
userExportMap.put("entity", currentEntities);
userExportMap.put("data", v);
@@ -243,10 +244,7 @@ public class FellowshipActivityStatisticsController {
ExcelExportService service = new ExcelExportService();
service.createSheetForMap(workbook, (ExportParams) map.get("title"), (List<ExcelExportEntity>) map.get("entity"), (Collection<?>) map.get("data"));
}
workbook.write(response.getOutputStream());
workbook.close();
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xlsx", workbook, response);
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xls", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
@@ -393,6 +393,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
dao().update(ActivitySchoolApply.class,
Chain.make("status", 2),
Cnd.where("activityId", "=", activityId)
.and("eventId", "=", eventId)
.and("activityUnionId", "=", basicUnion.getId()));
}
@@ -267,9 +267,9 @@ public class TrainSignUpActivityStatisticsController {
userSignData.put(cv.getString("columnCode"), cv.getString("columnValue"));
} else {
if (StrUtil.isNotBlank(cv.getString("columnValue"))) {
List<JSONObject> columnValue = Json.fromJsonAsList(JSONObject.class, cv.getString("columnValue"));
if (columnValue.size() == 1) {
JSONObject sysFile = columnValue.get(0);
List<NutMap> columnValue = cv.getAsList("columnValue", NutMap.class);
if (columnValue.size() == 1) {
NutMap sysFile = columnValue.get(0);
Sys_file file = dao.fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", sysFile.get("url")));
byte[] imageBytes = SysFileMinIoUtil.getFileBytes(file.getBucket(), file.getStoragePath());
if (imageBytes.length > 0) {
@@ -285,6 +285,7 @@ public class TrainSignUpActivityStatisticsController {
Map<String, Object> userExportMap = new HashMap<>();
userExportMap.put("name", k);
userExportParams.setType(ExcelType.HSSF);
userExportMap.put("title", userExportParams);
userExportMap.put("entity", currentEntities);
userExportMap.put("data", v);
@@ -297,10 +298,7 @@ public class TrainSignUpActivityStatisticsController {
ExcelExportService service = new ExcelExportService();
service.createSheetForMap(workbook, (ExportParams) map.get("title"), (List<ExcelExportEntity>) map.get("entity"), (Collection<?>) map.get("data"));
}
workbook.write(response.getOutputStream());
workbook.close();
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xlsx", workbook, response);
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xls", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
@@ -207,9 +207,9 @@ public class LiteracyActivityStatisticsController {
userSignData.put(cv.getString("columnCode"), cv.getString("columnValue"));
} else {
if (StrUtil.isNotBlank(cv.getString("columnValue"))) {
List<JSONObject> columnValue = Json.fromJsonAsList(JSONObject.class, cv.getString("columnValue"));
List<NutMap> columnValue = cv.getAsList("columnValue", NutMap.class);
if (columnValue.size() == 1) {
JSONObject sysFile = columnValue.get(0);
NutMap sysFile = columnValue.get(0);
Sys_file file = dao.fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", sysFile.get("url")));
byte[] imageBytes = SysFileMinIoUtil.getFileBytes(file.getBucket(), file.getStoragePath());
if (imageBytes.length > 0) {
@@ -225,6 +225,7 @@ public class LiteracyActivityStatisticsController {
Map<String, Object> userExportMap = new HashMap<>();
userExportMap.put("name", k);
userExportParams.setType(ExcelType.HSSF);
userExportMap.put("title", userExportParams);
userExportMap.put("entity", currentEntities);
userExportMap.put("data", v);
@@ -237,10 +238,7 @@ public class LiteracyActivityStatisticsController {
ExcelExportService service = new ExcelExportService();
service.createSheetForMap(workbook, (ExportParams) map.get("title"), (List<ExcelExportEntity>) map.get("entity"), (Collection<?>) map.get("data"));
}
workbook.write(response.getOutputStream());
workbook.close();
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xlsx", workbook, response);
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xls", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}