| | |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | // @CloudRequiredPermission("business:carevent:create") |
| | | public ApiResponse create(@RequestBody CarEvent carEvent) { |
| | | public ApiResponse create(@RequestBody CarEvent carEvent,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(carEventService.create(carEvent)); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:carevent:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | carEventService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("批量删除") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:carevent:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | |
| | | @ApiOperation("根据ID修改") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:carevent:update") |
| | | public ApiResponse updateById(@RequestBody CarEvent carEvent) { |
| | | public ApiResponse updateById(@RequestBody CarEvent carEvent,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | carEventService.updateById(carEvent); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | //@CloudRequiredPermission("business:carevent:query") |
| | | public ApiResponse<PageData<CarEventDTO>> findPage (@RequestBody PageWrap<CarEvent> pageWrap) { |
| | | public ApiResponse<PageData<CarEventDTO>> findPage (@RequestBody PageWrap<CarEvent> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(carEventService.findVisitCarPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | //@CloudRequiredPermission("business:carevent:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<CarEvent> pageWrap, HttpServletResponse response) { |
| | | public void exportExcel (@RequestBody PageWrap<CarEvent> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | // ExcelExporter.build(CarEventVo.class).exportWithFirstAndEnd (carEventService.findPageExcel(pageWrap),"停车场事件推送记录表", null, "停车场事件推送记录导出报表",null , response); |
| | | ExcelExporter.build(CarEventDTO.class).export(carEventService.findVisitCarPage(pageWrap).getRecords(), "停车场事件推送记录表", response); |
| | | } |
| | | @ApiOperation("根据日期(starttime)同步过车数据") |
| | | @PostMapping("/syncByDate") |
| | | @CloudRequiredPermission("business:carevent:sync") |
| | | public ApiResponse syncByDate(@RequestBody CarEvent param) { |
| | | public ApiResponse syncByDate(@RequestBody CarEvent param,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | hkSyncParkService.syncParkRecords(param.getCreateDate()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:carevent:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(carEventService.findById(id)); |
| | | } |
| | | } |