|
|
|
@ -8,6 +8,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.TimeZone;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by yixian on 2016-10-18.
|
|
|
|
@ -21,17 +23,20 @@ public class ConfigOperationQueryBean {
|
|
|
|
|
private String client_moniker;
|
|
|
|
|
|
|
|
|
|
public JSONObject toJSON() {
|
|
|
|
|
SimpleDateFormat utcFormater = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
utcFormater.setTimeZone(TimeZone.getTimeZone("UTC"));//时区定义并进行时间获取
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
if (begin != null) {
|
|
|
|
|
try {
|
|
|
|
|
res.put("begin", DateUtils.parseDate(begin, pattern));
|
|
|
|
|
|
|
|
|
|
res.put("begin", utcFormater.parse(begin));
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new ParamInvalidException("begin", "error.payment.valid.invalid_time");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (end != null) {
|
|
|
|
|
try {
|
|
|
|
|
res.put("end", DateUtils.parseDate(end, pattern));
|
|
|
|
|
res.put("end", DateUtils.addDays(utcFormater.parse(end),1));
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new ParamInvalidException("end", "error.payment.valid.invalid_time");
|
|
|
|
|
}
|
|
|
|
|