|
|
@ -188,8 +188,8 @@ public class CommunityCanteenServiceImpl extends BaseServiceImpl<CommunityCantee |
|
|
|
String lon = (String) params.get("longitude"); |
|
|
|
String lat = (String) params.get("latitude"); |
|
|
|
Point coordinate = new Point(); |
|
|
|
coordinate.setLongitude(Double.valueOf(lon)); |
|
|
|
coordinate.setLatitude(Double.valueOf(lat)); |
|
|
|
coordinate.setLongitude(Double.parseDouble(lon)); |
|
|
|
coordinate.setLatitude(Double.parseDouble(lat)); |
|
|
|
wrapper.like(StringUtils.isNotBlank(name), FieldConstant.NAME, name); |
|
|
|
IPage<CommunityCanteenEntity> page = baseDao.selectPage(getPage(new HashMap<>()), wrapper); |
|
|
|
PageData<CommunityCanteenDTO> pageData = getPageData(page, CommunityCanteenDTO.class); |
|
|
@ -201,8 +201,8 @@ public class CommunityCanteenServiceImpl extends BaseServiceImpl<CommunityCantee |
|
|
|
if (entity.getId().equals(dto.getId())) { |
|
|
|
//获取所有食堂的坐标系
|
|
|
|
Point point = new Point(); |
|
|
|
point.setLongitude(Double.valueOf(dto.getLongitude())); |
|
|
|
point.setLatitude(Double.valueOf(dto.getLatitude())); |
|
|
|
point.setLongitude(Double.parseDouble(dto.getLongitude())); |
|
|
|
point.setLatitude(Double.parseDouble(dto.getLatitude())); |
|
|
|
canteentMap.put(point, dto.getId()); |
|
|
|
points.add(point); |
|
|
|
dto.setThreeMeals(entity.getThreeMeals().split(",")); |
|
|
@ -212,22 +212,22 @@ public class CommunityCanteenServiceImpl extends BaseServiceImpl<CommunityCantee |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (!CollectionUtils.isEmpty(points)) { |
|
|
|
Point result = Collections.min(points, new Comparator<Point>() { |
|
|
|
@Override |
|
|
|
public int compare(Point o1, Point o2) { |
|
|
|
double tempLon = 0.0; |
|
|
|
double tempLan = 0.0; |
|
|
|
if (o1.getLongitude() - coordinate.getLongitude() < 0) { |
|
|
|
tempLon = o1.getLongitude(); |
|
|
|
} |
|
|
|
if (o2.getLongitude() - coordinate.getLongitude() < 0) { |
|
|
|
|
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
// if (!CollectionUtils.isEmpty(points)) {
|
|
|
|
// Point result = Collections.min(points, new Comparator<Point>() {
|
|
|
|
// @Override
|
|
|
|
// public int compare(Point o1, Point o2) {
|
|
|
|
// double tempLon = 0.0;
|
|
|
|
// double tempLan = 0.0;
|
|
|
|
// if (o1.getLongitude() - coordinate.getLongitude() < 0) {
|
|
|
|
// tempLon = o1.getLongitude();
|
|
|
|
// }
|
|
|
|
// if (o2.getLongitude() - coordinate.getLongitude() < 0) {
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// return 0;
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
return pageData; |
|
|
|
} |
|
|
|
|
|
|
|