删除数据处理接口,改用SQL处理数据
This commit is contained in:
parent
89f6f5ad4d
commit
c00fbd22b3
@ -1,2 +1,7 @@
|
||||
alter table exam_definition
|
||||
add `system` bit default 0 not null comment '系统生成';
|
||||
-- 数据处理
|
||||
UPDATE exam_definition
|
||||
SET `system` = 1
|
||||
WHERE
|
||||
remarks LIKE '%默认试卷'
|
@ -146,11 +146,6 @@ public class ExamController {
|
||||
iExamService.updateRules(examDefinitionVO);
|
||||
}
|
||||
|
||||
@PutMapping("/handleData/system")
|
||||
public void updateSystem() {
|
||||
iExamService.updateSystem();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查并更新【规则数据异常】状态
|
||||
*/
|
||||
|
@ -503,26 +503,6 @@ public class ExamService implements IExamService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateSystem() {
|
||||
LsLessonExample lessonExample = new LsLessonExample();
|
||||
lessonExample.createCriteria().andSysfaultEqualTo(true);
|
||||
List<Long> lessonIds = lessonDAO.selectByExample(lessonExample)
|
||||
.stream()
|
||||
.map(LsLesson::getId)
|
||||
.collect(Collectors.toList());
|
||||
ExamDefinitionExample examExample = new ExamDefinitionExample();
|
||||
examExample.createCriteria().andLessonIdIn(lessonIds);
|
||||
List<ExamDefinition> exams = examDefinitionDAO.selectByExample(examExample);
|
||||
for (ExamDefinition exam : exams) {
|
||||
if (StringUtils.hasText(exam.getRemarks()) && exam.getRemarks().contains("-默认试卷")) {
|
||||
exam.setSystem(true);
|
||||
examDefinitionDAO.updateByPrimaryKey(exam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void generateExam(long mapId, long lessonId, String prdType, String lessonName, long creatorId) {
|
||||
|
@ -127,5 +127,4 @@ public interface IExamService {
|
||||
*/
|
||||
void regenerateRules(long mapId);
|
||||
|
||||
void updateSystem();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user