|
@@ -16,7 +16,6 @@ import org.fouram.core.plugin.weixin.cp.core.WXCpMailList;
|
|
import org.fouram.core.util.AppUtil;
|
|
import org.fouram.core.util.AppUtil;
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
import org.fouram.core.util.ConfConfig;
|
|
import org.fouram.core.util.ConfConfig;
|
|
-import org.fouram.core.util.DateUtil;
|
|
|
|
import org.fouram.core.util.ExcelExportUtil;
|
|
import org.fouram.core.util.ExcelExportUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.entity.SapOrg;
|
|
import org.fouram.entity.SapOrg;
|
|
@@ -251,7 +250,7 @@ public class ApiController extends BaseController {
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
@RequestMapping(value = "/exportUserReportExcel")
|
|
@RequestMapping(value = "/exportUserReportExcel")
|
|
- public Object exportUserReportExcel() {
|
|
|
|
|
|
+ public void exportUserReportExcel(HttpServletResponse response) {
|
|
try {
|
|
try {
|
|
// 开始时间、结束时间、 部门、姓名
|
|
// 开始时间、结束时间、 部门、姓名
|
|
String startDate = getPageData().getString("startDate");
|
|
String startDate = getPageData().getString("startDate");
|
|
@@ -260,14 +259,10 @@ public class ApiController extends BaseController {
|
|
String name = getPageData().getString("name");
|
|
String name = getPageData().getString("name");
|
|
Object object = sapCheckService.findUserReports(startDate, endDate, departId, name);
|
|
Object object = sapCheckService.findUserReports(startDate, endDate, departId, name);
|
|
List<Map<String, Object>> dataList = (List<Map<String, Object>>) object;
|
|
List<Map<String, Object>> dataList = (List<Map<String, Object>>) object;
|
|
- String filePath = "/public/excel/userReport" + DateUtil.getTimeStamp() + ".xlsx";
|
|
|
|
String haveFilePath = "/public/excel/userReport.xlsx";
|
|
String haveFilePath = "/public/excel/userReport.xlsx";
|
|
- ExcelExportUtil.exportExcelFile(getRootPath() + haveFilePath, dataList, getRootPath() + filePath, 3);
|
|
|
|
- return AppUtil.success(filePath, null);
|
|
|
|
|
|
+ ExcelExportUtil.exportExcelStream(getRootPath() + haveFilePath, dataList, 1, response);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
LoggerUtil.error(e);
|
|
LoggerUtil.error(e);
|
|
- return AppUtil.error(AppUtil.ResultConstant.WEB_ERR_MSG);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|