大屏项目初始化
This commit is contained in:
@@ -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 {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user