From 07da6d3dfc9b708535f9f1c65bad334e0d9b97b4 Mon Sep 17 00:00:00 2001
From: wangxy <1481820854@qq.com>
Date: Mon, 23 Sep 2024 14:21:37 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E6=B6=89=E5=AF=86=E5=9C=BA=E6=89=80?=
 =?UTF-8?q?=E5=8F=98=E6=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../controller/manager/TdPlaceManager.java    | 11 +++
 .../place/TdPlaceChangeController.java        | 91 +++++++++++++++++++
 .../system/mapper/place/TdPlaceMapper.java    |  3 +
 .../system/service/place/TdPlaceService.java  |  2 +
 .../place/impl/TdPlaceServiceImpl.java        |  5 +
 .../resources/mapper/system/TdPlaceMapper.xml |  9 ++
 6 files changed, 121 insertions(+)
 create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceChangeController.java

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceManager.java
index d2588b5..469f72f 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceManager.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceManager.java
@@ -32,6 +32,10 @@ public class TdPlaceManager {
         return placeService.selectTdPlaceList(tdPlace);
     }
 
+    public List<TdPlace> selectTdPlaceChangeList(TdPlace tdPlace) {
+        return placeService.selectTdPlaceChangeList(tdPlace);
+    }
+
 
 
     public boolean saveOrUpdate(TdPlace tdPlace) {
@@ -50,6 +54,13 @@ public class TdPlaceManager {
     }
 
 
+    public boolean updateChange(TdPlace tdPlace) {
+        tdPlace.setAfterTime(new Date());
+        tdPlace.setState("2");
+        return placeService.saveOrUpdate(tdPlace);
+    }
+
+
     public TdPlace selectTdPlace(String id) {
         return placeService.getById(id);
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceChangeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceChangeController.java
new file mode 100644
index 0000000..0dddef1
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceChangeController.java
@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.place;
+
+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.system.domain.place.TdPlace;
+import com.ruoyi.web.controller.manager.TdPlaceManager;
+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.place
+ *
+ * @author wangxy
+ * @version JDK 8
+ * @className TdPlaceController
+ * @date 2024/8/13
+ * @description 涉密场所等级
+ */
+@Controller
+@RequestMapping("/system/placeChange")
+public class TdPlaceChangeController extends BaseController {
+
+
+    private String prefix = "system/placeChange";
+
+    @Resource
+    private TdPlaceManager placeManager;
+
+
+    @RequiresPermissions("system:placeChange:view")
+    @GetMapping()
+    public String place() {
+        return prefix + "/placeChange";
+    }
+
+    /**
+     * 场所列表
+     */
+    @RequiresPermissions("system:placeChange:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(TdPlace tdPlace) {
+        startPage();
+        List<TdPlace> tdPlaces = placeManager.selectTdPlaceChangeList(tdPlace);
+        return getDataTable(tdPlaces);
+    }
+
+
+    /**
+     * 涉密场所变更
+     */
+    @RequiresPermissions("system:placeChange:edit")
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") String id, ModelMap mmap) {
+        TdPlace tdPlace = placeManager.selectTdPlace(id);
+        mmap.put("tdPlace", tdPlace);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 涉密场所变更
+     */
+    @RequiresPermissions("system:placeChange:edit")
+    @Log(title = "涉密场所变更", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(TdPlace tdPlace) {
+        return toAjax(placeManager.updateChange(tdPlace));
+    }
+
+    /**
+     * 详情场所
+     */
+    @RequiresPermissions("system:placeChange:detail")
+    @GetMapping("/detail/{id}")
+    public String detail(@PathVariable("id") String id, ModelMap mmap) {
+        TdPlace tdPlace = placeManager.selectTdPlace(id);
+        mmap.put("tdPlace", tdPlace);
+        return prefix + "/detail";
+    }
+
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceMapper.java
index 16e877f..706af3b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceMapper.java
@@ -17,6 +17,9 @@ public interface TdPlaceMapper extends BaseMapper<TdPlace> {
 
     public List<TdPlace> selectTdPlaceList(TdPlace tdPlace);
 
+
+    public List<TdPlace> selectTdPlaceChangeList(TdPlace tdPlace);
+
 }
 
 
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceService.java
index 3e6606b..8e16bc9 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceService.java
@@ -16,4 +16,6 @@ public interface TdPlaceService extends IService<TdPlace> {
 
     public List<TdPlace> selectTdPlaceList(TdPlace tdPlace);
 
+    public List<TdPlace> selectTdPlaceChangeList(TdPlace tdPlace);
+
 }
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceServiceImpl.java
index 6e23020..1e550aa 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceServiceImpl.java
@@ -26,6 +26,11 @@ public class TdPlaceServiceImpl extends ServiceImpl<TdPlaceMapper, TdPlace>
     public List<TdPlace> selectTdPlaceList(TdPlace tdPlace) {
         return placeMapper.selectTdPlaceList(tdPlace);
     }
+
+    @Override
+    public List<TdPlace> selectTdPlaceChangeList(TdPlace tdPlace) {
+        return placeMapper.selectTdPlaceChangeList(tdPlace);
+    }
 }
 
 
diff --git a/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml
index 4860e59..545eea7 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml
@@ -35,4 +35,13 @@
         </trim>
         ORDER BY create_time DESC
     </select>
+    <select id="selectTdPlaceChangeList" resultType="com.ruoyi.system.domain.place.TdPlace">
+        select  <include refid="Base_Column_List"/> from  td_place
+        <trim prefix="where" prefixOverrides="and|or">
+            <if test="placeName!=null and placeName!=''">
+                AND place_name LIKE concat('%',#{placeName},'%')
+            </if>
+        </trim>
+        ORDER BY create_time DESC
+    </select>
 </mapper>