| | |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.device.dto.DeviceMaintenanceDto; |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.service.DeviceMaintenancePlanService; |
| | | import com.ruoyi.device.service.DeviceMaintenanceService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | private DeviceMaintenancePlanService deviceMaintenancePlanService; |
| | | |
| | | |
| | | /** |
| | |
| | | User user = userMapper.selectById(deviceMaintenance.getMaintenanceUserId()); |
| | | deviceMaintenance.setMaintenanceUserName(user.getName()); |
| | | |
| | | return Result.success(deviceMaintenanceService.saveOrUpdate(deviceMaintenance)); |
| | | boolean saved = deviceMaintenanceService.saveOrUpdate(deviceMaintenance); |
| | | // 保养完成后,把设备档案的最近/下次保养日期滚动到本轮 |
| | | if (saved && deviceMaintenance.getMaintenanceDate() != null) { |
| | | deviceMaintenancePlanService.updateDeviceMaintenanceDate(deviceMaintenance.getDeviceId(), deviceMaintenance.getMaintenanceDate()); |
| | | } |
| | | return Result.success(saved); |
| | | } |
| | | |
| | | /** |