|
@@ -61,6 +61,7 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
import java.io.InputStream;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -303,22 +304,22 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
|
|
|
return error("监控范围开始里程位置填写格式不正确");
|
|
|
} else {
|
|
|
- double begin = Double.parseDouble(baseCameraManagement.getBeginMiles());
|
|
|
- baseCameraManagement.setBeginMile((int) (begin * 1000));
|
|
|
+ BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
|
|
|
+ baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
}
|
|
|
}
|
|
|
if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
|
|
|
return error("监控相机安装里程位置填写格式不正确");
|
|
|
} else {
|
|
|
- double install = Double.parseDouble(baseCameraManagement.getInstallMiles());
|
|
|
- baseCameraManagement.setInstallMile((int) (install * 1000));
|
|
|
+ BigDecimal install = new BigDecimal(baseCameraManagement.getInstallMiles());
|
|
|
+ baseCameraManagement.setInstallMile(install.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles())) {
|
|
|
if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
|
|
|
return error("监控范围结束里程位置填写格式不正确");
|
|
|
} else {
|
|
|
- double end = Double.parseDouble(baseCameraManagement.getEndMiles());
|
|
|
- baseCameraManagement.setEndMile((int) (end * 1000));
|
|
|
+ BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
|
|
|
+ baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
}
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles()) && !ObjectUtils.isEmpty(baseCameraManagement.getBeginMiles())) {
|
|
@@ -377,8 +378,8 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
|
|
|
return error("监控范围开始里程位置填写格式不正确");
|
|
|
} else {
|
|
|
- double begin = Double.parseDouble(baseCameraManagement.getBeginMiles());
|
|
|
- baseCameraManagement.setBeginMile((int) (begin * 1000));
|
|
|
+ BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
|
|
|
+ baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
}
|
|
|
}else {
|
|
|
baseCameraManagement.setBeginMile(null);
|
|
@@ -386,15 +387,15 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
|
|
|
return error("监控相机安装里程位置填写格式不正确");
|
|
|
} else {
|
|
|
- double install = Double.parseDouble(baseCameraManagement.getInstallMiles());
|
|
|
- baseCameraManagement.setInstallMile((int) (install * 1000));
|
|
|
+ BigDecimal install = new BigDecimal(baseCameraManagement.getInstallMiles());
|
|
|
+ baseCameraManagement.setInstallMile(install.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles())) {
|
|
|
if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
|
|
|
return error("监控范围结束里程位置填写格式不正确");
|
|
|
} else {
|
|
|
- double end = Double.parseDouble(baseCameraManagement.getEndMiles());
|
|
|
- baseCameraManagement.setEndMile((int) (end * 1000));
|
|
|
+ BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
|
|
|
+ baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
}
|
|
|
}else {
|
|
|
baseCameraManagement.setEndMile(null);
|