diff --git a/tamguo-bms/src/main/resources/static/js/editor.js b/tamguo-bms/src/main/resources/static/js/editor.js index 800e93a..52772d4 100644 --- a/tamguo-bms/src/main/resources/static/js/editor.js +++ b/tamguo-bms/src/main/resources/static/js/editor.js @@ -51,10 +51,10 @@ function openLastSelectedNode() { function setLastSelectNode($node) { if(window.localStorage) { if (typeof $node === "undefined" || !$node) { - window.sessionStorage.removeItem("MinDoc::LastLoadDocument:" + window.book.identify); + window.sessionStorage.removeItem("MinDoc::LastLoadDocument:" + window.book.id); } else { var nodeId = $node.id ? $node.id : $node.node.id; - window.sessionStorage.setItem("MinDoc::LastLoadDocument:" + window.book.identify, nodeId); + window.sessionStorage.setItem("MinDoc::LastLoadDocument:" + window.book.id, nodeId); } } } diff --git a/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java b/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java index fa7798c..a8381ed 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 = "150000"; + private final String AREA_ID = "450000"; // 年份 - private final String YEAR = "2016"; + private final String YEAR = "2017"; // 真题试卷 类型(1:真题试卷,2:模拟试卷,3:押题预测,4:名校精品) private final String PAPER_TYPE = "2"; // 开始采集的URL - private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-20-4-2016-965-1-download"; + private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-20-4-2017-1111-1-download"; private RunData runData; diff --git a/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java b/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java index c565a8e..1c019a1 100644 --- a/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java +++ b/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java @@ -207,4 +207,17 @@ public class DocumentController { } return Result.result(0, null, "删除成功"); } + + @SuppressWarnings("unchecked") + @RequestMapping(value="delete" , method = RequestMethod.POST) + @ResponseBody + public Result delete(String id) { + try { + DocumentEntity document = iDocumentService.selectById(id); + iDocumentService.delete(Condition.create().eq("batch_no", document.getBatchNo())); + } catch (Exception e) { + return Result.result(1, null, "删除失败"); + } + return Result.result(0, null, "删除成功"); + } } diff --git a/tamguo-mms/src/main/resources/static/js/editor.js b/tamguo-mms/src/main/resources/static/js/editor.js index 800e93a..725ee16 100644 --- a/tamguo-mms/src/main/resources/static/js/editor.js +++ b/tamguo-mms/src/main/resources/static/js/editor.js @@ -12,7 +12,7 @@ function openLastSelectedNode() { } var $isSelected = false; if(window.localStorage){ - var $selectedNodeId = window.sessionStorage.getItem("MinDoc::LastLoadDocument:" + window.book.identify); + var $selectedNodeId = window.sessionStorage.getItem("MinDoc::LastLoadDocument:" + window.book.id); try{ if($selectedNodeId){ //遍历文档树判断是否存在节点 @@ -51,10 +51,10 @@ function openLastSelectedNode() { function setLastSelectNode($node) { if(window.localStorage) { if (typeof $node === "undefined" || !$node) { - window.sessionStorage.removeItem("MinDoc::LastLoadDocument:" + window.book.identify); + window.sessionStorage.removeItem("MinDoc::LastLoadDocument:" + window.book.id); } else { var nodeId = $node.id ? $node.id : $node.node.id; - window.sessionStorage.setItem("MinDoc::LastLoadDocument:" + window.book.identify, nodeId); + window.sessionStorage.setItem("MinDoc::LastLoadDocument:" + window.book.id, nodeId); } } } diff --git a/tamguo-modules-core/src/main/java/com/tamguo/modules/book/service/impl/DocumentServiceImpl.java b/tamguo-modules-core/src/main/java/com/tamguo/modules/book/service/impl/DocumentServiceImpl.java index bd70245..bb950b5 100644 --- a/tamguo-modules-core/src/main/java/com/tamguo/modules/book/service/impl/DocumentServiceImpl.java +++ b/tamguo-modules-core/src/main/java/com/tamguo/modules/book/service/impl/DocumentServiceImpl.java @@ -2,6 +2,7 @@ package com.tamguo.modules.book.service.impl; import java.util.Date; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -55,12 +56,19 @@ public class DocumentServiceImpl extends ServiceImpl