大屏项目初始化
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mini.mybigscreen.Auth;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
public class routeController {
|
||||
@@ -10,9 +12,15 @@ public class routeController {
|
||||
/**
|
||||
* 路由跳转
|
||||
*/
|
||||
@GetMapping({"/", "/login", "/dashboard"})
|
||||
@GetMapping({"/", "/login", "/bigScreen", "/dashboard"})
|
||||
public String forwardToIndex() {
|
||||
return "forward:/index.html";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/**/{path:[^.]*}")
|
||||
public String redirect(@PathVariable String path) {
|
||||
return "forward:/index.html";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.mini.mybigscreen.Auth;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mini.mybigscreen.Model.LoginRequest;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
import com.mini.mybigscreen.Model.loginUser;
|
||||
import com.mini.mybigscreen.Model.userInfo;
|
||||
import com.mini.mybigscreen.biz.domain.HomeUser;
|
||||
import com.mini.mybigscreen.biz.service.HomeUserService;
|
||||
import com.mini.mybigscreen.utils.AesUtil;
|
||||
@@ -32,11 +34,11 @@ public class userController {
|
||||
.eq("password", AesUtil.encrypt(loginRequest.getPassword()));
|
||||
HomeUser user = userService.getOne(queryWrapper, true);
|
||||
if (user != null) {
|
||||
String token = KeyUtil.ObjKey(125,0);
|
||||
String token = KeyUtil.ObjKey(125, 0);
|
||||
HttpSession session = request.getSession(true);
|
||||
session.setAttribute("userName", user.getUserName());
|
||||
session.setAttribute("token", token);
|
||||
return Result.success(token);
|
||||
return Result.success(new userInfo(token, new loginUser(user.getUname(), user.getUserId(), user.getRoleId(), user.getUserName())));
|
||||
}
|
||||
return Result.error("账号或密码错误");
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
.addPathPatterns("/**") // 拦截所有路径
|
||||
.excludePathPatterns(
|
||||
"/",
|
||||
"/login",
|
||||
"/index.html",
|
||||
"/userLogin"
|
||||
)
|
||||
|
||||
36
src/main/java/com/mini/mybigscreen/Model/Menu.java
Normal file
36
src/main/java/com/mini/mybigscreen/Model/Menu.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.mini.mybigscreen.Model;
|
||||
|
||||
import com.mini.mybigscreen.biz.domain.HomeMenu;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Menu implements Serializable {
|
||||
|
||||
private String menuId;
|
||||
private String parentId;
|
||||
private String menuName;
|
||||
private String menuType;
|
||||
private String path;
|
||||
private String menuIcon;
|
||||
private Integer sort;
|
||||
private Integer isIframe;
|
||||
// 子菜单列表
|
||||
private List<HomeMenu> children;
|
||||
|
||||
|
||||
public Menu(String menuId,String parentId, String menuName, String menuType, String path,String menuIcon, Integer sort, Integer isIframe,List<HomeMenu> children) {
|
||||
this.menuId = menuId;
|
||||
this.parentId = parentId;
|
||||
this.menuName = menuName;
|
||||
this.menuType = menuType;
|
||||
this.path = path;
|
||||
this.menuIcon = menuIcon;
|
||||
this.sort = sort;
|
||||
this.isIframe = isIframe;
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
@@ -12,4 +12,12 @@ public class PageResult<T> implements Serializable {
|
||||
private Integer currentPage; // 当前页码
|
||||
private Integer pageSize; // 每页条数
|
||||
private Integer total; // 总记录数
|
||||
|
||||
|
||||
public PageResult(List<T> list,Integer currentPage,Integer pageSize,Integer total){
|
||||
this.list = list;
|
||||
this.currentPage = currentPage;
|
||||
this.pageSize = pageSize;
|
||||
this.total = total;
|
||||
}
|
||||
}
|
||||
|
||||
21
src/main/java/com/mini/mybigscreen/Model/loginUser.java
Normal file
21
src/main/java/com/mini/mybigscreen/Model/loginUser.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.mini.mybigscreen.Model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class loginUser implements Serializable {
|
||||
|
||||
private String uname;
|
||||
private String userId;
|
||||
private String roleId;
|
||||
private String userName;
|
||||
|
||||
public loginUser(String uname, String userId, String roleId, String userName) {
|
||||
this.uname = uname;
|
||||
this.userId = userId;
|
||||
this.roleId = roleId;
|
||||
this.userName = userName;
|
||||
}
|
||||
}
|
||||
19
src/main/java/com/mini/mybigscreen/Model/userInfo.java
Normal file
19
src/main/java/com/mini/mybigscreen/Model/userInfo.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.mini.mybigscreen.Model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class userInfo implements Serializable {
|
||||
|
||||
private String token;
|
||||
private loginUser loginUser;
|
||||
|
||||
public userInfo(String token, loginUser loginUser) {
|
||||
this.token = token;
|
||||
this.loginUser = loginUser;
|
||||
}
|
||||
}
|
||||
@@ -40,13 +40,8 @@ public class ErpTransactionFlowController {
|
||||
.eq(StrUtil.isNotBlank(transactionType), "transaction_type", transactionType)
|
||||
.orderByDesc("create_time");
|
||||
List<ErpTransactionFlow> flowList = flowService.list(query);
|
||||
PageUtil<ErpTransactionFlow> pageUtil = new PageUtil<>(pageNum, pageSize, flowList);
|
||||
List<ErpTransactionFlow> pageData = pageUtil.OkData();
|
||||
PageResult<ErpTransactionFlow> result = new PageResult<>();
|
||||
result.setList(pageData); // 当前页数据
|
||||
result.setCurrentPage(pageNum); // 当前页码
|
||||
result.setPageSize(pageSize); // 每页条数
|
||||
result.setTotal(flowList.size()); // 总条数
|
||||
PageUtil<ErpTransactionFlow> util = new PageUtil<>(pageNum, pageSize, flowList);
|
||||
PageResult<?> result = new PageResult<>(util.OkData(), pageNum, pageSize, flowList.size());
|
||||
return Result.success(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.mini.mybigscreen.biz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mini.mybigscreen.Model.Menu;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
import com.mini.mybigscreen.biz.domain.HomeMenu;
|
||||
import com.mini.mybigscreen.biz.service.HomeMenuService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-03-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/biz/homeMenu")
|
||||
public class HomeMenuController {
|
||||
|
||||
|
||||
@Resource
|
||||
private HomeMenuService menuService;
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<?> getList() {
|
||||
List<Menu> menuList = new ArrayList<>();
|
||||
QueryWrapper<HomeMenu> query = new QueryWrapper<>();
|
||||
query.eq("ustatus", "1")
|
||||
.eq("parent_id", "0")
|
||||
.orderByAsc("sort");
|
||||
List<HomeMenu> pMenus = menuService.list(query);
|
||||
for (HomeMenu menu : pMenus) {
|
||||
QueryWrapper<HomeMenu> childQuery = new QueryWrapper<>();
|
||||
childQuery.eq("parent_id", menu.getMenuId());
|
||||
List<HomeMenu> childMenus = menuService.list(childQuery);
|
||||
menuList.add(new Menu(
|
||||
menu.getMenuId(),
|
||||
menu.getParentId(),
|
||||
menu.getMenuName(),
|
||||
menu.getMenuType(),
|
||||
menu.getPath(),
|
||||
menu.getMenuIcon(),
|
||||
menu.getSort(),
|
||||
menu.getIsIframe(),
|
||||
childMenus
|
||||
));
|
||||
}
|
||||
return Result.success(menuList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,22 @@
|
||||
package com.mini.mybigscreen.biz.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mini.mybigscreen.Model.PageResult;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
import com.mini.mybigscreen.biz.domain.HomeUser;
|
||||
import com.mini.mybigscreen.biz.service.HomeUserService;
|
||||
import com.mini.mybigscreen.utils.PageUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
@@ -15,4 +26,23 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/biz/homeUser")
|
||||
public class HomeUserController {
|
||||
|
||||
|
||||
@Resource
|
||||
private HomeUserService userService;
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<?> getList(Integer pageNum, Integer pageSize,
|
||||
String userName, String uname, String ustatus) {
|
||||
QueryWrapper<HomeUser> query = new QueryWrapper<>();
|
||||
query.like(StrUtil.isNotBlank(uname), "uname", uname)
|
||||
.eq(StrUtil.isNotBlank(ustatus), "ustatus", ustatus)
|
||||
.eq(StrUtil.isNotBlank(userName), "user_name", userName)
|
||||
.orderByDesc("create_time");
|
||||
List<HomeUser> userList = userService.list(query);
|
||||
PageUtil<HomeUser> util = new PageUtil<>(pageNum, pageSize, userList);
|
||||
PageResult<?> result = new PageResult<>(util.OkData(), pageNum, pageSize, userList.size());
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
77
src/main/java/com/mini/mybigscreen/biz/domain/HomeMenu.java
Normal file
77
src/main/java/com/mini/mybigscreen/biz/domain/HomeMenu.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.mini.mybigscreen.biz.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单表
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-03-01
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("biz_home_menu")
|
||||
public class HomeMenu implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableId(value = "menu_id", type = IdType.AUTO)
|
||||
private String menuId;
|
||||
|
||||
/**
|
||||
* 父菜单ID(0为顶级菜单)
|
||||
*/
|
||||
@TableField("parent_id")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@TableField("menu_name")
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 菜单类型(M=目录,C=菜单,F=按钮)
|
||||
*/
|
||||
@TableField("menu_type")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 路由路径
|
||||
*/
|
||||
@TableField("path")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@TableField("sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否外链(0=否,1=是)
|
||||
*/
|
||||
@TableField("is_iframe")
|
||||
private Integer isIframe;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@TableField("menu_icon")
|
||||
private String menuIcon;
|
||||
|
||||
@TableField("ustatus")
|
||||
private Integer ustatus;
|
||||
}
|
||||
@@ -4,18 +4,20 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-02-25
|
||||
* @since 2026-02-28
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -25,7 +27,7 @@ public class HomeUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
private String createTime;
|
||||
|
||||
@TableId(value = "user_id", type = IdType.AUTO)
|
||||
private String userId;
|
||||
@@ -40,26 +42,50 @@ public class HomeUser implements Serializable {
|
||||
private String uname;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
* 性别
|
||||
*/
|
||||
@TableField("f_tenant_id")
|
||||
private String fTenantId;
|
||||
@TableField("sex")
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
* 电子邮件
|
||||
*/
|
||||
@TableField("f_flow_id")
|
||||
private String fFlowId;
|
||||
@TableField("email")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 流程任务主键
|
||||
* 电话号码
|
||||
*/
|
||||
@TableField("f_flow_task_id")
|
||||
private String fFlowTaskId;
|
||||
@TableField("phone")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 流程任务状态
|
||||
* 角色编号
|
||||
*/
|
||||
@TableField("f_flow_state")
|
||||
private Integer fFlowState;
|
||||
@TableField("role_id")
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
@TableField("group_module_id")
|
||||
private String groupModuleId;
|
||||
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
@TableField("ustatus")
|
||||
private String ustatus;
|
||||
|
||||
/**
|
||||
* 累计登录次数
|
||||
*/
|
||||
@TableField("login_count")
|
||||
private Integer loginCount;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
@TableField("last_login_ip")
|
||||
private String lastLoginIp;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.mini.mybigscreen.biz.domain.HomeMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-03-01
|
||||
*/
|
||||
public interface HomeMenuMapper extends BaseMapper<HomeMenu> {
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-02-25
|
||||
* @since 2026-02-28
|
||||
*/
|
||||
public interface HomeUserMapper extends BaseMapper<HomeUser> {
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mini.mybigscreen.biz.service;
|
||||
|
||||
import com.mini.mybigscreen.biz.domain.HomeMenu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-03-01
|
||||
*/
|
||||
public interface HomeMenuService extends IService<HomeMenu> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mini.mybigscreen.biz.service.impl;
|
||||
|
||||
import com.mini.mybigscreen.biz.domain.HomeMenu;
|
||||
import com.mini.mybigscreen.biz.mapper.HomeMenuMapper;
|
||||
import com.mini.mybigscreen.biz.service.HomeMenuService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-03-01
|
||||
*/
|
||||
@Service
|
||||
public class HomeMenuServiceImpl extends ServiceImpl<HomeMenuMapper, HomeMenu> implements HomeMenuService {
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class demo {
|
||||
.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/resources/mapper"));
|
||||
})
|
||||
.strategyConfig(builder -> {
|
||||
builder.addInclude("erp_category")
|
||||
builder.addInclude("biz_home_menu")
|
||||
.addTablePrefix("biz_")
|
||||
.entityBuilder()
|
||||
.enableLombok()
|
||||
|
||||
Reference in New Issue
Block a user