From 87584077f9a64ce9e3548b9a8f8b2aeea6b30eff Mon Sep 17 00:00:00 2001 From: Tayl0r <519104047@qq.com> Date: Thu, 22 Feb 2018 20:32:50 +0800 Subject: [PATCH] =?UTF-8?q?[Y]=20surcharge=E4=B8=BA=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformClearAnalysisServiceImpl.java | 21 +++++++++++++------ .../mappers/log/PlatformSettlementMapper.java | 2 +- .../mappers/log/PlatformSettlementMapper.xml | 4 ++-- 3 files changed, 18 insertions(+), 9 deletions(-) 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 f130f3606..79f8a3336 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 @@ -76,6 +76,13 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { logger.error("PlatformClearAnalysisServiceImpl.verifySettleLogByDate ==> 校验" + end_date + "支付宝到账失败:", e); } } + if (StringUtils.equals("AlipayOnline", channel)) { + try { + doVerifyAlipayOnlineSettleLog(sdfClear.parse(end_date)); + } catch (Exception e) { + logger.error("PlatformClearAnalysisServiceImpl.verifySettleLogByDate ==> 校验" + end_date + "支付宝Online到账失败:", e); + } + } if (StringUtils.equals("Wechat", channel)) { try { Map settleDate = new HashMap<>(); @@ -130,13 +137,13 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { List dateList = TimeZoneUtils.getStatetime(); for (Date dateStr : dateList) { try { - doVerifyAlipaySettleLog(dateStr); + doVerifyAlipayOnlineSettleLog(dateStr); } catch (Exception e) { - logger.error("获取" + dateStr + "Alipay清算记录失败", e); + logger.error("获取" + dateStr + "AlipayOnline清算记录失败", e); } } } catch (Exception e) { - logger.error("获取Alipay清算记录时间失败", e); + logger.error("获取AlipayOnline清算记录时间失败", e); } } @@ -321,9 +328,11 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { sysLogs.put("sys_refund_fee", debitLogs.getBigDecimal("aud_amount")); sysLogs.put("sys_net_fee", creditLogs.getBigDecimal("aud_amount").subtract(debitLogs.getBigDecimal("aud_amount"))); - if(StringUtils.equals("Alipay",channel)){ - sysLogs.put("sys_surcharge",platformSettlementMapper.calculateRmbCharge(start_date, end_date, channel)); - }else { + if (StringUtils.equals("Alipay", channel)) { + sysLogs.put("sys_surcharge", platformSettlementMapper.calculateRmbCharge(start_date, end_date, channel, new BigDecimal(0.006))); + } else if (StringUtils.equals("AlipayOnline", channel)) { + sysLogs.put("sys_surcharge", platformSettlementMapper.calculateRmbCharge(start_date, end_date, channel, new BigDecimal(0.018))); + } else { sysLogs.put("sys_surcharge", creditLogs.getBigDecimal("charge_amount").subtract(debitLogs.getBigDecimal("charge_amount"))); } sysLogs.put("sys_settle_fee", sysLogs.getBigDecimal("sys_net_fee").subtract(sysLogs.getBigDecimal("sys_surcharge"))); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java index 0b87546ba..75120ceb8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/PlatformSettlementMapper.java @@ -36,7 +36,7 @@ public interface PlatformSettlementMapper { JSONObject calculateSysSettleLog5(@Param("start_date") String start_date, @Param("end_date") String end_date, @Param("channel") String channel, @Param("transaction_type") String type); - BigDecimal calculateRmbCharge(@Param("start_date") String start_date, @Param("end_date") String end_date, @Param("channel") String channel); + BigDecimal calculateRmbCharge(@Param("start_date") String start_date, @Param("end_date") String end_date, @Param("channel") String channel,@Param("ali_rate") BigDecimal ali_rate); @AutoSql(type = SqlType.DELETE) void delete(JSONObject params); 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 77bc52413..c65eaf3dc 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 @@ -28,8 +28,8 @@