From de3008f934b2e5ecc9401e6c898bf8134d358301 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Thu, 31 Oct 2024 16:59:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AF=86=E5=93=81=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/property/TdPropertyManagerController.java | 3 +++ .../com/ruoyi/system/domain/TdPropertyManager.java | 11 +++++++++++ .../service/impl/TdPropertyManagerServiceImpl.java | 2 ++ .../mapper/system/TdPropertyManagerMapper.xml | 8 +++++++- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java index ea5d589..462197c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java @@ -4,6 +4,7 @@ import java.util.Collections; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.uuid.Seq; import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.service.ITdPropertyInfoService; @@ -104,6 +105,7 @@ public class TdPropertyManagerController extends BaseController { @ResponseBody public AjaxResult addSave(TdPropertyManager tdPropertyManager) { tdPropertyManager.setUseId("Property_" + Seq.getId(Seq.commSeqType)); + tdPropertyManager.setDeptId(ShiroUtils.getSysUser().getDeptId()); return toAjax(tdPropertyManagerService.insertTdPropertyManager(tdPropertyManager)); } @@ -126,6 +128,7 @@ public class TdPropertyManagerController extends BaseController { @PostMapping("/edit") @ResponseBody public AjaxResult editSave(TdPropertyManager tdPropertyManager) { + tdPropertyManager.setDeptId(ShiroUtils.getSysUser().getDeptId()); return toAjax(tdPropertyManagerService.updateTdPropertyManager(tdPropertyManager)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TdPropertyManager.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TdPropertyManager.java index 2b133af..2822292 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TdPropertyManager.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TdPropertyManager.java @@ -71,6 +71,8 @@ public class TdPropertyManager extends BaseEntity @Excel(name = "密品类型" ,readConverterExp = "1=涉密信息设备,2=涉密设备") private String secretsType; + private Long deptId; + public void setUseId(String useId) @@ -190,6 +192,14 @@ public class TdPropertyManager extends BaseEntity this.secretsType = secretsType; } + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -206,6 +216,7 @@ public class TdPropertyManager extends BaseEntity .append("areaId", getAreaId()) .append("propertyNum", getPropertyNum()) .append("secretsType", getSecretsType()) + .append("deptId", getDeptId()) .toString(); } } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java index bb6b4be..5468628 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.annotation.DataScope; import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.count.PropertyManagerDTO; import com.ruoyi.system.mapper.TdPropertyInfoMapper; @@ -45,6 +46,7 @@ public class TdPropertyManagerServiceImpl extends ServiceImpl selectTdPropertyManagerList(TdPropertyManager tdPropertyManager) { diff --git a/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml index 59a49e0..5ae931c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml @@ -18,10 +18,11 @@ + - select use_id, use_depart, user_name, use_date, framework_id, recover_depart, recover_name, recover_date, shemichengdu, part, area_id, property_num,secrets_type from td_property_manager + select use_id, use_depart, user_name, use_date, framework_id, recover_depart, recover_name, recover_date, shemichengdu, part, area_id, property_num,secrets_type,dept_id from td_property_manager d @@ -64,6 +67,7 @@ area_id, property_num, secrets_type, + dept_id, #{useId}, @@ -79,6 +83,7 @@ #{areaId}, #{propertyNum}, #{secretsType}, + #{deptId}, @@ -97,6 +102,7 @@ area_id = #{areaId}, property_num = #{propertyNum}, secrets_type = #{secretsType}, + dept_id = #{deptId}, where use_id = #{useId}