日志管理,角色菜单树形列表无法展示问题

master
anthonywj 2 years ago
parent 64ae05af65
commit cb205b0361

@ -1,5 +1,6 @@
package com.glxp.api.controller.auth; package com.glxp.api.controller.auth;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
@ -61,7 +62,8 @@ public class SysMenuController extends BaseController {
public BaseResponse treeselect(SysMenu menu) { public BaseResponse treeselect(SysMenu menu) {
AuthAdmin authAdmin = customerService.getUserBean(); AuthAdmin authAdmin = customerService.getUserBean();
List<SysMenu> menus = menuService.selectMenuList(menu, authAdmin.getId()); List<SysMenu> menus = menuService.selectMenuList(menu, authAdmin.getId());
return ResultVOUtils.success(menuService.buildMenuTreeSelect(menus)); List<Tree<Long>> data = menuService.buildMenuTreeSelect(menus);
return ResultVOUtils.success(data);
} }
/** /**

@ -0,0 +1,63 @@
package com.glxp.api.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.monitor.SysLogininfor;
import com.glxp.api.req.monitor.SysLogininforRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.monitor.ISysLogininforService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 访
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController {
private final ISysLogininforService logininforService;
/**
* 访
*/
@SaCheckPermission("monitor:logininfor:list")
@GetMapping("/list")
public BaseResponse list(SysLogininforRequest sysLogininforRequest) {
List<SysLogininfor> selectLogininforList = logininforService.selectLogininforList(sysLogininforRequest);
PageInfo<SysLogininfor> pageInfo;
pageInfo = new PageInfo<>(selectLogininforList);
PageSimpleResponse<SysLogininfor> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(selectLogininforList);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param infoIds ids
*/
@SaCheckPermission("monitor:logininfor:remove")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public BaseResponse remove(@PathVariable Long[] infoIds) {
int i = logininforService.deleteLogininforByIds(Arrays.asList(infoIds));
return ResultVOUtils.success("删除成功!");
}
}

@ -0,0 +1,62 @@
package com.glxp.api.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.monitor.SysOperLog;
import com.glxp.api.req.monitor.SysOperLogRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.monitor.ISysOperLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController {
private final ISysOperLogService operLogService;
/**
*
*/
@SaCheckPermission("monitor:operlog:list")
@GetMapping("/list")
public BaseResponse list(SysOperLogRequest sysOperLogRequest) {
List<SysOperLog> selectOperLogList = operLogService.selectOperLogList(sysOperLogRequest);
PageInfo<SysOperLog> pageInfo;
pageInfo = new PageInfo<>(selectOperLogList);
PageSimpleResponse<SysOperLog> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(selectOperLogList);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param operIds ids
*/
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@SaCheckPermission("monitor:operlog:remove")
@DeleteMapping("/{operIds}")
public BaseResponse remove(@PathVariable Long[] operIds) {
int i = operLogService.deleteOperLogByIds(operIds);
return ResultVOUtils.success("删除成功!");
}
}

@ -1,9 +1,11 @@
package com.glxp.api.entity.auth; package com.glxp.api.entity.auth;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
@Data @Data
@EqualsAndHashCode(callSuper = true)
public class SysMenu extends TreeEntity<SysMenu> { public class SysMenu extends TreeEntity<SysMenu> {
/** /**

@ -2,6 +2,7 @@ package com.glxp.api.entity.auth;
import com.glxp.api.entity.BaseEntity; import com.glxp.api.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -11,6 +12,7 @@ import java.util.List;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true)
public class TreeEntity<T> extends BaseEntity { public class TreeEntity<T> extends BaseEntity {

@ -5,9 +5,9 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
jdbc-url: jdbc:mysql://127.0.0.1:3306/udi_wms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:mysql://192.168.0.66:3364/udi_wms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: Glxp@6066
hikari: hikari:
connection-timeout: 60000 connection-timeout: 60000
maximum-pool-size: 60 maximum-pool-size: 60

@ -112,7 +112,7 @@
and menu_id <![CDATA[ <> ]]> #{neMenuId} and menu_id <![CDATA[ <> ]]> #{neMenuId}
</if> </if>
</where> </where>
order by order_num order by parent_id, order_num
</select> </select>

Loading…
Cancel
Save