Commit 9fe36b3b by goul

fix:修改数据爬取范围 添加爬取测试接口

parent 8e5fb8c2
...@@ -55,6 +55,8 @@ public class CrawlData { ...@@ -55,6 +55,8 @@ public class CrawlData {
data1.put("high_counrt_city_name", "宁波"); data1.put("high_counrt_city_name", "宁波");
data1.put("counrt_name", "慈溪"); data1.put("counrt_name", "慈溪");
data1.put("case_no", "民"); data1.put("case_no", "民");
data1.put("odayDate1", CrawlDataXs.threeMonth());
data1.put("odayDate2", CrawlDataXs.nowDate());
crawlPage(URL_ALL,data1,1); crawlPage(URL_ALL,data1,1);
} }
...@@ -73,9 +75,10 @@ public class CrawlData { ...@@ -73,9 +75,10 @@ public class CrawlData {
//总页数 //总页数
int counts = Integer.parseInt(el.attr("value"))+1; int counts = Integer.parseInt(el.attr("value"))+1;
List<Map<String,Object>> list_map = business.excuteSql(" SELECT MAX(PAGE+0) AS PAGE FROM t_award_file WHERE FLAG = 1 AND TYPE = 1 AND PAGE IS NOT NULL ");
int counta = Integer.parseInt(list_map.get(0).get("PAGE").toString()); System.out.print("爬取的民事数据:"+el.getAllElements());
for(int i = counts;i>=counta;i--){ System.out.print("爬取的民事数据总页数:"+counts);
for(int i = 0;i<=counts;i++){
String str = DateTools.getServerDateTime(10).split(" ")[1]; String str = DateTools.getServerDateTime(10).split(" ")[1];
str = str.substring(0,5); str = str.substring(0,5);
if(PropUtil.getValue("DATA_TIME1", "quartz_service", "0").equals(str)){ if(PropUtil.getValue("DATA_TIME1", "quartz_service", "0").equals(str)){
......
...@@ -77,9 +77,8 @@ public class CrawlDataXs { ...@@ -77,9 +77,8 @@ public class CrawlDataXs {
//总页数 //总页数
int counts = Integer.parseInt(el.attr("value"))+1; int counts = Integer.parseInt(el.attr("value"))+1;
//List<Map<String,Object>> list_map = business.excuteSql(" SELECT MAX(PAGE+0) AS PAGE FROM t_award_file WHERE FLAG = 2 AND TYPE = 1 AND PAGE IS NOT NULL "); System.out.print("爬取的刑事数据:"+el.getAllElements());
//int counta = Integer.parseInt(list_map.get(0).get("PAGE").toString()); System.out.print("爬取的刑事数据总页数:"+counts);
//for(int i = counts;i>=counta;i--){
for(int i = 0;i<counts;i++){ for(int i = 0;i<counts;i++){
String str = DateTools.getServerDateTime(10).split(" ")[1]; String str = DateTools.getServerDateTime(10).split(" ")[1];
......
...@@ -27,6 +27,8 @@ import com.gaowj.util.ServiceUtil; ...@@ -27,6 +27,8 @@ import com.gaowj.util.ServiceUtil;
import com.gaowj.util.StringUtil; import com.gaowj.util.StringUtil;
import com.gaowj.util.getDDConfig; import com.gaowj.util.getDDConfig;
import com.jf.businessInfo.DataMBusiness; import com.jf.businessInfo.DataMBusiness;
import com.jf.common.CrawlData;
import com.jf.common.CrawlDataXs;
import com.jf.common.GetWord; import com.jf.common.GetWord;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
...@@ -366,8 +368,21 @@ public class AjaxLoginAction extends BasicAction { ...@@ -366,8 +368,21 @@ public class AjaxLoginAction extends BasicAction {
} }
public String test() throws Exception { public String test() throws Exception {
GetWord.matcherRuleLable("11", "C:\\Users\\VULCAN\\Desktop\\慈溪市检察院\\裁决书\\xs3.doc", "刑初","金a11罪" ,"2", "2"); Thread t1 = new Thread(){
//CrawlData.crawlData(); @Override
public void run() {
CrawlData.crawlData();
}
};
t1.start();
Thread t2 = new Thread(){
@Override
public void run() {
CrawlDataXs.crawlData_xs();
}
};
t2.start();
return "json"; return "json";
} }
...@@ -380,7 +395,7 @@ public class AjaxLoginAction extends BasicAction { ...@@ -380,7 +395,7 @@ public class AjaxLoginAction extends BasicAction {
//获取word内容 //获取word内容
public String test2() throws Exception { public String test2() throws Exception {
GetWord.getWordContent(2); GetWord.getWordContent(1);
return "json"; return "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