bug--修改权限菜单问题和删除一些无用包
This commit is contained in:
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
@ -12,13 +12,10 @@ import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.modules.quartz.domain.QuartzJob;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.modules.quartz.utils.QuartzManage;
|
||||
import co.yixiang.modules.shop.service.YxSystemStoreService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.utils.ValidationUtil;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.modules.quartz.service.QuartzJobService;
|
||||
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.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
import co.yixiang.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
|
@ -12,10 +12,8 @@ import co.yixiang.modules.quartz.domain.QuartzLog;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import lombok.AllArgsConstructor;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.utils.ValidationUtil;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.modules.quartz.service.QuartzLogService;
|
||||
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.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
import co.yixiang.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
|
@ -7,12 +7,10 @@
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -23,9 +21,10 @@ import java.io.Serializable;
|
||||
@TableName("roles_depts")
|
||||
public class RolesDepts implements Serializable {
|
||||
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
|
||||
/** 部门ID */
|
||||
private Long deptId;
|
||||
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
*/
|
||||
package co.yixiang.modules.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
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.copier.CopyOptions;
|
||||
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
|
@ -162,6 +162,8 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
|
||||
@Override
|
||||
public RoleDto findById(long id) {
|
||||
Role role = this.getById(id);
|
||||
role.setMenus(menuMapper.findMenuByRoleId(role.getId()));
|
||||
role.setDepts(deptMapper.findDeptByRoleId(role.getId()));
|
||||
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());
|
||||
}
|
||||
|
||||
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){
|
||||
List<RolesDepts> rolesDeptsList = resources.getDepts().stream().map(i ->{
|
||||
RolesDepts rolesDepts = new RolesDepts();
|
||||
@ -202,10 +208,8 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
|
||||
rolesDepts.setDeptId(i.getId());
|
||||
return rolesDepts;
|
||||
}).collect(Collectors.toList());
|
||||
rolesDeptsService.remove(new LambdaQueryWrapper<RolesDepts>().eq(RolesDepts::getRoleId,resources.getId()));
|
||||
rolesDeptsService.saveBatch(rolesDeptsList);
|
||||
}
|
||||
this.save(resources);
|
||||
return generator.convert(resources,RoleDto.class);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user