对比新文件 |
| | |
| | | package com.ruoyi.device.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.device.dto.DeviceRepairDto; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | |
| | | @Api(tags = "璁惧鎶ヤ慨绠$悊") |
| | | @RequestMapping("/device/reppair") |
| | | @RestController |
| | | public class DeviceRepairController { |
| | | |
| | | @Autowired |
| | | private IDeviceRepairService deviceRepairService; |
| | | |
| | | @ApiModelProperty("璁惧鎶ヤ慨鍒楄〃") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceRepairDto deviceRepairDto) { |
| | | return AjaxResult.success(deviceRepairService.queryPage(page,deviceRepairDto)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("娣诲姞璁惧鎶ヤ慨") |
| | | public AjaxResult add( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.saveDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | | @ApiModelProperty("鏍规嵁id鏌ヨ璁惧鎶ヤ慨") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceRepairService.getById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("淇敼璁惧鎶ヤ慨") |
| | | public AjaxResult update( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiModelProperty("鍒犻櫎璁惧鎶ヤ慨") |
| | | public AjaxResult delete(@PathVariable("ids") Long[] ids) { |
| | | boolean b = deviceRepairService.removeBatchByIds(Arrays.asList(ids)); |
| | | if (!b) { |
| | | return AjaxResult.error("鍒犻櫎澶辫触"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("export") |
| | | @ApiModelProperty("瀵煎嚭璁惧鎶ヤ慨") |
| | | public void export(HttpServletResponse response, Long[] ids) { |
| | | deviceRepairService.export(response, ids); |
| | | } |
| | | } |