parent
ee670003c4
commit
dc99853d71
Binary file not shown.
@ -1,17 +0,0 @@
|
||||
# EXSI主机
|
||||
10.10.14.93
|
||||
root
|
||||
DsideaL4r5t6y7u!@#
|
||||
|
||||
|
||||
#积木报表访问办法
|
||||
http://10.10.14.66:8085/jmreport/list
|
||||
|
||||
#显示全的
|
||||
http://10.10.14.66:8085/jmreport/view/810022805021978624?task_id=17
|
||||
|
||||
# 只显示中班
|
||||
http://10.10.14.66:8085/jmreport/view/810022805021978624?task_id=17&bx_id=3
|
||||
|
||||
# SQL中条件表达式
|
||||
https://www.kancloud.cn/zhangdaiscott/jimureport/2373410
|
@ -0,0 +1,79 @@
|
||||
package Tools;
|
||||
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.dsideal.FengHuang.Util.CommonUtil;
|
||||
import com.jfinal.kit.PropKit;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.jfinal.plugin.activerecord.dialect.PostgreSqlDialect;
|
||||
import com.jfinal.plugin.druid.DruidPlugin;
|
||||
import com.jfinal.plugin.redis.RedisPlugin;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class CC_DangJianImportQuestion {
|
||||
public static void main(String[] args) {
|
||||
//1、配置数据库
|
||||
PropKit.use("application.properties");
|
||||
|
||||
DruidPlugin druid = new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"),
|
||||
PropKit.get("password").trim(), PropKit.get("driverClassName"));
|
||||
druid.start();
|
||||
// 配置ActiveRecord插件
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(druid);
|
||||
arp.start();
|
||||
String excelFile = "D:\\dsWork\\ccDangJianExam\\Doc\\党建试题.xlsx";
|
||||
|
||||
ExcelReader reader = ExcelUtil.getReader(excelFile);
|
||||
List<Map<String, Object>> list = reader.readAll();
|
||||
|
||||
String sql = "select * from t_exam_question_type";
|
||||
List<Record> typeList = Db.find(sql);
|
||||
Map<String, Integer> _map = new HashMap<>();
|
||||
for (Record record : typeList) {
|
||||
_map.put(record.getStr("type_name"), record.getInt("type_id"));
|
||||
}
|
||||
sql = "truncate table t_exam_question";
|
||||
Db.update(sql);
|
||||
|
||||
sql = "truncate table t_exam_record";
|
||||
Db.update(sql);
|
||||
|
||||
int cnt = 0;
|
||||
for (Map<String, Object> record : list) {
|
||||
cnt++;
|
||||
String type_name = record.get("题型").toString();
|
||||
int type_id = _map.get(type_name);
|
||||
String content = record.get("题目内容").toString();
|
||||
String A = record.get("A").toString();
|
||||
String B = record.get("B").toString();
|
||||
String C = record.get("C").toString();
|
||||
String D = record.get("D").toString();
|
||||
String E = record.get("E").toString();
|
||||
String F = record.get("F").toString();
|
||||
String G = record.get("G").toString();
|
||||
String answer = record.get("答案").toString();
|
||||
String memo = record.get("解析").toString();
|
||||
String score = record.get("分值").toString();
|
||||
Record writeR = new Record();
|
||||
writeR.set("type_id", type_id);
|
||||
writeR.set("content", content);
|
||||
writeR.set("A", A);
|
||||
writeR.set("B", B);
|
||||
writeR.set("C", C);
|
||||
writeR.set("D", D);
|
||||
writeR.set("E", E);
|
||||
writeR.set("F", F);
|
||||
writeR.set("G", G);
|
||||
writeR.set("answer", answer);
|
||||
writeR.set("memo", memo);
|
||||
writeR.set("score", score);
|
||||
Db.save("t_exam_question", "question_id", writeR);
|
||||
System.out.println("成功导入第" + cnt + "条,共" + list.size() + "条。");
|
||||
}
|
||||
CommonUtil.printf("恭喜,所有导入工作成功完成!");
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
"title": "党建知识问答排名结果",
|
||||
"sheetName": "结果表",
|
||||
"titleHeight": 30,
|
||||
"rowHeight": 30,
|
||||
"showNumber": true,
|
||||
"colInfo": [
|
||||
{
|
||||
"show_column_name": "姓名",
|
||||
"list_column_name": "person_name",
|
||||
"width": 40
|
||||
},
|
||||
{
|
||||
"show_column_name": "得分",
|
||||
"list_column_name": "score",
|
||||
"width": 40
|
||||
},
|
||||
{
|
||||
"show_column_name": "开始时间",
|
||||
"list_column_name": "start_time",
|
||||
"width": 40
|
||||
},
|
||||
{
|
||||
"show_column_name": "结束时间",
|
||||
"list_column_name": "end_time",
|
||||
"width": 40
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
#namespace("Exam")
|
||||
#sql("getPageSummary")
|
||||
select t1.person_id,t2.person_name,sum(t1.score) as score,t2.start_time,t2.end_time from t_exam_record as t1
|
||||
inner join t_exam_person as t2 on t1.person_id=t2.person_id
|
||||
where t1.reply=t1.answer
|
||||
group by t1.person_id,t2.person_name order by sum(t1.score) desc,timediff(t2.end_time,t2.start_time) asc
|
||||
#end
|
||||
|
||||
#sql("getPersonAllInfoAfterJiaoJuan")
|
||||
select t1.*,t2.answer from t_exam_record as t1
|
||||
inner join t_exam_question as t2 on t1.question_id=t2.question_id
|
||||
where t1.person_id=#para(person_id) order by t1.order_id
|
||||
#end
|
||||
#end
|
Loading…
Reference in new issue