mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
课程完成情况的计算
This commit is contained in:
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class CourseStudyDto {
|
||||
|
||||
/**id,对于原系统是kid*/
|
||||
/**id,系统中标识的学习记录id,本地就是studyId*/
|
||||
private String id;
|
||||
|
||||
/**es中的id*/
|
||||
@@ -49,7 +49,7 @@ public class CourseStudyDto {
|
||||
/**
|
||||
* 应管理端需求,增加上课时间
|
||||
*/
|
||||
private Integer attendCourseTime;
|
||||
private Long attendCourseTime;
|
||||
|
||||
/**
|
||||
* 应管理端需求,增加面授地点
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.xboe.school.study.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -53,6 +55,20 @@ public class StudyCourseESApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value="/list-by-ids",method = {RequestMethod.POST})
|
||||
public JsonResponse<List<StudyCourse>> search(@RequestBody List<String> ids){
|
||||
if(ids.isEmpty()) {
|
||||
return badRequest("无需ids");
|
||||
}
|
||||
try {
|
||||
List<StudyCourse> rs=service.findByIds(ids);
|
||||
return success(rs);
|
||||
}catch(Exception e) {
|
||||
log.error("根据id集合查询报名学习错误",e);
|
||||
return error("查询失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/index-create")
|
||||
public JsonResponse<Boolean> createIndex(){
|
||||
if(search==null) {
|
||||
|
||||
@@ -79,6 +79,13 @@ public interface IStudyCourseService {
|
||||
* 二次查询 个人/他人
|
||||
* */
|
||||
List<StudyCourse> ids(StudyCourseQuery studyCourseQuery);
|
||||
|
||||
/**
|
||||
* 配合ES中二次查询显示一些信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<StudyCourse> findByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 查询课程内容学习记录
|
||||
|
||||
@@ -48,6 +48,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
|
||||
sci.setCourseId(assess.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(100);//直接设置为学习完成
|
||||
sci.setStatus(StudyCourseItem.STATUS_FINISH);
|
||||
sci.setStartTime(ldt);
|
||||
sci.setAid(assess.getStudentId());
|
||||
sci.setAname(assess.getStudentName());
|
||||
|
||||
@@ -704,4 +704,9 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
||||
return rslist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StudyCourse> findByIds(List<String> ids) {
|
||||
return studyCourseDao.findList(FieldFilters.in("id", ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
sci.setCourseId(exam.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(100);//直接设置为学习完成
|
||||
sci.setStatus(StudyCourseItem.STATUS_FINISH);//状态直接更新为已完成
|
||||
sci.setStartTime(ldt);
|
||||
sci.setAid(exam.getStudentId());
|
||||
sci.setAname(exam.getStudentName());
|
||||
|
||||
@@ -50,6 +50,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
|
||||
sci.setCourseId(homework.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(100);//直接设置为学习完成
|
||||
sci.setStatus(9);//状态直接更新为已完成
|
||||
sci.setStartTime(ldt);
|
||||
sci.setAid(homework.getStudentId());
|
||||
sci.setAname(homework.getStudentName());
|
||||
|
||||
@@ -99,6 +99,12 @@ public class StudySignupServiceImpl implements IStudySignupService{
|
||||
dto.setCourseType(sc.getCourseType());
|
||||
dto.setProgress(sc.getProgress()==null? 0:sc.getProgress().intValue());
|
||||
dto.setSource(2);//固定值,新系统
|
||||
//下面添加课程用于本地测试
|
||||
// dto.setCourseType(30);
|
||||
// dto.setSource(3);//来源在线课
|
||||
// dto.setApplyStatus(40);
|
||||
// dto.setCourseAddress("这里是上课地址");
|
||||
// dto.setAttendCourseTime(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
|
||||
//如果开始时间没有,就使用添加时间
|
||||
if(sc.getStartTime()!=null) {
|
||||
dto.setStartTime(sc.getStartTime().toEpochSecond(ZoneOffset.of("+8")));
|
||||
|
||||
Reference in New Issue
Block a user