默认初始化页面权限
This commit is contained in:
parent
f530956f06
commit
9e004d9cdb
|
|
@ -29,12 +29,12 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, ShopPagePath> implements ShopPagePathService{
|
public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, ShopPagePath> implements ShopPagePathService{
|
||||||
@Autowired
|
@Resource
|
||||||
private ShopStaffPagePermissionMapper shopStaffPermissionMapper;
|
private ShopStaffPagePermissionMapper shopStaffPagePermissionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShopPagePath> detail(Long staffId) {
|
public List<ShopPagePath> detail(Long staffId) {
|
||||||
Set<Long> pageIdList = shopStaffPermissionMapper.selectListByQuery(new QueryWrapper().eq(ShopStaffPagePermission::getShopId,
|
Set<Long> pageIdList = shopStaffPagePermissionMapper.selectListByQuery(new QueryWrapper().eq(ShopStaffPagePermission::getShopId,
|
||||||
StpKit.USER.getShopId()).eq(ShopStaffPagePermission::getStaffId, staffId)).stream().map(ShopStaffPagePermission::getPagePathId).collect(Collectors.toSet());
|
StpKit.USER.getShopId()).eq(ShopStaffPagePermission::getStaffId, staffId)).stream().map(ShopStaffPagePermission::getPagePathId).collect(Collectors.toSet());
|
||||||
if (pageIdList.isEmpty()) {
|
if (pageIdList.isEmpty()) {
|
||||||
list().forEach(item -> {
|
list().forEach(item -> {
|
||||||
|
|
@ -42,7 +42,7 @@ public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, Sho
|
||||||
permission.setShopId(StpKit.USER.getShopId());
|
permission.setShopId(StpKit.USER.getShopId());
|
||||||
permission.setStaffId(staffId);
|
permission.setStaffId(staffId);
|
||||||
permission.setPagePathId(item.getId());
|
permission.setPagePathId(item.getId());
|
||||||
shopStaffPermissionMapper.insert(permission);
|
shopStaffPagePermissionMapper.insert(permission);
|
||||||
pageIdList.add(permission.getPagePathId());
|
pageIdList.add(permission.getPagePathId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue