| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- package com.ruoyi.project.reliability.controller;
- import java.util.List;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.ruoyi.framework.aspectj.lang.annotation.Log;
- import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
- import com.ruoyi.project.reliability.domain.TRelMaintMemo;
- import com.ruoyi.project.reliability.service.ITRelMaintMemoService;
- import com.ruoyi.framework.web.controller.BaseController;
- import com.ruoyi.framework.web.domain.AjaxResult;
- import com.ruoyi.common.utils.poi.ExcelUtil;
- import com.ruoyi.framework.web.page.TableDataInfo;
- /**
- * 维修备忘录Controller
- *
- * @author ssy
- * @date 2025-11-06
- */
- @RestController
- @RequestMapping("/reliability/rel_maint_memo")
- public class TRelMaintMemoController extends BaseController
- {
- @Autowired
- private ITRelMaintMemoService tRelMaintMemoService;
- /**
- * 查询维修备忘录列表
- */
- @GetMapping("/list")
- public TableDataInfo list(TRelMaintMemo tRelMaintMemo)
- {
- startPage();
- List<TRelMaintMemo> list = tRelMaintMemoService.selectTRelMaintMemoList(tRelMaintMemo);
- return getDataTable(list);
- }
- /**
- * 导出维修备忘录列表
- */
- @Log(title = "维修备忘录", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult export(TRelMaintMemo tRelMaintMemo)
- {
- List<TRelMaintMemo> list = tRelMaintMemoService.selectTRelMaintMemoList(tRelMaintMemo);
- ExcelUtil<TRelMaintMemo> util = new ExcelUtil<TRelMaintMemo>(TRelMaintMemo.class);
- return util.exportExcel(list, "rel_maint_memo");
- }
- /**
- * 获取维修备忘录详细信息
- */
- @GetMapping(value = "/{memoId}")
- public AjaxResult getInfo(@PathVariable("memoId") Long memoId)
- {
- return AjaxResult.success(tRelMaintMemoService.selectTRelMaintMemoById(memoId));
- }
- /**
- * 新增维修备忘录
- */
- @Log(title = "维修备忘录", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody TRelMaintMemo tRelMaintMemo)
- {
- return toAjax(tRelMaintMemoService.insertTRelMaintMemo(tRelMaintMemo));
- }
- /**
- * 修改维修备忘录
- */
- @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:edit')")
- @Log(title = "维修备忘录", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody TRelMaintMemo tRelMaintMemo)
- {
- return toAjax(tRelMaintMemoService.updateTRelMaintMemo(tRelMaintMemo));
- }
- /**
- * 删除维修备忘录
- */
- @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:remove')")
- @Log(title = "维修备忘录", businessType = BusinessType.DELETE)
- @DeleteMapping("/{memoIds}")
- public AjaxResult remove(@PathVariable Long[] memoIds)
- {
- return toAjax(tRelMaintMemoService.deleteTRelMaintMemoByIds(memoIds));
- }
- }
|