|
|
|
@ -4,6 +4,7 @@ import au.com.royalpay.payment.core.beans.OrderStatus;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
|
|
|
|
import au.com.royalpay.payment.core.beans.PayChannel;
|
|
|
|
|
import au.com.royalpay.payment.tools.defines.TradeType;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
|
|
|
|
|
@ -34,21 +35,18 @@ public class AppQueryBean {
|
|
|
|
|
|
|
|
|
|
public JSONObject toParams() {
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
if (timezone != null) {
|
|
|
|
|
format.setTimeZone(TimeZone.getTimeZone(timezone));
|
|
|
|
|
}
|
|
|
|
|
if (begin != null) {
|
|
|
|
|
try {
|
|
|
|
|
params.put("begin", format.parse(begin));
|
|
|
|
|
params.put("from", format.parse(begin));
|
|
|
|
|
params.put("begin", TimeZoneUtils.formatTime(format.parse(begin),"yyyy-MM-dd HH:mm:ss",timezone!=null?timezone:""));
|
|
|
|
|
params.put("from", TimeZoneUtils.formatTime(format.parse(begin),"yyyy-MM-dd HH:mm:ss",timezone!=null?timezone:""));
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (end != null) {
|
|
|
|
|
try {
|
|
|
|
|
params.put("end", DateUtils.addDays(format.parse(end), 1));
|
|
|
|
|
params.put("to", DateUtils.addDays(format.parse(end), 1));
|
|
|
|
|
params.put("end", TimeZoneUtils.formatTime(DateUtils.addDays(format.parse(end), 1),"yyyy-MM-dd HH:mm:ss",timezone!=null?timezone:""));
|
|
|
|
|
params.put("to", TimeZoneUtils.formatTime(DateUtils.addDays(format.parse(end), 1),"yyyy-MM-dd HH:mm:ss",timezone!=null?timezone:""));
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format");
|
|
|
|
|
}
|
|
|
|
|