From 9db4fc8ab0771d34a7eb3ee9c636b4824b4a3d92 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Wed, 14 Aug 2024 09:12:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9C=BA=E6=89=80=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/TdPlaceRegistManager.java | 35 +++++++ .../place/TdPlaceRegistController.java | 97 ++++++++++++++++++- .../mapper/place/TdPlaceRegistMapper.java | 5 + .../service/place/TdPlaceRegistService.java | 6 ++ .../place/impl/TdPlaceRegistServiceImpl.java | 12 +++ .../mapper/system/TdPlaceRegistMapper.xml | 16 +++ 6 files changed, 170 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceRegistManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceRegistManager.java index 19388c5..009de07 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceRegistManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/TdPlaceRegistManager.java @@ -1,9 +1,16 @@ package com.ruoyi.web.controller.manager; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.text.CharSequenceUtil; +import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.system.domain.place.TdPlaceRegist; import com.ruoyi.system.service.place.TdPlaceRegistService; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Date; +import java.util.List; /** * packageName com.ruoyi.web.controller.manager @@ -20,4 +27,32 @@ public class TdPlaceRegistManager { @Resource private TdPlaceRegistService placeRegistService; + + + public List selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist) { + return placeRegistService.selectTdPlaceRegistList(tdPlaceRegist); + } + + public boolean saveOrUpdate(TdPlaceRegist tdPlaceRegist) { + if (CharSequenceUtil.isNotBlank(tdPlaceRegist.getId())) { + tdPlaceRegist.setUpdateBy(ShiroUtils.getSysUser().getLoginName()); + tdPlaceRegist.setUpdateTime(new Date()); + } else { + tdPlaceRegist.setCreateBy(ShiroUtils.getSysUser().getLoginName()); + tdPlaceRegist.setCreateTime(new Date()); + } + return placeRegistService.saveOrUpdate(tdPlaceRegist); + } + + + public TdPlaceRegist selectTdPlaceRegist(String id) { + return placeRegistService.getById(id); + } + + public boolean deleteTdPlaceRegistByids(String ids) { + List list = Arrays.asList(Convert.toStrArray(ids)); + return placeRegistService.removeByIds(list); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceRegistController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceRegistController.java index 80e1eda..778e7fe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceRegistController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceRegistController.java @@ -1,11 +1,19 @@ 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.TdPlaceRegist; import com.ruoyi.web.controller.manager.TdPlaceRegistManager; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; +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 @@ -21,8 +29,95 @@ import javax.annotation.Resource; public class TdPlaceRegistController extends BaseController { + private String prefix = "system/placeRegist"; + + @Resource private TdPlaceRegistManager placeRegistManager; + @RequiresPermissions("system:placeRegist:view") + @GetMapping() + public String placeRegist() { + return prefix + "/placeRegist"; + } + + /** + * 场所出入登记列表 + */ + @RequiresPermissions("system:placeRegist:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(TdPlaceRegist tdPlaceRegist) { + startPage(); + List tdPlaceRegists = placeRegistManager.selectTdPlaceRegistList(tdPlaceRegist); + return getDataTable(tdPlaceRegists); + } + + + /** + * 新增场所出入登记 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + + /** + * 新增场所出入登记 + */ + @RequiresPermissions("system:placeRegist:add") + @Log(title = "场所出入登记", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(TdPlaceRegist tdPlaceRegist) { + return toAjax(placeRegistManager.saveOrUpdate(tdPlaceRegist)); + } + + /** + * 修改场所出入登记 + */ + @RequiresPermissions("system:placeRegist:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + TdPlaceRegist tdPlaceRegist = placeRegistManager.selectTdPlaceRegist(id); + mmap.put("tdPlaceRegist", tdPlaceRegist); + return prefix + "/edit"; + } + + /** + * 修改出入登记 + */ + @RequiresPermissions("system:placeRegist:edit") + @Log(title = "场所出入登记", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(TdPlaceRegist tdPlaceRegist) { + return toAjax(placeRegistManager.saveOrUpdate(tdPlaceRegist)); + } + + /** + * 详情场所出入登记 + */ + @RequiresPermissions("system:placeRegist:detail") + @GetMapping("/detail/{id}") + public String detail(@PathVariable("id") String id, ModelMap mmap) { + TdPlaceRegist tdPlaceRegist = placeRegistManager.selectTdPlaceRegist(id); + mmap.put("tdPlaceRegist", tdPlaceRegist); + return prefix + "/detail"; + } + + /** + * 删除场所出入登记 + */ + @RequiresPermissions("system:placeRegist:remove") + @Log(title = "场所出入登记", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(placeRegistManager.deleteTdPlaceRegistByids(ids)); + } + + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceRegistMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceRegistMapper.java index e8fdddd..46b0e10 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceRegistMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/place/TdPlaceRegistMapper.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.domain.place.TdPlaceRegist; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * @author 13560 * @description 针对表【td_place_regist(涉密场所出入登记)】的数据库操作Mapper @@ -13,6 +15,9 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface TdPlaceRegistMapper extends BaseMapper { + + public List selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceRegistService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceRegistService.java index b1977db..2057a65 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceRegistService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/TdPlaceRegistService.java @@ -1,8 +1,11 @@ package com.ruoyi.system.service.place; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.place.TdPlace; import com.ruoyi.system.domain.place.TdPlaceRegist; +import java.util.List; + /** * @author 13560 * @description 针对表【td_place_regist(涉密场所出入登记)】的数据库操作Service @@ -10,4 +13,7 @@ import com.ruoyi.system.domain.place.TdPlaceRegist; */ public interface TdPlaceRegistService extends IService { + + public List selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceRegistServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceRegistServiceImpl.java index 4212b86..938bf03 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceRegistServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/place/impl/TdPlaceRegistServiceImpl.java @@ -2,10 +2,14 @@ package com.ruoyi.system.service.place.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.domain.place.TdPlaceRegist; +import com.ruoyi.system.mapper.place.TdPlaceMapper; import com.ruoyi.system.mapper.place.TdPlaceRegistMapper; import com.ruoyi.system.service.place.TdPlaceRegistService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * @author 13560 * @description 针对表【td_place_regist(涉密场所出入登记)】的数据库操作Service实现 @@ -15,6 +19,14 @@ import org.springframework.stereotype.Service; public class TdPlaceRegistServiceImpl extends ServiceImpl implements TdPlaceRegistService { + @Resource + private TdPlaceRegistMapper tdPlaceRegistMapper; + + + @Override + public List selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist) { + return tdPlaceRegistMapper.selectTdPlaceRegistList(tdPlaceRegist); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TdPlaceRegistMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdPlaceRegistMapper.xml index dfba3f9..086ccbc 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdPlaceRegistMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdPlaceRegistMapper.xml @@ -29,4 +29,20 @@ dept_id,create_by,create_time, update_by,update_time,remark +