| | |
| | | .eq(XpElectronicFenceArea::getAreaStatus, 1).list(); |
| | | return R.ok(electronicFenceAreaList); |
| | | } |
| | | |
| | | @ApiOperation(value = "点位管理列表", response = XpPoint.class) |
| | | @PostMapping("/listPoint") |
| | | public R<List<XpPoint>> list(@RequestBody PointListQuery query) { |
| | | List<XpPoint> pageList = xpPointService.listAll(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "点位管理分页列表", response = XpPoint.class) |
| | | @PostMapping("/pageList") |
| | | public R<PageInfo<XpPoint>> pageList(@RequestBody PointPageListListQuery query) { |
| | | PageInfo<XpPoint> pageList = xpPointService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @PostMapping("/getByIds") |
| | | public R<List<XpPoint>> getByIds(@RequestBody XpPointExportExcelQuery query){ |
| | | List<XpPoint> list = xpPointService.lambdaQuery().in(XpPoint::getId, query.getPointIds()).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 新增点位 |
| | | */ |
| | |
| | | xpPointService.save(xpPoint); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除点位 |
| | | */ |
| | |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | xpPointService.removeBatchByIds(Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList())); |
| | | xpPointService.removeBatchByIds(Arrays.stream(ids.split(",")) |
| | | .map(Long::parseLong).collect(Collectors.toList())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑点位 |
| | | */ |
| | |
| | | xpPointService.updateById(xpPoint); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 点位详情 |
| | | */ |
| | |
| | | public R<XpPoint> queryById(@RequestParam Long id) { |
| | | return R.ok(xpPointService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 启用/禁用 |
| | | */ |
| | |
| | | @PostMapping("/setSpecialPoint") |
| | | @ApiOperation(value = "设置特殊点位",tags = "后台管理-特殊点位") |
| | | public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) { |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().set(XpPoint::getChargePoint, 0).set(XpPoint::getParkingPoint,0)); |
| | | List<XpPoint> list = xpPointService.list(new LambdaQueryWrapper<XpPoint>().in(XpPoint::getId, dto.getChargePoints())); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().set(XpPoint::getChargePoint, 0) |
| | | .set(XpPoint::getParkingPoint, 0)); |
| | | List<XpPoint> list = xpPointService.list(new LambdaQueryWrapper<XpPoint>() |
| | | .in(XpPoint::getId, dto.getChargePoints())); |
| | | list.forEach(e->{ |
| | | e.setChargePoint(1); |
| | | e.setFpElectronicAreaId(null); |
| | | }); |
| | | xpPointService.updateBatchById(list); |
| | | List<XpPoint> list1 = xpPointService.list(new LambdaQueryWrapper<XpPoint>().in(XpPoint::getId, dto.getParkingPoints())); |
| | | List<XpPoint> list1 = xpPointService.list(new LambdaQueryWrapper<XpPoint>() |
| | | .in(XpPoint::getId, dto.getParkingPoints())); |
| | | list1.forEach(e->{ |
| | | e.setParkingPoint(1); |
| | | e.setFpElectronicAreaId(null); |