mirror of
https://gitee.com/mmsAdmin/mms
synced 2025-12-06 17:08:54 +08:00
首页信息
This commit is contained in:
parent
5b9708a199
commit
e2cd5a05ce
@ -81,6 +81,7 @@ public class AuthController extends BaseController {
|
||||
* @return 退出结果
|
||||
*/
|
||||
@Operation(summary = "退出登录", description = "退出当前登录会话")
|
||||
@SaIgnore
|
||||
@PostMapping("/logout")
|
||||
public R<String> logout() {
|
||||
loginService.logout();
|
||||
|
||||
@ -8,16 +8,18 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.system.entity.vo.SysConfigVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysFunctionVo;
|
||||
import com.sxpcwlkj.system.service.SysConfigService;
|
||||
import com.sxpcwlkj.system.service.SysFunctionService;
|
||||
import com.sxpcwlkj.system.service.SysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 首页控制台
|
||||
@ -30,6 +32,28 @@ import java.util.Map;
|
||||
@RequestMapping("system/home")
|
||||
public class HomeController extends BaseController {
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
private final SysFunctionService functionService;
|
||||
private final SysConfigService configService;
|
||||
|
||||
/**
|
||||
* 控制台默认数据
|
||||
* @return 数据
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/homeInit")
|
||||
public R<Object> homeInit(){
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("userName",sysUserService.selectVoById(LoginObject.getLoginId()).getUserName());
|
||||
int week = DateUtil.dayOfWeek(new Date());
|
||||
map.put("week",week==1?"星期日":week==2?"星期一":week==3?"星期二":week==4?"星期三":week==5?"星期四":week==6?"星期五":"星期六");
|
||||
List<SysFunctionVo> fastList= functionService.selectIsFast(9);
|
||||
map.put("fastList",fastList);
|
||||
List<SysConfigVo> eventList = configService.selectEventList(12);
|
||||
map.put("eventList",eventList);
|
||||
return R.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员类别
|
||||
*/
|
||||
|
||||
@ -94,4 +94,8 @@ public class SysFunction extends BaseEntity {
|
||||
* 是否总是显示
|
||||
*/
|
||||
private Integer alwaysShow;
|
||||
/**
|
||||
* 是否快捷菜单
|
||||
*/
|
||||
private Integer isFast;
|
||||
}
|
||||
|
||||
@ -97,6 +97,12 @@ public class SysFunctionBo extends BaseEntity {
|
||||
* 是否总是显示
|
||||
*/
|
||||
private Integer alwaysShow;
|
||||
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level=0;
|
||||
/**
|
||||
* 是否快捷菜单
|
||||
*/
|
||||
private Integer isFast;
|
||||
}
|
||||
|
||||
@ -91,7 +91,10 @@ public class SysFunctionVo {
|
||||
* 是否总是显示
|
||||
*/
|
||||
private Integer alwaysShow;
|
||||
|
||||
/**
|
||||
* 是否快捷菜单
|
||||
*/
|
||||
private Integer isFast;
|
||||
|
||||
private String revision;
|
||||
|
||||
|
||||
@ -27,4 +27,11 @@ public interface SysConfigService extends BaseService<SysConfig, SysConfigVo, Sy
|
||||
Boolean initEmail();
|
||||
|
||||
Boolean initWx();
|
||||
|
||||
/**
|
||||
* 查询项目列表
|
||||
* @param size 数量
|
||||
* @return 数据
|
||||
*/
|
||||
List<SysConfigVo> selectEventList(int size);
|
||||
}
|
||||
|
||||
@ -45,4 +45,10 @@ public interface SysFunctionService {
|
||||
|
||||
List<AdminMenuTree> getAllMenuTree();
|
||||
|
||||
/**
|
||||
* 快捷菜单
|
||||
* @param size 查询数量
|
||||
* @return 数据
|
||||
*/
|
||||
List<SysFunctionVo> selectIsFast(int size);
|
||||
}
|
||||
|
||||
@ -253,4 +253,12 @@ public class SysConfigServiceImpl extends BaseServiceImpl<SysConfig, SysConfigVo
|
||||
RedisUtil.expire(ConfigKeyNum.config_wx.getKey(), Duration.ofDays(99999999));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysConfigVo> selectEventList(int size) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysConfig>()
|
||||
.eq(SysConfig::getConfigType,3)
|
||||
.last("LIMIT "+size)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,9 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
* 系统菜单
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service("sysFunction")
|
||||
@ -86,6 +84,15 @@ public class SysFunctionServiceImpl implements SysFunctionService {
|
||||
return getAdminMenuTree(functionVos, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysFunctionVo> selectIsFast(int size) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysFunction>()
|
||||
.eq(SysFunction::getIsFast, 1)
|
||||
.ne(SysFunction::getComponent,"")
|
||||
.last("LIMIT "+size)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源格式化
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user