|
@@ -73,4 +73,36 @@ public class UserServiceImpl extends IBaseServiceImpl<UserEntity, Long> implemen
|
|
return Result.success(result);
|
|
return Result.success(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Object exportExcelGet() {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
|
+ List<ExcelUserVo> userList = entityMapper.exportExcelByDay();
|
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
|
+ log.info("sql耗时: {}s", (end-start)/1000);
|
|
|
|
+ String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmss");
|
|
|
|
+ String savePath = configConstant.serverBasePath + "/excel/" + time + ".xlsx";
|
|
|
|
+ HashMap<String, String> rowTitle = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ rowTitle.put("name", "姓名");
|
|
|
|
+ rowTitle.put("phone", "电话");
|
|
|
|
+ rowTitle.put("num", "展位号");
|
|
|
|
+ rowTitle.put("unit", "单位名称");
|
|
|
|
+ rowTitle.put("job", "职务");
|
|
|
|
+ rowTitle.put("date", "填写时间");
|
|
|
|
+ ExcelUtils.createExcel(userList, savePath, rowTitle);
|
|
|
|
+
|
|
|
|
+ String domain = configConstant.serverDomain + "/excel/" + time + ".xlsx";
|
|
|
|
+ log.info("url: {}", domain);
|
|
|
|
+
|
|
|
|
+ HashMap<String, Object> result = new HashMap<>();
|
|
|
|
+ result.put("size", userList.size());
|
|
|
|
+ result.put("domain", domain);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return domain;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|