liupeng 4 年之前
父節點
當前提交
894a46c5a0
共有 1 個文件被更改,包括 2 次插入7 次删除
  1. 2 7
      code/sapparent/sapcms/src/main/java/org/fouram/controller/ApiController.java

+ 2 - 7
code/sapparent/sapcms/src/main/java/org/fouram/controller/ApiController.java

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