update 同步更新 ruoyi 适配新功能
This commit is contained in:
parent
a8c1d02ee1
commit
44bbe8b307
@ -70,20 +70,31 @@ public class PageUtils {
|
|||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> Page<T> buildPage() {
|
||||||
|
return buildPage(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建 MP 普通分页对象
|
* 构建 MP 普通分页对象
|
||||||
* @param <T> domain 实体
|
* @param <T> domain 实体
|
||||||
* @return 分页对象
|
* @return 分页对象
|
||||||
*/
|
*/
|
||||||
public static <T> Page<T> buildPage() {
|
public static <T> Page<T> buildPage(String defaultOrderByColumn, String defaultIsAsc) {
|
||||||
Integer pageNum = ServletUtils.getParameterToInt(PAGE_NUM, DEFAULT_PAGE_NUM);
|
Integer pageNum = ServletUtils.getParameterToInt(PAGE_NUM, DEFAULT_PAGE_NUM);
|
||||||
Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE);
|
Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE);
|
||||||
String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN);
|
String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN, defaultOrderByColumn);
|
||||||
String isAsc = ServletUtils.getParameter(IS_ASC);
|
String isAsc = ServletUtils.getParameter(IS_ASC, defaultIsAsc);
|
||||||
|
// 兼容前端排序类型
|
||||||
|
if ("ascending".equals(isAsc)) {
|
||||||
|
isAsc = "asc";
|
||||||
|
} else if ("descending".equals(isAsc)) {
|
||||||
|
isAsc = "desc";
|
||||||
|
}
|
||||||
Page<T> page = new Page<>(pageNum, pageSize);
|
Page<T> page = new Page<>(pageNum, pageSize);
|
||||||
if (StrUtil.isNotBlank(orderByColumn)) {
|
if (StrUtil.isNotBlank(orderByColumn)) {
|
||||||
String orderBy = SqlUtil.escapeOrderBySql(orderByColumn);
|
String orderBy = SqlUtil.escapeOrderBySql(orderByColumn);
|
||||||
if ("asc".equals(isAsc)) {
|
orderBy = StrUtil.toUnderlineCase(orderBy);
|
||||||
|
if ("asc".equals(isAsc)) {
|
||||||
page.addOrder(OrderItem.asc(orderBy));
|
page.addOrder(OrderItem.asc(orderBy));
|
||||||
} else if ("desc".equals(isAsc)) {
|
} else if ("desc".equals(isAsc)) {
|
||||||
page.addOrder(OrderItem.desc(orderBy));
|
page.addOrder(OrderItem.desc(orderBy));
|
||||||
|
@ -1,144 +1,144 @@
|
|||||||
package com.ruoyi.quartz.controller;
|
package com.ruoyi.quartz.controller;
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.exception.job.TaskException;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.exception.job.TaskException;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.quartz.domain.SysJob;
|
import com.ruoyi.quartz.domain.SysJob;
|
||||||
import com.ruoyi.quartz.service.ISysJobService;
|
import com.ruoyi.quartz.service.ISysJobService;
|
||||||
import com.ruoyi.quartz.util.CronUtils;
|
import com.ruoyi.quartz.util.CronUtils;
|
||||||
import org.quartz.SchedulerException;
|
import org.quartz.SchedulerException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调度任务信息操作处理
|
* 调度任务信息操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/monitor/job")
|
@RequestMapping("/monitor/job")
|
||||||
public class SysJobController extends BaseController
|
public class SysJobController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysJobService jobService;
|
private ISysJobService jobService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询定时任务列表
|
* 查询定时任务列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysJob sysJob)
|
public TableDataInfo list(SysJob sysJob)
|
||||||
{
|
{
|
||||||
return jobService.selectPageJobList(sysJob);
|
return jobService.selectPageJobList(sysJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出定时任务列表
|
* 导出定时任务列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:export')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:export')")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
|
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysJob sysJob)
|
public AjaxResult export(SysJob sysJob)
|
||||||
{
|
{
|
||||||
List<SysJob> list = jobService.selectJobList(sysJob);
|
List<SysJob> list = jobService.selectJobList(sysJob);
|
||||||
ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
||||||
return util.exportExcel(list, "定时任务");
|
return util.exportExcel(list, "定时任务");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取定时任务详细信息
|
* 获取定时任务详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:query')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:query')")
|
||||||
@GetMapping(value = "/{jobId}")
|
@GetMapping(value = "/{jobId}")
|
||||||
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
|
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(jobService.selectJobById(jobId));
|
return AjaxResult.success(jobService.selectJobById(jobId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增定时任务
|
* 新增定时任务
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:add')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:add')")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.INSERT)
|
@Log(title = "定时任务", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException
|
public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException
|
||||||
{
|
{
|
||||||
if (!CronUtils.isValid(sysJob.getCronExpression()))
|
if (!CronUtils.isValid(sysJob.getCronExpression()))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("新增任务'" + sysJob.getJobName() + "'失败,Cron表达式不正确");
|
return AjaxResult.error("新增任务'" + sysJob.getJobName() + "'失败,Cron表达式不正确");
|
||||||
}
|
}
|
||||||
else if (StringUtils.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
|
else if (StrUtil.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("新增任务'" + sysJob.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
return AjaxResult.error("新增任务'" + sysJob.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
||||||
}
|
}
|
||||||
sysJob.setCreateBy(SecurityUtils.getUsername());
|
sysJob.setCreateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(jobService.insertJob(sysJob));
|
return toAjax(jobService.insertJob(sysJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改定时任务
|
* 修改定时任务
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:edit')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:edit')")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException
|
public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException
|
||||||
{
|
{
|
||||||
if (!CronUtils.isValid(sysJob.getCronExpression()))
|
if (!CronUtils.isValid(sysJob.getCronExpression()))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("修改任务'" + sysJob.getJobName() + "'失败,Cron表达式不正确");
|
return AjaxResult.error("修改任务'" + sysJob.getJobName() + "'失败,Cron表达式不正确");
|
||||||
}
|
}
|
||||||
else if (StringUtils.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
|
else if (StrUtil.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("修改任务'" + sysJob.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
return AjaxResult.error("修改任务'" + sysJob.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
||||||
}
|
}
|
||||||
sysJob.setUpdateBy(SecurityUtils.getUsername());
|
sysJob.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(jobService.updateJob(sysJob));
|
return toAjax(jobService.updateJob(sysJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务状态修改
|
* 定时任务状态修改
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException
|
public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException
|
||||||
{
|
{
|
||||||
SysJob newJob = jobService.selectJobById(job.getJobId());
|
SysJob newJob = jobService.selectJobById(job.getJobId());
|
||||||
newJob.setStatus(job.getStatus());
|
newJob.setStatus(job.getStatus());
|
||||||
return toAjax(jobService.changeStatus(newJob));
|
return toAjax(jobService.changeStatus(newJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务立即执行一次
|
* 定时任务立即执行一次
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/run")
|
@PutMapping("/run")
|
||||||
public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
|
public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
|
||||||
{
|
{
|
||||||
jobService.run(job);
|
jobService.run(job);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除定时任务
|
* 删除定时任务
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{jobIds}")
|
@DeleteMapping("/{jobIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException
|
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException
|
||||||
{
|
{
|
||||||
jobService.deleteJobByIds(jobIds);
|
jobService.deleteJobByIds(jobIds);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.lang.Validator;
|
import cn.hutool.core.lang.Validator;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -21,7 +21,6 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -64,14 +63,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
for (SysDept dept : depts) {
|
for (SysDept dept : depts) {
|
||||||
tempList.add(dept.getDeptId());
|
tempList.add(dept.getDeptId());
|
||||||
}
|
}
|
||||||
for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext(); ) {
|
for (SysDept dept : depts) {
|
||||||
SysDept dept = (SysDept) iterator.next();
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
if (!tempList.contains(dept.getParentId())) {
|
||||||
if (!tempList.contains(dept.getParentId())) {
|
recursionFn(depts, dept);
|
||||||
recursionFn(depts, dept);
|
returnList.add(dept);
|
||||||
returnList.add(dept);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (returnList.isEmpty()) {
|
if (returnList.isEmpty()) {
|
||||||
returnList = depts;
|
returnList = depts;
|
||||||
}
|
}
|
||||||
@ -137,7 +135,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
int result = count(new LambdaQueryWrapper<SysDept>()
|
int result = count(new LambdaQueryWrapper<SysDept>()
|
||||||
.eq(SysDept::getParentId, deptId)
|
.eq(SysDept::getParentId, deptId)
|
||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
return result > 0 ? true : false;
|
return result > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -150,7 +148,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
public boolean checkDeptExistUser(Long deptId) {
|
public boolean checkDeptExistUser(Long deptId) {
|
||||||
int result = userMapper.selectCount(new LambdaQueryWrapper<SysUser>()
|
int result = userMapper.selectCount(new LambdaQueryWrapper<SysUser>()
|
||||||
.eq(SysUser::getDeptId, deptId));
|
.eq(SysUser::getDeptId, deptId));
|
||||||
return result > 0 ? true : false;
|
return result > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -218,16 +216,12 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
*
|
*
|
||||||
* @param dept 当前部门
|
* @param dept 当前部门
|
||||||
*/
|
*/
|
||||||
private void updateParentDeptStatus(SysDept dept) {
|
private void updateParentDeptStatusNormal(SysDept dept) {
|
||||||
String updateBy = dept.getUpdateBy();
|
String ancestors = dept.getAncestors();
|
||||||
dept = getById(dept.getDeptId());
|
Long[] deptIds = Convert.toLongArray(ancestors);
|
||||||
dept.setUpdateBy(updateBy);
|
update(null, new LambdaUpdateWrapper<SysDept>()
|
||||||
update(null,new LambdaUpdateWrapper<SysDept>()
|
.set(SysDept::getStatus, "0")
|
||||||
.set(StrUtil.isNotBlank(dept.getStatus()),
|
.in(SysDept::getDeptId, Arrays.asList(deptIds)));
|
||||||
SysDept::getStatus,dept.getStatus())
|
|
||||||
.set(StrUtil.isNotBlank(dept.getUpdateBy()),
|
|
||||||
SysDept::getUpdateBy,dept.getUpdateBy())
|
|
||||||
.in(SysDept::getDeptId, Arrays.asList(dept.getAncestors().split(","))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -278,13 +272,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
*/
|
*/
|
||||||
private List<SysDept> getChildList(List<SysDept> list, SysDept t) {
|
private List<SysDept> getChildList(List<SysDept> list, SysDept t) {
|
||||||
List<SysDept> tlist = new ArrayList<SysDept>();
|
List<SysDept> tlist = new ArrayList<SysDept>();
|
||||||
Iterator<SysDept> it = list.iterator();
|
for (SysDept n : list) {
|
||||||
while (it.hasNext()) {
|
if (Validator.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
||||||
SysDept n = (SysDept) it.next();
|
tlist.add(n);
|
||||||
if (Validator.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
}
|
||||||
tlist.add(n);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return tlist;
|
return tlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,6 +284,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
* 判断是否有子节点
|
* 判断是否有子节点
|
||||||
*/
|
*/
|
||||||
private boolean hasChild(List<SysDept> list, SysDept t) {
|
private boolean hasChild(List<SysDept> list, SysDept t) {
|
||||||
return getChildList(list, t).size() > 0 ? true : false;
|
return getChildList(list, t).size() > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,9 +36,8 @@ public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, S
|
|||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||||
params.get("endTime"))
|
params.get("endTime"));
|
||||||
.orderByDesc(SysLogininfor::getInfoId);
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage("info_id","desc"), lqw));
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,7 +25,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单 业务层处理
|
* 菜单 业务层处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@ -137,7 +137,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
router.setComponent(getComponent(menu));
|
router.setComponent(getComponent(menu));
|
||||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StrUtil.equals("1", menu.getIsCache())));
|
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StrUtil.equals("1", menu.getIsCache())));
|
||||||
List<SysMenu> cMenus = menu.getChildren();
|
List<SysMenu> cMenus = menu.getChildren();
|
||||||
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
||||||
router.setAlwaysShow(true);
|
router.setAlwaysShow(true);
|
||||||
router.setRedirect("noRedirect");
|
router.setRedirect("noRedirect");
|
||||||
router.setChildren(buildMenus(cMenus));
|
router.setChildren(buildMenus(cMenus));
|
||||||
@ -170,14 +170,13 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
for (SysMenu dept : menus) {
|
for (SysMenu dept : menus) {
|
||||||
tempList.add(dept.getMenuId());
|
tempList.add(dept.getMenuId());
|
||||||
}
|
}
|
||||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) {
|
for (SysMenu menu : menus) {
|
||||||
SysMenu menu = (SysMenu) iterator.next();
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
if (!tempList.contains(menu.getParentId())) {
|
||||||
if (!tempList.contains(menu.getParentId())) {
|
recursionFn(menus, menu);
|
||||||
recursionFn(menus, menu);
|
returnList.add(menu);
|
||||||
returnList.add(menu);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (returnList.isEmpty()) {
|
if (returnList.isEmpty()) {
|
||||||
returnList = menus;
|
returnList = menus;
|
||||||
}
|
}
|
||||||
@ -216,7 +215,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
@Override
|
@Override
|
||||||
public boolean hasChildByMenuId(Long menuId) {
|
public boolean hasChildByMenuId(Long menuId) {
|
||||||
int result = count(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId,menuId));
|
int result = count(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId,menuId));
|
||||||
return result > 0 ? true : false;
|
return result > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -228,7 +227,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
@Override
|
@Override
|
||||||
public boolean checkMenuExistRole(Long menuId) {
|
public boolean checkMenuExistRole(Long menuId) {
|
||||||
int result = roleMenuMapper.selectCount(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getMenuId,menuId));
|
int result = roleMenuMapper.selectCount(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getMenuId,menuId));
|
||||||
return result > 0 ? true : false;
|
return result > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -364,14 +363,13 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
*/
|
*/
|
||||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
||||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
|
for (SysMenu t : list) {
|
||||||
SysMenu t = (SysMenu) iterator.next();
|
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
if (t.getParentId() == parentId) {
|
||||||
if (t.getParentId() == parentId) {
|
recursionFn(list, t);
|
||||||
recursionFn(list, t);
|
returnList.add(t);
|
||||||
returnList.add(t);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return returnList;
|
return returnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,13 +395,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
*/
|
*/
|
||||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
||||||
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
||||||
Iterator<SysMenu> it = list.iterator();
|
for (SysMenu n : list) {
|
||||||
while (it.hasNext()) {
|
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||||
SysMenu n = (SysMenu) it.next();
|
tlist.add(n);
|
||||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
}
|
||||||
tlist.add(n);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return tlist;
|
return tlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,6 +407,6 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
* 判断是否有子节点
|
* 判断是否有子节点
|
||||||
*/
|
*/
|
||||||
private boolean hasChild(List<SysMenu> list, SysMenu t) {
|
private boolean hasChild(List<SysMenu> list, SysMenu t) {
|
||||||
return getChildList(list, t).size() > 0 ? true : false;
|
return getChildList(list, t).size() > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,8 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
|||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||||
params.get("endTime"))
|
params.get("endTime"));
|
||||||
.orderByDesc(SysOperLog::getOperId);
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage("oper_id","desc"), lqw));
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 若依管理系统
|
VUE_APP_TITLE = RuoYi-Vue-Plus后台管理系统
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 若依管理系统
|
VUE_APP_TITLE = RuoYi-Vue-Plus后台管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 若依管理系统
|
VUE_APP_TITLE = RuoYi-Vue-Plus后台管理系统
|
||||||
|
|
||||||
NODE_ENV = production
|
NODE_ENV = production
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ function resolve(dir) {
|
|||||||
return path.join(__dirname, dir)
|
return path.join(__dirname, dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = defaultSettings.title || 'RuoYi-Vue-Plus后台管理系统' // 网页标题
|
const name = process.env.VUE_APP_TITLE || 'RuoYi-Vue-Plus后台管理系统' // 网页标题
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user