huanghongfa
2021-07-09 b7a06b6e93c0df03ed84c40385cbe88d27459d4f
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletServiceImpl.java
@@ -81,9 +81,20 @@
            comActWalletVO.setCommunityName(resultMap.get("name"));
            if(StringUtils.isEmpty(resultMap.get("content"))){
                this.baseMapper.insertSysAgreement(Constants.PROFIT_EXPLAIN,walletDetailDTO.getCommunityId());
                comActWalletVO.setAgreement(Constants.PROFIT_EXPLAIN);
            }else{
                comActWalletVO.setAgreement(resultMap.get("content"));
            }
            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);
    }
@@ -133,9 +144,6 @@
        //活动正在进行中,需要给用户计算收益
        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()));
@@ -171,7 +179,6 @@
                BigDecimal oldSettlementAmount = userWalletDO.getSettlementAmount();
                //更新钱包金额
                userWalletDO.setEasyCount(userWalletDO.getEasyCount() + 1);
                userWalletDO.setIncomeAmount(userWalletDO.getIncomeAmount().add(profitAmount));
                userWalletDO.setAvailableAmount(userWalletDO.getAvailableAmount().add(profitAmount));
                comActUserWalletMapper.updateById(userWalletDO);