From 74d18fd83c41cec936fd0c9b0b82d417e1188f12 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 31 Jan 2026 08:59:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=A6=E5=91=98=E5=9F=B9?= =?UTF-8?q?=E8=AE=AD=E8=AE=B0=E5=BD=95=E7=AE=A1=E7=90=86=E5=92=8C=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edu/web/archives/ArchivesController.java | 1 + .../edu/web/study/StudentController.java | 21 ++- .../command/query/study/StudentQueryExe.java | 18 +++ .../edu/service/study/StudentServiceImpl.java | 15 ++ .../zcloud/edu/api/study/StudentServiceI.java | 6 + .../edu/dto/clientobject/study/StudentCO.java | 5 + .../dto/data/archives/ClassArchivesDTO.java | 2 +- .../zcloud/edu/dto/study/StudentCountQry.java | 1 + .../zcloud/edu/dto/study/StudentPageQry.java | 3 +- .../domain/model/archives/ClassArchivesE.java | 3 + .../zcloud/edu/domain/model/study/ClassE.java | 2 + .../dataobject/study/StudentDO.java | 5 + .../mapper/study/StudentMapper.java | 7 + .../ClassCurriculumChapterRepositoryImpl.java | 5 +- .../impl/study/StudentRepositoryImpl.java | 12 ++ .../repository/study/StudentRepository.java | 3 + .../resources/mapper/study/StudentMapper.xml | 141 +++++++++++++++++- 17 files changed, 242 insertions(+), 8 deletions(-) diff --git a/web-adapter/src/main/java/com/zcloud/edu/web/archives/ArchivesController.java b/web-adapter/src/main/java/com/zcloud/edu/web/archives/ArchivesController.java index 84e6514..6593bb7 100644 --- a/web-adapter/src/main/java/com/zcloud/edu/web/archives/ArchivesController.java +++ b/web-adapter/src/main/java/com/zcloud/edu/web/archives/ArchivesController.java @@ -43,6 +43,7 @@ public class ArchivesController { public SingleResponse getAttendanceRecord(@RequestBody ClassArchivesQry qry) { return studentService.getAttendanceRecord(qry); } + @ApiOperation("查询学习档案") @PostMapping("/getStudyArchives") public SingleResponse getStudyArchives(@RequestBody ClassArchivesQry qry) { diff --git a/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java b/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java index 38f8657..b48ef26 100644 --- a/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java +++ b/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java @@ -48,6 +48,11 @@ public class StudentController { public PageResponse page(@RequestBody StudentPageQry qry) { return studentService.listPage(qry); } + @ApiOperation("培训记录管理分页") + @PostMapping("/listPageClassByStudent") + public PageResponse listPageClassByStudent(@RequestBody StudentPageQry qry) { + return studentService.listPageClassByStudent(qry); + } @ApiOperation("所有数据") @GetMapping("/listAll") @@ -55,18 +60,32 @@ public class StudentController { return MultiResponse.of(new ArrayList()); } + + + @ApiOperation("查询用户统计") + @PostMapping("/listStudentCount") + public MultiResponse listStudentCount(@RequestBody StudentCountQry qry) { + return studentService.listStudentCount(qry); + } + @ApiOperation("详情") @GetMapping("/{id}") public SingleResponse getInfoById(@PathVariable("id") Long id) { return SingleResponse.of(new StudentCO()); } + + @ApiOperation("查看学员详情") + @GetMapping("/getInfoByStudentId/{studentId}") + public SingleResponse getInfoByStudentId(@PathVariable("studentId") String studentId) { + return studentService.getInfoByStudentId(studentId); + } @ApiOperation("班级内学员数") @GetMapping("/countStudent/{classId}") public SingleResponse countStudent(@PathVariable("classId") String classId) { return SingleResponse.of(studentService.countStudent(classId)); } - @ApiOperation("班级内学员数") + @ApiOperation("根据企业统计学员") @PostMapping("/countStudentByCorpId") public MultiResponse countStudentByCorpId(@RequestBody StudentCountQry qry) { return studentService.countStudentByCorpId(qry); diff --git a/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java b/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java index 28fbd96..4119205 100644 --- a/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java +++ b/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java @@ -57,6 +57,13 @@ public class StudentQueryExe { return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex()); } + public PageResponse executelistPageClassByStudent(StudentPageQry studentPageQry) { + Map params = PageQueryHelper.toHashMap(studentPageQry); + PageResponse pageResponse = studentRepository.listPageClassByStudent(params); + List examCenterCOS = studentCoConvertor.converDOsToCOs(pageResponse.getData()); + return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex()); + } + public SingleResponse executeAttendanceRecord(ClassArchivesQry qry){ StudentDO studentDO = studentRepository.getById(qry.getStuId()); StudentE studentE = new StudentE(); @@ -216,6 +223,17 @@ public class StudentQueryExe { List studentCOList = BeanUtil.copyToList(studentDOList, StudentCO.class); return MultiResponse.of(studentCOList); } + public MultiResponse executeListStudentCount(StudentCountQry qry){ + Map params = PageQueryHelper.toHashMap(qry); + List studentDOList = studentRepository.listStudentCount(params); + List studentCOList = BeanUtil.copyToList(studentDOList, StudentCO.class); + return MultiResponse.of(studentCOList); + } + public SingleResponse executeGetInfoByStudentId(String studentId){ + StudentDO studentDO = studentRepository.findInfoByStudentId(studentId); + StudentCO studentCO = BeanUtil.copyProperties(studentDO, StudentCO.class); + return SingleResponse.of(studentCO); + } } diff --git a/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java b/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java index 545bce1..66737f1 100644 --- a/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java +++ b/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java @@ -42,6 +42,11 @@ public class StudentServiceImpl implements StudentServiceI { return studentQueryExe.execute(qry); } + @Override + public PageResponse listPageClassByStudent(StudentPageQry qry) { + return studentQueryExe.executelistPageClassByStudent(qry); + } + @Override public SingleResponse add(List cmdList) { @@ -97,5 +102,15 @@ public class StudentServiceImpl implements StudentServiceI { public MultiResponse countStudentByCorpId(StudentCountQry qry) { return studentQueryExe.executeCountStudentByCorpId(qry); } + + @Override + public MultiResponse listStudentCount(StudentCountQry qry) { + return studentQueryExe.executeListStudentCount(qry); + } + + @Override + public SingleResponse getInfoByStudentId(String studentId) { + return studentQueryExe.executeGetInfoByStudentId(studentId); + } } diff --git a/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java b/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java index 727eb42..3cad266 100644 --- a/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java +++ b/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java @@ -24,6 +24,8 @@ import java.util.List; public interface StudentServiceI { PageResponse listPage(StudentPageQry qry); + PageResponse listPageClassByStudent(StudentPageQry qry); + SingleResponse add(List cmdList); void edit(StudentUpdateCmd cmd); @@ -45,5 +47,9 @@ public interface StudentServiceI { SingleResponse getClassExamResult(ClassArchivesQry qry); MultiResponse countStudentByCorpId(StudentCountQry qry); + + MultiResponse listStudentCount(StudentCountQry qry); + + SingleResponse getInfoByStudentId(String studentId); } diff --git a/web-client/src/main/java/com/zcloud/edu/dto/clientobject/study/StudentCO.java b/web-client/src/main/java/com/zcloud/edu/dto/clientobject/study/StudentCO.java index 7221659..b519e9e 100644 --- a/web-client/src/main/java/com/zcloud/edu/dto/clientobject/study/StudentCO.java +++ b/web-client/src/main/java/com/zcloud/edu/dto/clientobject/study/StudentCO.java @@ -110,6 +110,11 @@ public class StudentCO extends ClientObject { + @ApiModelProperty(value = "完成班级数") + @TableField(exist = false) + private String departmentName; + + diff --git a/web-client/src/main/java/com/zcloud/edu/dto/data/archives/ClassArchivesDTO.java b/web-client/src/main/java/com/zcloud/edu/dto/data/archives/ClassArchivesDTO.java index 0146cb3..8bf8b91 100644 --- a/web-client/src/main/java/com/zcloud/edu/dto/data/archives/ClassArchivesDTO.java +++ b/web-client/src/main/java/com/zcloud/edu/dto/data/archives/ClassArchivesDTO.java @@ -51,7 +51,7 @@ public class ClassArchivesDTO { private Long corpinfoId; //所属单位名称 @ApiModelProperty(value = "所属单位名称") - private Long corpName; + private String corpName; //状态:1-未申请 2-待开班 3- 培训中 4-培训结束 @ApiModelProperty(value = "状态:1-未申请 2-待开班 3- 培训中 4-培训结束 ") private Integer state; diff --git a/web-client/src/main/java/com/zcloud/edu/dto/study/StudentCountQry.java b/web-client/src/main/java/com/zcloud/edu/dto/study/StudentCountQry.java index a843c77..2c4a1a8 100644 --- a/web-client/src/main/java/com/zcloud/edu/dto/study/StudentCountQry.java +++ b/web-client/src/main/java/com/zcloud/edu/dto/study/StudentCountQry.java @@ -31,6 +31,7 @@ public class StudentCountQry { private String likeName; private String likeInterestedIds; private List corpinfoIds; + private List phones; } diff --git a/web-client/src/main/java/com/zcloud/edu/dto/study/StudentPageQry.java b/web-client/src/main/java/com/zcloud/edu/dto/study/StudentPageQry.java index 02db9da..cb21682 100644 --- a/web-client/src/main/java/com/zcloud/edu/dto/study/StudentPageQry.java +++ b/web-client/src/main/java/com/zcloud/edu/dto/study/StudentPageQry.java @@ -28,6 +28,7 @@ public class StudentPageQry extends PageQuery { private String likeProjectNames; private String likeName; private String likeInterestedIds; - + private String likeClassName; + private Integer state; } diff --git a/web-domain/src/main/java/com/zcloud/edu/domain/model/archives/ClassArchivesE.java b/web-domain/src/main/java/com/zcloud/edu/domain/model/archives/ClassArchivesE.java index 36bbebb..6e41030 100644 --- a/web-domain/src/main/java/com/zcloud/edu/domain/model/archives/ClassArchivesE.java +++ b/web-domain/src/main/java/com/zcloud/edu/domain/model/archives/ClassArchivesE.java @@ -52,6 +52,9 @@ public class ClassArchivesE extends BaseE { //机构ID @ApiModelProperty(value = "机构ID") private Long corpinfoId; + // 机构名称 + @ApiModelProperty(value = "机构名称") + private String corpName; //状态:1-未申请 2-待开班 3- 培训中 4-培训结束 @ApiModelProperty(value = "状态:1-未申请 2-待开班 3- 培训中 4-培训结束 ") private Integer state; diff --git a/web-domain/src/main/java/com/zcloud/edu/domain/model/study/ClassE.java b/web-domain/src/main/java/com/zcloud/edu/domain/model/study/ClassE.java index 885a65d..5bca66f 100644 --- a/web-domain/src/main/java/com/zcloud/edu/domain/model/study/ClassE.java +++ b/web-domain/src/main/java/com/zcloud/edu/domain/model/study/ClassE.java @@ -37,6 +37,8 @@ public class ClassE extends BaseE { private String trainingLocation; //机构ID private Long corpinfoId; + //机构名称 + private String corpName; //状态:1-未申请 2-待开班 3- 培训中 4-培训结束 private Integer state; //培训有效期日期 开始时间 diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/study/StudentDO.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/study/StudentDO.java index 026fbb4..2913e15 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/study/StudentDO.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/study/StudentDO.java @@ -112,6 +112,11 @@ public class StudentDO extends BaseDO { private Integer completeClassCount; + @ApiModelProperty(value = "部门名称") + @TableField(exist = false) + private String departmentName; + + //班级名称 @ApiModelProperty(value = "班级名称") @TableField(exist = false) diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java index 3395f77..6721a1d 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java @@ -1,6 +1,8 @@ package com.zcloud.edu.persistence.mapper.study; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.zcloud.edu.persistence.dataobject.study.ClassDO; import com.zcloud.edu.persistence.dataobject.study.StudentDO; import com.zcloud.edu.persistence.mapper.po.study.StudentCountPO; @@ -18,6 +20,9 @@ import java.util.Map; */ @Mapper public interface StudentMapper extends BaseMapper { + + IPage listPageClassByStudent(IPage page, @Param("params") Map params); + long postponeUpdateStudent(String classId); List countStudentByClass(List classIds); @@ -33,6 +38,8 @@ public interface StudentMapper extends BaseMapper { List countStudentByCorpId(@Param("params") Map params); + List listStudentCount(@Param("params") Map params); + StudentDO findInfoByStudentId(@Param("studentId") String studentId); } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/ClassCurriculumChapterRepositoryImpl.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/ClassCurriculumChapterRepositoryImpl.java index 6107a87..e4949cd 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/ClassCurriculumChapterRepositoryImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/ClassCurriculumChapterRepositoryImpl.java @@ -64,10 +64,7 @@ public class ClassCurriculumChapterRepositoryImpl extends BaseRepositoryImpl listByClassCurriculumIds(List classCurriculumIds) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("class_curriculum_id", classCurriculumIds); - queryWrapper.eq("delete_enum", "FALSE"); - return classCurriculumChapterMapper.selectList(queryWrapper); + return classCurriculumChapterMapper.listByClassCurriculumIds(classCurriculumIds); } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java index 3ea6984..ac38ee3 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java @@ -40,6 +40,13 @@ public class StudentRepositoryImpl extends BaseRepositoryImpl listPageClassByStudent(Map params) { + IPage iPage = new Query().getPage(params); + IPage result = studentMapper.listPageClassByStudent(iPage, params); + return PageHelper.pageToResponse(result, result.getRecords()); + } + @Override public Boolean addBatch(List studentDOs) { saveBatch(studentDOs); @@ -112,5 +119,10 @@ public class StudentRepositoryImpl extends BaseRepositoryImpl listStudentCount(Map params) { + return studentMapper.listStudentCount(params); + } + } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java index 437b699..1471758 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java @@ -17,6 +17,7 @@ import java.util.Map; */ public interface StudentRepository extends BaseRepository { PageResponse listPage(Map params); + PageResponse listPageClassByStudent(Map params); Boolean addBatch(List studentDOs); Long countByClassId(String classId); @@ -40,5 +41,7 @@ public interface StudentRepository extends BaseRepository { void updateStudent(Map params); List countStudentByCorpId(Map params); + + List listStudentCount(Map params); } diff --git a/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml b/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml index cf3aebf..69d36a1 100644 --- a/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml @@ -78,6 +78,7 @@ count(CASE WHEN s.state = 1 THEN 1 END) complete_class_count FROM student s + left join class c on c.class_id = s.class_id AND s.phone in @@ -86,6 +87,8 @@ and s.delete_enum = 'FALSE' + and c.delete_enum = 'FALSE' + and c.state != 1 group by s.phone @@ -121,7 +124,7 @@ + + + + + +