From c0c70370ddffb61ab5fb88bb9a19e433b8f488c5 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Tue, 01 Mar 2022 15:44:21 +0800 Subject: [PATCH] 20222223 --- src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java | 344 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 259 insertions(+), 85 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java index a2b4b05..fbb1d90 100644 --- a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java @@ -7,8 +7,12 @@ import cn.hutool.core.util.RandomUtil; import cn.hutool.core.date.DateUtil; +import com.xcong.excoin.modules.coin.dao.ZhiYaDao; import com.xcong.excoin.modules.coin.dao.ZhiYaRecordDao; -import com.xcong.excoin.modules.coin.entity.ZhiYaRecordEntity; +import com.xcong.excoin.modules.coin.dao.ZhiyaRewardDao; +import com.xcong.excoin.modules.coin.entity.*; +import com.xcong.excoin.modules.coin.parameter.dto.ZhiyaRewardRecordsPageDto; +import com.xcong.excoin.modules.coin.parameter.vo.*; import com.xcong.excoin.modules.platform.entity.PlatformCnyUsdtExchangeEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -21,17 +25,8 @@ import com.xcong.excoin.common.enumerates.MemberWalletCoinEnum; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao; -import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange; -import com.xcong.excoin.modules.coin.entity.OrderCoinsDealEntity; import com.xcong.excoin.modules.coin.mapper.MemberAccountMoneyChangeMapper; import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto; -import com.xcong.excoin.modules.coin.parameter.vo.AllWalletCoinVo; -import com.xcong.excoin.modules.coin.parameter.vo.MemberAccountMoneyChangeInfoVo; -import com.xcong.excoin.modules.coin.parameter.vo.MemberAgentIntoInfoVo; -import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletAgentInfoVo; -import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletCoinInfoVo; -import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletCoinVo; -import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletContractInfoVo; import com.xcong.excoin.modules.coin.service.CoinService; import com.xcong.excoin.modules.member.dao.MemberWalletAgentDao; import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao; @@ -65,6 +60,10 @@ MemberWalletAgentDao memberWalletAgentDao; @Resource ZhiYaRecordDao zhiYaRecordDao; + @Resource + ZhiyaRewardDao zhiyaRewardDao; + @Resource + ZhiYaDao zhiYaDao; @Resource RedisUtils redisUtils; @@ -102,7 +101,15 @@ totalUsdts = totalUsdts.add(totalUsdt); BigDecimal totalCny = totalUsdt.multiply(cnyUsdt); walletCoin.setTotalBalance(totalCny); - } else { + } +// else if (MemberWalletCoinEnum.WALLETGUSDCOINCODE.getValue().equals(walletCoin.getWalletCode())) { +// BigDecimal totalUsdt = BigDecimal.ZERO; +// totalUsdt = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance()); +// totalUsdts = totalUsdts.add(totalUsdt); +// BigDecimal totalCny = totalUsdt.multiply(cnyUsdt); +// walletCoin.setTotalBalance(totalCny); +// } + else { BigDecimal amount = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance()); // 获取最新价 BigDecimal closePrice = new BigDecimal(redisUtils.getString(CoinTypeConvert.convertToKey(walletCoin.getWalletCode()+"/USDT"))); @@ -140,6 +147,10 @@ coin.setWalletCode(CoinTypeEnum.XRP.toString()); memberWalletCoinlist.add(coin); coin.setWalletCode(CoinTypeEnum.ETC.toString()); + memberWalletCoinlist.add(coin); +// coin.setWalletCode(CoinTypeEnum.GUSD.toString()); +// memberWalletCoinlist.add(coin); + coin.setWalletCode(CoinTypeEnum.GRICE.toString()); memberWalletCoinlist.add(coin); MemberWalletCoinVo memberWalletCoinVo = new MemberWalletCoinVo(); @@ -602,128 +613,205 @@ } @Override - public Result usdtToGusd(BigDecimal balance) { + @Transactional + public Result usdtToGusd(BigDecimal balance,Integer type) { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); if (balance.compareTo(BigDecimal.ZERO) <= 0) { return Result.fail(MessageSourceUtils.getString("member_service_0004")); } + if(1 == type){ + // 扣币 + String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue(); + MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, walletCode); + BigDecimal availableBalance = memberWalletCoinEntity.getAvailableBalance(); + BigDecimal totalBalance = memberWalletCoinEntity.getTotalBalance(); - // 扣币 - String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue(); - MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, walletCode); - BigDecimal availableBalance = memberWalletCoinEntity.getAvailableBalance(); - BigDecimal totalBalance = memberWalletCoinEntity.getTotalBalance(); + BigDecimal available = availableBalance.subtract(balance); + if (available.compareTo(BigDecimal.ZERO) < 0) { + return Result.fail(MessageSourceUtils.getString("member_service_0005")); + } + BigDecimal total = totalBalance.subtract(balance); + if (total.compareTo(BigDecimal.ZERO) < 0) { + return Result.fail(MessageSourceUtils.getString("member_service_0005")); + } - BigDecimal available = availableBalance.subtract(balance); - if (available.compareTo(BigDecimal.ZERO) < 0) { - return Result.fail(MessageSourceUtils.getString("member_service_0005")); + memberWalletCoinEntity.setAvailableBalance(available); + memberWalletCoinEntity.setTotalBalance(total); + int i = memberWalletCoinDao.updateById(memberWalletCoinEntity); + if (i < 1) { + return Result.fail(MessageSourceUtils.getString("member_service_0096")); + } + //添加资金划转历史记录 + MemberAccountMoneyChange memberAccountRecord = new MemberAccountMoneyChange(); + //获取usdt兑换gusd的兑换比例 + BigDecimal usdtToGusd = new BigDecimal(redisUtils.getString("USDTTOGSD")); + BigDecimal gusdBalance = balance.multiply(usdtToGusd); + + ZhiYaEntity zhiya = zhiYaDao.selectByMemberId(memberId); + BigDecimal gusdAvailableBalance = zhiya.getAvailableBalance(); + BigDecimal gusdTotalBalance = zhiya.getTotalBalance(); + zhiya.setAvailableBalance(gusdAvailableBalance.add(gusdBalance)); + zhiya.setTotalBalance(gusdTotalBalance.add(gusdBalance)); + + int updateById = zhiYaDao.updateById(zhiya); + if (updateById < 1) { + return Result.fail(MessageSourceUtils.getString("member_service_0096")); + } + + //添加资金划转历史记录 + memberAccountRecord.setMemberId(memberId); + memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER); + memberAccountRecord.setSymbol(walletCode); + memberAccountRecord.setContent(MemberWalletCoinEnum.ZHIYATOGUSD.getValue()); + memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_COIN); + memberAccountRecord.setAmount(gusdBalance); + memberAccountMoneyChangeDao.insert(memberAccountRecord); + }else if(2 == type){ + // 扣币 + ZhiYaEntity zhiya = zhiYaDao.selectByMemberId(memberId); + BigDecimal availableBalance = zhiya.getAvailableBalance(); + BigDecimal totalBalance = zhiya.getTotalBalance(); + + BigDecimal available = availableBalance.subtract(balance); + if (available.compareTo(BigDecimal.ZERO) < 0) { + return Result.fail(MessageSourceUtils.getString("member_service_0005")); + } + BigDecimal total = totalBalance.subtract(balance); + if (total.compareTo(BigDecimal.ZERO) < 0) { + return Result.fail(MessageSourceUtils.getString("member_service_0005")); + } + + zhiya.setAvailableBalance(available); + zhiya.setTotalBalance(total); + int i = zhiYaDao.updateById(zhiya); + if (i < 1) { + return Result.fail(MessageSourceUtils.getString("member_service_0096")); + } + //添加资金划转历史记录 + MemberAccountMoneyChange memberAccountRecord = new MemberAccountMoneyChange(); + //获取usdt兑换gusd的兑换比例 + BigDecimal usdtToGusd = new BigDecimal(redisUtils.getString("USDTTOGSD")); + BigDecimal usdtBalance = balance.divide(usdtToGusd); + + String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue(); + MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, walletCode); + + BigDecimal gusdAvailableBalance = memberWalletCoinEntity.getAvailableBalance(); + BigDecimal gusdTotalBalance = memberWalletCoinEntity.getTotalBalance(); + memberWalletCoinEntity.setAvailableBalance(gusdAvailableBalance.add(usdtBalance)); + memberWalletCoinEntity.setTotalBalance(gusdTotalBalance.add(usdtBalance)); + + int updateById = memberWalletCoinDao.updateById(memberWalletCoinEntity); + if (updateById < 1) { + return Result.fail(MessageSourceUtils.getString("member_service_0096")); + } + + //添加资金划转历史记录 + memberAccountRecord.setMemberId(memberId); + memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER); + memberAccountRecord.setSymbol(walletCode); + memberAccountRecord.setContent(MemberWalletCoinEnum.ZHIYATOUSDT.getValue()); + memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_COIN); + memberAccountRecord.setAmount(usdtBalance); + memberAccountMoneyChangeDao.insert(memberAccountRecord); + + }else{ + return Result.fail("member_controller_0005"); } - BigDecimal total = totalBalance.subtract(balance); - if (total.compareTo(BigDecimal.ZERO) < 0) { - return Result.fail(MessageSourceUtils.getString("member_service_0005")); - } - - memberWalletCoinEntity.setAvailableBalance(available); - memberWalletCoinEntity.setTotalBalance(total); - int i = memberWalletCoinDao.updateById(memberWalletCoinEntity); - if (i < 1) { - return Result.fail(MessageSourceUtils.getString("member_service_0095")); - } - //添加资金划转历史记录 - MemberAccountMoneyChange memberAccountRecord = new MemberAccountMoneyChange(); - //获取usdt兑换gusd的兑换比例 - String gusdName = CoinTypeEnum.GUSD.name(); - MemberWalletCoinEntity gusdMemberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, gusdName); - BigDecimal gusdAvailableBalance = gusdMemberWalletCoinEntity.getAvailableBalance(); - BigDecimal gusdTotalBalance = gusdMemberWalletCoinEntity.getTotalBalance(); - gusdMemberWalletCoinEntity.setAvailableBalance(gusdAvailableBalance.add(balance)); - gusdMemberWalletCoinEntity.setTotalBalance(gusdTotalBalance.add(balance)); - - int updateById = memberWalletCoinDao.updateById(gusdMemberWalletCoinEntity); - if (updateById < 1) { - return Result.fail(MessageSourceUtils.getString("member_service_0095")); - } - - //添加资金划转历史记录 - memberAccountRecord.setMemberId(memberId); - memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER); - memberAccountRecord.setSymbol(walletCode); - memberAccountRecord.setContent(MemberWalletCoinEnum.ZHIYATOGUSD.getValue()); - memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_COIN); - memberAccountRecord.setAmount(balance); - memberAccountMoneyChangeDao.insert(memberAccountRecord); return Result.ok(MessageSourceUtils.getString("member_service_0024")); } @Override + @Transactional public Result zhiYaGusd(BigDecimal balance) { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); if (balance.compareTo(new BigDecimal(100)) < 0) { - return Result.fail(MessageSourceUtils.getString("member_service_0005")); + return Result.fail(MessageSourceUtils.getString("zhiya_service_0006")); } + //质押Gusd,质押数量进入冻结余额, - String gusdName = CoinTypeEnum.GUSD.name(); - MemberWalletCoinEntity gusdMemberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, gusdName); - BigDecimal gusdAvailableBalance = gusdMemberWalletCoinEntity.getAvailableBalance(); - BigDecimal gusdTotalBalance = gusdMemberWalletCoinEntity.getTotalBalance(); - BigDecimal gusdfrozenBalance = gusdMemberWalletCoinEntity.getFrozenBalance(); + ZhiYaEntity zhiya = zhiYaDao.selectByMemberId(memberId); + BigDecimal gusdAvailableBalance = zhiya.getAvailableBalance(); + BigDecimal gusdTotalBalance = zhiya.getTotalBalance(); + BigDecimal gusdfrozenBalance = zhiya.getFrozenBalance(); BigDecimal available = gusdAvailableBalance.subtract(balance); if (available.compareTo(BigDecimal.ZERO) < 0) { - return Result.fail(MessageSourceUtils.getString("member_service_0005")); + return Result.fail(MessageSourceUtils.getString("zhiya_service_0005")); } BigDecimal total = gusdTotalBalance.subtract(balance); if (total.compareTo(BigDecimal.ZERO) < 0) { - return Result.fail(MessageSourceUtils.getString("member_service_0005")); + return Result.fail(MessageSourceUtils.getString("zhiya_service_0005")); } - gusdMemberWalletCoinEntity.setFrozenBalance(gusdfrozenBalance.add(gusdfrozenBalance)); - gusdMemberWalletCoinEntity.setAvailableBalance(gusdAvailableBalance.subtract(balance)); + zhiya.setFrozenBalance(gusdfrozenBalance.add(balance)); + zhiya.setAvailableBalance(gusdAvailableBalance.subtract(balance)); - int updateById = memberWalletCoinDao.updateById(gusdMemberWalletCoinEntity); + int updateById = zhiYaDao.updateById(zhiya); if (updateById < 1) { - return Result.fail(MessageSourceUtils.getString("member_service_0095")); + return Result.fail(MessageSourceUtils.getString("member_service_0096")); } //产生质押单,当前有的话,累加质押数量 - ZhiYaRecordEntity zhiYaRecord = zhiYaRecordDao.selectByMemberIdAndOrderStatus(memberId,1); - if(ObjectUtil.isEmpty(zhiYaRecord)){ +// ZhiYaRecordEntity zhiYaRecord = zhiYaRecordDao.selectByMemberIdAndOrderStatus(memberId,1); +// if(ObjectUtil.isEmpty(zhiYaRecord)){ //产生一条质押记录 ZhiYaRecordEntity zhiYaRecordEntity = new ZhiYaRecordEntity(); zhiYaRecordEntity.setMemberId(memberId); zhiYaRecordEntity.setOrderNo(generateSimpleSerialno(memberId.toString())); - zhiYaRecordEntity.setSymbol(gusdName); + zhiYaRecordEntity.setSymbol(MemberWalletCoinEnum.WALLETGUSDCOINCODE.getValue()); zhiYaRecordEntity.setZhiyaCnt(balance); zhiYaRecordEntity.setOrderStatus(1); Date date = new Date(); Date newDate = DateUtil.offsetDay(date, 1); zhiYaRecordEntity.setEffectDate(newDate); zhiYaRecordDao.insert(zhiYaRecordEntity); - }else{ - zhiYaRecord.setZhiyaCnt(zhiYaRecord.getZhiyaCnt().add(balance)); - Date date = new Date(); - Date newDate = DateUtil.offsetDay(date, 1); - zhiYaRecord.setEffectDate(newDate); - zhiYaRecordDao.updateById(zhiYaRecord); - } +// }else{ +// zhiYaRecord.setZhiyaCnt(zhiYaRecord.getZhiyaCnt().add(balance)); +// Date date = new Date(); +// Date newDate = DateUtil.offsetDay(date, 1); +// zhiYaRecord.setEffectDate(newDate); +// zhiYaRecordDao.updateById(zhiYaRecord); +// } + //更新团队算力表 + //只计算直属团队的算力信息 + return Result.ok(MessageSourceUtils.getString("member_service_0024")); } @Override - public Result shuhuiGusd(BigDecimal balance) { + @Transactional + public Result shuhuiGusd(BigDecimal balance,Long id) { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); if (balance.compareTo(BigDecimal.ZERO) <= 0) { - return Result.fail(MessageSourceUtils.getString("order_service_0010")); + return Result.fail(MessageSourceUtils.getString("zhiya_service_0004")); } - //质押Gusd,质押数量进入冻结余额, - String gusdName = CoinTypeEnum.GUSD.name(); - MemberWalletCoinEntity gusdMemberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, gusdName); - BigDecimal gusdAvailableBalance = gusdMemberWalletCoinEntity.getAvailableBalance(); - BigDecimal gusdTotalBalance = gusdMemberWalletCoinEntity.getTotalBalance(); - BigDecimal gusdfrozenBalance = gusdMemberWalletCoinEntity.getFrozenBalance(); + //赎回Gusd,获取质押单据, + ZhiYaRecordEntity zhiYaRecordEntity = zhiYaRecordDao.selectByIdAndMemberId(id,memberId); + if(ObjectUtil.isEmpty(zhiYaRecordEntity)){ + return Result.fail(MessageSourceUtils.getString("zhiya_service_0002")); + } + if(1 != zhiYaRecordEntity.getOrderStatus()){ + return Result.fail(MessageSourceUtils.getString("zhiya_service_0003")); + } + BigDecimal zhiyaCnt = zhiYaRecordEntity.getZhiyaCnt(); + if(balance.compareTo(zhiyaCnt) > 0){ + return Result.fail(MessageSourceUtils.getString("zhiya_service_0004")); + } +// zhiYaRecordEntity.setZhiyaCnt(zhiyaCnt.subtract(balance)); + if(zhiyaCnt.compareTo(balance) != 0){ + return Result.fail(MessageSourceUtils.getString("zhiya_service_0001")); + } + zhiYaRecordEntity.setOrderStatus(2); + zhiYaRecordDao.updateById(zhiYaRecordEntity); + //赎回Gusd,质押数量进入可用余额, + ZhiYaEntity zhiya = zhiYaDao.selectByMemberId(memberId); + BigDecimal gusdAvailableBalance = zhiya.getAvailableBalance(); + BigDecimal gusdTotalBalance = zhiya.getTotalBalance(); + BigDecimal gusdfrozenBalance = zhiya.getFrozenBalance(); BigDecimal frozen = gusdfrozenBalance.subtract(balance); if (frozen.compareTo(BigDecimal.ZERO) < 0) { @@ -733,7 +821,93 @@ if (total.compareTo(BigDecimal.ZERO) < 0) { return Result.fail(MessageSourceUtils.getString("member_service_0005")); } - return null; + zhiya.setFrozenBalance(gusdfrozenBalance.subtract(balance)); + zhiya.setAvailableBalance(gusdAvailableBalance.add(balance)); + zhiYaDao.updateById(zhiya); + return Result.ok(MessageSourceUtils.getString("member_service_0024")); + } + + @Override + public Result findMemberGusdInfo() { + //获取用户ID + Long memberId = LoginUserUtils.getAppLoginUser().getId(); + ZhiYaEntity zhiYaEntity = zhiYaDao.selectByMemberId(memberId); + MemberGusdInfoVo memberGusdInfoVo = new MemberGusdInfoVo(); + memberGusdInfoVo.setMemberId(memberId); + memberGusdInfoVo.setFrozenBalance(zhiYaEntity.getFrozenBalance()); + memberGusdInfoVo.setTotalBalance(zhiYaEntity.getTotalBalance()); + memberGusdInfoVo.setAvailableBalance(zhiYaEntity.getAvailableBalance()); + return Result.ok(memberGusdInfoVo); + } + + @Override + public Result getZhiyaRecords(RecordsPageDto recordsPageDto) { + //获取用户ID + Long memberId = LoginUserUtils.getAppLoginUser().getId(); + + Page<ZhiyaInfoVo> page = new Page<>(recordsPageDto.getPageNum(), recordsPageDto.getPageSize()); + ZhiYaEntity zhiya = new ZhiYaEntity(); + zhiya.setMemberId(memberId); + IPage<ZhiyaInfoVo> lists = zhiYaRecordDao.selectByMemberIdInPage(page, zhiya); + return Result.ok(lists); + } + + @Override + public Result getusdtToGusdRecords(RecordsPageDto recordsPageDto) { + //获取用户ID + Long memberId = LoginUserUtils.getAppLoginUser().getId(); + + Page<UsdtToGusdVo> page = new Page<>(recordsPageDto.getPageNum(), recordsPageDto.getPageSize()); + MemberAccountMoneyChange memberAccountMoneyChange = new MemberAccountMoneyChange(); + memberAccountMoneyChange.setMemberId(memberId); + IPage<UsdtToGusdVo> lists = memberAccountMoneyChangeDao.selectByMemberIdInPage(page, memberAccountMoneyChange); + return Result.ok(lists); + } + + @Override + @Transactional + public void grantZhiyaAmount() { + //获取每日总产出 + BigDecimal gusdReward = new BigDecimal(redisUtils.getString("GUSDREWARD")); + //获取每日质押总数 + Long totalGusd = zhiYaRecordDao.selectTotalGusdByStatueAndTime(1,new Date()); + BigDecimal totalGusdBigDecimal = new BigDecimal(totalGusd); + if(totalGusdBigDecimal.compareTo(BigDecimal.ZERO) > 0){ + //平均一个获取奖励数量 + BigDecimal divide = gusdReward.divide(totalGusdBigDecimal,2, BigDecimal.ROUND_HALF_UP); + //获取今天之前满足发放奖励的全部质押单 + //生效时间小于当前时间 + //状态为生效中 + List<ZhiYaRecordEntity> lists = zhiYaRecordDao.selectZhiYaRewardByStatueAndTime(1,new Date()); + if(CollUtil.isNotEmpty(lists)){ + for(ZhiYaRecordEntity zhiYaRecordEntity : lists){ + ZhiyaRewardEntity zhiyaRewardEntity = new ZhiyaRewardEntity(); + zhiyaRewardEntity.setRecordId(zhiYaRecordEntity.getId()); + zhiyaRewardEntity.setRecordNo(zhiYaRecordEntity.getOrderNo()); + zhiyaRewardEntity.setMemberId(zhiYaRecordEntity.getMemberId()); + zhiyaRewardEntity.setRewardAmout(divide.multiply(zhiYaRecordEntity.getZhiyaCnt())); + zhiyaRewardDao.insert(zhiyaRewardEntity); + + //给团队上级发送奖励goldrice + //给账户的冻结 + + } + } + } + } + + @Override + public Result getZhiyaReward(ZhiyaRewardRecordsPageDto recordsPageDto) { + + //获取用户ID + Long memberId = LoginUserUtils.getAppLoginUser().getId(); + + Page<ZhiyaRewardVo> page = new Page<>(recordsPageDto.getPageNum(), recordsPageDto.getPageSize()); + ZhiyaRewardEntity zhiyaRewardEntity = new ZhiyaRewardEntity(); + zhiyaRewardEntity.setMemberId(memberId); + zhiyaRewardEntity.setRecordNo(recordsPageDto.getOrderNo()); + IPage<ZhiyaRewardVo> lists = zhiYaRecordDao.selectZhiyaRewardByMemberIdInPage(page, zhiyaRewardEntity); + return Result.ok(lists); } public String generateSimpleSerialno(String userId) { -- Gitblit v1.9.1