|
@@ -40,16 +40,16 @@ public class ScantronController {
|
40
|
40
|
* @Return com.xhkjedu.vo.ResultVo
|
41
|
41
|
**/
|
42
|
42
|
@PostMapping("/list_my")
|
43
|
|
- public ResultVo listMy(@RequestBody TScantron scantron){
|
|
43
|
+ public ResultVo listMy(@RequestBody TScantron scantron) {
|
44
|
44
|
Integer page = scantron.getPage();
|
45
|
45
|
Integer pageSize = scantron.getPageSize();
|
46
|
46
|
Integer createid = scantron.getCreateid();
|
47
|
47
|
Integer schoolid = scantron.getSchoolid();
|
48
|
|
- N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,createid,"用户id",1,schoolid,"学校id",1});
|
|
48
|
+ N_Utils.validation(new Object[]{page, "显示页码", 1, pageSize, "显示条数", 1, createid, "用户id", 1, schoolid, "学校id", 1});
|
49
|
49
|
PageHelper.startPage(page, pageSize);
|
50
|
|
- List<Map<String,Object>> list = scantronService.listScantrons(scantron);
|
|
50
|
+ List<Map<String, Object>> list = scantronService.listScantrons(scantron);
|
51
|
51
|
PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
|
52
|
|
- return new ResultVo(0,"查询成功",pageResult);
|
|
52
|
+ return new ResultVo(0, "查询成功", pageResult);
|
53
|
53
|
}
|
54
|
54
|
|
55
|
55
|
/*
|
|
@@ -60,96 +60,96 @@ public class ScantronController {
|
60
|
60
|
* @Return com.xhkjedu.vo.ResultVo
|
61
|
61
|
**/
|
62
|
62
|
@PostMapping("/list")
|
63
|
|
- public ResultVo list(@RequestBody TScantron scantron){
|
|
63
|
+ public ResultVo list(@RequestBody TScantron scantron) {
|
64
|
64
|
Integer page = scantron.getPage();
|
65
|
65
|
Integer pageSize = scantron.getPageSize();
|
66
|
66
|
Integer createid = scantron.getCreateid();
|
67
|
67
|
Integer schoolid = scantron.getSchoolid();
|
68
|
|
- N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,createid,"教师id",1,schoolid,"学校id",1});
|
|
68
|
+ N_Utils.validation(new Object[]{page, "显示页码", 1, pageSize, "显示条数", 1, createid, "教师id", 1, schoolid, "学校id", 1});
|
69
|
69
|
|
70
|
|
- //获取用户类型
|
|
70
|
+ // 获取用户类型
|
71
|
71
|
UserVo userVo = userService.getUserTypeAndSubjectid(createid);
|
72
|
|
- if(userVo.getUsertype() == 1){
|
73
|
|
- //设置教师科目
|
|
72
|
+ if (userVo.getUsertype() == 1) {
|
|
73
|
+ // 设置教师科目
|
74
|
74
|
scantron.setSubjectid(userVo.getSubjectid());
|
75
|
75
|
}
|
76
|
|
- if(userVo.getUsertype() == 0){
|
77
|
|
- //管理员看到学校所有
|
|
76
|
+ if (userVo.getUsertype() == 0) {
|
|
77
|
+ // 管理员看到学校所有
|
78
|
78
|
scantron.setCreateid(null);
|
79
|
79
|
}
|
80
|
|
- scantron.setPubliched(1);//全部查看公开的
|
|
80
|
+ scantron.setPubliched(1);// 全部查看公开的
|
81
|
81
|
|
82
|
82
|
PageHelper.startPage(page, pageSize);
|
83
|
|
- List<Map<String,Object>> list = scantronService.listScantrons(scantron);
|
|
83
|
+ List<Map<String, Object>> list = scantronService.listScantrons(scantron);
|
84
|
84
|
PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
|
85
|
|
- return new ResultVo(0,"查询成功",pageResult);
|
|
85
|
+ return new ResultVo(0, "查询成功", pageResult);
|
86
|
86
|
}
|
87
|
87
|
|
88
|
|
- //答题卡-新增
|
|
88
|
+ // 答题卡-新增
|
89
|
89
|
@PostMapping("/add")
|
90
|
|
- public ResultVo add(@RequestBody TScantron scantron){
|
91
|
|
- N_Utils.validation(new Object[]{scantron.getCreateid(),"创建人id",1,scantron.getSchoolid(),"学校id",1,
|
92
|
|
- scantron.getSubjectid(),"科目id",1,scantron.getSname(),"答题卡名称",2});
|
|
90
|
+ public ResultVo add(@RequestBody TScantron scantron) {
|
|
91
|
+ N_Utils.validation(new Object[]{scantron.getCreateid(), "创建人id", 1, scantron.getSchoolid(), "学校id", 1,
|
|
92
|
+ scantron.getSubjectid(), "科目id", 1, scantron.getSname(), "答题卡名称", 2});
|
93
|
93
|
try {
|
94
|
|
- scantronService.save(scantron);
|
95
|
|
- return new ResultVo(0,"保存成功");
|
96
|
|
- }catch (Exception e){
|
97
|
|
- return new ResultVo(1,"保存失败");
|
|
94
|
+ String pdfpath = scantronService.save(scantron);
|
|
95
|
+ return new ResultVo(0, "保存成功", pdfpath);
|
|
96
|
+ } catch (Exception e) {
|
|
97
|
+ return new ResultVo(1, "保存失败");
|
98
|
98
|
}
|
99
|
99
|
}
|
100
|
100
|
|
101
|
|
- //答题卡-修改
|
|
101
|
+ // 答题卡-修改
|
102
|
102
|
@PostMapping("/update")
|
103
|
|
- public ResultVo update(@RequestBody TScantron scantron){
|
104
|
|
- N_Utils.validation(new Object[]{scantron.getSid(),"答题卡id",1});
|
|
103
|
+ public ResultVo update(@RequestBody TScantron scantron) {
|
|
104
|
+ N_Utils.validation(new Object[]{scantron.getSid(), "答题卡id", 1});
|
105
|
105
|
|
106
|
106
|
try {
|
107
|
|
- scantronService.update(scantron);
|
108
|
|
- return new ResultVo(0,"保存成功");
|
109
|
|
- }catch (Exception e){
|
110
|
|
- return new ResultVo(1,"保存失败");
|
|
107
|
+ String pdfpath = scantronService.update(scantron);
|
|
108
|
+ return new ResultVo(0, "保存成功", pdfpath);
|
|
109
|
+ } catch (Exception e) {
|
|
110
|
+ return new ResultVo(1, "保存失败");
|
111
|
111
|
}
|
112
|
112
|
}
|
113
|
113
|
|
114
|
|
- //答题卡-删除
|
|
114
|
+ // 答题卡-删除
|
115
|
115
|
@PostMapping("/delete")
|
116
|
|
- public ResultVo delete(@RequestBody TScantron scantron){
|
117
|
|
- N_Utils.validation(new Object[]{scantron.getSid(),"答题卡id",1});
|
|
116
|
+ public ResultVo delete(@RequestBody TScantron scantron) {
|
|
117
|
+ N_Utils.validation(new Object[]{scantron.getSid(), "答题卡id", 1});
|
118
|
118
|
scantronService.delete(scantron.getSid());
|
119
|
|
- return new ResultVo(0,"删除成功");
|
|
119
|
+ return new ResultVo(0, "删除成功");
|
120
|
120
|
}
|
121
|
|
- //答题卡-详情
|
|
121
|
+
|
|
122
|
+ // 答题卡-详情
|
122
|
123
|
@PostMapping("/detail")
|
123
|
|
- public ResultVo detail(@RequestBody TScantron scantron){
|
124
|
|
- N_Utils.validation(new Object[]{scantron.getSid(),"答题卡id",1});
|
|
124
|
+ public ResultVo detail(@RequestBody TScantron scantron) {
|
|
125
|
+ N_Utils.validation(new Object[]{scantron.getSid(), "答题卡id", 1});
|
125
|
126
|
TScantron st = scantronService.detail(scantron.getSid());
|
126
|
|
- return new ResultVo(0,"获取成功",st);
|
|
127
|
+ return new ResultVo(0, "获取成功", st);
|
127
|
128
|
}
|
128
|
129
|
|
129
|
|
- //答题卡-公开
|
|
130
|
+ // 答题卡-公开
|
130
|
131
|
@PostMapping("/pub")
|
131
|
|
- public ResultVo updatePubliched(@RequestBody TScantron scantron){
|
132
|
|
- N_Utils.validation(new Object[]{scantron.getSid(),"答题卡id",1});
|
133
|
|
- scantronService.updateScantronPubliched(scantron.getSid(),1);
|
134
|
|
- return new ResultVo(0,"设置成功");
|
|
132
|
+ public ResultVo updatePubliched(@RequestBody TScantron scantron) {
|
|
133
|
+ N_Utils.validation(new Object[]{scantron.getSid(), "答题卡id", 1});
|
|
134
|
+ scantronService.updateScantronPubliched(scantron.getSid(), 1);
|
|
135
|
+ return new ResultVo(0, "设置成功");
|
135
|
136
|
}
|
136
|
|
- //答题卡-取消公开
|
|
137
|
+
|
|
138
|
+ // 答题卡-取消公开
|
137
|
139
|
@PostMapping("/unpub")
|
138
|
|
- public ResultVo updateUnPubliched(@RequestBody TScantron scantron){
|
139
|
|
- N_Utils.validation(new Object[]{scantron.getSid(),"答题卡id",1});
|
140
|
|
- scantronService.updateScantronPubliched(scantron.getSid(),2);
|
141
|
|
- return new ResultVo(0,"设置成功");
|
|
140
|
+ public ResultVo updateUnPubliched(@RequestBody TScantron scantron) {
|
|
141
|
+ N_Utils.validation(new Object[]{scantron.getSid(), "答题卡id", 1});
|
|
142
|
+ scantronService.updateScantronPubliched(scantron.getSid(), 2);
|
|
143
|
+ return new ResultVo(0, "设置成功");
|
142
|
144
|
}
|
143
|
145
|
|
144
|
|
- //答题卡-复用
|
|
146
|
+ // 答题卡-复用
|
145
|
147
|
@PostMapping("/copy")
|
146
|
|
- public ResultVo copyScantron(@RequestBody TScantron scantron){
|
147
|
|
- N_Utils.validation(new Object[]{scantron.getSid(),"答题卡id",1,scantron.getCreateid(),"创建人id",1});
|
|
148
|
+ public ResultVo copyScantron(@RequestBody TScantron scantron) {
|
|
149
|
+ N_Utils.validation(new Object[]{scantron.getSid(), "答题卡id", 1, scantron.getCreateid(), "创建人id", 1});
|
148
|
150
|
TScantron st = scantronService.copyScantron(scantron);
|
149
|
|
- return new ResultVo(0,"复用成功",st);
|
|
151
|
+ return new ResultVo(0, "复用成功", st);
|
150
|
152
|
}
|
151
|
153
|
|
152
|
154
|
|
153
|
|
-
|
154
|
|
-
|
155
|
155
|
}
|