liujie
2026-08-11 323764c813a09cd56cdab780155ef659dbe0b364
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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格式不正确");
        }
    }
}