Helius
2021-05-14 0abd80878ee9045d5317a2dbeff6c20d2dfdabc0
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java
@@ -17,6 +17,7 @@
import com.xcong.excoin.modules.yunding.entity.YdProductEntity;
import com.xcong.excoin.modules.yunding.service.XchProfitService;
import com.xcong.excoin.utils.LogRecordUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -24,6 +25,7 @@
import java.math.BigDecimal;
import java.util.*;
@Slf4j
@Service
public class XchProfitServiceImpl implements XchProfitService {
@@ -203,6 +205,7 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void xchProfitDistributor(BigDecimal totalProfit) {
        Date currentDate = new Date();
        List<YdProductEntity> products = ydProductDao.selectList(null);
@@ -219,6 +222,7 @@
            // 单位XCH收益
            BigDecimal unitProfit = totalProfit.divide(totalCount, 8, BigDecimal.ROUND_DOWN);
            log.info("单位XCH收益:{}", unitProfit);
            List<YdOrderEntity> orders = ydOrderDao.selectAllValidOrders();
            if (CollUtil.isNotEmpty(orders)) {
@@ -253,6 +257,7 @@
                        }
                    }
                    remainProfit = remainProfit.subtract(orderProfit.subtract(orderProfit.multiply(order.getYdProductEntity().getManageExpense())));
                    String content = "XCH收益";
                    LogRecordUtils.insertMemberAccountMoneyChangeWithId(order.getMemberId(), content, remainProfit, "XCH", 1, 4, order.getId());
                    MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(order.getMemberId(), "XCH");