Commit 7135968b authored by zhangqingle's avatar zhangqingle

修改接口

parent 2843775e
......@@ -18,7 +18,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@Select("<script> select blp.*,bl.lesson_name lessonName,bl.default_url defaultUrl,bl.person_number personNumber, " +
" bl.class_hour classHour,bl.discuss_number discussNumber ,bl.lecturer_id lecturerId, bl.lesson_type " +
" lessonType,bl.course_time courseTime,bl.release_state releaseState " +
",su.name lecturerName " +
",su.name lecturerName,bl.train_sign_time trainSignTime,bl.train_start_date trainStartDate,bl.train_over_date trainOverDate,bl.lesson_type lessonType " +
" from b_lesson_person blp " +
" left join b_lesson bl on blp.lesson_id = bl.business_id " +
" left join s_user su on su.business_id = bl.lecturer_id " +
......@@ -40,7 +40,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"" +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryLearnBLessons(@Param("param") ILearnLessonDTO param);
List<BLessonPerson> queryLearnBLessons(@Param("param") ILearnLessonDTO param);
......
......@@ -149,6 +149,22 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient
private String finishDateSetNull;
@ApiModelProperty(value = "0 未开始 1签到中(进行中) 2已结束")
@Transient
private String trainType;
@ApiModelProperty(value = "开始前多少分钟开始签到")
@Transient
private String trainSignTime;
@ApiModelProperty(value = "培训开始时间")
@Transient
private Date trainStartDate;
@ApiModelProperty(value = "培训结束时间")
@Transient
private Date trainOverDate;
//初始化
public void initModel(){
UserUtil.setCurrentPersistOperation(this);
......
......@@ -2,6 +2,7 @@ package org.rcisoft.business.blesson.service;
import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.entity.BLessonPerson;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.sys.user.bean.CurUser;
......@@ -25,7 +26,7 @@ public interface BLessonPersonService {
* @param model
* @return
*/
List<BLesson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model);
List<BLessonPerson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model);
/**
* 查询线上课程学员追踪图表
......
......@@ -101,10 +101,21 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public List<BLesson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model) {
List<BLesson> bLessonList = bLessonPersonRepository.queryLearnBLessons(model);
public List<BLessonPerson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model) {
List<BLessonPerson> bLessonList = bLessonPersonRepository.queryLearnBLessons(model);
if ("1".equals(model.getLessonType())){
return bLessonServiceImpl.setTrainTypeByList(bLessonList);
Date now = new Date();
bLessonList.forEach(bLesson -> {
Long time = Long.parseLong(bLesson.getTrainSignTime()) * 60 * 1000;
Date signStart = new Date(bLesson.getTrainStartDate().getTime() - time);
if (now.before(signStart)){
bLesson.setTrainType("0");
}else if (bLesson.getTrainOverDate().before(now)){
bLesson.setTrainType("2");
}else{
bLesson.setTrainType("1");
}
});
}
return bLessonList;
}
......
......@@ -1552,7 +1552,7 @@ public class BLessonServiceImpl implements BLessonService {
Date signStart = new Date(bLesson.getTrainStartDate().getTime() - time);
if (now.before(signStart)){
bLesson.setTrainType("0");
}else if (bLesson.getTrainOverDate().before(now) ){
}else if (bLesson.getTrainOverDate().before(now)){
bLesson.setTrainType("2");
}else{
bLesson.setTrainType("1");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment