From 8848e08e1498189e13d58bb5b33947cf81da6172 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Mon, 23 Sep 2024 14:12:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E6=B6=89=E5=AF=86=E5=9C=BA=E6=89=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/manager/TdPlaceManager.java | 4 +++- .../src/main/resources/mapper/system/TdPlaceMapper.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 d2d90a2..d2588b5 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 @@ -56,7 +56,9 @@ public class TdPlaceManager { public boolean deletedPlaceByids(String ids) { List list = Arrays.asList(Convert.toStrArray(ids)); - return placeService.removeByIds(list); + return placeService.lambdaUpdate() + .in(TdPlace::getId,list) + .set(TdPlace::getState,"0").update(); } public List selectList() { diff --git a/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml index fda5b5c..4860e59 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml @@ -31,6 +31,7 @@ AND place_name LIKE concat('%',#{placeName},'%') + AND state !='0' ORDER BY create_time DESC 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 2/2] =?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 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 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 { public List selectTdPlaceList(TdPlace tdPlace); + + public List 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 { public List selectTdPlaceList(TdPlace tdPlace); + public List 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 public List selectTdPlaceList(TdPlace tdPlace) { return placeMapper.selectTdPlaceList(tdPlace); } + + @Override + public List 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 @@ ORDER BY create_time DESC +