|  |  |  | 
|---|
|  |  |  | import com.xcong.excoin.rabbit.producer.OrderProducer; | 
|---|
|  |  |  | import com.xcong.excoin.utils.CacheSettingUtils; | 
|---|
|  |  |  | import com.xcong.excoin.utils.CalculateUtil; | 
|---|
|  |  |  | import com.xcong.excoin.utils.ThreadPoolUtils; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.collections.CollectionUtils; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author helius | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class OrderWebsocketServiceImpl { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 开多止盈 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | public void dealForMoreStopPro(List<ContractHoldOrderEntity> orderList, List<OrderModel> list) { | 
|---|
|  |  |  | if (CollectionUtils.isNotEmpty(orderList)) { | 
|---|
|  |  |  | Map<Long, BigDecimal> modelMap = new HashMap<Long, BigDecimal>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //回报率 | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getPrePaymentAmount().subtract(contractOrderEntity.getClosingFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getBondAmount().subtract(contractOrderEntity.getOpeningFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | contractOrderEntity.setRewardAmount(profitLossPrice); | 
|---|
|  |  |  | contractOrderEntity.setRewardRatio(returnRate); | 
|---|
|  |  |  | contractOrderEntity.setClosingFeeAmount(order.getOpeningFeeAmount()); | 
|---|
|  |  |  | contractOrderEntity.setClosingPrice(closePrice); | 
|---|
|  |  |  | contractOrderEntity.setClosingType(6); | 
|---|
|  |  |  | contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_MORE); | 
|---|
|  |  |  | BigDecimal totalReturn = BigDecimal.ZERO; | 
|---|
|  |  |  | contractOrderService.save(contractOrderEntity); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contractHoldOrderService.removeById(order.getId()); | 
|---|
|  |  |  | // 将需要退回的减去手续费 | 
|---|
|  |  |  | BigDecimal needReturn = prePrice.add(profitLossPrice); | 
|---|
|  |  |  | //总退回金额=保证金+收益-手续费 | 
|---|
|  |  |  | totalReturn = needReturn.subtract(contractOrderEntity.getClosingFeeAmount()); | 
|---|
|  |  |  | // 更新钱包 | 
|---|
|  |  |  | // 总的是收益-平仓手续费 | 
|---|
|  |  |  | BigDecimal totalBalance = profitLossPrice.subtract(contractOrderEntity.getClosingFeeAmount()); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalBalance, totalReturn, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalReturn, totalBalance, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 流水记录 TODO 531e | 
|---|
|  |  |  | insertAccountFlow(order, wallet, profitLossPrice, "止盈平仓"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返佣 | 
|---|
|  |  |  | calYj(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, 2); | 
|---|
|  |  |  | ThreadPoolUtils.calReturnMoney(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_CLOSE); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | System.out.println("执行操作"); | 
|---|
|  |  |  | String symbol = order.getSymbol(); | 
|---|
|  |  |  | // 本次需要退回的预付款 | 
|---|
|  |  |  | BigDecimal prePrice = order.getPrePaymentAmount(); | 
|---|
|  |  |  | BigDecimal prePrice = order.getBondAmount(); | 
|---|
|  |  |  | Long memberId = order.getMemberId(); | 
|---|
|  |  |  | MemberWalletContractEntity wallet = memberWalletContractService.findWalletContractByMemberIdAndSymbol(memberId, "USDT"); | 
|---|
|  |  |  | if (wallet != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //回报率 | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getPrePaymentAmount().subtract(contractOrderEntity.getClosingFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getBondAmount().subtract(contractOrderEntity.getOpeningFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | contractOrderEntity.setRewardAmount(profitLossPrice); | 
|---|
|  |  |  | contractOrderEntity.setRewardRatio(returnRate); | 
|---|
|  |  |  | contractOrderEntity.setClosingFeeAmount(order.getOpeningFeeAmount()); | 
|---|
|  |  |  | contractOrderEntity.setClosingPrice(closePrice); | 
|---|
|  |  |  | contractOrderEntity.setClosingType(7); | 
|---|
|  |  |  | contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_MORE); | 
|---|
|  |  |  | BigDecimal totalReturn = BigDecimal.ZERO; | 
|---|
|  |  |  | contractOrderService.save(contractOrderEntity); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contractHoldOrderService.removeById(order.getId()); | 
|---|
|  |  |  | // 将需要退回的减去手续费 | 
|---|
|  |  |  | BigDecimal needReturn = prePrice.add(profitLossPrice); | 
|---|
|  |  |  | //总退回金额=保证金+收益-手续费 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 更新钱包 | 
|---|
|  |  |  | // 总的是收益-平仓手续费 | 
|---|
|  |  |  | BigDecimal totalBalance = profitLossPrice.subtract(contractOrderEntity.getClosingFeeAmount()); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalBalance, totalReturn, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalReturn, totalBalance, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | insertAccountFlow(order, wallet, profitLossPrice, "止盈平仓"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返佣 | 
|---|
|  |  |  | calYj(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, 2); | 
|---|
|  |  |  | ThreadPoolUtils.calReturnMoney(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_CLOSE); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | String symbol = order.getSymbol(); | 
|---|
|  |  |  | Long memberId = order.getMemberId(); | 
|---|
|  |  |  | // 本次需要退回的预付款 | 
|---|
|  |  |  | BigDecimal prePrice = order.getPrePaymentAmount(); | 
|---|
|  |  |  | BigDecimal prePrice = order.getBondAmount(); | 
|---|
|  |  |  | MemberWalletContractEntity wallet = memberWalletContractService.findWalletContractByMemberIdAndSymbol(memberId, "USDT"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (wallet != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //回报率 | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getPrePaymentAmount().subtract(contractOrderEntity.getClosingFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getBondAmount().subtract(contractOrderEntity.getOpeningFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | contractOrderEntity.setRewardAmount(profitLossPrice); | 
|---|
|  |  |  | contractOrderEntity.setRewardRatio(returnRate); | 
|---|
|  |  |  | contractOrderEntity.setClosingFeeAmount(order.getOpeningFeeAmount()); | 
|---|
|  |  |  | contractOrderEntity.setClosingPrice(closePrice); | 
|---|
|  |  |  | contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_MORE); | 
|---|
|  |  |  | contractOrderEntity.setClosingType(8); | 
|---|
|  |  |  | BigDecimal totalReturn = BigDecimal.ZERO; | 
|---|
|  |  |  | contractOrderService.save(contractOrderEntity); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contractHoldOrderService.removeById(order.getId()); | 
|---|
|  |  |  | // 将需要退回的减去手续费 | 
|---|
|  |  |  | BigDecimal needReturn = prePrice.add(profitLossPrice); | 
|---|
|  |  |  | //总退回金额=保证金+收益-手续费 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 更新钱包 | 
|---|
|  |  |  | // 总的是收益-平仓手续费 | 
|---|
|  |  |  | BigDecimal totalBalance = profitLossPrice.subtract(contractOrderEntity.getClosingFeeAmount()); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalBalance, totalReturn, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalReturn, totalBalance, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | insertAccountFlow(order, wallet, profitLossPrice, "开多止损平仓"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返佣 | 
|---|
|  |  |  | calYj(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, 2); | 
|---|
|  |  |  | ThreadPoolUtils.calReturnMoney(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_CLOSE); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | String symbol = order.getSymbol(); | 
|---|
|  |  |  | Long memberId = order.getMemberId(); | 
|---|
|  |  |  | // 本次需要退回的预付款 | 
|---|
|  |  |  | BigDecimal prePrice = order.getPrePaymentAmount(); | 
|---|
|  |  |  | BigDecimal prePrice = order.getBondAmount(); | 
|---|
|  |  |  | MemberWalletContractEntity wallet = memberWalletContractService.findWalletContractByMemberIdAndSymbol(memberId, "USDT"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (wallet != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //回报率 | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getPrePaymentAmount().subtract(contractOrderEntity.getClosingFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | BigDecimal returnRate = profitLossPrice.divide((order.getBondAmount().subtract(contractOrderEntity.getOpeningFeeAmount())), 8, BigDecimal.ROUND_DOWN); | 
|---|
|  |  |  | contractOrderEntity.setRewardAmount(profitLossPrice); | 
|---|
|  |  |  | contractOrderEntity.setRewardRatio(returnRate); | 
|---|
|  |  |  | contractOrderEntity.setClosingFeeAmount(order.getOpeningFeeAmount()); | 
|---|
|  |  |  | contractOrderEntity.setClosingPrice(closePrice); | 
|---|
|  |  |  | contractOrderEntity.setClosingType(9); | 
|---|
|  |  |  | contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_LESS); | 
|---|
|  |  |  | BigDecimal totalReturn = BigDecimal.ZERO; | 
|---|
|  |  |  | contractOrderService.save(contractOrderEntity); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contractHoldOrderService.removeById(order.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 将需要退回的减去手续费 | 
|---|
|  |  |  | BigDecimal needReturn = prePrice.add(profitLossPrice); | 
|---|
|  |  |  | //总退回金额=保证金+收益-手续费 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 更新钱包 | 
|---|
|  |  |  | // 总的是收益-平仓手续费 | 
|---|
|  |  |  | BigDecimal totalBalance = profitLossPrice.subtract(contractOrderEntity.getClosingFeeAmount()); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalBalance, totalReturn, null, wallet.getId()); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(totalReturn, totalBalance, null, wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | insertAccountFlow(order, wallet, profitLossPrice, "开空止损平仓"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返佣 | 
|---|
|  |  |  | calYj(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, 2); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ThreadPoolUtils.calReturnMoney(order.getMemberId(), order.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_CLOSE); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | contractOrderEntity.setEntrustOpeningPrice(coinsCoinsOrder.getEntrustPrice()); | 
|---|
|  |  |  | contractOrderEntity.setEntrustTime(coinsCoinsOrder.getCreateTime()); | 
|---|
|  |  |  | contractOrderEntity.setOpeningTime(new Date()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contractOrderEntity.setId(null); | 
|---|
|  |  |  | contractOrderService.save(contractOrderEntity); | 
|---|
|  |  |  | // 发送爆仓的队列 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 扣除手续费 | 
|---|
|  |  |  | BigDecimal totalBalance = openFeePrice.negate(); | 
|---|
|  |  |  | contractEntrustOrderService.removeById(coinsCoinsOrder.getId()); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(null, totalBalance, null, wallet.getId()); | 
|---|
|  |  |  | // TODO 531 待写 | 
|---|
|  |  |  | calYj(memId, openFeePrice, contractOrderEntity, 1); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(null, totalBalance, coinsCoinsOrder.getBondAmount().negate(), wallet.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返佣 | 
|---|
|  |  |  | ThreadPoolUtils.calReturnMoney(memberEntity.getId(), openFeePrice, contractOrderEntity, AgentReturnEntity.ORDER_TYPE_OPEN); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public void dealCoinOut(List<ContractHoldOrderEntity> orderList, List<OrderModel> orderModels) { | 
|---|
|  |  |  | // 需要比较查询到的和消息发来的单的爆仓操作次序号是否相同 | 
|---|
|  |  |  | // 构建map | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (CollectionUtils.isNotEmpty(orderList)) { | 
|---|
|  |  |  | Map<Long, Integer> modelMap = new HashMap<Long, Integer>(); | 
|---|
|  |  |  | for (OrderModel model : orderModels) { | 
|---|
|  |  |  | modelMap.put(model.getOrderId(), model.getOperateNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // TradeSetting tradeSetting = tradeMapper.findTradeSetting(); | 
|---|
|  |  |  | for (ContractHoldOrderEntity coinsOrder : orderList) { | 
|---|
|  |  |  | Long orderId = coinsOrder.getId(); | 
|---|
|  |  |  | Integer operateNo = coinsOrder.getOperateNo(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isDone = false; | 
|---|
|  |  |  | Long memId = coinsOrder.getMemberId(); | 
|---|
|  |  |  | MemberEntity byId = memberService.getById(memId); | 
|---|
|  |  |  | String symbol = coinsOrder.getSymbol(); | 
|---|
|  |  |  | //TradeSymbolSku symbolSku = tradeMapper.findSymbolSkubySymbol(symbol); | 
|---|
|  |  |  | BigDecimal nowPrice = coinsOrder.getForceClosingPrice(); | 
|---|
|  |  |  | // 创建订单(加入历史表的订单) | 
|---|
|  |  |  | ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(coinsOrder); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (isDone) { | 
|---|
|  |  |  | //删除次仓订单 | 
|---|
|  |  |  | contractHoldOrderService.removeById(orderId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //系统自动平仓(爆仓) | 
|---|
|  |  |  | //                    Double closingPrice = nowPrice | 
|---|
|  |  |  | //                            .multiply(new BigDecimal(tradeSetting.getClosingRatio()).divide(new BigDecimal(100), 8, BigDecimal.ROUND_DOWN)) | 
|---|
|  |  |  | //                            .multiply(symbolSku.getLotNumber())// 规格 | 
|---|
|  |  |  | //                            .multiply(new BigDecimal(coinsOrder.getSymbolSkuNumber())) | 
|---|
|  |  |  | //                            .setScale(8, BigDecimal.ROUND_DOWN).doubleValue(); | 
|---|
|  |  |  | // 订单状态转换 | 
|---|
|  |  |  | if (ContractOrderEntity.ORDER_TYPE_OPEN_MORE == contractOrderEntity.getOrderType()) { | 
|---|
|  |  |  | contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_MORE); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_LESS); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //更新主表订单状态位为“已平仓” | 
|---|
|  |  |  | contractOrderEntity.setId(null); | 
|---|
|  |  |  | contractOrderEntity.setClosingPrice(BigDecimal.ZERO); | 
|---|
|  |  |  | //order.setPayTotalPrice(coinsOrder.getPrePrice()+coinsOrder.getClosingPrice());// 总支付金额(预付款) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contractOrderEntity.setClosingPrice(nowPrice); | 
|---|
|  |  |  | contractOrderEntity.setClosingTime(new Date()); | 
|---|
|  |  |  | contractOrderEntity.setRewardAmount((coinsOrder.getOpeningFeeAmount().multiply(new BigDecimal("2")).subtract(coinsOrder.getPrePaymentAmount()))); | 
|---|
|  |  |  | //order.setRewardRatio(-(coinsOrder.getPrePrice() - (2*coinsOrder.getClosingPrice()))); | 
|---|
|  |  |  | contractOrderEntity.setClosingFeeAmount(coinsOrder.getOpeningFeeAmount()); | 
|---|
|  |  |  | contractOrderEntity.setRewardAmount(coinsOrder.getBondAmount().subtract(contractOrderEntity.getOpeningFeeAmount()).negate()); | 
|---|
|  |  |  | contractOrderService.save(contractOrderEntity); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //更新用户钱包数据 | 
|---|
|  |  |  | MemberWalletContractEntity usdt = memberWalletContractService.findWalletContractByMemberIdAndSymbol(memId, "USDT"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // Double totalPrice = wallet.getTotalBalance() - coinsOrder.getPrePrice(); | 
|---|
|  |  |  | // 减去的时候用负数 | 
|---|
|  |  |  | BigDecimal totalPrice = coinsOrder.getPrePaymentAmount().negate(); | 
|---|
|  |  |  | //Double totalPrice = - coinsOrder.getPrePrice(); | 
|---|
|  |  |  | BigDecimal totalPrice = coinsOrder.getBondAmount().negate(); | 
|---|
|  |  |  | memberWalletContractService.increaseWalletContractBalanceById(null, totalPrice, null, usdt.getId()); | 
|---|
|  |  |  | // 流水记录 TODO | 
|---|
|  |  |  | MemberAccountFlowEntity record = new MemberAccountFlowEntity(); | 
|---|
|  |  |  | 
|---|
|  |  |  | record.setBalance(usdt.getAvailableBalance()); | 
|---|
|  |  |  | record.setMemberId(memId); | 
|---|
|  |  |  | record.setSymbol(coinsOrder.getSymbol()); | 
|---|
|  |  |  | record.setPrice(coinsOrder.getPrePaymentAmount()); | 
|---|
|  |  |  | record.setPrice(coinsOrder.getBondAmount()); | 
|---|
|  |  |  | memberAccountFlowEntityDao.insert(record); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void calYj(Long mid, BigDecimal money, ContractOrderEntity order, int type) { | 
|---|
|  |  |  | if (money != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | agent.setInviteId(entry.getKey()); | 
|---|
|  |  |  | agentReturnDao.insert(agent); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|