|
@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
|
import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo;
|
|
@@ -267,6 +268,35 @@ public class ApiController extends BaseController {
|
|
|
String hzFilePath = "/public/excel/userReport" + DateUtil.getTimeStamp() + ".xlsx";
|
|
|
List<Map<String, Object>> hzList = sapCheckService.selectReportDayList(dto.getStartDate(), dto.getEndDate(),
|
|
|
dto.getDepartId(), dto.getName());
|
|
|
+ LoggerUtil.info("hz:" + hzList.size());
|
|
|
+ LoggerUtil.info("hz:" + JSON.toJSONString(hzList.get(0)));
|
|
|
+ ExcelExportUtil.exportExcelFile(getRootPath() + ysFilePath, hzList, getRootPath() + hzFilePath, 1, 0);
|
|
|
+ ysFilePath = hzFilePath;
|
|
|
+ // 明细
|
|
|
+ String resultFilePath = "/public/excel/userReport" + DateUtil.getTimeStamp() + ".xlsx";
|
|
|
+ List<Map<String, Object>> mxList = sapCheckService.findUserReports(dto.getStartDate(), dto.getEndDate(),
|
|
|
+ dto.getDepartId(), dto.getName(), dto.getStatus(), null, null);
|
|
|
+ ExcelExportUtil.exportExcelFile(getRootPath() + ysFilePath, mxList, getRootPath() + resultFilePath, 1, 1);
|
|
|
+ return ResultUtil.success(resultFilePath, "操作成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return ResultUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/exportUserReportExcelTest")
|
|
|
+ @ResponseBody
|
|
|
+ public Object exportUserReportExcelTest(HttpServletResponse response) {
|
|
|
+ try {
|
|
|
+ FindUsersDTO dto = FindUsersDTO.builder().startDate(getPageData().getString("startDate"))
|
|
|
+ .endDate(getPageData().getString("endDate")).build();
|
|
|
+ String ysFilePath = "/public/excel/userReport.xlsx";
|
|
|
+ // 汇总
|
|
|
+ String hzFilePath = "/public/excel/userReport" + DateUtil.getTimeStamp() + ".xlsx";
|
|
|
+ List<Map<String, Object>> hzList = sapCheckService.selectReportDayList(dto.getStartDate(), dto.getEndDate(),
|
|
|
+ dto.getDepartId(), dto.getName());
|
|
|
+ LoggerUtil.info("hz:" + hzList.size());
|
|
|
+ LoggerUtil.info("hz:" + JSON.toJSONString(hzList.get(0)));
|
|
|
ExcelExportUtil.exportExcelFile(getRootPath() + ysFilePath, hzList, getRootPath() + hzFilePath, 1, 0);
|
|
|
ysFilePath = hzFilePath;
|
|
|
// 明细
|