默认初始化页面权限

This commit is contained in:
张松 2025-04-02 16:21:50 +08:00
parent 7d311bb3a0
commit 1beba7c24c
1 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,8 @@ import com.czg.account.entity.ShopStaffPagePermission;
import com.czg.account.service.ShopStaffPagePermissionService;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import com.czg.service.account.mapper.ShopStaffPagePermissionMapper;
import com.czg.service.account.mapper.ShopStaffPermissionMapper;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.account.entity.ShopPagePath;
@ -27,11 +29,11 @@ import java.util.stream.Collectors;
@Service
public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, ShopPagePath> implements ShopPagePathService{
@Resource
private ShopStaffPagePermissionService shopStaffPagePermissionService;
private ShopStaffPagePermissionMapper shopStaffPermissionMapper;
@Override
public List<ShopPagePath> detail(Long staffId) {
Set<Long> pageIdList = shopStaffPagePermissionService.list(new QueryWrapper().eq(ShopStaffPagePermission::getShopId,
Set<Long> pageIdList = shopStaffPermissionMapper.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 -> {
@ -39,7 +41,7 @@ public class ShopPagePathServiceImpl extends ServiceImpl<ShopPagePathMapper, Sho
permission.setShopId(StpKit.USER.getShopId());
permission.setStaffId(staffId);
permission.setPagePathId(item.getId());
shopStaffPagePermissionService.save(permission);
shopStaffPermissionMapper.insert(permission);
pageIdList.add(permission.getPagePathId());
});
}