|
@@ -51,6 +51,9 @@ public class CqdxService {
|
|
// 获取所有xml的路径
|
|
// 获取所有xml的路径
|
|
List<String> files = this.loadFiles();
|
|
List<String> files = this.loadFiles();
|
|
|
|
|
|
|
|
+ //试卷名称(后缀)
|
|
|
|
+ final String paperNameSuffix = "192";
|
|
|
|
+
|
|
int i = 0;
|
|
int i = 0;
|
|
System.out.println("XML的文件数:" + files.size());
|
|
System.out.println("XML的文件数:" + files.size());
|
|
for (String filePath : files) {
|
|
for (String filePath : files) {
|
|
@@ -60,7 +63,7 @@ public class CqdxService {
|
|
// continue;
|
|
// continue;
|
|
// }
|
|
// }
|
|
|
|
|
|
- Map<Object, Object> paperInfoMap = this.readXml(filePath);
|
|
|
|
|
|
+ Map<Object, Object> paperInfoMap = this.readXml(filePath, paperNameSuffix);
|
|
// 查询课程
|
|
// 查询课程
|
|
Course course = courseService.getCourse(rootOrgId, paperInfoMap.get("courseCode").toString());
|
|
Course course = courseService.getCourse(rootOrgId, paperInfoMap.get("courseCode").toString());
|
|
// 初始化试卷
|
|
// 初始化试卷
|
|
@@ -149,8 +152,8 @@ public class CqdxService {
|
|
return paperDetails;
|
|
return paperDetails;
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<Object, Object> readXml(String xmlPath) throws Exception {
|
|
|
|
- Map<Object, Object> paperInfoMap = new HashedMap<Object, Object>();
|
|
|
|
|
|
+ public Map<Object, Object> readXml(String xmlPath, String paperNameSuffix) throws Exception {
|
|
|
|
+ Map<Object, Object> paperInfoMap = new HashedMap<>();
|
|
DocumentBuilderFactory a = DocumentBuilderFactory.newInstance();
|
|
DocumentBuilderFactory a = DocumentBuilderFactory.newInstance();
|
|
DocumentBuilder b = a.newDocumentBuilder();
|
|
DocumentBuilder b = a.newDocumentBuilder();
|
|
|
|
|
|
@@ -166,8 +169,8 @@ public class CqdxService {
|
|
NamedNodeMap namedNodeMap = node.getAttributes();
|
|
NamedNodeMap namedNodeMap = node.getAttributes();
|
|
// 课程代码
|
|
// 课程代码
|
|
paperInfoMap.put("courseCode", namedNodeMap.getNamedItem("CourseId").getTextContent());
|
|
paperInfoMap.put("courseCode", namedNodeMap.getNamedItem("CourseId").getTextContent());
|
|
- // 试卷名称
|
|
|
|
- paperInfoMap.put("name", namedNodeMap.getNamedItem("CourseName").getTextContent() + namedNodeMap.getNamedItem("ProblemDocumentName").getTextContent() + "(191)");
|
|
|
|
|
|
+ // 试卷名称(后缀)
|
|
|
|
+ paperInfoMap.put("name", namedNodeMap.getNamedItem("CourseName").getTextContent() + namedNodeMap.getNamedItem("ProblemDocumentName").getTextContent() + "(" + paperNameSuffix + ")");
|
|
// 试卷总分
|
|
// 试卷总分
|
|
paperInfoMap.put("totalScore", namedNodeMap.getNamedItem("Score").getTextContent());
|
|
paperInfoMap.put("totalScore", namedNodeMap.getNamedItem("Score").getTextContent());
|
|
// 大题数量
|
|
// 大题数量
|