From cf20ef1ff618c2477bdb1e44d9a5ae4352fbedae Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 9 Oct 2020 18:11:58 +1100 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E6=B8=85=E7=AE=97=E6=9F=A5=E8=AF=A2=E6=9F=A5=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E5=BD=93=E5=A4=A9=E6=B8=85=E7=AE=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/PartnerCardDashboardService.java | 14 +++---- .../impls/PartnerCardDashboardServiceImp.java | 40 +++++++++---------- .../core/impls/RetailAppServiceImp.java | 12 ++---- .../clearing/core/impl/CleanServiceImpl.java | 3 +- .../core/impls/TradeLogServiceImpl.java | 3 +- 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java index 7a2b14833..ce02b7b9f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/PartnerCardDashboardService.java @@ -8,17 +8,17 @@ import java.util.List; * Created by yishuqian on 20/02/2017. */ public interface PartnerCardDashboardService { - JSONObject getCommonAnalysis(String client_moniker); + JSONObject getCommonAnalysis(String clientMoniker); - JSONObject getTransactionAnalysis(String client_moniker); + JSONObject getTransactionAnalysis(String clientMoniker); - List getOrderCustomerChartAnalysis(String client_moniker); + List getOrderCustomerChartAnalysis(String clientMoniker); - List getTransTypesAnalysis(String client_moniker); + List getTransTypesAnalysis(String clientMoniker); - JSONObject getOrderAndCustomerPerDay(String client_moniker); + JSONObject getOrderAndCustomerPerDay(String clientMoniker); - List getTradeAnalysisInHours(String client_moniker); + List getTradeAnalysisInHours(String clientMoniker); - JSONObject getSettlementLog(String client_moniker, TradeLogQuery query); + JSONObject getSettlementLog(String clientMoniker, TradeLogQuery query); } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java index 03363b90b..99f6556e9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnerCardDashboardServiceImp.java @@ -25,6 +25,7 @@ import javax.annotation.Resource; import java.math.RoundingMode; import java.util.Date; import java.util.List; +import java.util.TimeZone; /** * Created by yishuqian on 20/02/2017. @@ -51,8 +52,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi private PaymentApi paymentApi; @Override - public JSONObject getCommonAnalysis(String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); + public JSONObject getCommonAnalysis(String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); client.putAll(clientConfigService.find(client.getIntValue("client_id"))); JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id")); Date data = new Date(); @@ -76,8 +77,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi } @Override - public JSONObject getTransactionAnalysis(String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); + public JSONObject getTransactionAnalysis(String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); Assert.notNull(client); JSONObject params = new JSONObject(); params.put("client_id", client.getIntValue("client_id")); @@ -85,8 +86,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi } @Override - public List getOrderCustomerChartAnalysis(String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); + public List getOrderCustomerChartAnalysis(String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); Assert.notNull(client); JSONObject params = new JSONObject(); params.put("client_id", client.getIntValue("client_id")); @@ -94,8 +95,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi } @Override - public List getTransTypesAnalysis(String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); + public List getTransTypesAnalysis(String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); Assert.notNull(client); JSONObject params = new JSONObject(); params.put("client_id", client.getIntValue("client_id")); @@ -103,8 +104,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi } @Override - public JSONObject getOrderAndCustomerPerDay(String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); + public JSONObject getOrderAndCustomerPerDay(String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); Assert.notNull(client); JSONObject params = new JSONObject(); params.put("client_id", client.getIntValue("client_id")); @@ -112,8 +113,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi } @Override - public List getTradeAnalysisInHours(String client_moniker) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); + public List getTradeAnalysisInHours(String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); Assert.notNull(client); JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id")); String timezone = client.getString("timezone"); @@ -128,18 +129,17 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi } @Override - public JSONObject getSettlementLog(String client_moniker, TradeLogQuery query) { - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); - Assert.notNull(client); - int client_id = client.getIntValue("client_id"); - String timezone = client.getString("timezone"); - JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client_id); + public JSONObject getSettlementLog(String clientMoniker, TradeLogQuery query) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); + Assert.notNull(client,"client not found:"+clientMoniker); + int clientId = client.getIntValue("client_id"); + JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(clientId); if (earlistOrder != null) { query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd")); } query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd")); - JSONObject params = query.toParams(timezone); - params.put("client_id", client_id); + JSONObject params = query.toParams(TimeZone.getDefault().getID()); + params.put("client_id", clientId); PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); JSONObject result = PageListUtils.buildPageListResult(logs); if (query.getPage() == 1) { diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index aec5a8be4..3e9c842ab 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -842,15 +842,11 @@ public class RetailAppServiceImp implements RetailAppService { public JSONObject getClientSettlementLog(JSONObject device, AppQueryBean appQueryBean) { String clientType = device.getString("client_type"); deviceSupport.findRegister(clientType); - int client_id = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(client_id); - String timezone = client.getString("timezone"); - if (timezone != null && !timezone.isEmpty()) { - appQueryBean.setTimezone(timezone); - } + int clientId = device.getIntValue("client_id"); + appQueryBean.setTimezone(TimeZone.getDefault().getID()); JSONObject params = appQueryBean.toParams(); - setAllClientIds(params, client_id); - params.put("client_id", client_id); + setAllClientIds(params, clientId); + params.put("client_id", clientId); PageList logs = clearingDetailMapper.listClientSettlementLog(params, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc"))); logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount")))); diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 7b899fe9e..8c9e43c1f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -1375,8 +1375,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider } PageList logs = clearingDetailMapper.listReportsOfSettlementLogs(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("report_date.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); - return result; + return PageListUtils.buildPageListResult(logs); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index fda25eebf..25761287b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -1413,8 +1413,7 @@ public class TradeLogServiceImpl implements TradeLogService { public JSONObject listSettlementLog(TradeLogQuery query, JSONObject partner) { JSONObject client = clientManager.getClientInfoByMoniker(partner.getString("client_moniker")); int clientId = partner.getIntValue("client_id"); - String timezone = partner.getJSONObject("client").getString("timezone"); - JSONObject params = query.toParams(timezone); + JSONObject params = query.toParams(TimeZone.getDefault().getID()); params.put("client_id", clientId); clientManager.queryModifyClientIds(clientId, params); JSONObject result = new JSONObject();