| | |
| | | } |
| | | comActWalletVO.setAgreement(Constants.PROFIT_EXPLAIN); |
| | | } |
| | | |
| | | Integer easyCount = 0; |
| | | //查询用户发布随手拍数量 |
| | | easyCount = comActEasyPhotoDAO.selectCount(new QueryWrapper<ComActEasyPhotoDO>().lambda() |
| | | .eq(ComActEasyPhotoDO::getSponsorId,walletDetailDTO.getUserId()) |
| | | .eq(ComActEasyPhotoDO::getCommunityId,walletDetailDTO.getCommunityId())); |
| | | comActWalletVO.setEasyCount(easyCount); |
| | | |
| | | return R.ok(comActWalletVO); |
| | | } |
| | | |
| | |
| | | //活动正在进行中,需要给用户计算收益 |
| | | if(nowDate.getTime() - photoActivityDO.getActivityStartAt().getTime() > 0 && nowDate.getTime() - photoActivityDO.getActivityEndAt().getTime() < 0){ |
| | | |
| | | photoActivityDO.setCount(photoActivityDO.getCount() + 1); |
| | | comActEasyPhotoActivityMapper.updateById(photoActivityDO); |
| | | |
| | | //查询用户钱包 |
| | | ComActUserWalletDO userWalletDO = comActUserWalletMapper.selectOne(new QueryWrapper<ComActUserWalletDO>() |
| | | .lambda().eq(ComActUserWalletDO::getUserId,easyPhotoDO.getSponsorId()).eq(ComActUserWalletDO::getCommunityId,easyPhotoDO.getCommunityId())); |
| | |
| | | BigDecimal oldSettlementAmount = userWalletDO.getSettlementAmount(); |
| | | |
| | | //更新钱包金额 |
| | | userWalletDO.setEasyCount(userWalletDO.getEasyCount() + 1); |
| | | userWalletDO.setIncomeAmount(userWalletDO.getIncomeAmount().add(profitAmount)); |
| | | userWalletDO.setAvailableAmount(userWalletDO.getAvailableAmount().add(profitAmount)); |
| | | comActUserWalletMapper.updateById(userWalletDO); |