| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- 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.MesMoldMaintenance;
- import com.jeesite.modules.mes.service.MesMoldMaintenanceService;
- /**
- * 模具保养Controller
- * @author mes
- * @version 2026-06-26
- */
- @Controller
- @RequestMapping(value = "${adminPath}/mes/mesMoldMaintenance")
- public class MesMoldMaintenanceController extends BaseController {
- @Autowired
- private MesMoldMaintenanceService mesMoldMaintenanceService;
- /**
- * 获取数据
- */
- @ModelAttribute
- public MesMoldMaintenance get(String id, boolean isNewRecord) {
- return mesMoldMaintenanceService.get(id, isNewRecord);
- }
- /**
- * 查询列表
- */
- @RequiresPermissions("mes:mesMoldMaintenance:view")
- @RequestMapping(value = {"list", ""})
- public String list(MesMoldMaintenance mesMoldMaintenance, Model model) {
- model.addAttribute("mesMoldMaintenance", mesMoldMaintenance);
- return "modules/mes/mesMoldMaintenanceList";
- }
- /**
- * 查询列表数据
- */
- @RequiresPermissions("mes:mesMoldMaintenance:view")
- @RequestMapping(value = "listData")
- @ResponseBody
- public Page<MesMoldMaintenance> listData(MesMoldMaintenance mesMoldMaintenance, HttpServletRequest request, HttpServletResponse response) {
- mesMoldMaintenance.setPage(new Page<>(request, response));
- Page<MesMoldMaintenance> page = mesMoldMaintenanceService.findPage(mesMoldMaintenance);
- return page;
- }
- /**
- * 查看编辑表单
- */
- @RequiresPermissions("mes:mesMoldMaintenance:view")
- @RequestMapping(value = "form")
- public String form(MesMoldMaintenance mesMoldMaintenance, Model model) {
- model.addAttribute("mesMoldMaintenance", mesMoldMaintenance);
- return "modules/mes/mesMoldMaintenanceForm";
- }
- /**
- * 保存数据
- */
- @RequiresPermissions("mes:mesMoldMaintenance:edit")
- @PostMapping(value = "save")
- @ResponseBody
- public String save(@Validated MesMoldMaintenance mesMoldMaintenance) {
- mesMoldMaintenanceService.save(mesMoldMaintenance);
- return renderResult(Global.TRUE, text("保存模具保养记录成功!"));
- }
- /**
- * 删除数据
- */
- @RequiresPermissions("mes:mesMoldMaintenance:edit")
- @RequestMapping(value = "delete")
- @ResponseBody
- public String delete(MesMoldMaintenance mesMoldMaintenance) {
- mesMoldMaintenanceService.delete(mesMoldMaintenance);
- return renderResult(Global.TRUE, text("删除模具保养记录成功!"));
- }
- }
|