| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.device.dto.DeviceMaintenanceDto; |
| | | import com.ruoyi.device.dto.DeviceRepairDto; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceMaintenanceService; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | |
| | | @Api(tags = "设备保养") |
| | |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("添加设备保养") |
| | | public AjaxResult add(@RequestBody DeviceMaintenance deviceMaintenance) { |
| | | public AjaxResult add(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceMaintenance.getDeviceLedgerId()); |
| | | deviceMaintenance.setDeviceName(byId.getDeviceName()); |
| | | deviceMaintenance.setDeviceModel(byId.getDeviceModel()); |
| | |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("修改设备保养") |
| | | public AjaxResult update(@RequestBody DeviceMaintenance deviceMaintenance) { |
| | | public AjaxResult update(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceMaintenance.getDeviceLedgerId()); |
| | | deviceMaintenance.setDeviceName(byId.getDeviceName()); |
| | | deviceMaintenance.setDeviceModel(byId.getDeviceModel()); |
| | |
| | | |
| | | @PostMapping ("maintenance") |
| | | @ApiModelProperty("修改设备保养") |
| | | public AjaxResult maintenance(@RequestBody DeviceMaintenance deviceMaintenance) { |
| | | public AjaxResult maintenance(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceMaintenanceDto byId = deviceMaintenanceService.detailById(deviceMaintenance.getId()); |
| | | deviceMaintenance.setStatus(1); |
| | | deviceMaintenance.setFiles(byId.getFiles()); |
| | | return deviceMaintenanceService.updateDeviceDeviceMaintenance(deviceMaintenance); |
| | | } |
| | | |