glcc后台页面更新-bugfix

This commit is contained in:
Gitea 2023-09-05 10:57:06 +08:00
parent c9e797819c
commit c5fa9d17a6
7 changed files with 38 additions and 20 deletions

View File

@ -307,8 +307,17 @@ public class ApplyController {
String projectNames,String taskNames,String tutorNames,
String matchStudentNames,Integer checkStatus,Boolean match) {
Page<RegistrationTaskVo> page = applyTaskService.taskListNew(curPage, pageSize, round,projectNames,taskNames,tutorNames,matchStudentNames,checkStatus,match);
return DataPacketUtil.ok(page.getTotal(), page.getRecords());
Page<RegistrationTaskWithStudentInfoVo> page = applyTaskService.taskListNew(curPage, pageSize, round,projectNames,taskNames,tutorNames,matchStudentNames,checkStatus,match);
List<RegistrationTaskWithStudentInfoVo> registrationTaskVos = page.getRecords().stream().map(item -> {
Set<Integer> taskIds = new HashSet<>();
taskIds.add(item.getId());
Boolean hasStudentUsedTask = studentApplyTaskService.existsTaskByStudentUsed(taskIds);
item.setHasStudent(hasStudentUsedTask);
return item;
}
).collect(Collectors.toList());
return DataPacketUtil.ok(page.getTotal(), registrationTaskVos);
}
@ApiOperation("是否有审核权限")

View File

