|
@@ -3,6 +3,7 @@ package com.zhongzheng.modules.course.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
@@ -14,8 +15,11 @@ import com.zhongzheng.modules.course.bo.CourseEditBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
|
import com.zhongzheng.modules.course.domain.Course;
|
|
|
+import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
+import com.zhongzheng.modules.course.domain.CoursePhotoLog;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
|
|
|
+import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
|
import com.zhongzheng.modules.course.vo.CourseUserVo;
|
|
@@ -29,11 +33,16 @@ import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
+import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeVo;
|
|
|
+import com.zhongzheng.modules.grade.vo.UserPeriodVo;
|
|
|
import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
|
|
|
+import com.zhongzheng.modules.user.domain.UserBankRecord;
|
|
|
+import com.zhongzheng.modules.user.domain.UserStudyRecord;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
|
|
|
+import com.zhongzheng.modules.user.service.IUserBankRecordService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
|
|
@@ -76,6 +85,17 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
@Autowired
|
|
|
private IGoodsCourseService iGoodsCourseService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserPeriodService iUserPeriodService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICoursePhotoLogService iCoursePhotoLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserBankRecordService iUserBankRecordService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public CourseVo queryById(Long courseId){
|
|
|
Course db = this.baseMapper.selectById(courseId);
|
|
@@ -271,6 +291,39 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
userPeriodStatusAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
userPeriodStatusAddBo.setStatus(3);
|
|
|
userPeriodStatusService.insertByAddBo(userPeriodStatusAddBo);
|
|
|
+ UserPeriodVo vo = iUserPeriodService.queryById(goodsPeriodStatusVo.getPeriodId());
|
|
|
+ LambdaUpdateWrapper<CoursePhotoLog> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(CoursePhotoLog::getUserId, bo.getUserId());
|
|
|
+ objectLambdaUpdateWrapper.eq(CoursePhotoLog::getGoodsId, vo.getGoodsId());
|
|
|
+ objectLambdaUpdateWrapper.eq(CoursePhotoLog::getSectionId,vo.getSectionId());
|
|
|
+ objectLambdaUpdateWrapper.eq(CoursePhotoLog::getGradeId,vo.getGradeId());
|
|
|
+ objectLambdaUpdateWrapper.eq(vo.getModuleId()>0,CoursePhotoLog::getModuleId,vo.getModuleId());
|
|
|
+ objectLambdaUpdateWrapper.eq(vo.getChapterId()>0,CoursePhotoLog::getChapterId,vo.getChapterId());
|
|
|
+
|
|
|
+ objectLambdaUpdateWrapper.set(CoursePhotoLog::getCurrentStatus,0); //拍照记录改为历史状态
|
|
|
+ iCoursePhotoLogService.update(null, objectLambdaUpdateWrapper);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<UserStudyRecord> objectLambdaUpdateWrapper1 = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper1.eq(UserStudyRecord::getUserId, bo.getUserId());
|
|
|
+ objectLambdaUpdateWrapper1.eq(UserStudyRecord::getGoodsId, vo.getGoodsId());
|
|
|
+ objectLambdaUpdateWrapper1.eq(UserStudyRecord::getSectionId,vo.getSectionId());
|
|
|
+ objectLambdaUpdateWrapper1.eq(UserStudyRecord::getGradeId,vo.getGradeId());
|
|
|
+ objectLambdaUpdateWrapper1.eq(vo.getModuleId()>0,UserStudyRecord::getModuleId,vo.getModuleId());
|
|
|
+ objectLambdaUpdateWrapper1.eq(vo.getChapterId()>0,UserStudyRecord::getChapterId,vo.getChapterId());
|
|
|
+
|
|
|
+ objectLambdaUpdateWrapper1.set(UserStudyRecord::getCurrentStatus,0); //学习记录改为历史状态
|
|
|
+ iUserStudyRecordService.update(null, objectLambdaUpdateWrapper1);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<UserBankRecord> objectLambdaUpdateWrapper2 = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper2.eq(UserBankRecord::getUserId, bo.getUserId());
|
|
|
+ objectLambdaUpdateWrapper2.eq(UserBankRecord::getGoodsId, vo.getGoodsId());
|
|
|
+ objectLambdaUpdateWrapper2.eq(UserBankRecord::getSectionId,vo.getSectionId());
|
|
|
+ objectLambdaUpdateWrapper2.eq(UserBankRecord::getGradeId,vo.getGradeId());
|
|
|
+ objectLambdaUpdateWrapper2.eq(vo.getModuleId()>0,UserBankRecord::getModuleId,vo.getModuleId());
|
|
|
+ objectLambdaUpdateWrapper2.eq(vo.getChapterId()>0,UserBankRecord::getChapterId,vo.getChapterId());
|
|
|
+
|
|
|
+ objectLambdaUpdateWrapper2.set(UserBankRecord::getCurrentStatus,0); //做卷记录改为历史状态
|
|
|
+ iUserBankRecordService.update(null, objectLambdaUpdateWrapper2);
|
|
|
}
|
|
|
return true;
|
|
|
}
|