吴羡
12 小时以前 2f07589b54d56085af77b50d580890cd4130b444
cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java
@@ -5,6 +5,7 @@
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;
@@ -27,6 +28,9 @@
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private DeviceMaintenancePlanService deviceMaintenancePlanService;
    /**
@@ -55,7 +59,12 @@
        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);
    }
    /**