From 2805f06505382902e9765b743aa0bd75e40497b1 Mon Sep 17 00:00:00 2001 From: tamguo Date: Mon, 10 Sep 2018 14:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=95=E5=8D=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/com/tamguo/PaperCrawler.java | 4 +- .../com/tamguo/web/tiku/PaperController.java | 6 +- .../resources/templates/mobile/paperlist.html | 723 +++++++++++++++--- .../resources/templates/mobile/subject.html | 6 +- 4 files changed, 642 insertions(+), 97 deletions(-) diff --git a/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java b/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java index 243906a..39aff5a 100644 --- a/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java +++ b/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java @@ -34,13 +34,13 @@ public class PaperCrawler { // 140000 山西 | 350000 福建 | 340000 安徽 | 220000 吉林 | 150000 内蒙古 | 640000 宁夏 | 650000 新疆 | 广西 450000 | 210000 辽宁 // 230000 黑龙江 | 610000 陕西 | 360000 江西 | 440000 广东 | 430000 湖南 | 460000 海南 | 530000 云南 | 510000 四川 | 630000 青海 // 620000 甘肃 | 130000 河北 | 540000 西藏 | 贵州 520000 - private final String AREA_ID = "110000"; + private final String AREA_ID = "310000"; // 年份 private final String YEAR = "2016"; // 真题试卷 类型(1:真题试卷,2:模拟试卷,3:押题预测,4:名校精品) private final String PAPER_TYPE = "4"; // 开始采集的URL - private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-17-7-2016-37-1-download"; + private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-17-7-2016-93-1-download"; private RunData runData; diff --git a/tamguo-tms/src/main/java/com/tamguo/web/tiku/PaperController.java b/tamguo-tms/src/main/java/com/tamguo/web/tiku/PaperController.java index c679417..05ce03a 100644 --- a/tamguo-tms/src/main/java/com/tamguo/web/tiku/PaperController.java +++ b/tamguo-tms/src/main/java/com/tamguo/web/tiku/PaperController.java @@ -57,7 +57,8 @@ public class PaperController { // request url logger.info("request url :{}" , request.getRequestURI()); CourseEntity course = iCourseService.selectById(courseId); - List courseList = iCourseService.selectList(Condition.create().eq("subject_id", subjectId)); + SysAreaEntity currArea = iSysAreaService.selectById(area); + List courseList = iCourseService.selectList(Condition.create().eq("subject_id", subjectId).orderBy("sort", true)); SubjectEntity subject = iSubjectService.selectById(subjectId); List areaList = iSysAreaService.selectList(Condition.create().eq("tree_level", "0")); @@ -79,7 +80,7 @@ public class PaperController { condition.eq("area_id", area); } PageUtils result = PageUtils.getPage(iPaperService.selectPage(page , condition)); - if(courseList.size() > 0) { + if(courseList.size() > 0 && course == null) { course = courseList.get(0); } Integer total = iPaperService.selectCount(Condition.EMPTY); @@ -93,6 +94,7 @@ public class PaperController { model.addObject("paperType", paperType); model.addObject("year", year); model.addObject("area", area); + model.addObject("currArea", currArea); if(BrowserUtils.isMobile(request.getHeader("user-agent"))) { diff --git a/tamguo-tms/src/main/resources/templates/mobile/paperlist.html b/tamguo-tms/src/main/resources/templates/mobile/paperlist.html index 5bfee08..b39807d 100644 --- a/tamguo-tms/src/main/resources/templates/mobile/paperlist.html +++ b/tamguo-tms/src/main/resources/templates/mobile/paperlist.html @@ -1,106 +1,640 @@ - + - - - - - - - - - + + - + - - - + + + + + + + -
-
-
- 关于 - -

-
- -
-
-
试卷
- +
+
+ + +
+
+
+ +
+ 探果网 + +
+ +
+ + + + +
+ +
+
+

科目

+

+ +
+
+

类型

+

真题试卷

+

模拟试卷

+

押题预测

+

名校经典

+ +
+
+

地区

+

地区

+ +
+
+

年份

+ +
+
+ + + +
+ 排序 +
+ +
+
  • + + +
    +
    + 年份年份 +
    + 查看解析 +
    +
  • +
    + +
    -
    -
    - + + \ No newline at end of file diff --git a/tamguo-tms/src/main/resources/templates/mobile/subject.html b/tamguo-tms/src/main/resources/templates/mobile/subject.html index d455bd0..6f3c78b 100644 --- a/tamguo-tms/src/main/resources/templates/mobile/subject.html +++ b/tamguo-tms/src/main/resources/templates/mobile/subject.html @@ -63,7 +63,7 @@ data-ulog_search="ljweb_id=30001&ljweb_mod=m_pages_homepage_recommend-ershoufang&ljweb_bl=more&ljweb_strategy_id=default" data-evtid_lazyaction="10889" data-ulog_lazyaction="recommend_module=m_ershou_shouye&fb_service_id=100001&fb_context_id={"req_source_type":"zhiying_m"}&fb_expo_id=r87474238291230720&fb_strategy_id=10000076&fb_item_type=ershou_house&fb_item_detail=107000203369&fb_item_location=1&fb_ab_test_flag=reco_rule-100001-default-default&fb_response_ts=1535591483&fb_query_id=188971149" - th:href="${domainName}">为您推荐真题试卷更多 + th:href="${domainName + 'paperlist/gaokao-0-1-0-0-1.html'}">为您推荐真题试卷更多
      @@ -95,7 +95,7 @@ data-ulog_search="ljweb_id=30001&ljweb_mod=m_pages_homepage_recommend-ershoufang&ljweb_bl=more&ljweb_strategy_id=default" data-evtid_lazyaction="10889" data-ulog_lazyaction="recommend_module=m_ershou_shouye&fb_service_id=100001&fb_context_id={"req_source_type":"zhiying_m"}&fb_expo_id=r87474238291230720&fb_strategy_id=10000076&fb_item_type=ershou_house&fb_item_detail=107000203369&fb_item_location=1&fb_ab_test_flag=reco_rule-100001-default-default&fb_response_ts=1535591483&fb_query_id=188971149" - th:href="${domainName}">为您推荐模拟试卷更多 + th:href="${domainName + 'paperlist/gaokao-0-2-0-0-1.html'}">为您推荐模拟试卷更多
        @@ -127,7 +127,7 @@ data-ulog_search="ljweb_id=30001&ljweb_mod=m_pages_homepage_recommend-ershoufang&ljweb_bl=more&ljweb_strategy_id=default" data-evtid_lazyaction="10889" data-ulog_lazyaction="recommend_module=m_ershou_shouye&fb_service_id=100001&fb_context_id={"req_source_type":"zhiying_m"}&fb_expo_id=r87474238291230720&fb_strategy_id=10000076&fb_item_type=ershou_house&fb_item_detail=107000203369&fb_item_location=1&fb_ab_test_flag=reco_rule-100001-default-default&fb_response_ts=1535591483&fb_query_id=188971149" - th:href="${domainName}">为您推荐热门试卷更多 + th:href="${domainName + 'paperlist/gaokao-0-0-0-0-1.html'}">为您推荐热门试卷更多