fix
Helius
2021-07-15 f69fd42a3ae2d11713dcd284ae3db57e449ae6dd
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.RandomUtil;
import com.xzx.gc.common.Result;
import com.xzx.gc.common.constant.Constants;
import com.xzx.gc.common.dto.gdmap.CreateFenceDto;
import com.xzx.gc.common.dto.gdmap.GdGEODto;
import com.xzx.gc.common.dto.gdmap.GdPOIDto;
import com.xzx.gc.common.utils.gdmap.GdMapUtil;
import com.xzx.gc.entity.AddressInfo;
import org.junit.Test;
 
 
/**
 * 围栏测试
 */
public class FenceTest {
 
 
    @Test
    public void deleteFence(){
    }
 
    @Test
    public void findFenc(){
//        GdMapUtil.findFence(null,"");
    }
 
 
    @Test
    public void getLocation(){
        GdGEODto gdGEODto=new GdGEODto();
        gdGEODto.setCity("长沙市");
        gdGEODto.setAddress("水墨林溪(云峰路交汇处与木莲西路交汇处)的天天特价鞋店");
        Result locationByAddress = GdMapUtil.getLocationByAddress(gdGEODto);
        System.out.println(locationByAddress.getData());
        gdGEODto.setAddress("水墨林溪(云峰路交汇处与木莲西路交汇处)建行对面良品铺子");
        locationByAddress = GdMapUtil.getLocationByAddress(gdGEODto);
        System.out.println(locationByAddress.getData());
    }
 
    @Test
    public void getPOI(){
        GdPOIDto gdGEODto=new GdPOIDto();
//        if(StrUtil.isNotBlank(addressInfo.getAdcode())){
//            gdGEODto.setCity(addressInfo.getAdcode());
//        }else if(StrUtil.isNotBlank(addressInfo.getCitycode())){
//            gdGEODto.setCity(addressInfo.getCitycode());
//        }else{
            gdGEODto.setCity(Constants.CHANGSHA_CODE);
//        }
        gdGEODto.setKeywords("湖南省长沙市天心区青山小区13栋芙蓉兴盛");
        AddressInfo locationByAddress = GdMapUtil.getLocationByPOI(gdGEODto,null);
    }
 
    @Test
    public void createFenc(){
        CreateFenceDto createFenceDto=new CreateFenceDto();
        createFenceDto.setName("aa");
        createFenceDto.setPoints("112.893938,28.136741;112.898641,28.135615;112.894735,28.134028");
        createFenceDto.setValid_time("2054-12-30");
        createFenceDto.setRepeat("Mon,Tues,Wed,Thur,Fri,Sat,Sun");
        createFenceDto.setTime("00:00,23:59");
//        GdMapUtil.createFence(createFenceDto);
    }
 
    @Test
    public void updateFence(){
        String gid="bad11949-8e18-4998-bc05-5bc17d4ef774";
        CreateFenceDto createFenceDto=new CreateFenceDto();
        createFenceDto.setName("圆形围栏大学城");
//        createFenceDto.setPoints("112.893154,28.14613;112.904006,28.146512;112.9007,28.142754");
//        createFenceDto.setValid_time("2054-12-30");
//        createFenceDto.setRepeat("Mon,Tues,Wed,Thur,Fri,Sat,Sun");
        createFenceDto.setTime("00:00,23:59");
//        createFenceDto.setEnable(null);
        createFenceDto.setCenter("112.937054,28.16652");
        createFenceDto.setRadius(Convert.toDouble(3000));
//        GdMapUtil.updateFence(createFenceDto,gid);
//        findFenc();
    }
 
    @Test
    public void isIn(){
        String s=RandomUtil.randomString(14);
//        GdMapUtil.findFence(null,"tianxinqu");
//        GdMapUtil.isInFence("112.896838,28.137962," + DateUtil.currentSeconds(),s);
//        GdMapUtil.isInFence("112.900484,28.141862," + DateUtil.currentSeconds(),s);
    }
}