店铺用户不存在

This commit is contained in:
2026-05-27 16:35:31 +08:00
parent 6a94645076
commit 94fce3b08f

View File

@@ -143,7 +143,7 @@ public class AShopUserServiceImpl implements AShopUserService {
List<ShopUserDTO> dtoList = shopUserMapper.selectPageByKeyAndIsVip(mainIdByShopId, isVip, key, null);
// 将 dtoList 转换为 ShopUserExportDTO 列表
List<ShopUserExportDTO> exportList = BeanUtil.copyToList(dtoList, ShopUserExportDTO.class);
List<ShopUserExportDTO> exportList = BeanUtil.copyToList(dtoList, ShopUserExportDTO.class);
ExcelExportUtil.exportToResponse(exportList, ShopUserExportDTO.class, shopInfo == null ? "店铺用户列表" : shopInfo.getShopName() + "_用户列表", response);
}
@@ -193,7 +193,15 @@ public class AShopUserServiceImpl implements AShopUserService {
@Override
public ShopUser getDetail(Integer id, Integer userId) {
Long mainId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainId).eq(ShopUser::getId, id).eq(ShopUser::getUserId, userId));
ShopUser shopUser;
if (id == null) {
shopUser = shopUserService.getShopUserInfo(StpKit.USER.getShopId(), userId);
} else {
shopUser = shopUserService.getById(id);
if (shopUser == null) {
throw new CzgException("用户不存在");
}
}
long count = couponRecordService.count(new QueryWrapper()
.eq(MkShopCouponRecord::getShopUserId, shopUser.getId())
.eq(MkShopCouponRecord::getStatus, 0)