|
@@ -251,14 +251,14 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
errorList.add(question);
|
|
|
continue;
|
|
|
}
|
|
|
- Long projectId = findProjectId(question.getProject());
|
|
|
+ Long projectId = findProjectId(question.getProject(),eduId);
|
|
|
if(!Validator.isNotEmpty(projectId)){
|
|
|
// errorLog+=question.getProject()+"-该项目类型不存在\n";
|
|
|
question.setCause("项目类型不存在");
|
|
|
errorList.add(question);
|
|
|
continue;
|
|
|
}
|
|
|
- Long businessId = findBusinessId(question.getBusiness());
|
|
|
+ Long businessId = findBusinessId(question.getBusiness(),projectId);
|
|
|
if(!Validator.isNotEmpty(businessId)){
|
|
|
// errorLog+=question.getBusiness()+"-该业务层次不存在\n";
|
|
|
question.setCause("业务层次不存在");
|
|
@@ -431,7 +431,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public Long findProjectId(String project){
|
|
|
+ public Long findProjectId(String project,Long eduId){
|
|
|
if(project!=null){
|
|
|
String key = "PROJ_"+project;
|
|
|
Long value = redisCache.getCacheObject(key);
|
|
@@ -442,7 +442,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return value;
|
|
|
}
|
|
|
CourseProjectType info = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>()
|
|
|
- .eq(CourseProjectType::getProjectName,project).eq(CourseProjectType::getStatus,1).last("limit 1"));
|
|
|
+ .eq(CourseProjectType::getProjectName,project).eq(CourseProjectType::getEducationId,eduId).eq(CourseProjectType::getStatus,1).last("limit 1"));
|
|
|
if(info!=null){
|
|
|
redisCache.setCacheObject(key,info.getId(),3, TimeUnit.MINUTES);//3分钟
|
|
|
return info.getId();
|
|
@@ -453,7 +453,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public Long findBusinessId(String business){
|
|
|
+ public Long findBusinessId(String business,Long projectId){
|
|
|
if(business!=null){
|
|
|
String key = "BUS_"+business;
|
|
|
Long value = redisCache.getCacheObject(key);
|
|
@@ -464,7 +464,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return value;
|
|
|
}
|
|
|
CourseBusiness info = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>()
|
|
|
- .eq(CourseBusiness::getBusinessName,business).eq(CourseBusiness::getStatus,1).last("limit 1"));
|
|
|
+ .eq(CourseBusiness::getBusinessName,business).eq(CourseBusiness::getProjectId,projectId).eq(CourseBusiness::getStatus,1).last("limit 1"));
|
|
|
if(info!=null){
|
|
|
redisCache.setCacheObject(key,info.getId(),3, TimeUnit.MINUTES);//3分钟
|
|
|
return info.getId();
|