|
@@ -28,26 +28,21 @@ public class HomePageService {
|
|
|
if (list.size() > 0) {
|
|
|
return ResultVoUtil.success(list);
|
|
|
}
|
|
|
- synchronized (list) {
|
|
|
- if (list.size() > 0) {
|
|
|
- return ResultVoUtil.success(list);
|
|
|
+ List<HomePageDoctor> originList = dao.selectHomePageDoctors();
|
|
|
+ List<HomePageDoctor> tempList = new ArrayList<>();
|
|
|
+ for (HomePageDoctor doctor : originList) {
|
|
|
+ if (null == doctor.getIntroduction() || doctor.getIntroduction().equals("")) {
|
|
|
+ continue;
|
|
|
}
|
|
|
- List<HomePageDoctor> originList = dao.selectHomePageDoctors();
|
|
|
- List<HomePageDoctor> tempList = new ArrayList<>();
|
|
|
- for (HomePageDoctor doctor : originList) {
|
|
|
- if (null == doctor.getIntroduction() || doctor.getIntroduction().equals("")) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- tempList.add(doctor);
|
|
|
- if (tempList.size() == 3) {
|
|
|
- list.add(tempList);
|
|
|
- tempList = new ArrayList<>();
|
|
|
- }
|
|
|
- }
|
|
|
- if (tempList.size() > 0) {
|
|
|
+ tempList.add(doctor);
|
|
|
+ if (tempList.size() == 3) {
|
|
|
list.add(tempList);
|
|
|
+ tempList = new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
+ if (tempList.size() > 0) {
|
|
|
+ list.add(tempList);
|
|
|
+ }
|
|
|
return ResultVoUtil.success(list);
|
|
|
}
|
|
|
|