From 1f4487437f8dcb7a81e3e272a356de908df3b3dd Mon Sep 17 00:00:00 2001 From: 20918 <2091823062@qq.com> Date: Tue, 20 Aug 2024 11:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=89=E5=AF=86=E8=AE=BE=E5=A4=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/TdPropertyEmentController.java | 93 +++++++++++++++++++ .../system/property/ementdata/add.html | 10 ++ .../system/property/ementdata/detail.html | 10 ++ .../property/ementdata/propertyEment.html | 10 ++ 4 files changed, 123 insertions(+) create mode 100644 ruoyi-admin/src/main/resources/templates/system/property/ementdata/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/property/ementdata/detail.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/property/ementdata/propertyEment.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyEmentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyEmentController.java index 48bb61d..7df19fb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyEmentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyEmentController.java @@ -1,6 +1,20 @@ package com.ruoyi.web.controller.system.property; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.uuid.Seq; +import com.ruoyi.system.domain.TdPropertyEment; +import com.ruoyi.web.controller.manager.TdPropertyEmentManager; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; /** * packageName com.ruoyi.web.controller.system.property @@ -11,5 +25,84 @@ import com.ruoyi.common.core.controller.BaseController; * @date 2024/8/20 * @description */ +@Controller +@RequestMapping("/system/prementData") public class TdPropertyEmentController extends BaseController { + private String prefix = "system/property/ementdata"; + @Resource + private TdPropertyEmentManager tdPropertyEmentManager; + + @RequiresPermissions("system:property:view") + @GetMapping() + public String tdEment() { + return prefix + "/propertyEment"; + } + + /** + * 设备列表 + */ + @RequiresPermissions("system:property:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(TdPropertyEment tdPropertyEment) { + startPage(); + List tdPropertyEments = tdPropertyEmentManager.selectEmentList(tdPropertyEment); + return getDataTable(tdPropertyEments); + } + + /** + * 新增设备 + */ + @GetMapping("/add/{useId}") + public String add(@PathVariable("useId") String useId, ModelMap mmap) { + mmap.put("useId", useId); + return prefix + "/add"; + } + + /** + * 新增设备 + */ + @RequiresPermissions("system:property:add") + @Log(title = "涉密设备", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(TdPropertyEment tdPropertyEment) { + tdPropertyEment.setId("Ement_" + Seq.getId(Seq.commSeqType)); + tdPropertyEment.setMaintainState("1"); + return toAjax(tdPropertyEmentManager.saveOrUpdate(tdPropertyEment)); + } + + /** + * 设备详情 + */ + @RequiresPermissions("system:property:detail") + @GetMapping("/detail/{id}") + public String detail(@PathVariable("id") String id, ModelMap mmap) { + TdPropertyEment tdPropertyEment = tdPropertyEmentManager.selecttdEment(id); + mmap.put("tdPropertyEment", tdPropertyEment); + return prefix + "/detail"; + } + + /** + * 删除设备 + */ + @RequiresPermissions("system:property:remove") + @Log(title = "涉密设备", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(tdPropertyEmentManager.deletedEmentByids(ids)); + } + + /** + * + * 查询所有设备 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @PostMapping("/getList") + @ResponseBody + public AjaxResult getList() { + return AjaxResult.success(tdPropertyEmentManager.selectList()); + } + } diff --git a/ruoyi-admin/src/main/resources/templates/system/property/ementdata/add.html b/ruoyi-admin/src/main/resources/templates/system/property/ementdata/add.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/property/ementdata/add.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/property/ementdata/detail.html b/ruoyi-admin/src/main/resources/templates/system/property/ementdata/detail.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/property/ementdata/detail.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/property/ementdata/propertyEment.html b/ruoyi-admin/src/main/resources/templates/system/property/ementdata/propertyEment.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/property/ementdata/propertyEment.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file