| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.device.dto.DeviceMaintenancePlanDetailsDto; |
| | | import com.ruoyi.device.dto.DeviceMaintenancePlanDto; |
| | | import com.ruoyi.device.pojo.DeviceMaintenancePlan; |
| | | import com.ruoyi.device.pojo.DeviceMaintenancePlanDetails; |
| | | import com.ruoyi.device.service.DeviceMaintenancePlanDetailsService; |
| | | import com.ruoyi.device.service.DeviceMaintenancePlanService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | public class DeviceMaintenancePlanController { |
| | | @Resource |
| | | private DeviceMaintenancePlanService deviceMaintenancePlanService; |
| | | |
| | | @Resource |
| | | private DeviceMaintenancePlanDetailsService deviceMaintenancePlanDetailsService; |
| | | |
| | | /** |
| | | * 分页查询设备保养计划 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 按年份查询设备保养计划(不存在则自动创建),并自动补全已到点的设备明细 |
| | | */ |
| | | @Operation(summary = "按年份查询设备保养计划(自动创建并补全到点明细)") |
| | | @GetMapping("/getPlanByYear") |
| | | public Result<DeviceMaintenancePlanDto> getPlanByYear(String planYear) { |
| | | return Result.success(deviceMaintenancePlanService.getOrCreatePlanByYear(planYear)); |
| | | } |
| | | |
| | | /** |
| | | * 设备保养计划详情列表(含到点标红) |
| | | */ |
| | | @Operation(summary = "设备保养计划详情列表") |
| | | @GetMapping("/pageMaintenancePlanDetail") |
| | | public Result<IPage<DeviceMaintenancePlanDetailsDto>> pageMaintenancePlanDetail(Page page, Integer planId, String deviceName, String deviceNumber) { |
| | | return Result.success(deviceMaintenancePlanService.pageMaintenancePlanDetail(page, planId, deviceName, deviceNumber)); |
| | | } |
| | | |
| | | /** |
| | | * 修改设备保养计划详情 |
| | | */ |
| | | @Operation(summary = "修改设备保养计划详情") |
| | | @PostMapping("/updateMaintenancePlanDetail") |
| | | public Result updateMaintenancePlanDetail(@RequestBody DeviceMaintenancePlanDetails deviceMaintenancePlanDetails) { |
| | | return Result.success(deviceMaintenancePlanDetailsService.updateById(deviceMaintenancePlanDetails)); |
| | | } |
| | | |
| | | /** |
| | | * 删除设备保养计划详情 |
| | | */ |
| | | @Operation(summary = "删除设备保养计划详情") |
| | | @DeleteMapping("/delMaintenancePlanDetail") |
| | | public Result delMaintenancePlanDetail(Integer maintenancePlanDetailId) { |
| | | return Result.success(deviceMaintenancePlanDetailsService.removeById(maintenancePlanDetailId)); |
| | | } |
| | | |
| | | /** |
| | | * 导出设备保养计划 |
| | | */ |
| | | @Operation(summary = "导出设备保养计划") |