diff --git a/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java b/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java index c374b6438..2b7e63fb0 100644 --- a/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java +++ b/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java @@ -4,6 +4,7 @@ import com.czg.account.dto.shopuser.ShopUserAddDTO; import com.czg.account.dto.shopuser.ShopUserDetailDTO; import com.czg.account.dto.shopuser.ShopUserVipCardDTO; import com.czg.account.entity.PointsExchangeRecord; +import com.czg.account.entity.ShopUser; import com.czg.account.entity.ShopUserFlow; import com.czg.account.service.PointsExchangeRecordService; import com.czg.account.service.ShopUserFlowService; @@ -15,9 +16,14 @@ import com.czg.utils.PageUtil; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import jakarta.annotation.Resource; +import lombok.Data; +import lombok.EqualsAndHashCode; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.HashSet; +import java.util.Objects; + /** * 店铺会员相关 * @@ -103,8 +109,9 @@ public class UShopUserController { */ @GetMapping("/pointsRecord") public CzgResult> getPointsRecord() { + ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getId, StpKit.USER.getLoginIdAsLong())); return CzgResult.success(pointsExchangeRecordService.page(PageUtil.buildPage(), new QueryWrapper().eq(PointsExchangeRecord::getShopId, StpKit.USER.getShopId()) - .eq(PointsExchangeRecord::getShopUserId, StpKit.USER.getLoginIdAsLong()).orderBy(PointsExchangeRecord::getId, false))); + .eq(PointsExchangeRecord::getShopUserId, shopUser.getId()).orderBy(PointsExchangeRecord::getId, false))); } /** @@ -114,9 +121,13 @@ public class UShopUserController { */ @GetMapping("/pointsRecord/detail") public CzgResult getPointsRecordDetail(@RequestParam Long id) { + ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getId, StpKit.USER.getLoginIdAsLong())); return CzgResult.success(pointsExchangeRecordService.getOne(new QueryWrapper().eq(PointsExchangeRecord::getShopId, StpKit.USER.getShopId()) - .eq(PointsExchangeRecord::getShopUserId, StpKit.USER.getLoginIdAsLong()).eq(PointsExchangeRecord::getId, id))); + .eq(PointsExchangeRecord::getShopUserId, shopUser.getId()).eq(PointsExchangeRecord::getId, id))); } + public static void main(String[] args) { + + } }