Commit 3181f651 authored by liaoanyuan's avatar liaoanyuan

用户列表导出功能修改

parent e9af1822
package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.constant.RedisConsts;
import cn.wisenergy.common.utils.DateUtil;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.User;
import cn.wisenergy.model.dto.UserCommitDto;
......@@ -128,17 +129,44 @@ public class UserController {
return R.ok(token);
}
@ApiOperation(value = "用户Excel导出",notes = "方案Excel导出",httpMethod = "POST")
@ApiImplicitParam(name = "queryVo", value = "用户信息", dataType = "UserQueryVo")
@PostMapping(value = "/createExcel")
public R<Boolean> createExcel(@RequestBody UserQueryVo queryVo, HttpServletResponse response){
log.info("UserController[]createExcel[]input.param.userId,recordId:" + queryVo);
@ApiOperation(value = "用户Excel导出",notes = "用户Excel导出",httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userName",value = "用户名",dataType="string"),
@ApiImplicitParam(name = "pageSize",value = "电话",dataType="string"),
@ApiImplicitParam(name = "startTime",value = "开始时间",dataType="string"),
@ApiImplicitParam(name = "endTime",value = "结束时间",dataType="string")
})
@GetMapping(value = "/createExcel")
public R<Boolean> createExcel( String userName,String phone,String startTime,String endTime, HttpServletResponse response){
log.info("UserController[]createExcel[]input.param:" + userName,phone,startTime,endTime);
UserQueryVo userQueryVo = new UserQueryVo();
if (StringUtils.isEmpty(userName)){
userQueryVo.setUserName(null);
}else {
userQueryVo.setUserName(userName);
}
if (null == queryVo) {
return R.error("入参为空!");
if (StringUtils.isEmpty(phone)) {
userQueryVo.setPhone(null);
}else{
userQueryVo.setPhone(phone);
}
if (StringUtils.isEmpty(endTime)) {
userQueryVo.setEndTime(null);
}else{
userQueryVo.setEndTime(DateUtil.getTime(endTime,"yyyy-MM-dd HH:mm:ss"));
}
if (StringUtils.isEmpty(startTime)) {
userQueryVo.setStartTime(null);
}else{
userQueryVo.setStartTime(DateUtil.getTime(startTime,"yyyy-MM-dd HH:mm:ss"));
}
return userService.createExcel(queryVo,response);
return userService.createExcel(userQueryVo,response);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment