Procházet zdrojové kódy

如果当前没有任何区域,那么就创建主区域金邻助家

LiRong před 3 měsíci
rodič
revize
3185c2a18c

+ 12 - 0
leromro-system/src/main/java/com/leromro/system/service/impl/SysDeptServiceImpl.java

@@ -51,6 +51,18 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
     @DataScope(deptAlias = "d")
     public List<SysDept> selectDeptList(SysDept dept)
     {
+        List<SysDept> sysDepts = deptMapper.selectDeptList(dept);
+        if (sysDepts.isEmpty()){
+            SysDept sysDept = new SysDept();
+            sysDept.setDeptName("金邻助家");
+            sysDept.setParentId(0L);
+            sysDept.setAreaType("0");
+            sysDept.setOrderNum(0);
+            sysDept.setStatus("0");
+            sysDept.setDelFlag("0");
+            deptMapper.insertDept(sysDept);
+        }
+
         return deptMapper.selectDeptList(dept);
     }