CeDo
2021-06-03 1fbdd1f48a5ec551a4c044d4babd95633e36d62e
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
package com.panzhihua.service_grid.api;
 
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_grid.service.EventGridDataService;
import com.panzhihua.service_grid.service.EventGridMemberGpsLogService;
import com.panzhihua.service_grid.service.EventGridMemberRelationService;
import com.panzhihua.service_grid.service.EventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * 地图模块api
 */
@Slf4j
@RestController
@RequestMapping("/map")
public class MapApi {
 
    @Resource
    private EventService eventService;
    @Resource
    private EventGridDataService eventGridDataService;
    @Resource
    private EventGridMemberGpsLogService eventGridMemberGpsLogService;
    @Resource
    private EventGridMemberRelationService eventGridMemberRelationService;
 
    /**
     * 地图模块-根据网格id查询网格详细信息
     * @param gridId    网格id
     * @return  网格详细信息
     */
    @PostMapping("getGridDetail")
    public R getGridDetail(@RequestParam("gridId") Long gridId){
        return eventGridDataService.getMapGridDetail(gridId);
    }
 
    /**
     * 根据网格员id查询今日轨迹
     * @param userId    网格员id
     * @return  网格员今日轨迹
     */
    @PostMapping("/getTrajectoryByApp")
    public R getTrajectoryByApp(@RequestParam("userId") Long userId){
        return eventGridMemberGpsLogService.getTrajectoryByApp(userId);
    }
 
    /**
     * 根据网格员id查询关联网格列表
     * @param userId    网格员id
     * @return  网格列表
     */
    @PostMapping("getMapGridListByApp")
    public R getMapGridListByApp(@RequestParam("userId") Long userId){
        return eventGridMemberRelationService.getMapGridListByApp(userId);
    }
 
}