|
|
@@ -133,6 +133,18 @@ public class XgConductScoreController extends BaseController {
|
|
|
@PostMapping("/listByDeptId")
|
|
|
public TableDataInfo<XgConductScoreVo> listByDeptId(@RequestBody Map<String, Object> requestBody,
|
|
|
PageQuery pageQuery) {
|
|
|
+ // 从请求体中解析分页参数
|
|
|
+ if (requestBody.containsKey("pageNum") && requestBody.get("pageNum") != null) {
|
|
|
+ pageQuery.setPageNum(Integer.valueOf(requestBody.get("pageNum").toString()));
|
|
|
+ } else {
|
|
|
+ pageQuery.setPageNum(1);
|
|
|
+ }
|
|
|
+ if (requestBody.containsKey("pageSize") && requestBody.get("pageSize") != null) {
|
|
|
+ pageQuery.setPageSize(Integer.valueOf(requestBody.get("pageSize").toString()));
|
|
|
+ } else {
|
|
|
+ pageQuery.setPageSize(10);
|
|
|
+ }
|
|
|
+
|
|
|
// 从请求体中解析排序参数
|
|
|
if (requestBody.containsKey("orderByColumn")) {
|
|
|
pageQuery.setOrderByColumn((String) requestBody.get("orderByColumn"));
|
|
|
@@ -747,6 +759,7 @@ public class XgConductScoreController extends BaseController {
|
|
|
XgConductScoreImportVo example = new XgConductScoreImportVo();
|
|
|
|
|
|
// 设置示例数据
|
|
|
+ example.setMonth(9);
|
|
|
example.setStudentNo("2024001");
|
|
|
example.setStudentName("张三");
|
|
|
example.setScore(85);
|
|
|
@@ -769,19 +782,17 @@ public class XgConductScoreController extends BaseController {
|
|
|
@Log(title = "学生操行分", businessType = BusinessType.IMPORT)
|
|
|
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
|
public R<Void> importData(@RequestPart("file") MultipartFile file,
|
|
|
- @NotNull(message = "学年不能为空") Integer academicYear,
|
|
|
- @NotNull(message = "学期不能为空") Integer semester,
|
|
|
- @NotNull(message = "月份不能为空") Integer month,
|
|
|
- String classId) throws Exception {
|
|
|
- log.info("导入操行分数据,学年: {}, 学期: {}, 月份: {}, 班级ID: {}", academicYear, semester, month, classId);
|
|
|
+ @NotNull(message = "学年不能为空") Integer academicYear,
|
|
|
+ @NotNull(message = "学期不能为空") Integer semester,
|
|
|
+ String classId) throws Exception {
|
|
|
+ log.info("导入操行分数据,学年: {}, 学期: {}, 班级ID: {}", academicYear, semester, classId);
|
|
|
log.info("导入文件名: {}, 文件大小: {} bytes", file.getOriginalFilename(), file.getSize());
|
|
|
|
|
|
try {
|
|
|
ExcelResult<XgConductScoreImportVo> result = ExcelUtil.importExcel(
|
|
|
- file.getInputStream(),
|
|
|
- XgConductScoreImportVo.class,
|
|
|
- new XgConductScoreImportListener(academicYear, semester, month, classId)
|
|
|
- );
|
|
|
+ file.getInputStream(),
|
|
|
+ XgConductScoreImportVo.class,
|
|
|
+ new XgConductScoreImportListener(academicYear, semester, classId));
|
|
|
|
|
|
log.info("Excel导入完成,结果: {}", result.getAnalysis());
|
|
|
return R.ok(result.getAnalysis());
|