|  |  |  | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody YwPatrolPoint ywPatrolPoint,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywPatrolPoint.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywPatrolPointService.create(ywPatrolPoint)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywPatrolPointService.deleteById(id); | 
|---|
|  |  |  | ywPatrolPointService.deleteById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | for (String id : idArray) { | 
|---|
|  |  |  | idList.add(Integer.valueOf(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ywPatrolPointService.deleteByIdInBatch(idList); | 
|---|
|  |  |  | ywPatrolPointService.deleteByIdInBatch(idList,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody YwPatrolPoint ywPatrolPoint,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywPatrolPoint.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ywPatrolPointService.updateById(ywPatrolPoint); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:query") | 
|---|
|  |  |  | public ApiResponse<PageData<YwPatrolPoint>> findPage (@RequestBody PageWrap<YwPatrolPoint> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywPatrolPointService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("列表查询") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:query") | 
|---|
|  |  |  | public ApiResponse<List<YwPatrolPoint>> list (@RequestBody YwPatrolPoint ywPatrolPoint,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(ywPatrolPointService.findList(ywPatrolPoint)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<YwPatrolPoint> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ExcelExporter.build(YwPatrolPoint.class).export(ywPatrolPointService.findPage(pageWrap).getRecords(), "运维巡检点信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywpatrolpoint:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(ywPatrolPointService.findById(id)); | 
|---|
|  |  |  | return ApiResponse.success(ywPatrolPointService.getDetail(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|