|  |  |  | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywdevicerecord:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody YwDeviceRecord ywDeviceRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywDeviceRecord.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywDeviceRecordService.create(ywDeviceRecord)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywdevicerecord:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywDeviceRecordService.deleteById(id); | 
|---|
|  |  |  | ywDeviceRecordService.deleteById(id, this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | for (String id : idArray) { | 
|---|
|  |  |  | idList.add(Integer.valueOf(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ywDeviceRecordService.deleteByIdInBatch(idList); | 
|---|
|  |  |  | ywDeviceRecordService.deleteByIdInBatch(idList,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywdevicerecord:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody YwDeviceRecord ywDeviceRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywDeviceRecord.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ywDeviceRecordService.updateById(ywDeviceRecord); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywdevicerecord:query") | 
|---|
|  |  |  | public ApiResponse<PageData<YwDeviceRecord>> findPage (@RequestBody PageWrap<YwDeviceRecord> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywDeviceRecordService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywdevicerecord:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<YwDeviceRecord> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ExcelExporter.build(YwDeviceRecord.class).export(ywDeviceRecordService.findPage(pageWrap).getRecords(), "运维设备运维记录表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywdevicerecord:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(ywDeviceRecordService.findById(id)); | 
|---|
|  |  |  | return ApiResponse.success(ywDeviceRecordService.getDetail(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|