|
@@ -10,6 +10,7 @@ import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecord;
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecord;
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -42,6 +43,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
@Autowired
|
|
@Autowired
|
|
private IUserStudyRecordService iUserStudyRecordService;
|
|
private IUserStudyRecordService iUserStudyRecordService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserStudyRecordPhotoService userStudyRecordPhotoService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -96,10 +101,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
add.setStartTime(DateUtils.getNowTime()-add.getStudyDuration());
|
|
add.setStartTime(DateUtils.getNowTime()-add.getStudyDuration());
|
|
add.setEndTime(DateUtils.getNowTime());
|
|
add.setEndTime(DateUtils.getNowTime());
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
this.save(add);
|
|
this.save(add);
|
|
|
|
+ //新增学时记录,照片
|
|
|
|
+ userPeriodSave(add,bo);
|
|
|
|
+ //完成当天学习计划
|
|
|
|
+ userPlanSave(add);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -120,6 +126,17 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void userPeriodSave(UserStudyRecord entity,UserStudyRecordAddBo bo){
|
|
|
|
+ UserStudyRecordPhotoAddBo userStudyRecordPhotoAddBo = new UserStudyRecordPhotoAddBo();
|
|
|
|
+ userStudyRecordPhotoAddBo.setPhoto(bo.getPhoto());
|
|
|
|
+ userStudyRecordPhotoService.insertByAddBo(userStudyRecordPhotoAddBo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void userPlanSave(UserStudyRecord entity){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
if(isValid){
|
|
if(isValid){
|