【修改】word、excel补全,判分修改,超级管理员可以直接删除试卷任务
This commit is contained in:
@@ -158,4 +158,8 @@ public interface EducationPaperTaskMapper extends BaseMapperX<EducationPaperTask
|
||||
//查询该试卷涉及的所有课程(课程ID + 名称)
|
||||
List<CourseInVo> selectPaperCountBypaperId(@Param("paperId") String paperId);
|
||||
|
||||
List<String> selectUserRoleId(Long loginUserId);
|
||||
|
||||
List<String> selectUserRole(List<String> roleIds);
|
||||
|
||||
}
|
||||
|
@@ -201,7 +201,25 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
||||
if (taskIds == null || taskIds.length == 0) {
|
||||
return "请选择删除数据!";
|
||||
}
|
||||
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
List<String>roleIds= educationPaperTaskMapper.selectUserRoleId(loginUserId);
|
||||
if (roleIds!=null&&roleIds.size()>0){
|
||||
List<String> userRole= educationPaperTaskMapper.selectUserRole(roleIds);
|
||||
if (userRole!=null&&userRole.size()>0) {
|
||||
boolean flag = false;
|
||||
for (String s : userRole) {
|
||||
if ("超级管理员".equals(s) || "租户管理员".equals(s)) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
// 3. 执行删除操作
|
||||
educationPaperTaskMapper.deleteEducationPaperTaskByTaskIds(taskIds);
|
||||
monitorMapper.deleteByTaskIds(taskIds);
|
||||
return "删除成功";
|
||||
}
|
||||
}
|
||||
}
|
||||
// 1. 找出没有关联试卷的任务ID
|
||||
List<String> canDeleteTaskIds = new ArrayList<>();
|
||||
List<String> cannotDeleteTaskIds = new ArrayList<>();
|
||||
@@ -250,6 +268,25 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
||||
public String deleteEducationPaperTaskByTaskId(String taskId) {
|
||||
EducationPaperTask educationPaperTask = educationPaperTaskMapper.selectById(taskId);
|
||||
if (educationPaperTask.getTaskType().equals("0") || educationPaperTask.getTaskType().equals("1") || educationPaperTask.getTaskType().equals("3")) {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
List<String>roleIds= educationPaperTaskMapper.selectUserRoleId(loginUserId);
|
||||
if (roleIds!=null&&roleIds.size()>0){
|
||||
List<String> userRole= educationPaperTaskMapper.selectUserRole(roleIds);
|
||||
if (userRole!=null&&userRole.size()>0) {
|
||||
boolean flag = false;
|
||||
for (String s : userRole) {
|
||||
if ("超级管理员".equals(s) || "租户管理员".equals(s)) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
// 3. 执行删除操作
|
||||
educationPaperTaskMapper.deleteEducationPaperTaskByTaskId(taskId);
|
||||
monitorMapper.deleteByTaskId(taskId);
|
||||
return "删除成功";
|
||||
}
|
||||
}
|
||||
}
|
||||
// 1. 找出没有关联试卷的任务ID
|
||||
List<String> canDeleteTaskIds = new ArrayList<>();
|
||||
List<String> cannotDeleteTaskIds = new ArrayList<>();
|
||||
|
@@ -43,6 +43,7 @@
|
||||
LEFT JOIN education_paper_person pp ON s.id = pp.person_id
|
||||
WHERE
|
||||
s.user_type = #{userType}
|
||||
and s.deleted = 0
|
||||
AND s.id IN (
|
||||
SELECT person_id FROM education_paper_person WHERE
|
||||
session_id ='' and
|
||||
@@ -83,6 +84,7 @@
|
||||
LEFT JOIN education_paper_person pp ON s.id = pp.person_id
|
||||
WHERE
|
||||
s.user_type = #{userType}
|
||||
and s.deleted = 0
|
||||
AND s.id NOT IN (
|
||||
SELECT person_id FROM education_paper_person WHERE task_id =#{taskId}
|
||||
)
|
||||
@@ -138,6 +140,7 @@
|
||||
LEFT JOIN education_paper_person pp ON s.id = pp.person_id
|
||||
WHERE
|
||||
s.user_type = #{userType}
|
||||
and s.deleted = 0
|
||||
AND s.id IN (
|
||||
SELECT person_id FROM education_paper_person WHERE
|
||||
session_id ='' and
|
||||
@@ -164,6 +167,7 @@
|
||||
LEFT JOIN education_paper_person pp ON s.id = pp.person_id
|
||||
WHERE
|
||||
s.user_type = #{userType}
|
||||
and s.deleted = 0
|
||||
AND s.id NOT IN (
|
||||
SELECT person_id FROM education_paper_person WHERE task_id =#{taskId}
|
||||
)
|
||||
|
@@ -40,12 +40,17 @@
|
||||
LIMIT 1;
|
||||
</select>
|
||||
<select id="selectUsedQuestionIds" resultType="java.lang.String">
|
||||
SELECT DISTINCT qu_id
|
||||
FROM education_paper_qu
|
||||
WHERE qu_id IN
|
||||
SELECT DISTINCT epq.qu_id
|
||||
FROM education_paper_qu epq
|
||||
JOIN education_paper ep ON ep.paper_id = epq.paper_id
|
||||
JOIN education_paper_task ept ON ept.task_id = ep.task_id
|
||||
WHERE epq.qu_id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
AND ept.task_type IN ('0','1','3')
|
||||
and ep.deleted ='0'
|
||||
and ept.deleted ='0';
|
||||
</select>
|
||||
<select id="selectByPaperIdAndType" resultType="java.lang.String">
|
||||
SELECT epq.qu_id
|
||||
|
@@ -192,6 +192,17 @@
|
||||
and course.deleted ='0'
|
||||
GROUP BY course.sp_id, course.sp_name, major.sp_name
|
||||
</select>
|
||||
<select id="selectUserRoleId" resultType="java.lang.String">
|
||||
select role_id from system_user_role where user_id =#{loginUserId}
|
||||
</select>
|
||||
<select id="selectUserRole" resultType="java.lang.String">
|
||||
select name
|
||||
from system_role
|
||||
where id in
|
||||
<foreach collection="list" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertEducationPaperTask" parameterType="EducationPaperTask">
|
||||
|
Reference in New Issue
Block a user