| | |
| | | import com.github.pagehelper.PageInfo;
|
| | | import com.ruoyi.common.core.constant.HttpStatus;
|
| | | import com.ruoyi.common.core.utils.DateUtils;
|
| | | import com.ruoyi.common.core.utils.PageUtils;
|
| | | import com.ruoyi.common.core.utils.StringUtils;
|
| | | import com.ruoyi.common.core.utils.sql.SqlUtil;
|
| | | import com.ruoyi.common.core.web.domain.AjaxResult;
|
| | |
| | | */
|
| | | protected void startPage()
|
| | | {
|
| | | PageUtils.startPage();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置请求排序数据
|
| | | */
|
| | | protected void startOrderBy()
|
| | | {
|
| | | PageDomain pageDomain = TableSupport.buildPageRequest();
|
| | | Integer pageNum = pageDomain.getPageNum();
|
| | | Integer pageSize = pageDomain.getPageSize();
|
| | | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
| | | if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
|
| | | {
|
| | | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
| | | Boolean reasonable = pageDomain.getReasonable();
|
| | | PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
|
| | | PageHelper.orderBy(orderBy);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 清理分页的线程变量
|
| | | */
|
| | | protected void clearPage()
|
| | | {
|
| | | PageUtils.clearPage();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | rspData.setMsg("查询成功");
|
| | | rspData.setTotal(new PageInfo(list).getTotal());
|
| | | return rspData;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回成功
|
| | | */
|
| | | public AjaxResult success()
|
| | | {
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回成功消息
|
| | | */
|
| | | public AjaxResult success(String message)
|
| | | {
|
| | | return AjaxResult.success(message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回成功消息
|
| | | */
|
| | | public AjaxResult success(Object data)
|
| | | {
|
| | | return AjaxResult.success(data);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回失败消息
|
| | | */
|
| | | public AjaxResult error()
|
| | | {
|
| | | return AjaxResult.error();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回失败消息
|
| | | */
|
| | | public AjaxResult error(String message)
|
| | | {
|
| | | return AjaxResult.error(message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回警告消息
|
| | | */
|
| | | public AjaxResult warn(String message)
|
| | | {
|
| | | return AjaxResult.warn(message);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | protected AjaxResult toAjax(boolean result)
|
| | | {
|
| | | return result ? success() : error();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回成功
|
| | | */
|
| | | public AjaxResult success()
|
| | | {
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回失败消息
|
| | | */
|
| | | public AjaxResult error()
|
| | | {
|
| | | return AjaxResult.error();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回成功消息
|
| | | */
|
| | | public AjaxResult success(String message)
|
| | | {
|
| | | return AjaxResult.success(message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返回失败消息
|
| | | */
|
| | | public AjaxResult error(String message)
|
| | | {
|
| | | return AjaxResult.error(message);
|
| | | }
|
| | | }
|