MesDeviceMaintenanceController.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.jeesite.modules.mes.web;
  2. import javax.servlet.http.HttpServletRequest;
  3. import javax.servlet.http.HttpServletResponse;
  4. import org.apache.shiro.authz.annotation.RequiresPermissions;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.stereotype.Controller;
  7. import org.springframework.ui.Model;
  8. import org.springframework.validation.annotation.Validated;
  9. import org.springframework.web.bind.annotation.ModelAttribute;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.ResponseBody;
  13. import com.jeesite.common.config.Global;
  14. import com.jeesite.common.entity.Page;
  15. import com.jeesite.common.web.BaseController;
  16. import com.jeesite.modules.mes.entity.MesDeviceMaintenance;
  17. import com.jeesite.modules.mes.service.MesDeviceMaintenanceService;
  18. /**
  19. * 设备保养Controller
  20. * @author mes
  21. * @version 2026-06-26
  22. */
  23. @Controller
  24. @RequestMapping(value = "${adminPath}/mes/mesDeviceMaintenance")
  25. public class MesDeviceMaintenanceController extends BaseController {
  26. @Autowired
  27. private MesDeviceMaintenanceService mesDeviceMaintenanceService;
  28. /**
  29. * 获取数据
  30. */
  31. @ModelAttribute
  32. public MesDeviceMaintenance get(String id, boolean isNewRecord) {
  33. return mesDeviceMaintenanceService.get(id, isNewRecord);
  34. }
  35. /**
  36. * 查询列表
  37. */
  38. @RequiresPermissions("mes:mesDeviceMaintenance:view")
  39. @RequestMapping(value = {"list", ""})
  40. public String list(MesDeviceMaintenance mesDeviceMaintenance, Model model) {
  41. model.addAttribute("mesDeviceMaintenance", mesDeviceMaintenance);
  42. return "modules/mes/mesDeviceMaintenanceList";
  43. }
  44. /**
  45. * 查询列表数据
  46. */
  47. @RequiresPermissions("mes:mesDeviceMaintenance:view")
  48. @RequestMapping(value = "listData")
  49. @ResponseBody
  50. public Page<MesDeviceMaintenance> listData(MesDeviceMaintenance mesDeviceMaintenance, HttpServletRequest request, HttpServletResponse response) {
  51. mesDeviceMaintenance.setPage(new Page<>(request, response));
  52. Page<MesDeviceMaintenance> page = mesDeviceMaintenanceService.findPage(mesDeviceMaintenance);
  53. return page;
  54. }
  55. /**
  56. * 查看编辑表单
  57. */
  58. @RequiresPermissions("mes:mesDeviceMaintenance:view")
  59. @RequestMapping(value = "form")
  60. public String form(MesDeviceMaintenance mesDeviceMaintenance, Model model) {
  61. model.addAttribute("mesDeviceMaintenance", mesDeviceMaintenance);
  62. return "modules/mes/mesDeviceMaintenanceForm";
  63. }
  64. /**
  65. * 查看详情
  66. */
  67. @RequiresPermissions("mes:mesDeviceMaintenance:view")
  68. @RequestMapping(value = "info")
  69. public String info(MesDeviceMaintenance mesDeviceMaintenance, Model model) {
  70. model.addAttribute("mesDeviceMaintenance", mesDeviceMaintenance);
  71. return "modules/mes/mesDeviceMaintenanceInfo";
  72. }
  73. /**
  74. * 保存数据
  75. */
  76. @RequiresPermissions("mes:mesDeviceMaintenance:edit")
  77. @PostMapping(value = "save")
  78. @ResponseBody
  79. public String save(@Validated MesDeviceMaintenance mesDeviceMaintenance) {
  80. mesDeviceMaintenanceService.save(mesDeviceMaintenance);
  81. return renderResult(Global.TRUE, text("保存设备维保记录成功!"));
  82. }
  83. /**
  84. * 删除数据
  85. */
  86. @RequiresPermissions("mes:mesDeviceMaintenance:edit")
  87. @RequestMapping(value = "delete")
  88. @ResponseBody
  89. public String delete(MesDeviceMaintenance mesDeviceMaintenance) {
  90. mesDeviceMaintenanceService.delete(mesDeviceMaintenance);
  91. return renderResult(Global.TRUE, text("删除设备维保记录成功!"));
  92. }
  93. }