2026-07-03 3179fbb9c77eeb5260593e9df20046285dc56fe6
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 cn.iocoder.yudao.module.crm.framework.excel.core;
 
import cn.iocoder.yudao.framework.excel.core.function.ExcelColumnSelectFunction;
import cn.iocoder.yudao.framework.ip.core.Area;
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * 地区下拉框数据源的 {@link ExcelColumnSelectFunction} 实现类
 *
 * @author HUIHUI
 */
@Service
public class AreaExcelColumnSelectFunction implements ExcelColumnSelectFunction {
 
    public static final String NAME = "getCrmAreaNameList"; // 防止和别的模块重名
 
    @Override
    public String getName() {
        return NAME;
    }
 
    @Override
    public List<String> getOptions() {
        // 获取地区下拉数据
        // TODO @puhui999:嘿嘿,这里改成省份、城市、区域,三个选项,难度大么?
        Area area = AreaUtils.getArea(Area.ID_CHINA);
        return AreaUtils.getAreaNodePathList(area.getChildren());
    }
 
}