|
@@ -7,6 +7,12 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.microsoft.schemas.office.visio.x2012.main.SectionType;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
+import com.zhongzheng.modules.grade.bo.UserPeriodAddBo;
|
|
|
+import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
|
+import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
+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.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecord;
|
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
|
|
@@ -46,6 +52,12 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
@Autowired
|
|
|
private IUserStudyRecordPhotoService userStudyRecordPhotoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserPeriodService iUserPeriodService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserPeriodStatusService iUserPeriodStatusService;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -131,8 +143,25 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
//记录学时审核
|
|
|
Long periodId = null;
|
|
|
// 学习无记录加一条学时审核记录
|
|
|
- if (baseMapper.selectStudyRecord(bo) > 0){
|
|
|
-
|
|
|
+ if (baseMapper.selectStudyRecord(entity) < 1){
|
|
|
+ UserPeriod userPeriod = new UserPeriod();
|
|
|
+ userPeriod.setUserId(entity.getUserId());
|
|
|
+ userPeriod.setCourseId(entity.getCourseId());
|
|
|
+ userPeriod.setSectionId(entity.getSectionId());
|
|
|
+ userPeriod.setGoodsId(entity.getGoodsId());
|
|
|
+ userPeriod.setType(1);
|
|
|
+ userPeriod.setCreateTime(DateUtils.getNowTime());
|
|
|
+ userPeriod.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ userPeriod.setModuleId(entity.getModuleId());
|
|
|
+ userPeriod.setChapterId(entity.getChapterId());
|
|
|
+ userPeriod.setGradeId(entity.getGradeId());
|
|
|
+ iUserPeriodService.save(userPeriod);
|
|
|
+ periodId = userPeriod.getId();
|
|
|
+ UserPeriodStatus userPeriodStatusAddBo = new UserPeriodStatus();
|
|
|
+ userPeriodStatusAddBo.setPeriodStatus(1);
|
|
|
+ userPeriodStatusAddBo.setStatus(2);
|
|
|
+ userPeriodStatusAddBo.setPeriodId(userPeriod.getId());
|
|
|
+ iUserPeriodStatusService.save(userPeriodStatusAddBo);
|
|
|
}
|
|
|
//待审有结束时间跳过下面两步
|
|
|
//有学习记录时审核记录或0作弊或3待重修更改为待审核,完整播放也添加结束时间
|