Commit 3ffec630 by 陶光胜

配置表

parent 17a55781
......@@ -33,6 +33,8 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -210,8 +212,13 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
String[] split = s.split("-");
if(split.length == 2){
JSONObject json = new JSONObject();
json.put("start", split[0]);
json.put("end", split[1]);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
json.put("start", sdf.parse(split[0]));
json.put("end", sdf.parse(split[1]));
} catch (ParseException e) {
log.warn("日期转换异常:", e);
}
criteria = new Criteria(k, MongoOperTypeEnum.BETWEEN, json);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment