页面权限
This commit is contained in:
parent
99e7cbe1de
commit
ee1661e20b
|
|
@ -21,6 +21,10 @@ public class ShopStaffAddDTO {
|
|||
* 店铺权限id集合
|
||||
*/
|
||||
private List<Long> shopPermissionIds;
|
||||
/**
|
||||
* 页面路径权限
|
||||
*/
|
||||
private List<Long> pagePathIdList;
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@ public class ShopStaffEditDTO {
|
|||
* 店铺权限id集合
|
||||
*/
|
||||
private List<Long> shopPermissionIds;
|
||||
/**
|
||||
* 页面权限
|
||||
*/
|
||||
private List<Long> pagePathIdList;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.czg.service.account.service.impl;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.ShopStaffEditDTO;
|
||||
import com.czg.account.dto.staff.ShopStaffRemoveDTO;
|
||||
|
|
@ -39,6 +40,8 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||
private ShopPermissionService shopPermissionService;
|
||||
@Resource
|
||||
private ShopStaffPermissionService shopStaffPermissionService;
|
||||
@Resource
|
||||
private ShopStaffPagePermissionService pagePermissionService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
@ -54,6 +57,13 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||
if (shopStaffAddDTO.getShopPermissionIds() != null && !shopStaffAddDTO.getShopPermissionIds().isEmpty()) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -98,6 +108,13 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||
// 权限添加
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue