bug--修改权限菜单问题和删除一些无用包

This commit is contained in:
taozi
2020-05-18 14:25:32 +08:00
parent b60bbc82eb
commit 477db01586
8 changed files with 8 additions and 86 deletions

View File

@ -1,50 +0,0 @@
package co.yixiang.modules.monitor.service.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author Zhang houying
* @date 2019-11-03
*/
@Data
public class ServerDTO implements Serializable {
private Integer id;
private String name;
private String address;
private Integer port;
private String state;
/** CPU使用率 */
private Float cpuRate;
/** CPU内核数 */
private Integer cpuCore;
/** 内存总数 */
private Float memTotal;
/** 内存使用量 */
private Float memUsed;
/** 磁盘总量 */
private Float diskTotal;
/** 磁盘使用量 */
private Float diskUsed;
/** 交换区总量 */
private Float swapTotal;
/** 交换区使用量 */
private Float swapUsed;
private Integer sort;
}

View File

@ -1,15 +0,0 @@
package co.yixiang.modules.monitor.service.dto;
import co.yixiang.annotation.Query;
import lombok.Data;
/**
* @author Zhang houying
* @date 2019-11-03
*/
@Data
public class ServerQueryCriteria{
@Query(blurry = "name,address")
private String blurry;
}

View File

@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.io.Serializable; import java.io.Serializable;

View File

@ -12,13 +12,10 @@ import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.quartz.domain.QuartzJob; import co.yixiang.modules.quartz.domain.QuartzJob;
import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.quartz.utils.QuartzManage; import co.yixiang.modules.quartz.utils.QuartzManage;
import co.yixiang.modules.shop.service.YxSystemStoreService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import co.yixiang.dozer.service.IGenerator; import co.yixiang.dozer.service.IGenerator;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.common.utils.QueryHelpPlus;
import co.yixiang.utils.ValidationUtil;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.modules.quartz.service.QuartzJobService; import co.yixiang.modules.quartz.service.QuartzJobService;
import co.yixiang.modules.quartz.service.dto.QuartzJobDto; import co.yixiang.modules.quartz.service.dto.QuartzJobDto;
@ -31,10 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
//import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable; //import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import co.yixiang.utils.PageUtil;
import co.yixiang.utils.QueryHelp;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.io.IOException; import java.io.IOException;

View File

@ -12,10 +12,8 @@ import co.yixiang.modules.quartz.domain.QuartzLog;
import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.service.impl.BaseServiceImpl;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import co.yixiang.dozer.service.IGenerator; import co.yixiang.dozer.service.IGenerator;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.common.utils.QueryHelpPlus;
import co.yixiang.utils.ValidationUtil;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.modules.quartz.service.QuartzLogService; import co.yixiang.modules.quartz.service.QuartzLogService;
import co.yixiang.modules.quartz.service.dto.QuartzLogDto; import co.yixiang.modules.quartz.service.dto.QuartzLogDto;
@ -28,10 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
//import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable; //import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import co.yixiang.utils.PageUtil;
import co.yixiang.utils.QueryHelp;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.io.IOException; import java.io.IOException;

View File

@ -7,12 +7,10 @@
* 一经发现盗用、分享等行为,将追究法律责任,后果自负 * 一经发现盗用、分享等行为,将追究法律责任,后果自负
*/ */
package co.yixiang.modules.system.domain; package co.yixiang.modules.system.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data; import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -23,9 +21,10 @@ import java.io.Serializable;
@TableName("roles_depts") @TableName("roles_depts")
public class RolesDepts implements Serializable { public class RolesDepts implements Serializable {
/** 角色ID */
private Long roleId; private Long roleId;
/** 部门ID */
private Long deptId; private Long deptId;

View File

@ -8,7 +8,6 @@
*/ */
package co.yixiang.modules.system.domain; package co.yixiang.modules.system.domain;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
@ -16,9 +15,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.validation.constraints.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.io.Serializable; import java.io.Serializable;
import java.util.Set; import java.util.Set;

View File

@ -162,6 +162,8 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
@Override @Override
public RoleDto findById(long id) { public RoleDto findById(long id) {
Role role = this.getById(id); Role role = this.getById(id);
role.setMenus(menuMapper.findMenuByRoleId(role.getId()));
role.setDepts(deptMapper.findDeptByRoleId(role.getId()));
return generator.convert(role, RoleDto.class); return generator.convert(role, RoleDto.class);
} }
@ -195,6 +197,10 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
throw new EntityExistException(Role.class,"username",resources.getName()); throw new EntityExistException(Role.class,"username",resources.getName());
} }
if(this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName,resources.getName())) != null){
throw new EntityExistException(Role.class,"username",resources.getName());
}
this.save(resources);
if(resources.getDepts().size()>0){ if(resources.getDepts().size()>0){
List<RolesDepts> rolesDeptsList = resources.getDepts().stream().map(i ->{ List<RolesDepts> rolesDeptsList = resources.getDepts().stream().map(i ->{
RolesDepts rolesDepts = new RolesDepts(); RolesDepts rolesDepts = new RolesDepts();
@ -202,10 +208,8 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
rolesDepts.setDeptId(i.getId()); rolesDepts.setDeptId(i.getId());
return rolesDepts; return rolesDepts;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
rolesDeptsService.remove(new LambdaQueryWrapper<RolesDepts>().eq(RolesDepts::getRoleId,resources.getId()));
rolesDeptsService.saveBatch(rolesDeptsList); rolesDeptsService.saveBatch(rolesDeptsList);
} }
this.save(resources);
return generator.convert(resources,RoleDto.class); return generator.convert(resources,RoleDto.class);
} }