src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java
@@ -34,8 +34,8 @@ public static String ETH_FEE = "0.005"; public static final String TOTAL_ADDRESS = "0x067b4bE5d7B05560AE539Fc8f10597D854ae056D"; public static final String TOTAL_PRIVATE = "1fb7288c8c88c37d6f79e9617822bffc8d3635bf2d808c5f6afdee9bb326e49c"; public static final String TOTAL_ADDRESS = "0x8115A796327311e627050d0129C17176A79Dc050"; public static final String TOTAL_PRIVATE = "bba4029d67e26ec6b537db986c8500b5bc1c21b53755dd7a3d41d9a4ce84c05e"; @Resource private MemberCoinChargeDao memberCoinChargeDao; src/main/java/com/xcong/excoin/modules/coin/service/OrderCoinService.java
@@ -51,8 +51,6 @@ public void handleOrder(List<ExchangeTrade> trades); void initOrders(String symbol, Integer type, Integer tradeType, BigDecimal price, BigDecimal amount,BigDecimal entrustAmount); /** * 撮合交易单的撤销方法 src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java
@@ -1043,67 +1043,4 @@ } } @Override public void initOrders(String symbol, Integer type, Integer tradeType, BigDecimal price, BigDecimal amount, BigDecimal entrustAmount) { //获取用户ID Long memberId = 10L; BigDecimal nowPriceinBigDecimal = price; //查询当前价 //BigDecimal nowPrice = new BigDecimal(redisUtils.getString(CoinTypeConvert.convertToKey(symbol + "/USDT"))); // 获取交易管理的杠杠倍率,手续费率等信息,由平台进行设置 symbol = symbol.toUpperCase(); // 手续费用(手续费=建仓价X数量X手续费率) BigDecimal closingPrice = BigDecimal.ZERO; // BigDecimal totalPayPricCoin = nowPrice.multiply(amount).add(closingPrice); // 首先将单插入到数据库主表(委托表) // 创建订单 OrderCoinsEntity order = new OrderCoinsEntity(); //根据委托类型生成不同数据 // 如果是限价交易直接插入主表数据 order.setMemberId(memberId); order.setOrderNo(generateSimpleSerialno(memberId.toString())); order.setOrderType(type); order.setSymbol(symbol); //order.setMarkPrice(nowPrice); // 成交量 先设置为0 order.setDealCnt(BigDecimal.ZERO); // 成交价 //order.setDealPrice(price); // 成交金额 order.setDealAmount(BigDecimal.ZERO); order.setOrderStatus(OrderCoinsEntity.ORDERSTATUS_DODING); order.setTradeType(tradeType); // 手续费 order.setFeeAmount(closingPrice); if (OrderCoinsEntity.TRADETYPE_FIXEDPRICE.equals(tradeType)) { // 限价 是需要价格和数量 可以得到成交金额 // 下单量 order.setEntrustCnt(amount); // 下单价格 order.setEntrustPrice(price); order.setEntrustAmount(amount.multiply(price)); } else { if (OrderCoinsEntity.ORDERTYPE_BUY.equals(type)) { // 市价 只有金额 order.setEntrustAmount(entrustAmount); } else { // 下单量 order.setEntrustCnt(amount); // 下单价格 order.setEntrustPrice(price); order.setEntrustAmount(amount.multiply(price)); } } orderCoinsDao.insert(order); // 加入到撮合 CoinTrader trader = factory.getTrader(symbol); trader.trade(order); } } src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
@@ -177,6 +177,9 @@ break; } parentId = parentMember.getRefererId(); if(StringUtils.isBlank(parentId)){ break; } if (parentMember.getRefererId().equals(parentMember.getInviteId())) { flag = true; } src/main/java/com/xcong/excoin/processor/DefaultCoinProcessor.java
@@ -362,7 +362,7 @@ // 存储昨日K线 if("day".equals(rangeUnit)){ redisUtils.set("ROC/USDT",kLine); redisUtils.set("CPV/USDT",kLine); } } src/main/java/com/xcong/excoin/quartz/job/KLineGeneratorJob.java
@@ -23,27 +23,6 @@ @Resource private CoinProcessorFactory processorFactory; @Resource private OrderCoinService orderCoinService; //@Scheduled(cron = "0/40 * * * * *") public void test(){ Random random = new Random(); Integer type = OrderCoinsDealEntity.ORDERTYPE_BUY; Integer tradeType = OrderCoinsDealEntity.TRADETYPE_FIXEDPRICE; double random1 = Math.random(); BigDecimal price = new BigDecimal(random1).setScale(4, RoundingMode.HALF_UP).multiply(new BigDecimal("2")); if(price.compareTo(BigDecimal.ZERO)==0){ price = BigDecimal.ONE; } System.out.println(price); orderCoinService.initOrders("ROC",type,tradeType,price,new BigDecimal(2),null); orderCoinService.initOrders("ROC",OrderCoinsDealEntity.ORDERTYPE_SELL,tradeType,price,new BigDecimal(2),null); } /** * 每分钟定时器,处理分钟K线 */ src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java
@@ -27,7 +27,7 @@ /** * usdt 归集 */ // @Scheduled(cron = "0 5/30 * * * ? ") @Scheduled(cron = "0 5/30 * * * ? ") public void poolUsdtEth() { try { log.info("USDT归集开始"); @@ -38,13 +38,13 @@ } } //@Scheduled(cron = "0 2/8 * * * ? ") @Scheduled(cron = "0 2/8 * * * ? ") public void usdtEthPoolCheck() { log.info("USDTETH归集结果扫描开始"); usdtEthService.usdtEthPoolCheck(); } //@Scheduled(cron = "0 2/30 * * * ? ") @Scheduled(cron = "0 2/30 * * * ? ") public void poolEth() { try { usdtEthService.ethPool();