| | |
| | | import com.ruoyi.device.dto.DeviceExaminePlanDto; |
| | | import com.ruoyi.device.dto.DeviceExamineRecordContrastDto; |
| | | import com.ruoyi.device.dto.DeviceExamineRecordDto; |
| | | import com.ruoyi.device.pojo.DeviceExamineAttachment; |
| | | import com.ruoyi.device.pojo.DeviceExaminePlan; |
| | | import com.ruoyi.device.pojo.DeviceExaminePlanDetails; |
| | | import com.ruoyi.device.service.DeviceExaminePlanDetailsService; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 核查计划年份列表(自动删除没有明细的空年份计划) |
| | | * @return |
| | | */ |
| | | @Operation(summary = "核查计划年份列表") |
| | | @GetMapping("/getPlanYears") |
| | | public Result<List<String>> getPlanYears() { |
| | | return Result.success(deviceExaminePlanService.getExaminePlanYears()); |
| | | } |
| | | |
| | | /** |
| | | * 设备核查计划详情列表 |
| | | * @return |
| | | */ |
| | |
| | | @Operation(summary = "修改设备核查计划详情") |
| | | @PostMapping("/updateDeviceExaminePlanDetail") |
| | | public Result updateDeviceExaminePlanDetail(@RequestBody DeviceExaminePlanDetails deviceExaminePlanDetail){ |
| | | return Result.success(deviceExaminePlanDetailsService.updateById(deviceExaminePlanDetail)); |
| | | return Result.success(deviceExaminePlanService.updateExaminePlanDetail(deviceExaminePlanDetail)); |
| | | } |
| | | |
| | | /** |
| | | * 删除设备核查计划详情 |
| | | * 删除设备核查计划详情(已审核完成的核查记录不允许删除,未审核记录随明细一起删除) |
| | | * @return |
| | | */ |
| | | @Operation(summary = "删除设备核查计划详情") |
| | | @DeleteMapping("/delDeviceExaminePlanDetail") |
| | | public Result delDeviceExaminePlanDetail(Integer planDetailsId){ |
| | | return Result.success(deviceExaminePlanDetailsService.removeById(planDetailsId)); |
| | | return Result.success(deviceExaminePlanService.removeExaminePlanDetail(planDetailsId)); |
| | | } |
| | | |
| | | /** |
| | | * 为指定设备找一条可录入核查记录的计划明细,没有则新增本轮明细 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "按设备获取本轮核查计划明细") |
| | | @GetMapping("/resolveExaminePlanDetail") |
| | | public Result<DeviceExaminePlanDetails> resolveExaminePlanDetail(Integer deviceId, String checkTime){ |
| | | return Result.success(deviceExaminePlanService.resolveExaminePlanDetail(deviceId, checkTime)); |
| | | } |
| | | |
| | | /** |
| | | * 查找指定设备可复用的计划明细(只查询,不新增) |
| | | * @return |
| | | */ |
| | | @Operation(summary = "查找可复用的核查计划明细") |
| | | @GetMapping("/findExaminePlanDetail") |
| | | public Result<DeviceExaminePlanDetails> findExaminePlanDetail(Integer deviceId, String checkTime){ |
| | | return Result.success(deviceExaminePlanService.findExaminePlanDetail(deviceId, checkTime)); |
| | | } |
| | | |
| | | /** |
| | | * 查询核查记录附件 |
| | | */ |
| | | @Operation(summary = "查询核查记录附件") |
| | | @GetMapping("/selectAttachments") |
| | | public Result<List<DeviceExamineAttachment>> selectAttachments(Integer planDetailsId) { |
| | | return Result.success(deviceExaminePlanService.selectAttachments(planDetailsId)); |
| | | } |
| | | |
| | | /** |
| | | * 上传核查记录附件(任意格式,支持多个) |
| | | */ |
| | | @Operation(summary = "上传核查记录附件") |
| | | @PostMapping("/uploadAttachment") |
| | | public Result uploadAttachment(@RequestParam("planDetailsId") Integer planDetailsId, |
| | | @RequestParam("file") MultipartFile file) { |
| | | return Result.success(deviceExaminePlanService.uploadAttachment(planDetailsId, file)); |
| | | } |
| | | |
| | | /** |
| | | * 删除核查记录附件 |
| | | */ |
| | | @Operation(summary = "删除核查记录附件") |
| | | @DeleteMapping("/deleteAttachment") |
| | | public Result deleteAttachment(Long id) { |
| | | return Result.success(deviceExaminePlanService.deleteAttachment(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "导出设备核查计划") |
| | | @GetMapping("/exportDeviceExaminePlanDetail") |
| | | public void exportDeviceExaminePlanDetail(Integer planId, HttpServletResponse response){ |
| | | deviceExaminePlanService.exportDeviceExaminePlanDetail(planId, response); |
| | | public void exportDeviceExaminePlanDetail(Integer planId, String deviceName, String deviceNumber, HttpServletResponse response){ |
| | | deviceExaminePlanService.exportDeviceExaminePlanDetail(planId, deviceName, deviceNumber, response); |
| | | } |
| | | |
| | | /*********************************************** 报告 **************************************************/ |