| | |
| | | package com.panzhihua.grid_app.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridCascadeListDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.ComMapGridDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.EventMapGridCascadeVO; |
| | | import com.panzhihua.common.model.vos.grid.EventMapGridVO; |
| | | import com.panzhihua.common.model.vos.grid.EventMapTrajectoryVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | | |
| | | /** |
| | | * @author lyq |
| | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | @ApiOperation(value = "根据网格id查询网格详细信息-lyq",response = ComMapGridDetailVO.class) |
| | | @ApiOperation(value = "根据网格id查询网格详细信息-lyq", response = ComMapGridDetailVO.class) |
| | | @PostMapping("getGridDetail") |
| | | public R getGridDetail(@RequestParam("gridId") Long gridId){ |
| | | if(gridId == null){ |
| | | public R getGridDetail(@RequestParam("gridId") Long gridId) { |
| | | if (gridId == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | return gridService.getGridDetail(gridId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询网格员今日运动轨迹-lyq",response = EventMapTrajectoryVO.class) |
| | | @ApiOperation(value = "查询网格员今日运动轨迹-lyq", response = EventMapTrajectoryVO.class) |
| | | @PostMapping("getTrajectory") |
| | | public R getTrajectory(){ |
| | | public R getTrajectory() { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if(userInfoVO == null || userInfoVO.getUserId() == null){ |
| | | if (userInfoVO == null || userInfoVO.getUserId() == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return gridService.getTrajectoryByApp(userInfoVO.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询网格员关联网格列表-lyq",response = EventMapGridVO.class) |
| | | @ApiOperation(value = "查询网格员关联网格列表-lyq", response = EventMapGridVO.class) |
| | | @PostMapping("getGridList") |
| | | public R getGridList(){ |
| | | public R getGridList() { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if(userInfoVO == null || userInfoVO.getUserId() == null){ |
| | | if (userInfoVO == null || userInfoVO.getUserId() == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return gridService.getMapGridListByApp(userInfoVO.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询网格员关联网格列表级联-lyq", response = EventMapGridVO.class) |
| | | @PostMapping("getGridLists") |
| | | public R getGridLists(@RequestBody EventGridCascadeListDTO cascadeListDTO) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null || userInfoVO.getUserId() == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | if (cascadeListDTO.getType() == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | cascadeListDTO.setUserId(userInfoVO.getUserId()); |
| | | return gridService.getMapGridListsByApp(cascadeListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询网格员关联网格列表级联2-lyq", response = EventMapGridCascadeVO.class) |
| | | @PostMapping("getGridsLists") |
| | | public R getGridsLists() { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null || userInfoVO.getUserId() == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return gridService.getMapGridsListsByApp(userInfoVO.getUserId()); |
| | | } |
| | | |
| | | } |