收音机页面路径配置
This commit is contained in:
parent
dfc6f5a1f5
commit
ef3a612c58
|
|
@ -51,7 +51,7 @@ public class ShopPagePermissionController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户已拥有页面路径
|
||||
* 获取当前员工已拥有页面路径权限
|
||||
*/
|
||||
@GetMapping("/mine")
|
||||
public CzgResult<List<ShopPagePath>> mine() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -26,7 +27,8 @@ public class ShopStaffPagePermission implements Serializable {
|
|||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.czg.account.service.ShopStaffPagePermissionService;
|
|||
import com.czg.service.account.mapper.ShopStaffPagePermissionMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
@ -30,6 +31,7 @@ public class ShopStaffPagePermissionServiceImpl extends ServiceImpl<ShopStaffPag
|
|||
private ShopStaffService shopStaffService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean add(Long shopId, PagePathPermissionAddDTO pagePathPermissionAddDTO) {
|
||||
ShopStaff shopStaff = shopStaffService.getOne(new QueryWrapper().eq(ShopStaff::getId, pagePathPermissionAddDTO.getStaffId()).eq(ShopStaff::getShopId, shopId));
|
||||
if (shopStaff == null) {
|
||||
|
|
@ -42,7 +44,13 @@ public class ShopStaffPagePermissionServiceImpl extends ServiceImpl<ShopStaffPag
|
|||
}
|
||||
|
||||
ArrayList<ShopStaffPagePermission> pagePermissions = new ArrayList<>();
|
||||
ArrayList<ShopStaffPagePermission> updatePagePermissions = new ArrayList<>();
|
||||
remove(new QueryWrapper().eq(ShopStaffPagePermission::getStaffId, pagePathPermissionAddDTO.getStaffId()));
|
||||
pagePathPermissionAddDTO.getPagePathIdList().forEach(item -> {
|
||||
long count1 = count(new QueryWrapper().eq(ShopStaffPagePermission::getStaffId, shopStaff).eq(ShopStaffPagePermission::getPagePathId, item));
|
||||
if (count1 > 0) {
|
||||
return;
|
||||
}
|
||||
ShopStaffPagePermission permission = new ShopStaffPagePermission();
|
||||
permission.setShopId(shopId);
|
||||
permission.setPagePathId(item);
|
||||
|
|
|
|||
Loading…
Reference in New Issue