|
|
@@ -30,6 +30,7 @@ import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
|
|
|
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
@@ -38,6 +39,7 @@ import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
|
|
|
+import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformRemindQueryBo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
|
import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
@@ -111,6 +113,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
@Autowired
|
|
|
private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserPeriodStatusService userPeriodStatusService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IUserService iUserService;
|
|
|
|
|
|
@@ -305,6 +310,42 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Integer insertByAddBo(UserStudyRecordAddBo bo) {
|
|
|
+ CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
|
|
|
+ //判断录播拍照是否达标
|
|
|
+ if(courseSectionVo.getSectionType()==1&&Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==1){
|
|
|
+ GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
|
|
|
+ if(Validator.isNotEmpty(goodsVo)){
|
|
|
+ CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
+ queryBo.setId(goodsVo.getBusinessId());
|
|
|
+ String fullName = iCourseBusinessService.queryFullName(queryBo);
|
|
|
+ if(Validator.isNotEmpty(fullName)){
|
|
|
+ if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")){
|
|
|
+ if(Validator.isNotEmpty(courseSectionVo.getDurationTime())){
|
|
|
+ Integer num = (int)Math.ceil(courseSectionVo.getDurationTime()/(15*60));
|
|
|
+ UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
|
|
|
+ userPeriodQueryBo2.setSectionId(bo.getSectionId());
|
|
|
+ userPeriodQueryBo2.setCourseId(bo.getCourseId());
|
|
|
+ userPeriodQueryBo2.setGoodsId(bo.getGoodsId());
|
|
|
+ userPeriodQueryBo2.setUserId(bo.getUserId());
|
|
|
+ userPeriodQueryBo2.setChapterId(bo.getChapterId());
|
|
|
+ userPeriodQueryBo2.setModuleId(bo.getModuleId());
|
|
|
+ userPeriodQueryBo2.setGradeId(bo.getGradeId());
|
|
|
+ List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo2);
|
|
|
+ if (!CollectionUtils.isEmpty(userPeriodStatusVos)&&userPeriodStatusVos.size()>0) {
|
|
|
+ int numIndex = userPeriodStatusVos.size() - 1;
|
|
|
+ UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
|
|
|
+ LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
+ List<UserStudyRecordPhoto> examPhoto = userStudyRecordPhotoService.list(lqw);
|
|
|
+ if(examPhoto.size()<num){
|
|
|
+ throw new CustomException("拍照次数不达标");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
// throw new CustomException("订单商品ID缺失");
|
|
|
// }
|
|
|
@@ -319,11 +360,12 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
}
|
|
|
redisCache.setCacheObject(key,1L,3, TimeUnit.SECONDS);//3秒
|
|
|
|
|
|
- CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
|
|
|
+
|
|
|
if(courseSectionVo.getSectionType()==2&&Validator.isNotEmpty(bo.getPhoto())){ //直播有拍照即学完 第五阶段去掉这个需求
|
|
|
// bo.setStatus(1);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
UserStudyRecordQueryBo userStudyRecordQueryBo = BeanUtil.toBean(bo, UserStudyRecordQueryBo.class);
|
|
|
UserStudyRecordVo first = queryFirst(userStudyRecordQueryBo);
|
|
|
UserStudyRecord add = BeanUtil.toBean(bo, UserStudyRecord.class);
|