|
@@ -68,7 +68,7 @@ public class CourseTargetServiceImpl extends ServiceImpl<CourseTargetMapper, Cou
|
|
|
String targetContent = e.getTargetContent();
|
|
|
List<Long> dimensionIdList = JSON.parseArray(targetContent, Long.class);
|
|
|
List<CourseDimensionDto> dimensionList = new ArrayList<>();
|
|
|
- if (SystemConstant.strNotNull(targetContent)){
|
|
|
+ if (SystemConstant.strNotNull(targetContent)) {
|
|
|
dimensionIdList.forEach(d -> {
|
|
|
CourseDimensionDto courseDimensionDto = new CourseDimensionDto();
|
|
|
CourseDimension courseDimension = courseDimensionMap.get(d);
|
|
@@ -97,7 +97,7 @@ public class CourseTargetServiceImpl extends ServiceImpl<CourseTargetMapper, Cou
|
|
|
.collect(Collectors.toMap(BaseEntity::getId, v -> {
|
|
|
List<Long> dimensionList = new ArrayList<>();
|
|
|
String targetContent = v.getTargetContent();
|
|
|
- if (SystemConstant.strNotNull(targetContent)){
|
|
|
+ if (SystemConstant.strNotNull(targetContent)) {
|
|
|
dimensionList = JSON.parseArray(targetContent, Long.class);
|
|
|
}
|
|
|
return dimensionList;
|
|
@@ -165,7 +165,7 @@ public class CourseTargetServiceImpl extends ServiceImpl<CourseTargetMapper, Cou
|
|
|
List<Long> occupiedIdList = courseTargetResultList.stream().flatMap(e -> {
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
String content = e.getTargetContent();
|
|
|
- if (SystemConstant.strNotNull(content)){
|
|
|
+ if (SystemConstant.strNotNull(content)) {
|
|
|
idList = JSON.parseArray(content, Long.class);
|
|
|
}
|
|
|
return idList.stream();
|
|
@@ -197,15 +197,31 @@ public class CourseTargetServiceImpl extends ServiceImpl<CourseTargetMapper, Cou
|
|
|
|
|
|
if (SystemConstant.longNotNull(id)) {
|
|
|
// 编辑 (更新教学课程权重标识)
|
|
|
+ UpdateWrapper<TeachCourse> teachCourseUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ teachCourseUpdateWrapper.lambda().eq(TeachCourse::getId, teachCourseId);
|
|
|
+
|
|
|
+ CourseTarget db = this.getById(id);
|
|
|
+ String dbContent = db.getTargetContent();
|
|
|
+ if (SystemConstant.strNotNull(dbContent)) {
|
|
|
+ List<Long> dbDimensionList = JSON.parseArray(dbContent, Long.class);
|
|
|
+ if (!dimensionIdList.containsAll(dbDimensionList) || !dbDimensionList.containsAll(dimensionIdList)) {
|
|
|
+ // 关联知识点变化 重设知识点,权重md5更新
|
|
|
+ teachCourseUpdateWrapper.lambda().set(TeachCourse::getDimensionSign, SystemConstant.getDbUuid())
|
|
|
+ .set(TeachCourse::getWeightSettingSign, SystemConstant.getDbUuid());
|
|
|
+ }
|
|
|
+ // 目标描述变了 更新权重设置标识
|
|
|
+ if (!courseTarget.getTargetName().equals(db.getTargetName()) || !courseTarget.getDegreeRequirement()
|
|
|
+ .equals(db.getDegreeRequirement())) {
|
|
|
+ teachCourseUpdateWrapper.lambda().set(TeachCourse::getWeightSettingSign, SystemConstant.getDbUuid());
|
|
|
+ }
|
|
|
+ }
|
|
|
courseTarget.setId(id);
|
|
|
courseTarget.updateInfo(requestUserId);
|
|
|
-
|
|
|
- UpdateWrapper<TeachCourse> teachCourseUpdateWrapper = new UpdateWrapper<>();
|
|
|
- teachCourseUpdateWrapper.lambda().eq(TeachCourse::getId, teachCourseId)
|
|
|
- .set(TeachCourse::getWeightSettingSign, SystemConstant.getDbUuid());
|
|
|
teachCourseService.update(teachCourseUpdateWrapper);
|
|
|
} else {
|
|
|
// 新增 (清空权重设置)
|
|
|
+ teachCourseService.update(
|
|
|
+ new UpdateWrapper<TeachCourse>().lambda().eq(TeachCourse::getId, courseTarget.getTeachCourseId()).set(TeachCourse::getDimensionSign, SystemConstant.getDbUuid()));
|
|
|
teachCourseService.clearCourseSetting(teachCourseId, CourseSettingTypeEnum.COURSE_TARGET);
|
|
|
courseTarget.insertInfo(requestUserId);
|
|
|
}
|
|
@@ -217,6 +233,8 @@ public class CourseTargetServiceImpl extends ServiceImpl<CourseTargetMapper, Cou
|
|
|
public void deleteCourseTarget(Long id) {
|
|
|
CourseTarget courseTarget = this.getById(id);
|
|
|
if (Objects.nonNull(courseTarget)) {
|
|
|
+ teachCourseService.update(
|
|
|
+ new UpdateWrapper<TeachCourse>().lambda().eq(TeachCourse::getId, courseTarget.getTeachCourseId()).set(TeachCourse::getDimensionSign, SystemConstant.getDbUuid()));
|
|
|
teachCourseService.clearCourseSetting(courseTarget.getTeachCourseId(), CourseSettingTypeEnum.COURSE_TARGET);
|
|
|
this.removeById(id);
|
|
|
}
|