|
|
|
@ -42,7 +42,20 @@ public class ExamPaperServiceImpl extends BaseServiceImpl<ExamPaperMapper, ExamP |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean delExamPaper(List<Long> ids) { |
|
|
|
|
public Map<String, Object> delExamPaper(List<Long> ids) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
int size = baseMapper.getExamIsUsed(ids); |
|
|
|
|
if( size > 0 ) |
|
|
|
|
{ |
|
|
|
|
map.put("success", "error"); |
|
|
|
|
if (ids.size() > 1){ |
|
|
|
|
map.put("message", "选中的试卷中有" + size + "个已被引用,需删除引用的考试后方可删除"); |
|
|
|
|
} else { |
|
|
|
|
map.put("message", "该试卷已被引用,需删除引用的考试后方可删除"); |
|
|
|
|
} |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean flag = false; |
|
|
|
|
flag = deleteLogic(ids); |
|
|
|
|
|
|
|
|
@ -54,11 +67,29 @@ public class ExamPaperServiceImpl extends BaseServiceImpl<ExamPaperMapper, ExamP |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return flag; |
|
|
|
|
if (flag) { |
|
|
|
|
map.put("success", "true"); |
|
|
|
|
map.put("message", "试卷更新成功"); |
|
|
|
|
} else { |
|
|
|
|
map.put("success", "false"); |
|
|
|
|
map.put("message", "试卷更新失败"); |
|
|
|
|
} |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean upPaperStatus(InsExamPaperVO vo) { |
|
|
|
|
public Map<String, Object> upPaperStatus(InsExamPaperVO vo) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
int size = baseMapper.getExamIsUsed(vo.getIds()); |
|
|
|
|
if (size > 0) { |
|
|
|
|
map.put("success", "error"); |
|
|
|
|
if (vo.getIds().size() > 1) { |
|
|
|
|
map.put("message", "选中的试卷中有" + size + "个已被引用,需删除引用的考试后方可" + (vo.getPaperStatus() == 0 ? "停用" : "启用")); |
|
|
|
|
} else { |
|
|
|
|
map.put("message", "该试卷已被引用,需删除引用的考试后方可" + (vo.getPaperStatus() == 0 ? "停用" : "启用")); |
|
|
|
|
} |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
boolean flag = false; |
|
|
|
|
for (Long id : vo.getIds()) { |
|
|
|
|
ExamPapers entity = baseMapper.getExamPaperDetail(id); |
|
|
|
@ -68,7 +99,14 @@ public class ExamPaperServiceImpl extends BaseServiceImpl<ExamPaperMapper, ExamP |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return flag; |
|
|
|
|
if (flag) { |
|
|
|
|
map.put("success", "true"); |
|
|
|
|
map.put("message", "试卷更新成功"); |
|
|
|
|
} else { |
|
|
|
|
map.put("success", "false"); |
|
|
|
|
map.put("message", "试卷更新失败"); |
|
|
|
|
} |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|