| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @ApiOperation(value = "获取所有运营中的区域", response = XpElectronicFenceArea.class) |
| | | @PostMapping("/listElectronicFenceArea") |
| | | public R<List<XpElectronicFenceArea>> listElectronicFenceArea() { |
| | | R<List<XpElectronicFenceArea>> listR = xpPointClient.listElectronicFenceArea(); |
| | | |
| | | return xpPointClient.listElectronicFenceArea(); |
| | | |
| | | return listR; |
| | | } |
| | | @ApiOperation(value = "点位管理分页列表", response = XpPoint.class) |
| | | @PostMapping("/pageList") |
| | |
| | | /** |
| | | * 新增点位 |
| | | */ |
| | | @GlobalTransactional(name = "add-point", rollbackFor = Exception.class) |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "新增点位") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | public R add(@Validated @RequestBody PointAddDto pointAddDto) { |
| | | return xpPointClient.add(pointAddDto); |
| | | xpPointClient.add(pointAddDto); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 编辑点位 |
| | | */ |
| | | @PostMapping("/edit") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @ApiOperation(value = "编辑点位") |
| | | public R edit(@Validated@RequestBody PointUpdateDto pointAddDto) { |
| | | |
| | | return xpPointClient.edit(pointAddDto); |
| | | xpPointClient.edit(pointAddDto); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 批量删除点位 |
| | |
| | | @GetMapping("/deletePoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | xpPointClient.deletePoint(ids); |
| | | return R.ok(); |
| | |
| | | @PostMapping("/enableDisable") |
| | | @ResponseBody |
| | | @ApiOperation(value = "启用/禁用") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | public R enableDisable(@RequestBody XpPointEnableDisableDto dto) { |
| | | return xpPointClient.enableDisable(dto); |
| | | } |