修改权限改造引起的bug
This commit is contained in:
@ -33,7 +33,6 @@ public class Dept implements Serializable {
|
||||
|
||||
|
||||
/** 名称 */
|
||||
@NotBlank
|
||||
private String name;
|
||||
|
||||
|
||||
|
@ -47,7 +47,6 @@ public class DictDetail implements Serializable {
|
||||
|
||||
|
||||
/** 字典id */
|
||||
@TableId
|
||||
private Long dictId;
|
||||
|
||||
|
||||
|
@ -21,6 +21,5 @@ public class DictDetailQueryCriteria{
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String label;
|
||||
|
||||
@Query(propName = "name",joinName = "dict")
|
||||
private String dictName;
|
||||
}
|
||||
|
@ -66,7 +66,8 @@ public class DictDetailServiceImpl extends BaseServiceImpl<DictDetailMapper, Dic
|
||||
@Override
|
||||
//@Cacheable
|
||||
public List<DictDetail> queryAll(DictDetailQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(DictDetail.class, criteria));
|
||||
List<DictDetail> list = baseMapper.selectDictDetailList(criteria.getLabel(),criteria.getDictName());
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
@ -289,7 +289,6 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
|
||||
* @param resources /
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
public void update(Menu resources) {
|
||||
if(resources.getId().equals(resources.getPid())) {
|
||||
throw new BadRequestException("上级不能为自己");
|
||||
@ -315,6 +314,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
|
||||
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
|
||||
}
|
||||
}
|
||||
menu.setId(resources.getId());
|
||||
menu.setName(resources.getName());
|
||||
menu.setComponent(resources.getComponent());
|
||||
menu.setPath(resources.getPath());
|
||||
@ -327,6 +327,6 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
|
||||
menu.setComponentName(resources.getComponentName());
|
||||
menu.setPermission(resources.getPermission());
|
||||
menu.setType(resources.getType());
|
||||
this.save(menu);
|
||||
this.saveOrUpdate(menu);
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,6 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@CacheConfig(cacheNames = "role")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implements RoleService {
|
||||
|
||||
@ -77,7 +76,6 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
|
||||
private final DeptMapper deptMapper;
|
||||
|
||||
@Override
|
||||
@Cacheable
|
||||
public Map<String, Object> queryAll(RoleQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<Role> page = new PageInfo<>(queryAll(criteria));
|
||||
@ -89,9 +87,13 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
|
||||
|
||||
|
||||
@Override
|
||||
@Cacheable
|
||||
public List<Role> queryAll(RoleQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(Role.class, criteria));
|
||||
List<Role> roleList = baseMapper.selectList(QueryHelpPlus.getPredicate(Role.class, criteria));
|
||||
for (Role role : roleList) {
|
||||
role.setMenus(menuMapper.findMenuByRoleId(role.getId()));
|
||||
role.setDepts(deptMapper.findDeptByRoleId(role.getId()));
|
||||
}
|
||||
return roleList;
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,9 +10,14 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.DictDetail;
|
||||
import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
@ -21,4 +26,6 @@ import org.springframework.stereotype.Repository;
|
||||
@Mapper
|
||||
public interface DictDetailMapper extends CoreMapper<DictDetail> {
|
||||
|
||||
@Select("<script>SELECT t.* from dict_detail d LEFT JOIN dict t on d.dict_id = t.id where 1=1 <if test = \"label !=null\" > and d.label LIKE concat('%', #{label}, '%') </if> <if test = \"dictName != ''||dictName !=null\" > AND t.name = #{dictName} order by t.sort asc</if></script>")
|
||||
List<DictDetail> selectDictDetailList(@Param("label") String label,@Param("dictName") String dictName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user