@ -3,6 +3,7 @@ package com.xjy.ai.model.dao.glcc.mapper;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xjy.ai.model.service.glcc.vo.RegistrationTaskVo;
import com.xjy.ai.model.service.glcc.vo.RegistrationTaskWithStudentInfoVo;
import java.util.List;
@ -16,10 +17,10 @@ import java.util.List;
*/
public interface GlccRegistrationTaskMapper extends BaseMapper<GlccRegistrationTask> {
List<RegistrationTaskVo> selectTaskListWithProject(Integer offset,Integer pageSize,Integer round, List<String> projectNames,
List<String> taskNames, List<String> tutorNames,
List<String> matchStudentNames, Integer checkStatus,
Boolean match);
List<RegistrationTaskWithStudentInfoVo> selectTaskListWithProject(Integer offset, Integer pageSize, Integer round, List<String> projectNames,
List<String> taskNames, List<String> tutorNames,
List<String> matchStudentNames, Integer checkStatus,
Boolean match);
Long selectTaskListWithProjectCount(Integer offset,Integer pageSize,Integer round, List<String> projectNames,
List<String> taskNames, List<String> tutorNames,
List<String> matchStudentNames, Integer checkStatus,

View File

@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationStudent;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationTask;
import com.xjy.ai.model.service.glcc.vo.RegistrationTaskVo;
import com.xjy.ai.model.service.glcc.vo.RegistrationTaskWithStudentInfoVo;
import com.xjy.ai.model.service.glcc.vo.UpdateSortVo;
import com.xjy.ai.model.service.glcc.vo.UpdateTaskInfoVo;
@ -43,7 +43,7 @@ public interface ApplyTaskService extends IService<GlccRegistrationTask> {
List<GlccRegistrationTask> getTaskListByName(String taskName, Integer round);
Page<RegistrationTaskVo> taskListNew(int curPage, int pageSize, Integer round, String projectNames, String taskNames, String tutorNames, String matchStudentNames, Integer checkStatus, Boolean match);
Page<RegistrationTaskWithStudentInfoVo> taskListNew(int curPage, int pageSize, Integer round, String projectNames, String taskNames, String tutorNames, String matchStudentNames, Integer checkStatus, Boolean match);
boolean updateTaskInfo(UpdateTaskInfoVo updateVo);
}

View File

@ -4,24 +4,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xjy.ai.common.constant.Constants;
import com.xjy.ai.common.response.HttpClientResult;
import com.xjy.ai.common.utils.CommonUtils;
import com.xjy.ai.common.utils.FastJsonUtils;
import com.xjy.ai.common.utils.HttpClientUtils;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationInformation;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationStudent;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationStudentTask;
import com.xjy.ai.model.dao.glcc.entity.GlccRegistrationTask;
import com.xjy.ai.model.dao.glcc.mapper.GlccRegistrationTaskMapper;
import com.xjy.ai.model.service.glcc.ApplyService;
import com.xjy.ai.model.service.glcc.ApplyTaskService;
import com.xjy.ai.model.service.glcc.vo.RegistrationTaskVo;
import com.xjy.ai.model.service.glcc.vo.SendMailVo;
import com.xjy.ai.model.service.glcc.vo.UpdateSortVo;
import com.xjy.ai.model.service.glcc.vo.UpdateTaskInfoVo;
import com.xjy.ai.model.service.glcc.vo.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
@ -231,14 +225,14 @@ public class ApplyTaskServiceImpl extends ServiceImpl<GlccRegistrationTaskMapper
}
@Override
public Page<RegistrationTaskVo> taskListNew(int curPage, int pageSize, Integer round, String projectNames, String taskNames, String tutorNames, String matchStudentNames, Integer checkStatus, Boolean match) {
public Page<RegistrationTaskWithStudentInfoVo> taskListNew(int curPage, int pageSize, Integer round, String projectNames, String taskNames, String tutorNames, String matchStudentNames, Integer checkStatus, Boolean match) {
List<String> projects = CommonUtils.splitToList(projectNames);
List<String> tasks = CommonUtils.splitToList(taskNames);
List<String> tutors = CommonUtils.splitToList(tutorNames);
List<String> matchStudents = CommonUtils.splitToList(matchStudentNames);
int offset = (curPage - 1) * pageSize;
Page<RegistrationTaskVo> page = new Page<>();
List<RegistrationTaskVo> list = baseMapper.selectTaskListWithProject(offset, pageSize, round, projects, tasks, tutors, matchStudents, checkStatus, match);
Page<RegistrationTaskWithStudentInfoVo> page = new Page<>();
List<RegistrationTaskWithStudentInfoVo> list = baseMapper.selectTaskListWithProject(offset, pageSize, round, projects, tasks, tutors, matchStudents, checkStatus, match);
page.setRecords(list);
page.setTotal(baseMapper.selectTaskListWithProjectCount(offset, pageSize, round, projects, tasks, tutors, matchStudents, checkStatus, match));
page.setPages(curPage);

View File

@ -55,6 +55,11 @@ public class RegistrationTaskWithStudentInfoVo {
private String matchTime;
//是否有学生报名
private Boolean hasStudent;
public Integer getId() {
return id;
}
@ -246,4 +251,12 @@ public class RegistrationTaskWithStudentInfoVo {
public void setMatch(Boolean match) {
isMatch = match;
}
public Boolean getHasStudent() {
return hasStudent;
}
public void setHasStudent(Boolean hasStudent) {
this.hasStudent = hasStudent;
}
}

View File

@ -74,7 +74,7 @@
stu.student_name AS 'student_name',
stu.mail AS 'student_email',
stu.phone AS 'student_phone',
'1970-01-01' as 'created_on',
null as 'created_on',
0 as 'is_authed',
'' as 'PPT_attachment_id',
'' as 'code_or_pr_url',
@ -153,7 +153,7 @@
stu.student_name AS 'student_name',
stu.mail AS 'student_email',
stu.phone AS 'student_phone',
'1970-01-01' as 'created_on',
null as 'created_on',
0 as 'is_authed',
'' as 'PPT_attachment_id',
'' as 'code_or_pr_url',

View File

@ -75,6 +75,7 @@
AND CASE WHEN grst.student_reg_id IS NULL THEN 0 ELSE 1 END = #{match}
</if>
</where>
order by grt.reg_id, grt.sort_no desc, grt.created_on desc
LIMIT #{offset}, #{pageSize}
</select>
<select id="selectTaskListWithProjectCount" resultType="Long">