From 624cbc9d730f1596c27b505190eb42048d8ba8ff Mon Sep 17 00:00:00 2001
From: zhanglin8526 <852614290@qq.com>
Date: 星期六, 26 八月 2023 17:34:52 +0800
Subject: [PATCH] 分账
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/sys/SysDeptServiceImpl.java | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/sys/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/sys/SysDeptServiceImpl.java
index 63c79a6..b7b4b70 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/sys/SysDeptServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/sys/SysDeptServiceImpl.java
@@ -225,8 +225,13 @@
}
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
//新增部门
- deptMapper.insertDept(dept);
- return insertDeptMenu(dept);
+ int i = deptMapper.insertDept(dept);
+ if(dept.getMenuIds()!=null||dept.getStaffMenuIds()!=null){
+ return insertDeptMenu(dept);
+ }else{
+ return i;
+ }
+
}
/**
@@ -244,6 +249,14 @@
SysDeptMenu rm = new SysDeptMenu();
rm.setDeptId(dept.getDeptId());
rm.setMenuId(menuId);
+ rm.setMenuFrom(1);
+ list.add(rm);
+ }
+ for(Long menuId : dept.getStaffMenuIds()){
+ SysDeptMenu rm = new SysDeptMenu();
+ rm.setDeptId(dept.getDeptId());
+ rm.setMenuId(menuId);
+ rm.setMenuFrom(2);
list.add(rm);
}
if (list.size() > 0)
@@ -370,4 +383,19 @@
{
return getChildList(list, t).size() > 0 ? true : false;
}
+
+
+ /**
+ * @description 通过微信部门id获取部门
+ * @author jqs
+ * @date 2023/8/17 16:21
+ * @param wxDeptId
+ * @return SysDept
+ */
+ @Override
+ public SysDept getByWxDeptId(Long wxDeptId){
+ return deptMapper.getByWxDeptId(wxDeptId);
+ }
+
+
}
--
Gitblit v1.7.1