|
@@ -7,6 +7,7 @@ import com.example.civilizedcity.common.BaseController;
|
7
|
7
|
import com.example.civilizedcity.common.Constants;
|
8
|
8
|
import com.example.civilizedcity.common.ExcelUtils;
|
9
|
9
|
import com.example.civilizedcity.common.ResponseBean;
|
|
10
|
+
|
10
|
11
|
import java.util.List;
|
11
|
12
|
|
12
|
13
|
import com.example.civilizedcity.vo.CheckLocAnswer;
|
|
@@ -23,6 +24,7 @@ import javax.servlet.http.HttpServletResponse;
|
23
|
24
|
|
24
|
25
|
/**
|
25
|
26
|
* 测评作答;(ta_check_answer)表控制层
|
|
27
|
+ *
|
26
|
28
|
* @author : http://njyunzhi.com
|
27
|
29
|
* @date : 2022-12-13
|
28
|
30
|
*/
|
|
@@ -30,12 +32,12 @@ import javax.servlet.http.HttpServletResponse;
|
30
|
32
|
@RestController
|
31
|
33
|
@RequestMapping("/")
|
32
|
34
|
public class TaCheckAnswerController extends BaseController {
|
33
|
|
-
|
|
35
|
+
|
34
|
36
|
@Autowired
|
35
|
37
|
private TaCheckAnswerService taCheckAnswerService;
|
36
|
|
-
|
37
|
|
- /**
|
38
|
|
- * 通过ID查询单条数据
|
|
38
|
+
|
|
39
|
+ /**
|
|
40
|
+ * 通过ID查询单条数据
|
39
|
41
|
*
|
40
|
42
|
* @param answerId 主键
|
41
|
43
|
* @return 实例对象
|
|
@@ -45,69 +47,97 @@ public class TaCheckAnswerController extends BaseController {
|
45
|
47
|
public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
|
46
|
48
|
return ResponseBean.success(taCheckAnswerService.getById(id));
|
47
|
49
|
}
|
48
|
|
-
|
49
|
|
- /**
|
50
|
|
- * 分页查询
|
|
50
|
+
|
|
51
|
+ /**
|
|
52
|
+ * 分页查询答题详情
|
51
|
53
|
*
|
52
|
|
- * @param pageNum 当前页码
|
|
54
|
+ * @param pageNum 当前页码
|
53
|
55
|
* @param pageSize 每页条数
|
54
|
56
|
* @return 查询结果
|
55
|
57
|
*/
|
56
|
|
- @ApiOperation("分页查询")
|
|
58
|
+ @ApiOperation("分页查询答题详情")
|
57
|
59
|
@GetMapping("/taCheckAnswer")
|
58
|
|
- public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
59
|
|
- @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
60
|
|
- @ApiParam("答卷类型") @RequestParam(value ="itemType", defaultValue = "loc") String itemType,
|
61
|
|
- @ApiParam("测评ID") @RequestParam(value ="checkId", required = false) String checkId,
|
62
|
|
- @ApiParam("点位ID") @RequestParam(value ="typeId", required = false) String typeId,
|
63
|
|
- @ApiParam("社区") @RequestParam(value ="communityName", required = false) String communityName,
|
64
|
|
- @ApiParam("答卷类型") @RequestParam(value ="addr", required = false) String addr) throws Exception {
|
|
60
|
+ public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
61
|
+ @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
62
|
+ @ApiParam("答卷类型") @RequestParam(value = "itemType") String itemType,
|
|
63
|
+ @ApiParam("测评ID") @RequestParam(value = "checkId") String checkId,
|
|
64
|
+ @ApiParam("点位ID") @RequestParam(value = "typeId", required = false) String typeId,
|
|
65
|
+ @ApiParam("社区") @RequestParam(value = "communityName", required = false) String communityName,
|
|
66
|
+ @ApiParam("答卷类型") @RequestParam(value = "addr", required = false) String addr) throws Exception {
|
|
67
|
+
|
|
68
|
+ IPage<TaCheckAnswer> page = new Page<>(pageNum, pageSize);
|
|
69
|
+
|
|
70
|
+ page = taCheckAnswerService.getPageBy(page, checkId, itemType, typeId, communityName, addr);
|
|
71
|
+
|
|
72
|
+ return ResponseBean.success(page);
|
|
73
|
+ }
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+ /**
|
|
77
|
+ * 分页查询答题详情
|
|
78
|
+ *
|
|
79
|
+ * @param pageNum 当前页码
|
|
80
|
+ * @param pageSize 每页条数
|
|
81
|
+ * @return 查询结果
|
|
82
|
+ */
|
|
83
|
+ @ApiOperation("分页查询答题详情")
|
|
84
|
+ @GetMapping("/taCheckAnswer/{answerId}/detail")
|
|
85
|
+ public ResponseBean listDetail(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
86
|
+ @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
87
|
+ @ApiParam("答案ID") @PathVariable String answerId,
|
|
88
|
+ @ApiParam("答卷类型") @RequestParam(value = "itemType", required = false) String itemType,
|
|
89
|
+ @ApiParam("测评ID") @RequestParam(value = "checkId", required = false) String checkId,
|
|
90
|
+ @ApiParam("点位ID") @RequestParam(value = "typeId", required = false) String typeId,
|
|
91
|
+ @ApiParam("社区") @RequestParam(value = "communityName", required = false) String communityName,
|
|
92
|
+ @ApiParam("答卷类型") @RequestParam(value = "addr", required = false) String addr) throws Exception {
|
65
|
93
|
|
66
|
94
|
if (Constants.CHECK_OF_LOC.equals(itemType)) {
|
67
|
95
|
IPage<CheckLocAnswer> pg = new Page<>(pageNum, pageSize);
|
68
|
|
- IPage<CheckLocAnswer> result = taCheckAnswerService.getLocPageBy(pg, checkId, typeId);
|
|
96
|
+ IPage<CheckLocAnswer> result = taCheckAnswerService.getLocPageBy(pg, checkId, typeId, answerId);
|
69
|
97
|
return ResponseBean.success(result);
|
70
|
98
|
}
|
71
|
99
|
|
72
|
100
|
if (Constants.CHECK_OF_SURVEY.equals(itemType)) {
|
73
|
101
|
IPage<CheckSurveyAnswer> pg = new Page<>(pageNum, pageSize);
|
74
|
|
- IPage<CheckSurveyAnswer> result = taCheckAnswerService.getSurveyPageBy(pg, checkId, communityName, addr);
|
|
102
|
+ IPage<CheckSurveyAnswer> result = taCheckAnswerService.getSurveyPageBy(pg, checkId, answerId, communityName, addr);
|
75
|
103
|
return ResponseBean.success(result);
|
76
|
104
|
}
|
77
|
105
|
|
78
|
106
|
return ResponseBean.error("非法的答卷类型");
|
79
|
107
|
}
|
80
|
108
|
|
81
|
|
- /**
|
82
|
|
- * 导出
|
83
|
|
- *
|
84
|
|
- * @return 查询结果
|
85
|
|
- */
|
86
|
|
- @ApiOperation("导出")
|
87
|
|
- @GetMapping("/taCheckAnswer/export")
|
88
|
|
- public ResponseBean export(@ApiParam("答卷类型") @RequestParam(value ="itemType", defaultValue = "loc") String itemType,
|
89
|
|
- @ApiParam("测评ID") @RequestParam(value ="checkId", required = false) String checkId,
|
90
|
|
- @ApiParam("点位ID") @RequestParam(value ="typeId", required = false) String typeId,
|
91
|
|
- @ApiParam("社区") @RequestParam(value ="communityName", required = false) String communityName,
|
92
|
|
- @ApiParam("答卷类型") @RequestParam(value ="addr", required = false) String addr,
|
93
|
|
- HttpServletResponse response) throws Exception {
|
94
|
|
-
|
95
|
|
- if (Constants.CHECK_OF_LOC.equals(itemType)) {
|
96
|
|
- List<CheckLocAnswer> result = taCheckAnswerService.getLocListBy(checkId, typeId);
|
97
|
|
- ExcelUtils.flush(response, CheckLocAnswer.class, result, "实地测评答案明细");
|
98
|
|
- return null;
|
99
|
|
- }
|
100
|
|
-
|
101
|
|
- if (Constants.CHECK_OF_SURVEY.equals(itemType)) {
|
102
|
|
- List<CheckSurveyAnswer> result = taCheckAnswerService.getSurveyListBy(checkId, communityName, addr);
|
103
|
|
- ExcelUtils.flush(response, CheckSurveyAnswer.class, result, "调查问卷答案明细");
|
104
|
|
- return null;
|
105
|
|
- }
|
106
|
|
-
|
107
|
|
- return ResponseBean.error("非法的答卷类型");
|
108
|
|
- }
|
109
|
|
-
|
110
|
|
- /**
|
|
109
|
+ /**
|
|
110
|
+ * 导出答题详情
|
|
111
|
+ *
|
|
112
|
+ * @return 查询结果
|
|
113
|
+ */
|
|
114
|
+ @ApiOperation("导出答题详情")
|
|
115
|
+ @GetMapping("/taCheckAnswer/{answerId}/detail/export")
|
|
116
|
+ public ResponseBean exportDetail(
|
|
117
|
+ @ApiParam("答案ID") @PathVariable String answerId,
|
|
118
|
+ @ApiParam("答卷类型") @RequestParam(value = "itemType", required = false) String itemType,
|
|
119
|
+ @ApiParam("测评ID") @RequestParam(value = "checkId", required = false) String checkId,
|
|
120
|
+ @ApiParam("点位ID") @RequestParam(value = "typeId", required = false) String typeId,
|
|
121
|
+ @ApiParam("社区") @RequestParam(value = "communityName", required = false) String communityName,
|
|
122
|
+ @ApiParam("答卷类型") @RequestParam(value = "addr", required = false) String addr,
|
|
123
|
+ HttpServletResponse response) throws Exception {
|
|
124
|
+
|
|
125
|
+ if (Constants.CHECK_OF_LOC.equals(itemType)) {
|
|
126
|
+ List<CheckLocAnswer> result = taCheckAnswerService.getLocListBy(checkId, typeId, answerId);
|
|
127
|
+ ExcelUtils.flush(response, CheckLocAnswer.class, result, "实地测评答案明细");
|
|
128
|
+ return null;
|
|
129
|
+ }
|
|
130
|
+
|
|
131
|
+ if (Constants.CHECK_OF_SURVEY.equals(itemType)) {
|
|
132
|
+ List<CheckSurveyAnswer> result = taCheckAnswerService.getSurveyListBy(checkId, answerId, communityName, addr);
|
|
133
|
+ ExcelUtils.flush(response, CheckSurveyAnswer.class, result, "调查问卷答案明细");
|
|
134
|
+ return null;
|
|
135
|
+ }
|
|
136
|
+
|
|
137
|
+ return ResponseBean.error("非法的答卷类型");
|
|
138
|
+ }
|
|
139
|
+
|
|
140
|
+ /**
|
111
|
141
|
* 新增数据
|
112
|
142
|
*
|
113
|
143
|
* @param taCheckAnswer 实例对象
|
|
@@ -119,8 +149,8 @@ public class TaCheckAnswerController extends BaseController {
|
119
|
149
|
taCheckAnswerService.save(taCheckAnswer);
|
120
|
150
|
return ResponseBean.success(taCheckAnswer);
|
121
|
151
|
}
|
122
|
|
-
|
123
|
|
- /**
|
|
152
|
+
|
|
153
|
+ /**
|
124
|
154
|
* 更新数据
|
125
|
155
|
*
|
126
|
156
|
* @param taCheckAnswer 实例对象
|
|
@@ -129,12 +159,12 @@ public class TaCheckAnswerController extends BaseController {
|
129
|
159
|
@ApiOperation("更新数据")
|
130
|
160
|
@PutMapping("/taCheckAnswer/{id}")
|
131
|
161
|
public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaCheckAnswer taCheckAnswer,
|
132
|
|
- @ApiParam("对象ID") @PathVariable String id ) throws Exception {
|
|
162
|
+ @ApiParam("对象ID") @PathVariable String id) throws Exception {
|
133
|
163
|
taCheckAnswerService.updateById(taCheckAnswer);
|
134
|
164
|
return ResponseBean.success(taCheckAnswer);
|
135
|
165
|
}
|
136
|
|
-
|
137
|
|
- /**
|
|
166
|
+
|
|
167
|
+ /**
|
138
|
168
|
* 通过主键删除数据
|
139
|
169
|
*
|
140
|
170
|
* @param answerId 主键
|
|
@@ -142,7 +172,7 @@ public class TaCheckAnswerController extends BaseController {
|
142
|
172
|
*/
|
143
|
173
|
@ApiOperation("通过主键删除数据")
|
144
|
174
|
@DeleteMapping("/taCheckAnswer/{id}")
|
145
|
|
- public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id){
|
|
175
|
+ public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
|
146
|
176
|
taCheckAnswerService.removeLogicById(id);
|
147
|
177
|
return ResponseBean.success("success");
|
148
|
178
|
}
|