页面权限
This commit is contained in:
@@ -21,6 +21,10 @@ public class ShopStaffAddDTO {
|
|||||||
* 店铺权限id集合
|
* 店铺权限id集合
|
||||||
*/
|
*/
|
||||||
private List<Long> shopPermissionIds;
|
private List<Long> shopPermissionIds;
|
||||||
|
/**
|
||||||
|
* 页面路径权限
|
||||||
|
*/
|
||||||
|
private List<Long> pagePathIdList;
|
||||||
/**
|
/**
|
||||||
* 员工姓名
|
* 员工姓名
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ public class ShopStaffEditDTO {
|
|||||||
* 店铺权限id集合
|
* 店铺权限id集合
|
||||||
*/
|
*/
|
||||||
private List<Long> shopPermissionIds;
|
private List<Long> shopPermissionIds;
|
||||||
|
/**
|
||||||
|
* 页面权限
|
||||||
|
*/
|
||||||
|
private List<Long> pagePathIdList;
|
||||||
/**
|
/**
|
||||||
* 角色id
|
* 角色id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.czg.service.account.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.czg.account.dto.pagepath.PagePathPermissionAddDTO;
|
||||||
import com.czg.account.dto.staff.ShopStaffAddDTO;
|
import com.czg.account.dto.staff.ShopStaffAddDTO;
|
||||||
import com.czg.account.dto.staff.ShopStaffEditDTO;
|
import com.czg.account.dto.staff.ShopStaffEditDTO;
|
||||||
import com.czg.account.dto.staff.ShopStaffRemoveDTO;
|
import com.czg.account.dto.staff.ShopStaffRemoveDTO;
|
||||||
@@ -39,6 +40,8 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||||||
private ShopPermissionService shopPermissionService;
|
private ShopPermissionService shopPermissionService;
|
||||||
@Resource
|
@Resource
|
||||||
private ShopStaffPermissionService shopStaffPermissionService;
|
private ShopStaffPermissionService shopStaffPermissionService;
|
||||||
|
@Resource
|
||||||
|
private ShopStaffPagePermissionService pagePermissionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -54,6 +57,13 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||||||
if (shopStaffAddDTO.getShopPermissionIds() != null && !shopStaffAddDTO.getShopPermissionIds().isEmpty()) {
|
if (shopStaffAddDTO.getShopPermissionIds() != null && !shopStaffAddDTO.getShopPermissionIds().isEmpty()) {
|
||||||
addPermission(shopStaff, shopStaffAddDTO.getShopPermissionIds());
|
addPermission(shopStaff, shopStaffAddDTO.getShopPermissionIds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shopStaffAddDTO.getPagePathIdList() != null && !shopStaffAddDTO.getPagePathIdList().isEmpty()) {
|
||||||
|
PagePathPermissionAddDTO pagePathPermissionAddDTO = new PagePathPermissionAddDTO();
|
||||||
|
pagePathPermissionAddDTO.setPagePathIdList(shopStaffAddDTO.getPagePathIdList());
|
||||||
|
pagePathPermissionAddDTO.setStaffId(shopStaff.getId());
|
||||||
|
pagePermissionService.add(StpKit.USER.getShopId(), pagePathPermissionAddDTO);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +108,13 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||||||
// 权限添加
|
// 权限添加
|
||||||
addPermission(shopStaff, shopStaffEditDTO.getShopPermissionIds());
|
addPermission(shopStaff, shopStaffEditDTO.getShopPermissionIds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shopStaffEditDTO.getPagePathIdList() != null && !shopStaffEditDTO.getPagePathIdList().isEmpty()) {
|
||||||
|
PagePathPermissionAddDTO pagePathPermissionAddDTO = new PagePathPermissionAddDTO();
|
||||||
|
pagePathPermissionAddDTO.setPagePathIdList(shopStaffEditDTO.getPagePathIdList());
|
||||||
|
pagePathPermissionAddDTO.setStaffId(shopStaff.getId());
|
||||||
|
pagePermissionService.add(StpKit.USER.getShopId(), pagePathPermissionAddDTO);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user