Helius
2021-05-14 e16ab23cc4b872436edf3743f7e9e5639c45d770
modify
4 files modified
18 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/yunding/dao/YdOrderDao.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/yunding/YdOrderDao.xml 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/yunding/dao/YdOrderDao.java
@@ -30,4 +30,6 @@
    IPage<AgentVo> getAgentList(Page<AgentVo> page, @Param("record")  YdBasicLevelSettingEntity ydBasicLevelSettingEntity);
    List<YdOrderEntity> selectTeamAllPower(@Param("inviteId") String inviteId);
    int updateOrderProfit(@Param("profit") BigDecimal profit, @Param("id") Long id);
}
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java
@@ -16,6 +16,7 @@
import com.xcong.excoin.modules.yunding.entity.YdOrderEntity;
import com.xcong.excoin.modules.yunding.entity.YdProductEntity;
import com.xcong.excoin.modules.yunding.service.XchProfitService;
import com.xcong.excoin.rabbit.producer.YunDingProducter;
import com.xcong.excoin.utils.LogRecordUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +44,9 @@
    @Autowired
    private YdBasicLevelSettingDao ydBasicLevelSettingDao;
    @Autowired
    private YunDingProducter yunDingProducter;
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -147,6 +151,8 @@
    public void usdtProfitDistributorByOrderId(Long id) {
        YdOrderEntity ydOrderEntity = ydOrderDao.selectById(id);
        usdtProfitDistributor(ydOrderEntity);
        yunDingProducter.sendYunDingAutoAgent(ydOrderEntity.getMemberId());
    }
    private void usdtProfitDistributor(YdOrderEntity order) {
@@ -262,6 +268,7 @@
                    LogRecordUtils.insertMemberAccountMoneyChangeWithId(order.getMemberId(), content, remainProfit, "XCH", 1, 4, order.getId());
                    MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(order.getMemberId(), "XCH");
                    ydOrderDao.updateOrderProfit(remainProfit, order.getId());
                    memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), remainProfit, BigDecimal.ZERO, 0);
                }
            }
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java
@@ -280,7 +280,6 @@
                "USDT", 1, 3, ydOrderEntity.getId());
        yunDingProducter.sendYunDingUsdtProfit(ydOrderEntity.getId());
        yunDingProducter.sendYunDingAutoAgent(ydOrderEntity.getMemberId());
        return Result.ok("支付成功");
    }
@@ -585,7 +584,6 @@
        memberEntity.setAgentLevel(id.intValue());
        LoginUserUtils.resetAppLoginUser(memberEntity);
        yunDingProducter.sendYunDingAutoAgent(memberId);
        yunDingProducter.sendYunDingUsdtProfit(orderEntity.getId());
        return Result.ok("购买成功");
    }
src/main/resources/mapper/yunding/YdOrderDao.xml
@@ -96,4 +96,11 @@
        inner join yd_product c on c.id = a.product_id
        where a.type=1
    </select>
    <update id="updateOrderProfit">
        update yd_order
            set total_profit=total_profit+#{profit},
                today_profit=#{profit}
        where id=#{id}
    </update>
</mapper>