| | |
| | | |
| | | 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 org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | |
| | | @Api(tags = "设备报修管理") |
| | |
| | | @Autowired |
| | | private IDeviceRepairService deviceRepairService; |
| | | |
| | | @Autowired |
| | | private IDeviceLedgerService deviceLedgerService; |
| | | |
| | | @ApiModelProperty("设备报修列表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceRepairDto deviceRepairDto) { |
| | |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("添加设备报修") |
| | | public AjaxResult add( @RequestBody DeviceRepair deviceRepair) { |
| | | public AjaxResult add( @RequestBody DeviceRepairDto deviceRepair) { |
| | | return deviceRepairService.saveDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("修改设备报修") |
| | | public AjaxResult update( @RequestBody DeviceRepair deviceRepair) { |
| | | public AjaxResult update( @RequestBody DeviceRepairDto deviceRepair) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | | @PostMapping ("repair") |
| | | @ApiModelProperty("设备维修") |
| | | public AjaxResult repair( @RequestBody DeviceRepair deviceRepair) { |
| | | public AjaxResult repair( @RequestBody DeviceRepairDto deviceRepair) { |
| | | DeviceRepairDto deviceRepairDto = deviceRepairService.detailById(deviceRepair.getId()); |
| | | deviceRepair.setStatus(1); |
| | | deviceRepair.setFiles(deviceRepairDto.getFiles()); |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | } |
| | | |