package com.ruoyi.system.utils;
|
|
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.utils.StringUtils;
|
|
/**
|
* 区域 ID 转换工具。
|
*/
|
public final class AreaIdUtils
|
{
|
private AreaIdUtils()
|
{
|
}
|
|
/**
|
* 将查询边界使用的字符串区域 ID 转换为本地数据库使用的数值 ID。
|
*/
|
public static Long parseLocalAreaId(String areaId)
|
{
|
if (StringUtils.isEmpty(areaId))
|
{
|
return null;
|
}
|
try
|
{
|
return Long.valueOf(areaId.trim());
|
}
|
catch (NumberFormatException e)
|
{
|
throw new ServiceException("区域ID格式不正确");
|
}
|
}
|
}
|