首页接口

This commit is contained in:
MMS 2025-08-26 00:41:03 +08:00
parent a30152797e
commit d6dbcdc7b7
5 changed files with 22 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateRange;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.sxpcwlkj.MmsAdminApplication;
import com.sxpcwlkj.authority.LoginObject;
import com.sxpcwlkj.common.code.controller.BaseController;
import com.sxpcwlkj.common.utils.R;
@ -12,6 +13,7 @@ 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.SysNoticeService;
import com.sxpcwlkj.system.service.SysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
@ -35,6 +37,8 @@ public class HomeController extends BaseController {
private final SysUserService sysUserService;
private final SysFunctionService functionService;
private final SysConfigService configService;
private final MmsAdminApplication mmsAdminApplication;
private final SysNoticeService sysNoticeService;
/**
* 控制台默认数据
@ -51,6 +55,10 @@ public class HomeController extends BaseController {
map.put("fastList",fastList);
List<SysConfigVo> eventList = configService.selectEventList(12);
map.put("eventList",eventList);
map.put("systemInfo",mmsAdminApplication);
map.put("userTool",sysUserService.selectTool());
map.put("newsTool",sysNoticeService.selectTool());
map.put("task","0/0");
return R.success(map);
}

View File

@ -22,4 +22,6 @@ public interface SysNoticeService extends BaseService<SysNotice, SysNoticeVo, Sy
* @return true成功 false 失败
*/
Boolean imports(Set<SysNoticeExport> list);
Long selectTool();
}

View File

@ -182,4 +182,6 @@ public interface SysUserService {
* @return true成功 false 失败
*/
boolean bindingOpenId(String openId);
Long selectTool();
}

View File

@ -95,4 +95,9 @@ public class SysNoticeServiceImpl extends BaseServiceImpl<SysNotice, SysNoticeVo
public Boolean imports(Set<SysNoticeExport> list) {
return true;
}
@Override
public Long selectTool() {
return baseMapper.selectCount(new LambdaQueryWrapper<SysNotice>().eq(SysNotice::getStatus,0));
}
}

View File

@ -445,6 +445,11 @@ public class SysUserServiceImpl implements SysUserService {
return baseMapper.update(null, new LambdaUpdateWrapper<SysUser>().set(SysUser::getWxOpenid, openId).eq(SysUser::getUserId, LoginObject.getLoginId())) > 0;
}
@Override
public Long selectTool() {
return baseMapper.selectCount(new LambdaQueryWrapper<SysUser>().eq(SysUser::getStatus, 0));
}
@Override
public List<AdminMenuTree> getAdminMenuTree(String userId) {