添加学员培训记录管理和统计功能
parent
2bda8de692
commit
74d18fd83c
|
|
@ -43,6 +43,7 @@ public class ArchivesController {
|
|||
public SingleResponse<PersonArchivesDTO> getAttendanceRecord(@RequestBody ClassArchivesQry qry) {
|
||||
return studentService.getAttendanceRecord(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("查询学习档案")
|
||||
@PostMapping("/getStudyArchives")
|
||||
public SingleResponse<PersonArchivesDTO> getStudyArchives(@RequestBody ClassArchivesQry qry) {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ public class StudentController {
|
|||
public PageResponse<StudentCO> page(@RequestBody StudentPageQry qry) {
|
||||
return studentService.listPage(qry);
|
||||
}
|
||||
@ApiOperation("培训记录管理分页")
|
||||
@PostMapping("/listPageClassByStudent")
|
||||
public PageResponse<StudentCO> listPageClassByStudent(@RequestBody StudentPageQry qry) {
|
||||
return studentService.listPageClassByStudent(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
|
|
@ -55,18 +60,32 @@ public class StudentController {
|
|||
return MultiResponse.of(new ArrayList<StudentCO>());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("查询用户统计")
|
||||
@PostMapping("/listStudentCount")
|
||||
public MultiResponse<StudentCO> listStudentCount(@RequestBody StudentCountQry qry) {
|
||||
return studentService.listStudentCount(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<StudentCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new StudentCO());
|
||||
}
|
||||
|
||||
@ApiOperation("查看学员详情")
|
||||
@GetMapping("/getInfoByStudentId/{studentId}")
|
||||
public SingleResponse<StudentCO> getInfoByStudentId(@PathVariable("studentId") String studentId) {
|
||||
return studentService.getInfoByStudentId(studentId);
|
||||
}
|
||||
@ApiOperation("班级内学员数")
|
||||
@GetMapping("/countStudent/{classId}")
|
||||
public SingleResponse<Long> countStudent(@PathVariable("classId") String classId) {
|
||||
return SingleResponse.of(studentService.countStudent(classId));
|
||||
}
|
||||
|
||||
@ApiOperation("班级内学员数")
|
||||
@ApiOperation("根据企业统计学员")
|
||||
@PostMapping("/countStudentByCorpId")
|
||||
public MultiResponse<StudentCO> countStudentByCorpId(@RequestBody StudentCountQry qry) {
|
||||
return studentService.countStudentByCorpId(qry);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,13 @@ public class StudentQueryExe {
|
|||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public PageResponse<StudentCO> executelistPageClassByStudent(StudentPageQry studentPageQry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(studentPageQry);
|
||||
PageResponse<StudentDO> pageResponse = studentRepository.listPageClassByStudent(params);
|
||||
List<StudentCO> examCenterCOS = studentCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<PersonArchivesDTO> executeAttendanceRecord(ClassArchivesQry qry){
|
||||
StudentDO studentDO = studentRepository.getById(qry.getStuId());
|
||||
StudentE studentE = new StudentE();
|
||||
|
|
@ -216,6 +223,17 @@ public class StudentQueryExe {
|
|||
List<StudentCO> studentCOList = BeanUtil.copyToList(studentDOList, StudentCO.class);
|
||||
return MultiResponse.of(studentCOList);
|
||||
}
|
||||
public MultiResponse<StudentCO> executeListStudentCount(StudentCountQry qry){
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
List<StudentDO> studentDOList = studentRepository.listStudentCount(params);
|
||||
List<StudentCO> studentCOList = BeanUtil.copyToList(studentDOList, StudentCO.class);
|
||||
return MultiResponse.of(studentCOList);
|
||||
}
|
||||
|
||||
public SingleResponse<StudentCO> executeGetInfoByStudentId(String studentId){
|
||||
StudentDO studentDO = studentRepository.findInfoByStudentId(studentId);
|
||||
StudentCO studentCO = BeanUtil.copyProperties(studentDO, StudentCO.class);
|
||||
return SingleResponse.of(studentCO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ public class StudentServiceImpl implements StudentServiceI {
|
|||
return studentQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<StudentCO> listPageClassByStudent(StudentPageQry qry) {
|
||||
return studentQueryExe.executelistPageClassByStudent(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(List<StudentAddCmd> cmdList) {
|
||||
|
||||
|
|
@ -97,5 +102,15 @@ public class StudentServiceImpl implements StudentServiceI {
|
|||
public MultiResponse<StudentCO> countStudentByCorpId(StudentCountQry qry) {
|
||||
return studentQueryExe.executeCountStudentByCorpId(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<StudentCO> listStudentCount(StudentCountQry qry) {
|
||||
return studentQueryExe.executeListStudentCount(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<StudentCO> getInfoByStudentId(String studentId) {
|
||||
return studentQueryExe.executeGetInfoByStudentId(studentId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import java.util.List;
|
|||
public interface StudentServiceI {
|
||||
PageResponse<StudentCO> listPage(StudentPageQry qry);
|
||||
|
||||
PageResponse<StudentCO> listPageClassByStudent(StudentPageQry qry);
|
||||
|
||||
SingleResponse<StudentCO> add(List<StudentAddCmd> cmdList);
|
||||
|
||||
void edit(StudentUpdateCmd cmd);
|
||||
|
|
@ -45,5 +47,9 @@ public interface StudentServiceI {
|
|||
SingleResponse<ClassArchivesDTO> getClassExamResult(ClassArchivesQry qry);
|
||||
|
||||
MultiResponse<StudentCO> countStudentByCorpId(StudentCountQry qry);
|
||||
|
||||
MultiResponse<StudentCO> listStudentCount(StudentCountQry qry);
|
||||
|
||||
SingleResponse<StudentCO> getInfoByStudentId(String studentId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,6 +110,11 @@ public class StudentCO extends ClientObject {
|
|||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "完成班级数")
|
||||
@TableField(exist = false)
|
||||
private String departmentName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public class StudentCountQry {
|
|||
private String likeName;
|
||||
private String likeInterestedIds;
|
||||
private List<Long> corpinfoIds;
|
||||
private List<String> phones;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ public class StudentPageQry extends PageQuery {
|
|||
private String likeProjectNames;
|
||||
private String likeName;
|
||||
private String likeInterestedIds;
|
||||
|
||||
private String likeClassName;
|
||||
private Integer state;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
//培训有效期日期 开始时间
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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<StudentDO> {
|
||||
|
||||
IPage<StudentDO> listPageClassByStudent(IPage<StudentDO> page, @Param("params") Map<String, Object> params);
|
||||
|
||||
long postponeUpdateStudent(String classId);
|
||||
|
||||
List<ClassDO> countStudentByClass(List<String> classIds);
|
||||
|
|
@ -33,6 +38,8 @@ public interface StudentMapper extends BaseMapper<StudentDO> {
|
|||
|
||||
List<StudentDO> countStudentByCorpId(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<StudentDO> listStudentCount(@Param("params") Map<String, Object> params);
|
||||
|
||||
StudentDO findInfoByStudentId(@Param("studentId") String studentId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,10 +64,7 @@ public class ClassCurriculumChapterRepositoryImpl extends BaseRepositoryImpl<Cla
|
|||
|
||||
@Override
|
||||
public List<ClassCurriculumChapterDO> listByClassCurriculumIds(List<String> classCurriculumIds) {
|
||||
QueryWrapper<ClassCurriculumChapterDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("class_curriculum_id", classCurriculumIds);
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
return classCurriculumChapterMapper.selectList(queryWrapper);
|
||||
return classCurriculumChapterMapper.listByClassCurriculumIds(classCurriculumIds);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,13 @@ public class StudentRepositoryImpl extends BaseRepositoryImpl<StudentMapper, Stu
|
|||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<StudentDO> listPageClassByStudent(Map<String, Object> params) {
|
||||
IPage<StudentDO> iPage = new Query<StudentDO>().getPage(params);
|
||||
IPage<StudentDO> result = studentMapper.listPageClassByStudent(iPage, params);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addBatch(List<StudentDO> studentDOs) {
|
||||
saveBatch(studentDOs);
|
||||
|
|
@ -112,5 +119,10 @@ public class StudentRepositoryImpl extends BaseRepositoryImpl<StudentMapper, Stu
|
|||
return studentMapper.countStudentByCorpId(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StudentDO> listStudentCount(Map<String, Object> params) {
|
||||
return studentMapper.listStudentCount(params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import java.util.Map;
|
|||
*/
|
||||
public interface StudentRepository extends BaseRepository<StudentDO> {
|
||||
PageResponse<StudentDO> listPage(Map<String, Object> params);
|
||||
PageResponse<StudentDO> listPageClassByStudent(Map<String, Object> params);
|
||||
Boolean addBatch(List<StudentDO> studentDOs);
|
||||
|
||||
Long countByClassId(String classId);
|
||||
|
|
@ -40,5 +41,7 @@ public interface StudentRepository extends BaseRepository<StudentDO> {
|
|||
void updateStudent(Map<String, Object> params);
|
||||
|
||||
List<StudentDO> countStudentByCorpId(Map<String, Object> params);
|
||||
|
||||
List<StudentDO> listStudentCount(Map<String, Object> params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
<where>
|
||||
<if test="params.inCorpinfoId != null">
|
||||
AND s.phone in
|
||||
|
|
@ -86,6 +87,8 @@
|
|||
</foreach>
|
||||
</if>
|
||||
and s.delete_enum = 'FALSE'
|
||||
and c.delete_enum = 'FALSE'
|
||||
and c.state != 1
|
||||
</where>
|
||||
group by s.phone
|
||||
</select>
|
||||
|
|
@ -121,7 +124,7 @@
|
|||
|
||||
<select id="countStudentByCorpId" resultType="com.zcloud.edu.persistence.dataobject.study.StudentDO">
|
||||
select
|
||||
count(*) student_count,
|
||||
count(DISTINCT s.phone) student_count,
|
||||
s.class_corpinfo_id
|
||||
from
|
||||
student s
|
||||
|
|
@ -130,10 +133,146 @@
|
|||
s.delete_enum = 'FALSE'
|
||||
and c.delete_enum = 'FALSE'
|
||||
and c.state != 1
|
||||
<if test="params.corpinfoIds != null and params.corpinfoIds.size > 0">
|
||||
s.class_corpinfo_id in
|
||||
<foreach item="item" collection="params.corpinfoIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by
|
||||
s.class_corpinfo_id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listStudentCount" resultType="com.zcloud.edu.persistence.dataobject.study.StudentDO">
|
||||
SELECT
|
||||
s.phone,
|
||||
count(*) class_count,
|
||||
count(CASE WHEN s.state = 1 THEN 1 END) complete_class_count,
|
||||
d.name as department_name
|
||||
FROM
|
||||
student s
|
||||
left join user u on u.phone = s.phone
|
||||
left join department d on d.department_id = u.department_id
|
||||
left join class c on c.class_id = s.class_id
|
||||
<where>
|
||||
<if test="params.phones != null">
|
||||
AND s.phone in
|
||||
<foreach collection="params.phones" item="phone" open="(" close=")" separator=",">
|
||||
#{phone}
|
||||
</foreach>
|
||||
</if>
|
||||
and s.delete_enum = 'FALSE'
|
||||
and c.delete_enum = 'FALSE'
|
||||
and c.state != 1
|
||||
</where>
|
||||
group by s.phone
|
||||
</select>
|
||||
<select id="listPageClassByStudent" resultType="com.zcloud.edu.persistence.dataobject.study.StudentDO">
|
||||
select
|
||||
s.id,
|
||||
s.student_id,
|
||||
s.user_id,
|
||||
s.class_id,
|
||||
s.name,
|
||||
s.class_corpinfo_id,
|
||||
s.phone,
|
||||
s.user_id_card,
|
||||
s.nation,
|
||||
s.nation_name,
|
||||
s.user_avatar_url,
|
||||
s.current_address,
|
||||
s.location_address,
|
||||
s.cultural_level,
|
||||
s.cultural_level_name,
|
||||
s.marital_status,
|
||||
s.marital_status_name,
|
||||
s.political_affiliation,
|
||||
s.political_affiliation_name,
|
||||
s.post_name,
|
||||
s.sign_flag,
|
||||
s.exam_sign_flag,
|
||||
case when s.state = 1 then 1
|
||||
when s.state = 0 and c.start_time > now() then 0
|
||||
when s.state = 0 and c.start_time <= now() and c.end_time >= now() then 2
|
||||
end as state,
|
||||
s.interested_ids,
|
||||
s.interested_names,
|
||||
s.project_ids,
|
||||
s.project_names,
|
||||
c.name as class_name,
|
||||
c.start_time,
|
||||
c.end_time
|
||||
|
||||
from
|
||||
student s
|
||||
left join class c on c.class_id = s.class_id
|
||||
<where>
|
||||
s.delete_enum = 'FALSE'
|
||||
and c.delete_enum = 'FALSE'
|
||||
and c.state != 1
|
||||
<if test="params.phone != null and params.phone != ''">
|
||||
and s.phone = #{params.phone}
|
||||
</if>
|
||||
<if test="params.likeClassName != null and params.likeClassName != ''">
|
||||
and c.name like concat('%',#{params.likeClassName},'%')
|
||||
</if>
|
||||
<if test="params.state != null and params.state != ''">
|
||||
<if test="params.state == 0">
|
||||
and s.state = 0
|
||||
and c.start_time > now()
|
||||
</if>
|
||||
<if test="params.state == 1">
|
||||
and s.state = #{params.state}
|
||||
</if>
|
||||
<if test="params.state == 2">
|
||||
and s.state = 0
|
||||
and c.start_time <= now()
|
||||
and c.end_time >= now()
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- findInfoByStudentId -->
|
||||
<select id="findInfoByStudentId" resultType="com.zcloud.edu.persistence.dataobject.study.StudentDO">
|
||||
select
|
||||
s.id,
|
||||
s.student_id,
|
||||
s.class_id,
|
||||
s.name,
|
||||
s.class_corpinfo_id,
|
||||
s.phone,
|
||||
s.user_id_card,
|
||||
s.nation,
|
||||
s.nation_name,
|
||||
s.user_avatar_url,
|
||||
s.current_address,
|
||||
s.location_address,
|
||||
s.cultural_level,
|
||||
s.cultural_level_name,
|
||||
s.marital_status,
|
||||
s.marital_status_name,
|
||||
s.political_affiliation,
|
||||
s.political_affiliation_name,
|
||||
s.post_name,
|
||||
s.sign_flag,
|
||||
s.exam_sign_flag,
|
||||
s.state,
|
||||
s.interested_ids,
|
||||
s.interested_names,
|
||||
s.project_ids,
|
||||
s.project_names,
|
||||
u.user_avatar_url,
|
||||
u.usse_id
|
||||
from
|
||||
student s
|
||||
left join user u on u.phone = s.phone
|
||||
<where>
|
||||
s.student_id = #{params.studentId}
|
||||
</where>
|
||||
group by s.student_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue