Browse Source

修改数据类型转换错误;

dev
luyan 2 years ago
parent
commit
143b8dfe78
  1. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/CommunityCanteenServiceImpl.java

40
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/CommunityCanteenServiceImpl.java

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

Loading…
Cancel
Save