RegConifgUtils.java
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.thinkgem.jeesite.modules.reg.utils;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.utils.SpringContextHolder;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.entity.config.SysUserConfig;
import com.thinkgem.jeesite.modules.sys.service.config.SysUserConfigService;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
public class RegConifgUtils {
private static SysUserConfigService sysUserConfigService = SpringContextHolder.getBean(SysUserConfigService.class);
public static int getCUserPageSize() {
User user = UserUtils.getUser();
SysUserConfig sysUserConfig = new SysUserConfig();
//sysUserConfig.setUserid(user.getId());
//Page<SysUserConfig> page = new Page<SysUserConfig>(1, -1);
//Page<SysUserConfig> findPage = sysUserConfigService.findPage(page, sysUserConfig);
//List<SysUserConfig> findList = findPage.getList();
sysUserConfig = sysUserConfigService.getByUserID(user.getId());
//int counts = findList.size();
if(sysUserConfig != null){
int mypagesize = Integer.valueOf(sysUserConfig.getPagesize());
if(mypagesize > 0){
//sysUserConfig = findList.get(0);
return mypagesize;
}else{
return Integer.valueOf(Global.getConfig("page.pageSize"));
}
}else{
return Integer.valueOf(Global.getConfig("page.pageSize"));
}
}
}