mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 11:26:50 +08:00
提交
This commit is contained in:
@@ -542,16 +542,16 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
studyCourseQuery.setAid(this.getCurrent().getAccountId());
|
||||
}
|
||||
List<StudyCourse> studyCouseDtos = service.ids(studyCourseQuery);
|
||||
List<String> ids=new ArrayList<String>();
|
||||
for(StudyCourse scourse:studyCouseDtos) {
|
||||
ids.add(scourse.getCourseId());
|
||||
}
|
||||
Map<String,Object> maps = courseService.findImages(ids);
|
||||
for(StudyCourse scourse:studyCouseDtos) {
|
||||
if(maps.containsKey(scourse.getCourseId())) {
|
||||
scourse.setCourseImage((String)maps.get(scourse.getCourseId()));
|
||||
}
|
||||
}
|
||||
// List<String> ids=new ArrayList<String>();
|
||||
// for(StudyCourse scourse:studyCouseDtos) {
|
||||
// ids.add(scourse.getCourseId());
|
||||
// }
|
||||
// Map<String,Object> maps = courseService.findImages(ids);
|
||||
// for(StudyCourse scourse:studyCouseDtos) {
|
||||
// if(maps.containsKey(scourse.getCourseId())) {
|
||||
// scourse.setCourseImage((String)maps.get(scourse.getCourseId()));
|
||||
// }
|
||||
// }
|
||||
|
||||
return success(studyCouseDtos);
|
||||
}
|
||||
|
||||
@@ -283,19 +283,29 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
||||
builder.addFilter(FieldFilters.in("sc.courseId",studyCourseQuery.getIds()));
|
||||
builder.addOrder(OrderCondition.desc("sc.lastTime"));
|
||||
builder.addFields("sc");
|
||||
// try {
|
||||
//// List<Object[]> listFields = studyCourseDao.(builder.builder());
|
||||
//// for (Object[] o:listFields) {
|
||||
//// StudyCouseDto studyCouseDto = new StudyCouseDto();
|
||||
//// studyCouseDto.setCourseId((String) o[0]);
|
||||
//// studyCouseDto.setProgress((Float) o[1]);
|
||||
//// studyCouseDto.setLastTime((LocalDateTime) o[2]);
|
||||
//// studyCouseDtos.add(studyCouseDto);
|
||||
//// }
|
||||
List<StudyCourse> list = studyCourseDao.findList(builder.builder());
|
||||
|
||||
|
||||
return list;
|
||||
builder.addFields("c.score");
|
||||
builder.addFields("c.coverImg");
|
||||
//List<StudyCourse> list = studyCourseDao.findList(builder.builder());
|
||||
List<StudyCourse> rs=new ArrayList<StudyCourse>();
|
||||
Set<String> checkSet=new HashSet<String>();
|
||||
try {
|
||||
List<Object[]> list= studyCourseDao.findListFields(builder.builder());
|
||||
for(Object[] objs:list) {
|
||||
StudyCourse sc=(StudyCourse)objs[0];
|
||||
if(!checkSet.contains(sc.getCourseId())) {
|
||||
Float score=(Float)objs[1];
|
||||
String img=(String)objs[2];
|
||||
sc.setLastScore(score);
|
||||
sc.setCourseImage(img);
|
||||
rs.add(sc);
|
||||
checkSet.add(sc.getCourseId());
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
}catch(Exception e){
|
||||
log.error("",e);
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,7 +345,7 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
||||
}
|
||||
return rs;
|
||||
}catch(Exception e){
|
||||
|
||||
log.error("",e);
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user