大屏项目初始化
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user