|
|
|
@ -42,20 +42,20 @@ public class AppQueryBean {
|
|
|
|
|
public JSONObject toParams() {
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
if (begin != null) {
|
|
|
|
|
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");
|
|
|
|
|
}
|
|
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
if (end != null) {
|
|
|
|
|
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");
|
|
|
|
|
}
|
|
|
|
|
/* DateTime toDate = DateTime.parse(end, DateTimeFormat.forPattern("yyyyMMdd")).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timezone))).plusDays(1).withZone(DateTimeZone.getDefault());
|
|
|
|
|
params.put("end", toDate.toDate());
|
|
|
|
|
params.put("to", toDate.toDate());*/
|
|
|
|
|
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));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (gateway != null && gateway.length > 0) {
|
|
|
|
|
List<Integer> tradeTypes = new ArrayList<>();
|
|
|
|
|