Commit 4112a8bf by s_guodong

分页

parent 55123585
......@@ -688,9 +688,6 @@ public class Comsel extends AbstractTransaction{
@Rule(target="accsel",order=100)
public boolean ruleAccselN100(){
IContext ctx = MdaEnv.getContext();
BaseVO baseVO = ctx.getVo();
int pageNum = baseVO.getPageNum();
int pageSize = baseVO.getPageSize();
ctx.getErrorCode();
MdaUtils.clear(this.getActlst());
......@@ -698,11 +695,11 @@ public class Comsel extends AbstractTransaction{
String cur = this.getCur();
if(MdaUtils.isEmpty(cur))
{
ctx.getDaoSession().dbReadset(this.getActlst(),new CacheOption(pageNum, pageSize),new Argument<String>("ptyinr",ptyinr));
ctx.getDaoSession().dbReadset(this.getActlst(),new CacheOption(0, true),new Argument<String>("ptyinr",ptyinr));
}
else
ctx.getDaoSession().dbReadset(this.getActlst(),new CacheOption(pageNum, pageSize),new Argument<String>("cur",cur),new Argument<String>("ptyinr",ptyinr));
ctx.getDaoSession().dbReadset(this.getActlst(),new CacheOption(0, true),new Argument<String>("cur",cur),new Argument<String>("ptyinr",ptyinr));
if(ctx.getErrorCode()!= NO_ERROR)
{
ctx.setMessage(MdaUtils.getI18NString("comsel","CT000070"),MdaUtils.getI18NString("comsel","CT000071"));
......
......@@ -7,6 +7,7 @@ import com.brilliance.mda.runtime.mda.impl.AbstractDaoSession;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.ModuleList;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.request.BaseVO;
import com.brilliance.mda.support.mybatis.count.CounterService;
import com.brilliance.mda.support.mybatis.dync.mapper.DbExecuteMapper;
import com.github.pagehelper.PageHelper;
......@@ -164,7 +165,11 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public <T extends IModule> int dbReadset(ModuleList<T> list, CacheOption cacheOption, Argument... args) {
if (cacheOption != null) {
PageHelper.startPage(cacheOption.getPageNum(), cacheOption.getPageSize());
IContext ctx = MdaEnv.getContext();
BaseVO baseVO = ctx.getVo();
int pageNum = baseVO.getPageNum();
int pageSize = baseVO.getPageSize();
PageHelper.startPage(pageNum, pageSize);
}
int size = dbReadset(list, args);
if (cacheOption != null) {
......@@ -179,7 +184,11 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
DynamicDataSourceContextHolder.setDataSourceType(moduleDB);
if (cacheOption != null) {
PageHelper.startPage(cacheOption.getPageNum(), cacheOption.getPageSize());
IContext ctx = MdaEnv.getContext();
BaseVO baseVO = ctx.getVo();
int pageNum = baseVO.getPageNum();
int pageSize = baseVO.getPageSize();
PageHelper.startPage(pageNum, pageSize);
}
List<Class<? extends IModule>> clazzList = new ArrayList<>();
......
......@@ -9,10 +9,6 @@ public class CacheOption {
public long cacheTimeout;
public boolean paging;
private int pageNum = 1;
private int pageSize = 10;
public CacheOption(long cacheTimeout) {
this(cacheTimeout, false);
}
......@@ -28,24 +24,4 @@ public class CacheOption {
this.paging = paging;
}
public CacheOption(int pageNum, int pageSize) {
this.pageNum = pageNum;
this.pageSize = pageSize;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
}
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