Helius
2020-10-14 c794a77a28e6685528e7c29abe745c4ef42ee5f6
modify
1 files modified
58 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java 58 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java
@@ -350,35 +350,35 @@
        }
        // 需要先
        String phone = memberEntity.getPhone();
        if (!"13632989240".equals(phone) && !"15158130575".equals(phone)) {
            if (OrderCoinsEntity.ORDERTYPE_BUY.equals(type)) {
                // 不能超过800个
//                if (amount != null && amount.compareTo(new BigDecimal("800")) > 0) {
//                    return Result.fail("买入额度受限");
//                }
//                BigDecimal bigDecimal = orderCoinDealDao.sumTodayBuyAmount(memberId, symbol);
//                if (bigDecimal == null) {
//                    bigDecimal = BigDecimal.ZERO;
//                }
//                amount = amount == null ? BigDecimal.ZERO : amount;
//                bigDecimal = bigDecimal.add(amount);
//                if (bigDecimal != null && bigDecimal.compareTo(new BigDecimal("800")) > 0) {
//                    return Result.fail("买入额度受限");
//                }
//                // 挂单不能超过800
//                BigDecimal bigDecimal1 = orderCoinDealDao.sumTodayEntrustCntBuyAmount(memberId, symbol);
//                if (bigDecimal1 == null) {
//                    bigDecimal1 = BigDecimal.ZERO;
//                }
//                bigDecimal1 = bigDecimal1.add(amount);
//                if (bigDecimal1 != null && bigDecimal1.compareTo(new BigDecimal("800")) > 0) {
//                    return Result.fail("买入额度受限");
//                }
            } else {
               return Result.fail("卖出受限");
            }
        }
//        if (!"13632989240".equals(phone) && !"15158130575".equals(phone)) {
//            if (OrderCoinsEntity.ORDERTYPE_BUY.equals(type)) {
//                // 不能超过800个
//
////                if (amount != null && amount.compareTo(new BigDecimal("800")) > 0) {
////                    return Result.fail("买入额度受限");
////                }
////                BigDecimal bigDecimal = orderCoinDealDao.sumTodayBuyAmount(memberId, symbol);
////                if (bigDecimal == null) {
////                    bigDecimal = BigDecimal.ZERO;
////                }
////                amount = amount == null ? BigDecimal.ZERO : amount;
////                bigDecimal = bigDecimal.add(amount);
////                if (bigDecimal != null && bigDecimal.compareTo(new BigDecimal("800")) > 0) {
////                    return Result.fail("买入额度受限");
////                }
////                // 挂单不能超过800
////                BigDecimal bigDecimal1 = orderCoinDealDao.sumTodayEntrustCntBuyAmount(memberId, symbol);
////                if (bigDecimal1 == null) {
////                    bigDecimal1 = BigDecimal.ZERO;
////                }
////                bigDecimal1 = bigDecimal1.add(amount);
////                if (bigDecimal1 != null && bigDecimal1.compareTo(new BigDecimal("800")) > 0) {
////                    return Result.fail("买入额度受限");
////                }
//            } else {
//               return Result.fail("卖出受限");
//            }
//        }
        BigDecimal nowPriceinBigDecimal = price;
        //查询当前价