|
@@ -1,16 +1,8 @@
|
|
|
package com.ruoyi.common.core.controller;
|
|
|
|
|
|
-import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import cn.hutool.http.HttpStatus;
|
|
|
-import com.github.pagehelper.PageHelper;
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
-import com.ruoyi.common.core.page.PageDomain;
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
-import com.ruoyi.common.core.page.TableSupport;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
-import com.ruoyi.common.utils.sql.SqlUtil;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.web.bind.WebDataBinder;
|
|
@@ -18,7 +10,6 @@ import org.springframework.web.bind.annotation.InitBinder;
|
|
|
|
|
|
import java.beans.PropertyEditorSupport;
|
|
|
import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* web层通用数据处理
|
|
@@ -46,35 +37,6 @@ public class BaseController
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 设置请求分页数据
|
|
|
- */
|
|
|
- protected void startPage()
|
|
|
- {
|
|
|
- PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
- Integer pageNum = pageDomain.getPageNum();
|
|
|
- Integer pageSize = pageDomain.getPageSize();
|
|
|
- if (Validator.isNotNull(pageNum) && Validator.isNotNull(pageSize))
|
|
|
- {
|
|
|
- String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
|
|
- PageHelper.startPage(pageNum, pageSize, orderBy);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 响应请求分页数据
|
|
|
- */
|
|
|
- @SuppressWarnings({ "rawtypes", "unchecked" })
|
|
|
- protected <T> TableDataInfo<T> getDataTable(List<T> list)
|
|
|
- {
|
|
|
- TableDataInfo<T> rspData = new TableDataInfo();
|
|
|
- rspData.setCode(HttpStatus.HTTP_OK);
|
|
|
- rspData.setMsg("查询成功");
|
|
|
- rspData.setRows(list);
|
|
|
- rspData.setTotal(new PageInfo(list).getTotal());
|
|
|
- return rspData;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 响应返回结果
|
|
|
*
|