|
|
@@ -241,8 +241,8 @@ public class SbPositionServiceImpl extends BaseServiceImpl<SbPositionMapper, SbP
|
|
|
List<String> positionIds = request.getPositionIds();
|
|
|
String mapName = request.getMapName();
|
|
|
Integer isShow = request.getIsShow();
|
|
|
- if (points == null || points.size() != 4) {
|
|
|
- throw new BusinessException("请提供矩形的四个角点坐标");
|
|
|
+ if (points == null || points.size() != 2) {
|
|
|
+ throw new BusinessException("请提供矩形的左上角和右下角两个坐标");
|
|
|
}
|
|
|
if (positionIds == null || positionIds.isEmpty()) {
|
|
|
throw new BusinessException("请选择至少一个设备位置");
|
|
|
@@ -254,7 +254,7 @@ public class SbPositionServiceImpl extends BaseServiceImpl<SbPositionMapper, SbP
|
|
|
throw new BusinessException("请设置是否显示");
|
|
|
}
|
|
|
|
|
|
- // 1. 从四个角点中提取矩形边界
|
|
|
+ // 1. 从两个角点(左上、右下)中提取矩形边界
|
|
|
double lngMin = points.stream().mapToDouble(p -> p.getLongitude().doubleValue()).min().orElse(0);
|
|
|
double lngMax = points.stream().mapToDouble(p -> p.getLongitude().doubleValue()).max().orElse(0);
|
|
|
double latMin = points.stream().mapToDouble(p -> p.getLatitude().doubleValue()).min().orElse(0);
|