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..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,13 +54,22 @@ 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); } 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-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 fda5b5c..545eea7 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdPlaceMapper.xml @@ -26,6 +26,16 @@ update_time,remark +