| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- package com.jeesite.modules.mes.web;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.shiro.authz.annotation.RequiresPermissions;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.ModelAttribute;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import com.jeesite.common.config.Global;
- import com.jeesite.common.entity.Page;
- import com.jeesite.common.web.BaseController;
- import com.jeesite.modules.mes.entity.MesDeviceMaintenance;
- import com.jeesite.modules.mes.service.MesDeviceMaintenanceService;
- /**
- * 设备保养Controller
- * @author mes
- * @version 2026-06-26
- */
- @Controller
- @RequestMapping(value = "${adminPath}/mes/mesDeviceMaintenance")
- public class MesDeviceMaintenanceController extends BaseController {
- @Autowired
- private MesDeviceMaintenanceService mesDeviceMaintenanceService;
- /**
- * 获取数据
- */
- @ModelAttribute
- public MesDeviceMaintenance get(String id, boolean isNewRecord) {
- return mesDeviceMaintenanceService.get(id, isNewRecord);
- }
- /**
- * 查询列表
- */
- @RequiresPermissions("mes:mesDeviceMaintenance:view")
- @RequestMapping(value = {"list", ""})
- public String list(MesDeviceMaintenance mesDeviceMaintenance, Model model) {
- model.addAttribute("mesDeviceMaintenance", mesDeviceMaintenance);
- return "modules/mes/mesDeviceMaintenanceList";
- }
- /**
- * 查询列表数据
- */
- @RequiresPermissions("mes:mesDeviceMaintenance:view")
- @RequestMapping(value = "listData")
- @ResponseBody
- public Page<MesDeviceMaintenance> listData(MesDeviceMaintenance mesDeviceMaintenance, HttpServletRequest request, HttpServletResponse response) {
- mesDeviceMaintenance.setPage(new Page<>(request, response));
- Page<MesDeviceMaintenance> page = mesDeviceMaintenanceService.findPage(mesDeviceMaintenance);
- return page;
- }
- /**
- * 查看编辑表单
- */
- @RequiresPermissions("mes:mesDeviceMaintenance:view")
- @RequestMapping(value = "form")
- public String form(MesDeviceMaintenance mesDeviceMaintenance, Model model) {
- model.addAttribute("mesDeviceMaintenance", mesDeviceMaintenance);
- return "modules/mes/mesDeviceMaintenanceForm";
- }
- /**
- * 查看详情
- */
- @RequiresPermissions("mes:mesDeviceMaintenance:view")
- @RequestMapping(value = "info")
- public String info(MesDeviceMaintenance mesDeviceMaintenance, Model model) {
- model.addAttribute("mesDeviceMaintenance", mesDeviceMaintenance);
- return "modules/mes/mesDeviceMaintenanceInfo";
- }
- /**
- * 保存数据
- */
- @RequiresPermissions("mes:mesDeviceMaintenance:edit")
- @PostMapping(value = "save")
- @ResponseBody
- public String save(@Validated MesDeviceMaintenance mesDeviceMaintenance) {
- mesDeviceMaintenanceService.save(mesDeviceMaintenance);
- return renderResult(Global.TRUE, text("保存设备维保记录成功!"));
- }
- /**
- * 删除数据
- */
- @RequiresPermissions("mes:mesDeviceMaintenance:edit")
- @RequestMapping(value = "delete")
- @ResponseBody
- public String delete(MesDeviceMaintenance mesDeviceMaintenance) {
- mesDeviceMaintenanceService.delete(mesDeviceMaintenance);
- return renderResult(Global.TRUE, text("删除设备维保记录成功!"));
- }
- }
|