天气调整
This commit is contained in:
parent
d2fca3feb9
commit
0c45451476
@ -12,10 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
@ -231,27 +228,13 @@ public class WeatherController {
|
||||
@ApiOperation(value = "导出excel天气信息信息", notes = "导出excel天气信息信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<Weather> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
Weather weather = JSON.parseObject(deString, Weather.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(weather, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<Weather> pageList = weatherService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "天气信息列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, Weather.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("天气信息列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("天气信息列表数据", "模版信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, new ArrayList<>());
|
||||
return mv;
|
||||
}
|
||||
|
||||
@ -272,7 +255,7 @@ public class WeatherController {
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setTitleRows(1);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
|
||||
@ -80,7 +80,7 @@ public class Weather implements Serializable {
|
||||
*/
|
||||
@Excel(name = "风力等级", width = 15)
|
||||
@ApiModelProperty(value = "风力等级")
|
||||
private Double winSpeed;
|
||||
private String winSpeed;
|
||||
/**
|
||||
* 风向
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user