From 108557b00c85b05418120e1f0eafbc321cae953e Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Wed, 31 Oct 2018 14:07:49 +0800 Subject: [PATCH] =?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 --- .../impls/EstimateAnalysisServiceImpl.java | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java index 9521c1680..c12c98bcb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java @@ -167,42 +167,6 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService { dayInfo.put("t1", 0); } - List hfSettle = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "hf"); - if (hfSettle !=null && hfSettle.size()>0) { - for (JSONObject logs : hfSettle) { - dayInfo.put("hfSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); - dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("hfSettleFee_" + logs.getString("merchants"))); - } - }else { - dayInfo.put("platformGetSettleFee",BigDecimal.ZERO); - } - - List alipaySettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "Alipay"); - for (JSONObject logs : alipaySettleLogs) { - dayInfo.put("aliSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); - dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliSettleFee_" + logs.getString("merchants")))); - } - - List alipayOnlineSettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "AlipayOnline"); - logger.info(" Estimate alipayOnlineSettleLogs is :{}", alipayOnlineSettleLogs.toString()); - for (JSONObject logs : alipayOnlineSettleLogs) { - dayInfo.put("aliOnlineSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); - dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliOnlineSettleFee_" + logs.getString("merchants")))); - } - cleanDays.clear(); - - //T2 - maxDays = estimateAnalysisMapper.findLastCleanDays(end_date, 1); - end_date = maxDays.getString("date_str"); - cleanDays = estimateAnalysisMapper.findLastCleanDays(start_date, 1); - start_date = cleanDays.getString("date_str"); - JSONObject totalAmountT2 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t2client); - if (totalAmountT2 != null) { - dayInfo.put("t2", totalAmountT2.getBigDecimal("total_amount")); - } else { - dayInfo.put("t2", 0); - } - List tencentSettle = platformSettlementMapper.findBySettleDate(new Date(maxDays.getDate("date_str").getTime() - 86400000L), "Wechat"); if (tencentSettle != null && tencentSettle.size()>0) { for (JSONObject logs : tencentSettle) { @@ -239,6 +203,42 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService { } + List hfSettle = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "hf"); + if (hfSettle !=null && hfSettle.size()>0) { + for (JSONObject logs : hfSettle) { + dayInfo.put("hfSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); + dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("hfSettleFee_" + logs.getString("merchants"))); + } + }else { + dayInfo.put("platformGetSettleFee",BigDecimal.ZERO); + } + + List alipaySettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "Alipay"); + for (JSONObject logs : alipaySettleLogs) { + dayInfo.put("aliSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); + dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliSettleFee_" + logs.getString("merchants")))); + } + + List alipayOnlineSettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "AlipayOnline"); + logger.info(" Estimate alipayOnlineSettleLogs is :{}", alipayOnlineSettleLogs.toString()); + for (JSONObject logs : alipayOnlineSettleLogs) { + dayInfo.put("aliOnlineSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); + dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliOnlineSettleFee_" + logs.getString("merchants")))); + } + cleanDays.clear(); + + //T2 + maxDays = estimateAnalysisMapper.findLastCleanDays(end_date, 1); + end_date = maxDays.getString("date_str"); + cleanDays = estimateAnalysisMapper.findLastCleanDays(start_date, 1); + start_date = cleanDays.getString("date_str"); + JSONObject totalAmountT2 = estimateAnalysisMapper.findAllTransactionByDate(start_date, end_date, t2client); + if (totalAmountT2 != null) { + dayInfo.put("t2", totalAmountT2.getBigDecimal("total_amount")); + } else { + dayInfo.put("t2", 0); + } + //T3 maxDays = estimateAnalysisMapper.findLastCleanDays(end_date, 1); end_date = maxDays.getString("date_str");