|
@@ -6,8 +6,10 @@ 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;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
|
|
+import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
|
|
+import com.sckw.core.web.response.ResponseUtil;
|
|
|
import com.sckw.excel.easyexcel.RequestHolder;
|
|
import com.sckw.excel.easyexcel.RequestHolder;
|
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
|
import com.sckw.fleet.model.KwfTruckReport;
|
|
import com.sckw.fleet.model.KwfTruckReport;
|
|
@@ -22,6 +24,8 @@ import org.springframework.http.MediaType;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -73,16 +77,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 HttpResult export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
|
|
|
|
|
|
|
+ public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) throws IOException {
|
|
|
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)) {
|
|
if (!CollectionUtils.isEmpty(trucks)) {
|
|
|
ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
|
|
ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
|
|
|
- return HttpResult.ok();
|
|
|
|
|
}
|
|
}
|
|
|
- return HttpResult.error("无数据!");
|
|
|
|
|
|
|
+ ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|