收音机页面路径配置

This commit is contained in:
张松
2025-04-02 14:33:48 +08:00
parent dfc6f5a1f5
commit ef3a612c58
3 changed files with 12 additions and 2 deletions

View File

@@ -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);