| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TFaultRepairMessage; |
| | | import com.ruoyi.system.query.TFaultRepairMessageQuery; |
| | | import com.ruoyi.system.service.TFaultRepairMessageService; |
| | | import com.ruoyi.system.vo.TFaultRepairMessageVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | this.tFaultRepairMessageService = tFaultRepairMessageService; |
| | | } |
| | | |
| | | /** |
| | | * 获取报修管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:fault:list')") |
| | | @ApiOperation(value = "获取报修分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TFaultRepairMessageVO>> pageList(@RequestBody TFaultRepairMessageQuery query) { |
| | | return R.ok(tFaultRepairMessageService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 处理维修 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:fault:update')") |
| | | @Log(title = "报修信息-处理维修", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "处理维修") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TFaultRepairMessage faultRepairMessage) { |
| | | faultRepairMessage.setStatus(2); |
| | | return R.ok(tFaultRepairMessageService.updateById(faultRepairMessage)); |
| | | } |
| | | |
| | | /** |
| | | * 查看报修详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:fault:detail')") |
| | | @ApiOperation(value = "查看报修详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TFaultRepairMessageVO> getDetailById(@RequestParam String id) { |
| | | TFaultRepairMessageVO faultRepairMessageVO = tFaultRepairMessageService.getDetailById(id); |
| | | return R.ok(faultRepairMessageVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除报修 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:fault:delete')") |
| | | @Log(title = "报修信息-删除报修", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除报修") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(tFaultRepairMessageService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除报修 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:fault:delete')") |
| | | @Log(title = "报修信息-删除报修", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除报修") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(tFaultRepairMessageService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |