jinpengyong
2024-06-19 32cc13189371ee1e367897a64fbc22f90b53add8
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.moral.api.config.properties;
 
import com.moral.api.entity.SysArea;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
import java.util.List;
import java.util.Map;
 
/**
 * @ClassName
 * @Description TODO
 * @Author 陈凯裕
 * @Date 2021/12/31 8:56
 * @Version TODO
 **/
@Data
@ConfigurationProperties(prefix = "special-city")
@Component
public class SpecialCitiesProperties {
 
    private List<SysArea> twentyEightCities;
 
    private List<SysArea> heBeiEightCities;
 
    private List<SysArea> oneSixEightCities;
 
    public boolean isTwentyEightCities(Integer cityCode){
        for (SysArea city : twentyEightCities) {
            if(city.getAreaCode().equals(cityCode))
                return true;
        }
        return false;
    }
 
    public boolean isHeBeiEightCities(Integer cityCode){
        for (SysArea city : heBeiEightCities) {
            if(city.getAreaCode().equals(cityCode))
                return true;
        }
        return false;
    }
 
    public boolean isOneSixEightCities(Integer cityCode){
        for (SysArea city : oneSixEightCities) {
            if(city.getAreaCode().equals(cityCode))
                return true;
        }
        return false;
    }
 
}