|
@ -52,8 +52,8 @@ public class DcBusiHisReportController extends BaseController { |
|
|
* |
|
|
* |
|
|
* @return 分页数据 |
|
|
* @return 分页数据 |
|
|
*/ |
|
|
*/ |
|
|
@GetMapping("/listReport") |
|
|
@PostMapping("/listReport") |
|
|
public AjaxResult list(@NotNull @RequestBody LogTimeThreeQueryParamVo queryVo) { |
|
|
public AjaxResult list(@RequestBody LogTimeThreeQueryParamVo queryVo) { |
|
|
String error = validatorator(queryVo); |
|
|
String error = validatorator(queryVo); |
|
|
if (error != null) { |
|
|
if (error != null) { |
|
|
return AjaxResult.error(error); |
|
|
return AjaxResult.error(error); |
|
@ -170,13 +170,13 @@ public class DcBusiHisReportController extends BaseController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
private String validatorator(LogTimeThreeQueryParamVo queryVo) { |
|
|
private String validatorator(LogTimeThreeQueryParamVo queryVo) { |
|
|
if (StringUtils.isEmpty(queryVo.getBeginTime())) { |
|
|
if (StringUtils.isNull(queryVo.getBeginTime())||StringUtils.isEmpty(queryVo.getBeginTime())) { |
|
|
return "查询失败,开始时间不能为空!"; |
|
|
return "查询失败,开始时间不能为空!"; |
|
|
} |
|
|
} |
|
|
if (StringUtils.isEmpty(queryVo.getEndTime())) { |
|
|
if (StringUtils.isNull(queryVo.getEndTime())||StringUtils.isEmpty(queryVo.getEndTime())) { |
|
|
return "查询失败,结束时间不能为空!"; |
|
|
return "查询失败,结束时间不能为空!"; |
|
|
} |
|
|
} |
|
|
if (StringUtils.isEmpty(queryVo.getQueryParamClass())) { |
|
|
if (StringUtils.isNull(queryVo.getQueryParamClass())||StringUtils.isEmpty(queryVo.getQueryParamClass())) { |
|
|
return "查询失败,参数类型不能为空!"; |
|
|
return "查询失败,参数类型不能为空!"; |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
@ -280,8 +280,9 @@ public class DcBusiHisReportController extends BaseController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void toExcel(HttpServletResponse response,List<Map<String, Object>> mapList) throws IOException { |
|
|
private void toExcel(HttpServletResponse response,List<Map<String, Object>> mapList) throws IOException { |
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
String fileName ="report"+DateUtil.now() + ".xls"; |
|
|
response.setCharacterEncoding("utf-8"); |
|
|
//response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
|
|
|
//response.setCharacterEncoding("utf-8");
|
|
|
ExcelWriter writer = ExcelUtil.getWriter(); |
|
|
ExcelWriter writer = ExcelUtil.getWriter(); |
|
|
// 一次性写出内容,使用默认样式,强制输出标题
|
|
|
// 一次性写出内容,使用默认样式,强制输出标题
|
|
|
//writer.write(mapList, true);
|
|
|
//writer.write(mapList, true);
|
|
@ -294,7 +295,7 @@ public class DcBusiHisReportController extends BaseController { |
|
|
//response为HttpServletResponse对象
|
|
|
//response为HttpServletResponse对象
|
|
|
response.setContentType("application/vnd.ms-excel;charset=utf-8"); |
|
|
response.setContentType("application/vnd.ms-excel;charset=utf-8"); |
|
|
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
|
|
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=换热站数据明细表.xls"); |
|
|
response.setHeader("Content-Disposition", "attachment;filename="+fileName); |
|
|
ServletOutputStream out = response.getOutputStream(); |
|
|
ServletOutputStream out = response.getOutputStream(); |
|
|
writer.flush(out, true); |
|
|
writer.flush(out, true); |
|
|
// 关闭writer,释放内存
|
|
|
// 关闭writer,释放内存
|
|
@ -302,5 +303,17 @@ public class DcBusiHisReportController extends BaseController { |
|
|
//此处记得关闭输出Servlet流
|
|
|
//此处记得关闭输出Servlet流
|
|
|
IoUtil.close(out); |
|
|
IoUtil.close(out); |
|
|
} |
|
|
} |
|
|
|
|
|
@ApiOperation("获取生产IOT系统参数模版列表") |
|
|
|
|
|
@GetMapping("/getParamClass") |
|
|
|
|
|
public AjaxResult getParamClass(){ |
|
|
|
|
|
return AjaxResult.success(logTimesacleHistoryThreeService.selectParamModels()) ; |
|
|
|
|
|
} |
|
|
|
|
|
@ApiOperation("获取生产IOT系统设备列表") |
|
|
|
|
|
@GetMapping("/getDevicie/{orgCode}") |
|
|
|
|
|
public AjaxResult selectDevices(@PathVariable Long orgCode) { |
|
|
|
|
|
if(orgCode==0){ |
|
|
|
|
|
return AjaxResult.success(logTimesacleHistoryThreeService.selectDevices(null)) ; |
|
|
|
|
|
} |
|
|
|
|
|
return AjaxResult.success(logTimesacleHistoryThreeService.selectDevices(orgCode)) ; |
|
|
|
|
|
} |
|
|
} |
|
|
} |