From c5ac51a5525b261127845a38a1fec5a86c860441 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 14 May 2021 20:00:10 +0800 Subject: [PATCH] Merge branch 'yunding' of http://120.27.238.55:7000/r/exchange into yunding --- src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java b/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java index 42e0959..12d3ea6 100644 --- a/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/YunDingServiceImpl.java @@ -109,7 +109,7 @@ for(YdProductVo ydProductVo : records){ ydProductVo.setProfitT(prifitT); - if(ydProductVo.getTotalT().compareTo(BigDecimal.ZERO) < 1) { + if(ydProductVo.getSurplusT().compareTo(BigDecimal.ZERO) < 1) { ydProductVo.setStatus(2); } } @@ -148,10 +148,8 @@ Date endTime = DateUtil.offsetDay(workTime, proCycle); ydProductVo.setEndTime(endTime); - if (ydProductVo.getTotalT().compareTo(BigDecimal.ZERO) < 1) { + if (ydProductVo.getSurplusT().compareTo(BigDecimal.ZERO) < 1) { ydProductVo.setStatus(2); - } else { - ydProductVo.setStatus(1); } return Result.ok(ydProductVo); } @@ -231,12 +229,14 @@ quantityOwn = quantityOwn + ydOrderEntity.getQuantity(); } } - if(quantityOwn >= limitedNum){ + int quantityInt = quantity.intValue(); + if(quantityOwn + quantityInt > limitedNum){ return Result.fail("产品限购"+limitedNum); } - if (quantity.compareTo(BigDecimal.valueOf(ydProductEntity.getLimitedNum())) < 1) { - return Result.fail("产品限购" + ydProductEntity.getLimitedNum()); - } + +// if (quantity.compareTo(BigDecimal.valueOf(ydProductEntity.getLimitedNum())) < 1) { +// return Result.fail("产品限购" + ydProductEntity.getLimitedNum()); +// } BigDecimal salePrice = ydProductEntity.getSalePrice(); //剩余产品数量 BigDecimal surplusT = ydProductEntity.getSurplusT(); @@ -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("购买成功"); } @@ -593,8 +591,12 @@ @Override public Result getXchPrice() { log.info("获取XCH当前价"); + BigDecimal xchNewPrices = BigDecimal.ZERO; String xchNewPrice = redisUtils.getString("XCH_NEW_PRICE"); - return Result.ok(xchNewPrice); + if(StrUtil.isNotEmpty(xchNewPrice)){ + xchNewPrices = new BigDecimal(xchNewPrice); + } + return Result.ok(xchNewPrices); } -- Gitblit v1.9.1