默认初始化页面权限

This commit is contained in:
张松 2025-04-02 16:25:51 +08:00
parent f530956f06
commit 9e004d9cdb
1 changed files with 4 additions and 4 deletions

View File

@ -29,12 +29,12 @@ import java.util.stream.Collectors;
*/
@Service
public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, ShopPagePath> implements ShopPagePathService{
@Autowired
private ShopStaffPagePermissionMapper shopStaffPermissionMapper;
@Resource
private ShopStaffPagePermissionMapper shopStaffPagePermissionMapper;
@Override
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());
if (pageIdList.isEmpty()) {
list().forEach(item -> {
@ -42,7 +42,7 @@ public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, Sho
permission.setShopId(StpKit.USER.getShopId());
permission.setStaffId(staffId);
permission.setPagePathId(item.getId());
shopStaffPermissionMapper.insert(permission);
shopStaffPagePermissionMapper.insert(permission);
pageIdList.add(permission.getPagePathId());
});
}