Commit 2843775e authored by zhangqingle's avatar zhangqingle

修改接口

parent 70cf7be1
......@@ -102,7 +102,11 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public List<BLesson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model) {
return bLessonPersonRepository.queryLearnBLessons(model);
List<BLesson> bLessonList = bLessonPersonRepository.queryLearnBLessons(model);
if ("1".equals(model.getLessonType())){
return bLessonServiceImpl.setTrainTypeByList(bLessonList);
}
return bLessonList;
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
......@@ -126,7 +130,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
Date signStart = new Date(bLesson.getTrainStartDate().getTime() - time);
if (now.before(signStart)){
trainType = "0";
}else if ( bLesson.getTrainOverDate().before(now) ){
}else if ( bLesson.getTrainOverDate().before(now)){
trainType = "2";
}else{
trainType = "1";
......
......@@ -173,18 +173,7 @@ public class BLessonServiceImpl implements BLessonService {
public List<BLesson> queryBLessonsByPagination(PageUtil pageUtil, MyReleaseDTO myReleaseDTO) {
List<BLesson> bLessonList = bLessonRepository.queryBLessons(myReleaseDTO);
if ("1".equals(myReleaseDTO.getLessonType())){
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 setTrainTypeByList(bLessonList);
}
return bLessonList;
}
......@@ -1556,4 +1545,20 @@ public class BLessonServiceImpl implements BLessonService {
}
}
List<BLesson> setTrainTypeByList(List<BLesson> 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;
}
}
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