|
@@ -141,9 +141,32 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
userPeriodSave(add, bo);
|
|
|
//完成当天学习计划
|
|
|
userPlanSave(add);
|
|
|
+ //判断有无学习结束
|
|
|
+ studyFinish(add);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ private void studyFinish(UserStudyRecord bo) {
|
|
|
+ //获得当前所在班级
|
|
|
+ if (bo.getStatus() != null && bo.getStatus().equals(1)){
|
|
|
+ Long secLong = 0L;
|
|
|
+ Long studyLong = 0L;
|
|
|
+ SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
|
|
|
+ subjectStudyRecordQueryBo.setGoodsId(bo.getGoodsId());
|
|
|
+ subjectStudyRecordQueryBo.setUserId(bo.getUserId());
|
|
|
+ subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
|
|
|
+ List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
|
|
|
+ for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
|
|
|
+ secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
|
|
|
+ studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
|
|
|
+ }
|
|
|
+ //发送课时完成
|
|
|
+ if (secLong.equals(studyLong)) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean updateByEditBo(UserStudyRecordEditBo bo) {
|
|
|
UserStudyRecord update = BeanUtil.toBean(bo, UserStudyRecord.class);
|