From 825b41a8d2c319585a115867feb54251eb34ae84 Mon Sep 17 00:00:00 2001 From: yangkai Date: Mon, 24 Sep 2018 00:25:14 +1000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=BC=B9=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"); } From ed1b811eb8e5f589ac95947cd4653fbeb31e31a0 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Sun, 23 Sep 2018 22:43:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B8=85=E7=AE=97=E9=A2=84=E4=BC=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/analysis/core/PlatformClearService.java | 2 ++ .../core/impls/PlatformClearAnalysisServiceImpl.java | 11 +++++++++-- .../payment/manage/task/SettleEstimateTaskManger.java | 2 +- .../manage/mappers/log/PlatformSettlementMapper.xml | 6 +++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java index a6444e4af..21049cd1f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PlatformClearService.java @@ -14,5 +14,7 @@ public interface PlatformClearService { void generateSettleLogs(); + void generateAliPaySettleLogs(); + void doVerifyHFSettleLog(JSONObject param); } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java index 9e9064a3e..83a03f191 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java @@ -127,6 +127,13 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { generateAlipayOnlineSettleLogs(); } + @Override + @Transactional + public void generateAliPaySettleLogs() { + generateAlipaySettleLogs(); + generateAlipayOnlineSettleLogs(); + } + @Transactional public void generateWechatSettleLogs() { try { @@ -138,7 +145,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { } } - public void generateAlipaySettleLogs() { + private void generateAlipaySettleLogs() { try { List dateList = TimeZoneUtils.getStatetime(); for (Date dateStr : dateList) { @@ -154,7 +161,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { } - public void generateAlipayOnlineSettleLogs() { + private void generateAlipayOnlineSettleLogs() { try { List dateList = TimeZoneUtils.getStatetime(); for (Date dateStr : dateList) { diff --git a/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java b/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java index d7d38327a..d1b69b508 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/SettleEstimateTaskManger.java @@ -42,6 +42,6 @@ public class SettleEstimateTaskManger { @Scheduled(cron = "0 0 10 * * ?") public void generateSettleLogs2() { - synchronizedScheduler.executeProcess("manage_task:genSettleLogappli2", 120_000, () -> platformClearService.generateSettleLogs()); + synchronizedScheduler.executeProcess("manage_task:generateAliPaySettleLog", 120_000, () -> platformClearService.generateAliPaySettleLogs()); } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml index c65eaf3dc..98529f116 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.xml @@ -18,7 +18,7 @@ FROM pmt_transactions WHERE - channel = #{channel} + order_channel = #{channel} AND transaction_type = #{transaction_type} AND transaction_time >= #{start_date} AND #{end_date} > transaction_time @@ -33,7 +33,7 @@ ELSE 0 END), 0.00) ali_charge_amount FROM pmt_transactions - WHERE channel = #{channel} + WHERE order_channel = #{channel} AND transaction_time >= #{start_date} AND #{end_date} > transaction_time AND system_generate = 0 @@ -47,7 +47,7 @@ FROM pmt_transactions WHERE - channel = #{channel} + order_channel = #{channel} AND transaction_type = #{transaction_type} AND transaction_time >= #{start_date} AND #{end_date} > transaction_time