From a8f659549cba623f0108d24ae66fc4c700e56da2 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Mon, 18 Nov 2019 19:02:02 +1200 Subject: [PATCH] =?UTF-8?q?Upd:=E4=BA=A4=E6=98=93=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=9D=A1=E4=BB=B6-=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=97=A0=E8=BF=9B=E8=A1=8C=E6=97=B6=E5=8C=BA=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/appclient/beans/AppQueryBean.java | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 92e9ca0c3..d19b81d7a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.85 + 1.2.86 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java index c6ca197eb..560b13ea4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java @@ -42,16 +42,20 @@ public class AppQueryBean { public JSONObject toParams() { JSONObject params = new JSONObject(); if (begin != null) { - DateTime fromDate = DateTime.parse(begin, DateTimeFormat.forPattern("yyyyMMdd")) - .withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone)?timezone:"Australia/Melbourne"))).withZone(DateTimeZone.getDefault()); - params.put("begin", fromDate.toDate()); - params.put("from", fromDate.toDate()); + try { + params.put("begin", format.parse(begin)); + params.put("from", format.parse(begin)); + } catch (ParseException e) { + throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format"); + } } if (end != null) { - DateTime toDate = DateTime.parse(end, DateTimeFormat.forPattern("yyyyMMdd")) - .withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone)?timezone:"Australia/Melbourne"))).withZone(DateTimeZone.getDefault()); - params.put("end", DateUtils.addDays(toDate.toDate(), 1)); - params.put("to", DateUtils.addDays(toDate.toDate(), 1)); + try { + params.put("end", DateUtils.addDays(format.parse(end), 1)); + params.put("to", DateUtils.addDays(format.parse(end), 1)); + } catch (ParseException e) { + throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format"); + } } if (gateway != null && gateway.length > 0) { List tradeTypes = new ArrayList<>();