| | |
| | | import java.util.Objects; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @ApiOperation(value = "点位导出") |
| | | @PostMapping("/exportExcel") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.EXPORT, |
| | | content = "导出正式点位", |
| | | appendRequestData = true |
| | | ) |
| | | public void exportExcel(@RequestBody XpPointExportExcelQuery query) { |
| | | List<Long> pointIds = query == null ? Collections.emptyList() : query.getPointIds(); |
| | | List<Long> distinctIds = pointIds == null |
| | |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | @ApiOperation(value = "新增点位") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "新增正式点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> add(@Validated @RequestBody PointAddDto pointAddDto) { |
| | | if (xpGeoFencingPolygonService.isInFence(pointAddDto.getPointLon(), pointAddDto.getPointLat(), pointAddDto.getFenceId(), "prohibited_area")) { |
| | | return R.ok("in_prohibited_area"); |
| | |
| | | @GetMapping("/deletePoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'删除正式点位,ids=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | List<Long> pointIds = Arrays.stream(ids.split(",")) |
| | | .map(String::trim) |
| | |
| | | @ApiOperation(value = "编辑点位") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "编辑正式点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) { |
| | | XpPoint xpPoint = xpPointService.getById(pointAddDto.getId()); |
| | | if (xpPoint == null) { |
| | |
| | | */ |
| | | @PostMapping("/enableDisable") |
| | | @ApiOperation(value = "启用/禁用") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.SWITCH_STATUS, |
| | | content = "启用/禁用正式点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R enableDisable(@RequestBody XpPointEnableDisableDto dto) { |
| | | XpPoint xpPoint = xpPointService.getById(dto.getId()); |
| | | xpPoint.setOperationStatus(dto.getOperationStatus()); |