Commit 688f7856 authored by zhangqingle's avatar zhangqingle

学员跟踪列表 增加trainType返回值

parent e8a89a61
......@@ -115,6 +115,24 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Override
public List<StudentTrackingRspDTO> studentTrackingByPagination(PageUtil pageUtil, StudentTrackingDTO studentTrackingDTO) {
// List<Long> deptIds = new ArrayList<>();
BLesson bLesson = bLessonRepository.selectByPrimaryKey(studentTrackingDTO.getLessonId());
if (bLesson == null){
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
}
String trainType = "";
if ("1".equals(bLesson.getLessonType())){
Date now = new Date();
Long time = Long.parseLong(bLesson.getTrainSignTime()) * 60 * 1000;
Date signStart = new Date(bLesson.getTrainStartDate().getTime() - time);
if (now.before(signStart)){
trainType = "0";
}else if ( bLesson.getTrainOverDate().before(now) ){
trainType = "2";
}else{
trainType = "1";
}
}
if(StringUtils.isNotEmpty(studentTrackingDTO.getDepartId())){
Set<String> deptIds = new HashSet<>();
......@@ -152,6 +170,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
studentTrackingRspDTO.setDepartName(depart.getDepts().get(0).getName());
}
}
studentTrackingRspDTO.setTrainType(trainType);
}
}
return studentTrackingRspDTOs;
......
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