| | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/v1/testPoint") |
| | | @RequestMapping("") |
| | | @Api(tags = "测试demo-点位管理") |
| | | public class XpTestPointManagementController extends BaseController { |
| | | |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "获取所有运营中的区域", response = XpElectronicFenceArea.class) |
| | | @PostMapping("/listElectronicFenceArea") |
| | | @PostMapping("/api/v1/testPoint/listElectronicFenceArea") |
| | | public R<List<XpElectronicFenceArea>> listElectronicFenceArea() { |
| | | // 获取所有启用的电子围栏 |
| | | List<XpElectronicFence> electronicFences = xpElectronicFenceService.lambdaQuery().eq(XpElectronicFence::getStatus, 2).list(); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "点位管理列表", response = XpTestPoint.class) |
| | | @PostMapping("/listPoint") |
| | | @PostMapping("/api/v1/testPoint/listPoint") |
| | | public R<List<XpTestPoint>> list(@RequestBody PointListQuery query) { |
| | | List<XpTestPoint> pageList = xpTestPointService.listAll(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "点位管理分页列表", response = XpTestPoint.class) |
| | | @PostMapping("/pageList") |
| | | @PostMapping("/api/v1/testPoint/pageList") |
| | | public R<PageInfo<XpTestPoint>> pageList(@RequestBody PointPageListListQuery query) { |
| | | PageInfo<XpTestPoint> pageList = xpTestPointService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @PostMapping("/getByIds") |
| | | @PostMapping("/api/v1/testPoint/getByIds") |
| | | public R<List<XpTestPoint>> getByIds(@RequestBody XpPointExportExcelQuery query) { |
| | | List<XpTestPoint> list = xpTestPointService.lambdaQuery().in(XpTestPoint::getId, query.getPointIds()).list(); |
| | | return R.ok(list); |
| | |
| | | /** |
| | | * 新增点位 |
| | | */ |
| | | @PostMapping("/addPoint") |
| | | @PostMapping("/api/v1/testPoint/addPoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "新增点位") |
| | | public R add(@Validated @RequestBody PointAddDto pointAddDto) { |
| | |
| | | /** |
| | | * 批量删除点位 |
| | | */ |
| | | @GetMapping("/deletePoint") |
| | | @GetMapping("/api/v1/testPoint/deletePoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | |
| | | /** |
| | | * 编辑点位 |
| | | */ |
| | | @PostMapping("/editPoint") |
| | | @PostMapping("/api/v1/testPoint/editPoint") |
| | | @ApiOperation(value = "编辑点位") |
| | | public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) { |
| | | XpTestPoint xpPoint = new XpTestPoint(); |
| | |
| | | /** |
| | | * 点位详情 |
| | | */ |
| | | @GetMapping("/queryPointById") |
| | | @GetMapping("/api/v1/testPoint/queryPointById") |
| | | @ApiOperation(value = "点位详情") |
| | | public R<XpTestPoint> queryById(@RequestParam Long id) { |
| | | return R.ok(xpTestPointService.getById(id)); |
| | |
| | | /** |
| | | * 启用/禁用 |
| | | */ |
| | | @PostMapping("/enableDisablePoint") |
| | | @PostMapping("/api/v1/testPoint/enableDisablePoint") |
| | | @ApiOperation(value = "启用/禁用") |
| | | public R enableDisable(@RequestBody XpPointEnableDisableDto dto) { |
| | | XpTestPoint xpPoint = xpTestPointService.getById(dto.getId()); |
| | |
| | | /** |
| | | * 设置特殊点位 |
| | | */ |
| | | @PostMapping("/setSpecialPoint") |
| | | @PostMapping("/api/v1/testPoint/setSpecialPoint") |
| | | @ApiOperation(value = "设置特殊点位", tags = "后台管理-特殊点位") |
| | | public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) { |
| | | xpTestPointService.update(new LambdaUpdateWrapper<XpTestPoint>().set(XpTestPoint::getChargePoint, 0) |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/listSpecialPoint") |
| | | @GetMapping("/api/v1/testPoint/listSpecialPoint") |
| | | @ApiOperation(value = "获取特殊点位", tags = "后台管理-特殊点位") |
| | | public R<SpecialPointVo> getSpecialPoint() { |
| | | List<XpTestPoint> chargePoints = xpTestPointService.list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getChargePoint, 1)); |
| | |
| | | |
| | | return R.ok(specialPointVo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断点位是在有效期内 |
| | | * @param pointId |
| | | * @return |
| | | */ |
| | | @GetMapping("/inner/v1/testPoint/nowInTimePoint") |
| | | public R<Boolean> nowInTimePoint(@RequestParam Long pointId){ |
| | | return R.ok(xpTestPointService.nowInTimePoint(pointId)); |
| | | } |
| | | } |