From 825b41a8d2c319585a115867feb54251eb34ae84 Mon Sep 17 00:00:00 2001 From: yangkai Date: Mon, 24 Sep 2018 00:25:14 +1000 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=8C=E6=88=90=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impls/CustomerPointsServiceImp.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java index 3cd2e8dad..750b48835 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java @@ -23,6 +23,8 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; @@ -284,7 +286,18 @@ public class CustomerPointsServiceImp implements CustomerPointsService { public BigDecimal checkLotteryAfterPay(String order_id) { JSONObject order = transactionAnalysisMapper.getOrderClearAmount(order_id); if (order.getIntValue("client_id") != 9) { - return BigDecimal.valueOf(0); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + Date newDay = new Date(); + try { + if (newDay.compareTo(sdf.parse("2018-09-24 00:00:00")) < 0) { + return BigDecimal.valueOf(0); + } + if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) { + return BigDecimal.valueOf(0); + } + } catch (ParseException e) { + + } } return order.getBigDecimal("clearing_amount"); }