|
@@ -287,69 +287,76 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
|
|
|
}
|
|
|
//发送课时完成
|
|
|
- if (secLong.equals(studyLong)&§ionStudyRecordVo.getExamRecordNum().equals(sectionStudyRecordVo.getExamNum())) {
|
|
|
-
|
|
|
- LambdaQueryWrapper<ClassGradeUser> classGradeUser = Wrappers.lambdaQuery();
|
|
|
- classGradeUser.eq(ClassGradeUser::getUserId, bo.getUserId());
|
|
|
- classGradeUser.eq(ClassGradeUser::getGradeId, bo.getGradeId());
|
|
|
- ClassGradeUser classGradeUser1 = new ClassGradeUser();
|
|
|
- classGradeUser1.setPeriodStatus(2);
|
|
|
- classGradeUser1.setPeriodWaitTime(DateUtils.getNowTime());
|
|
|
- classGradeUser1.setUpdateTime(DateUtils.getNowTime());
|
|
|
- List<ClassGradeUser> list1 = iClassGradeUserService.list(classGradeUser);
|
|
|
- iClassGradeUserService.update(classGradeUser1, classGradeUser);
|
|
|
-
|
|
|
- InformRemindQueryBo informRemindQueryBo = new InformRemindQueryBo();
|
|
|
- informRemindQueryBo.setSort(8L);
|
|
|
- List<InformRemindVo> list = iInformRemindService.queryList(informRemindQueryBo);
|
|
|
- CourseQueryBo courseQueryBo = new CourseQueryBo();
|
|
|
- courseQueryBo.setGoodsId(bo.getGoodsId());
|
|
|
- courseQueryBo.setUserId(bo.getUserId());
|
|
|
- GoodsVo goodsVo = iGoodsService.selectUserDetail(courseQueryBo);
|
|
|
- if (!CollectionUtils.isEmpty(list)){
|
|
|
- InformRemindVo informRemindVo = list.get(0);
|
|
|
- if (!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness())) {
|
|
|
- for (InformRemindBusinessVo informRemindBusiness : informRemindVo.getInformRemindBusiness()) {
|
|
|
- if (goodsVo.getBusinessId().equals(informRemindBusiness.getBusinessId())) {
|
|
|
- if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
- InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
- informUserAddBo.setUserId(bo.getUserId());
|
|
|
- informUserAddBo.setSendStatus(1);
|
|
|
- informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setRemindId(8L);
|
|
|
- informUserAddBo.setSystemStatus(1);
|
|
|
- informUserAddBo.setRemind("学时学习完成提醒");
|
|
|
- informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
- GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
|
|
|
- informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时已全部学完,请耐心等待审核学时。");
|
|
|
- iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
- }
|
|
|
- if (informRemindVo.getNoteStatus().equals(1)){
|
|
|
- InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
- informUserAddBo.setUserId(bo.getUserId());
|
|
|
- informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setSendStatus(1);
|
|
|
- informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setRemindId(8L);
|
|
|
- informUserAddBo.setSystemStatus(3);
|
|
|
- informUserAddBo.setRemind("学时学习完成提醒");
|
|
|
- informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
- GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
|
|
|
- informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时已全部学完,请耐心等待审核学时。");
|
|
|
- iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
- UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- param.put("goods", goodsVo1.getGoodsName());
|
|
|
- IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), completionReminderCode);
|
|
|
+ ClassGradeUser gradeUser =iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
|
|
|
+ .eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()
|
|
|
+ ).eq(ClassGradeUser::getStatus,1).eq(ClassGradeUser::getChangeGrade,0).last("limit 1"));
|
|
|
+ if(Validator.isNotEmpty(gradeUser)&&gradeUser.getPeriodStatus()==-1){
|
|
|
+ //原本未审核才可进来
|
|
|
+ if (secLong.equals(studyLong)&§ionStudyRecordVo.getExamRecordNum().equals(sectionStudyRecordVo.getExamNum())) {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<ClassGradeUser> classGradeUser = Wrappers.lambdaQuery();
|
|
|
+ classGradeUser.eq(ClassGradeUser::getUserId, bo.getUserId());
|
|
|
+ classGradeUser.eq(ClassGradeUser::getGradeId, bo.getGradeId());
|
|
|
+ ClassGradeUser classGradeUser1 = new ClassGradeUser();
|
|
|
+ classGradeUser1.setPeriodStatus(2);
|
|
|
+ classGradeUser1.setPeriodWaitTime(DateUtils.getNowTime());
|
|
|
+ classGradeUser1.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ List<ClassGradeUser> list1 = iClassGradeUserService.list(classGradeUser);
|
|
|
+ iClassGradeUserService.update(classGradeUser1, classGradeUser);
|
|
|
+
|
|
|
+ InformRemindQueryBo informRemindQueryBo = new InformRemindQueryBo();
|
|
|
+ informRemindQueryBo.setSort(8L);
|
|
|
+ List<InformRemindVo> list = iInformRemindService.queryList(informRemindQueryBo);
|
|
|
+ CourseQueryBo courseQueryBo = new CourseQueryBo();
|
|
|
+ courseQueryBo.setGoodsId(bo.getGoodsId());
|
|
|
+ courseQueryBo.setUserId(bo.getUserId());
|
|
|
+ GoodsVo goodsVo = iGoodsService.selectUserDetail(courseQueryBo);
|
|
|
+ if (!CollectionUtils.isEmpty(list)){
|
|
|
+ InformRemindVo informRemindVo = list.get(0);
|
|
|
+ if (!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness())) {
|
|
|
+ for (InformRemindBusinessVo informRemindBusiness : informRemindVo.getInformRemindBusiness()) {
|
|
|
+ if (goodsVo.getBusinessId().equals(informRemindBusiness.getBusinessId())) {
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(bo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(8L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("学时学习完成提醒");
|
|
|
+ informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时已全部学完,请耐心等待审核学时。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(bo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(8L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("学时学习完成提醒");
|
|
|
+ informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时已全部学完,请耐心等待审核学时。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goods", goodsVo1.getGoodsName());
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), completionReminderCode);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|