| | |
| | | package com.ruoyi.safe.specialequipment.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Tag(name = "安全生产--特种设备隐患整改") |
| | | @RequestMapping("/safe/specialEquipment/rectification") |
| | | @AllArgsConstructor |
| | | public class SpecialEquipmentRectificationController extends BaseController { |
| | | private final SpecialEquipmentRectificationService service; |
| | | @GetMapping("/listPage") @Operation(summary = "隐患整改-分页查询") |
| | | public AjaxResult listPage(Page page, SpecialEquipmentRectification req) { return AjaxResult.success(service.listPage(page, req)); } |
| | | @PostMapping("/add") @Log(title = "隐患整改-新增", businessType = BusinessType.INSERT) |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "隐患整改-分页查询") |
| | | public AjaxResult listPage(Page page, SpecialEquipmentRectification req) { |
| | | return AjaxResult.success(service.listPage(page, req)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "隐患整改-新增", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "隐患整改-新增") |
| | | public AjaxResult add(@RequestBody SpecialEquipmentRectification req) { return service.save(req) ? success() : error(); } |
| | | @PostMapping("/close") @Log(title = "隐患整改-闭环", businessType = BusinessType.UPDATE) |
| | | public AjaxResult add(@RequestBody SpecialEquipmentRectification req) { |
| | | return service.save(req) ? success() : error(); |
| | | } |
| | | |
| | | @PostMapping("/close") |
| | | @Log(title = "隐患整改-闭环", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "隐患整改-闭环") |
| | | public AjaxResult close(@RequestBody SpecialEquipmentRectification req) { req.setRectificationStatus(4); req.setClosedDate(LocalDate.now()); return service.updateById(req) ? success() : error(); } |
| | | @DeleteMapping("/delete") @Log(title = "隐患整改-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult close(@RequestBody SpecialEquipmentRectification req) { |
| | | req.setRectificationStatus(4); |
| | | req.setClosedDate(LocalDate.now()); |
| | | return service.updateById(req) ? success() : error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "隐患整改-删除", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "隐患整改-删除") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { return service.removeByIds(ids) ? success() : error(); } |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return service.removeByIds(ids) ? success() : error(); |
| | | } |
| | | } |