|
|
|
@ -25,7 +25,7 @@ public class CC_DangJianImportQuestion {
|
|
|
|
|
// 配置ActiveRecord插件
|
|
|
|
|
ActiveRecordPlugin arp = new ActiveRecordPlugin(druid);
|
|
|
|
|
arp.start();
|
|
|
|
|
String excelFile = "D:\\dsWork\\ccDangJianExam\\Doc\\党建试题.xlsx";
|
|
|
|
|
String excelFile = "D:\\dsWork\\ccDangJianExamForMysql\\Doc\\党建试题.xlsx";
|
|
|
|
|
|
|
|
|
|
ExcelReader reader = ExcelUtil.getReader(excelFile);
|
|
|
|
|
List<Map<String, Object>> list = reader.readAll();
|
|
|
|
@ -36,6 +36,9 @@ public class CC_DangJianImportQuestion {
|
|
|
|
|
for (Record record : typeList) {
|
|
|
|
|
_map.put(record.getStr("type_name"), record.getInt("type_id"));
|
|
|
|
|
}
|
|
|
|
|
sql = "truncate table t_exam_person";
|
|
|
|
|
Db.update(sql);
|
|
|
|
|
|
|
|
|
|
sql = "truncate table t_exam_question";
|
|
|
|
|
Db.update(sql);
|
|
|
|
|
|
|
|
|
@ -72,7 +75,7 @@ public class CC_DangJianImportQuestion {
|
|
|
|
|
writeR.set("memo", memo);
|
|
|
|
|
writeR.set("score", score);
|
|
|
|
|
Db.save("t_exam_question", "question_id", writeR);
|
|
|
|
|
System.out.println("成功导入第" + cnt + "条,共" + list.size() + "条。");
|
|
|
|
|
System.out.println("成功导入第" + cnt + "条,共" + list.size() + "条。");
|
|
|
|
|
}
|
|
|
|
|
CommonUtil.printf("恭喜,所有导入工作成功完成!");
|
|
|
|
|
}
|
|
|
|
|