|
@ -4,13 +4,29 @@ import java.math.BigDecimal; |
|
|
import java.math.RoundingMode; |
|
|
import java.math.RoundingMode; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 桩号距离计算工具 |
|
|
* @Description 桩号计算工具 |
|
|
* |
|
|
* |
|
|
* @author liuwenge |
|
|
* @author liuwenge |
|
|
* @date 2024/1/17 14:43 |
|
|
* @date 2024/1/17 14:43 |
|
|
*/ |
|
|
*/ |
|
|
public class StakeMarkUtils { |
|
|
public class StakeMarkUtils { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 桩号转公里数 |
|
|
|
|
|
* |
|
|
|
|
|
* @author liuwenge |
|
|
|
|
|
* @date 2024/3/6 11:06 |
|
|
|
|
|
* @param stakeMark 桩号:"K123+123" |
|
|
|
|
|
* @return 公里数:123.123 |
|
|
|
|
|
*/ |
|
|
|
|
|
public BigDecimal format(String stakeMark){ |
|
|
|
|
|
if (StringUtils.isEmpty(stakeMark)){ |
|
|
|
|
|
return BigDecimal.ZERO; |
|
|
|
|
|
} |
|
|
|
|
|
String kilometre = stakeMark.toLowerCase().replace("k","").replace("+","."); |
|
|
|
|
|
return new BigDecimal(kilometre); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 计算桩号距离(公里) |
|
|
* @Description 计算桩号距离(公里) |
|
|
* |
|
|
* |
|
|