|
@@ -2,6 +2,7 @@ package com.sckw.fleet.controller;
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
+import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.exception.SystemException;
|
|
import com.sckw.core.exception.SystemException;
|
|
|
import com.sckw.core.model.enums.SystemTypeEnum;
|
|
import com.sckw.core.model.enums.SystemTypeEnum;
|
|
|
import com.sckw.core.model.page.PageHelperUtil;
|
|
import com.sckw.core.model.page.PageHelperUtil;
|
|
@@ -77,15 +78,15 @@ public class KwfTruckReportController {
|
|
|
* @date 2023/07/18
|
|
* @date 2023/07/18
|
|
|
**/
|
|
**/
|
|
|
@PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
- public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) throws IOException {
|
|
|
|
|
|
|
+ public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
|
|
|
params.put("entId", LoginUserHolder.getEntId());
|
|
params.put("entId", LoginUserHolder.getEntId());
|
|
|
/**查询数据**/
|
|
/**查询数据**/
|
|
|
List<KwfTruckReportVo> trucks = reportService.findPage(params);
|
|
List<KwfTruckReportVo> trucks = reportService.findPage(params);
|
|
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(trucks)) {
|
|
|
|
|
- ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(trucks)) {
|
|
|
|
|
+ throw new BusinessException("没有您想导出的数据!");
|
|
|
}
|
|
}
|
|
|
- ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
|
|
|
|
|
|
|
+ ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|