消费项目排序和样式
This commit is contained in:
@ -82,15 +82,18 @@ public class SysLoginService {
|
||||
Collection<String> keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*");
|
||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
||||
for (String key : keys) {
|
||||
LoginUser user = redisCache.getCacheObject(key);
|
||||
if (StringUtils.isNotEmpty(username) && StringUtils.isNotNull(user.getUser())) {
|
||||
if (StringUtils.equals(username, user.getUsername())) {
|
||||
//存在已经登录用户,抛出异常
|
||||
try {
|
||||
LoginUser user = redisCache.getCacheObject(key);
|
||||
if (StringUtils.isNotEmpty(username) && StringUtils.isNotNull(user.getUser())) {
|
||||
if (StringUtils.equals(username, user.getUsername())) {
|
||||
//存在已经登录用户,抛出异常
|
||||
// CustomException alreadyLoginExcep = new CustomException("该账号已在别处登陆", HttpStatus.ALREADY_LOGIN);
|
||||
// alreadyLoginExcep.setObj(username);
|
||||
// throw alreadyLoginExcep;
|
||||
redisCache.deleteObject(key);
|
||||
redisCache.deleteObject(key);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,15 +24,13 @@ import com.ruoyi.framework.web.page.TableSupport;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class BaseController
|
||||
{
|
||||
public class BaseController {
|
||||
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
|
||||
|
||||
public static String getUUID32()
|
||||
{
|
||||
public static String getUUID32() {
|
||||
return UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
||||
}
|
||||
|
||||
@ -40,14 +38,11 @@ public class BaseController
|
||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||
*/
|
||||
@InitBinder
|
||||
public void initBinder(WebDataBinder binder)
|
||||
{
|
||||
public void initBinder(WebDataBinder binder) {
|
||||
// Date 类型转换
|
||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
||||
{
|
||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
|
||||
@Override
|
||||
public void setAsText(String text)
|
||||
{
|
||||
public void setAsText(String text) {
|
||||
setValue(DateUtils.parseDate(text));
|
||||
}
|
||||
});
|
||||
@ -56,14 +51,19 @@ public class BaseController
|
||||
/**
|
||||
* 设置请求分页数据
|
||||
*/
|
||||
protected void startPage()
|
||||
{
|
||||
protected void startPage() {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
// System.out.println("order:" + orderBy);
|
||||
//特殊情况处理 汉字排序
|
||||
if (orderBy.equals("xfxm asc")) {
|
||||
orderBy = "CONVERT(xfxm USING gbk) asc";
|
||||
} else if (orderBy.equals("xfxm desc")) {
|
||||
orderBy = "CONVERT(xfxm USING gbk) desc";
|
||||
}
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
}
|
||||
@ -71,9 +71,8 @@ public class BaseController
|
||||
/**
|
||||
* 响应请求分页数据
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected TableDataInfo getDataTable(List<?> list)
|
||||
{
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
protected TableDataInfo getDataTable(List<?> list) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setRows(list);
|
||||
@ -83,12 +82,11 @@ public class BaseController
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
*
|
||||
* @param rows 影响行数
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(int rows)
|
||||
{
|
||||
protected AjaxResult toAjax(int rows) {
|
||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user