| | |
| | | package com.xcong.excoin.modules.yunding.service.Impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.LoginUserUtils; |
| | | 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.member.dao.MemberWalletCoinDao; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity; |
| | |
| | | private YdOrderDao ydOrderDao; |
| | | @Resource |
| | | private MemberWalletCoinDao memberWalletCoinDao; |
| | | |
| | | @Resource |
| | | private MemberAccountMoneyChangeDao memberAccountMoneyChangeDao; |
| | | |
| | | @Override |
| | | public Result findAllInfo() { |
| | |
| | | |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | Long memberId = memberEntity.getId(); |
| | | // Long memberId = 28L; |
| | | // Long memberId = 442L; |
| | | OrderAllInfoVo orderAllInfoVo = new OrderAllInfoVo(); |
| | | DecimalFormat decimalFormat = new DecimalFormat("0.0000#"); |
| | | //历史总收益 |
| | |
| | | QueryWrapper<YdOrderEntity> powerReradyQuery = new QueryWrapper<>(); |
| | | powerReradyQuery.eq("member_id",memberId); |
| | | powerReradyQuery.eq("state",YdOrderEntity.ORDER_STATE_READY); |
| | | List<YdOrderEntity> PowerReradyQuery = ydOrderDao.selectList(powerNowQuery); |
| | | List<YdOrderEntity> PowerReradyQuery = ydOrderDao.selectList(powerReradyQuery); |
| | | if(CollUtil.isNotEmpty(PowerReradyQuery)){ |
| | | for(YdOrderEntity order : PowerReradyQuery){ |
| | | int quantity = order.getQuantity(); |
| | |
| | | } |
| | | } |
| | | orderAllInfoVo.setPowerReady(powerReady); |
| | | //昨日总收益 |
| | | BigDecimal lastdayProfit = BigDecimal.ZERO; |
| | | Date date = DateUtil.date(); |
| | | Date dateTime = DateUtil.offsetDay(date, 1); |
| | | QueryWrapper<MemberAccountMoneyChange> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("type",4); |
| | | queryWrapper.eq("member_id",memberId); |
| | | queryWrapper.eq("status",1); |
| | | queryWrapper.like("create_time",DateUtil.formatDate(dateTime)); |
| | | List<MemberAccountMoneyChange> memberAccountMoneyChanges = memberAccountMoneyChangeDao.selectList(queryWrapper); |
| | | if(CollUtil.isNotEmpty(memberAccountMoneyChanges)){ |
| | | for(MemberAccountMoneyChange memberAccountMoneyChange : memberAccountMoneyChanges){ |
| | | BigDecimal amount = memberAccountMoneyChange.getAmount(); |
| | | lastdayProfit = lastdayProfit.add(amount); |
| | | } |
| | | } |
| | | orderAllInfoVo.setLastdayProfit(decimalFormat.format(lastdayProfit)); |
| | | return Result.ok(orderAllInfoVo); |
| | | } |
| | | |