| | |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | @Api(tags = "设备报修管理") |
| | | @Tag(name = "设备报修管理") |
| | | @RequestMapping("/device/repair") |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | |
| | | private IDeviceRepairService deviceRepairService; |
| | | |
| | | @ApiOperation("设备报修列表") |
| | | @Operation(summary = "设备报修列表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceRepairDto deviceRepairDto) { |
| | | return AjaxResult.success(deviceRepairService.queryPage(page,deviceRepairDto)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiOperation("添加设备报修") |
| | | public AjaxResult add( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.saveDeviceRepair(deviceRepair); |
| | | @Operation(summary = "添加设备报修") |
| | | public AjaxResult add( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.saveDeviceRepair(deviceRepairDto); |
| | | } |
| | | |
| | | @ApiOperation("根据id查询设备报修") |
| | | @Operation(summary = "根据id查询设备报修") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | DeviceRepairDto byId = deviceRepairService.detailById(id); |
| | | return AjaxResult.success(byId); |
| | | return AjaxResult.success(deviceRepairService.detailById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @ApiOperation("修改设备报修") |
| | | public AjaxResult update( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | @Operation(summary = "修改设备报修") |
| | | public AjaxResult update( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepairDto); |
| | | } |
| | | |
| | | @PostMapping ("repair") |
| | | @ApiOperation("设备维修") |
| | | public AjaxResult repair( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | @Operation(summary = "设备维修") |
| | | public AjaxResult repair( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepairDto); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiOperation("删除设备报修") |
| | | @Operation(summary = "删除设备报修") |
| | | public AjaxResult delete(@PathVariable("ids") Long[] ids) { |
| | | boolean b = deviceRepairService.removeBatchByIds(Arrays.asList(ids)); |
| | | if (!b) { |
| | |
| | | } |
| | | |
| | | @PostMapping("export") |
| | | @ApiOperation("导出设备报修") |
| | | @Operation(summary = "导出设备报修") |
| | | public void export(HttpServletResponse response, Long[] ids) { |
| | | deviceRepairService.export(response, ids); |
| | | } |