for (int j = 0; j < jsonStr.length(); j++) {
JSONObject obj = jsonStr.getJSONObject(j);
if (obj.has("thedate")) {
JSONObject thedate = obj.getJSONObject("thedate");
Integer operate = Integer.parseInt(thedate.get("operate").toString());
OperateType optype=WebServiceParams.parseOperateType(operate);
String[] val = WebServiceParams.parseFqValue(thedate.getString("value"), operate).split(",");
if (optype.equals(OperateType.eq)||optype.equals(OperateType.in))
{
for (String day : val) {
Date d = fmt.parse(day.replaceAll("-", ""));
String[] partions = get(d.getTime(), d.getTime(), parttype);
for (String partion : partions) {
rtn.add(partion);
isset = true;
}
}
}
if (optype.equals(OperateType.range))// =,range
{
Long min = Long.MAX_VALUE;
Long max = Long.MIN_VALUE;
for (String day : val) {
Date d = fmt.parse(day.replaceAll("-", ""));
Long time = d.getTime();
max = Math.max(max, time);
min = Math.min(min, time);
isset = true;
}
String[] partions = get(min, max, parttype);
for (String partion : partions) {
rtn.add(partion);
}
break;
}
if (optype.equals(OperateType.gt)||optype.equals(OperateType.gteq))
{
for (String day : val) {
Date d = fmt.parse(day.replaceAll("-", ""));
Long time = d.getTime() + (operate == 3 ? 0 : 1);
small = small > 0 ? Math.min(small, time) : time;
}
}
if (optype.equals(OperateType.lg)||optype.equals(OperateType.lgeq))
{
for (String day : val) {
Date d = fmt.parse(day.replaceAll("-", ""));
Long time = d.getTime() - (operate == 4 ? 0 : 1);
bigger = bigger > 0 ? Math.max(bigger, time) : time;