wwh 11 часов назад
Родитель
Сommit
59bcc34d0b

+ 1 - 19
baqing-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java

@@ -58,16 +58,6 @@ public class SysDeptController extends BaseController
58 58
         return success(depts);
59 59
     }
60 60
 
61
-    /**
62
-     * 校验部门名称是否唯一
63
-     */
64
-    @PreAuthorize("@ss.hasPermi('system:dept:list')")
65
-    @GetMapping("/checkDeptNameUnique")
66
-    public AjaxResult checkDeptNameUnique(SysDept dept)
67
-    {
68
-        return success(deptService.checkDeptNameUnique(dept));
69
-    }
70
-
71 61
     /**
72 62
      * 根据部门编号获取详细信息
73 63
      */
@@ -87,10 +77,6 @@ public class SysDeptController extends BaseController
87 77
     @PostMapping
88 78
     public AjaxResult add(@Validated @RequestBody SysDept dept)
89 79
     {
90
-        if (!deptService.checkDeptNameUnique(dept))
91
-        {
92
-            return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
93
-        }
94 80
         dept.setCreateBy(getUsername());
95 81
         return toAjax(deptService.insertDept(dept));
96 82
     }
@@ -105,11 +91,7 @@ public class SysDeptController extends BaseController
105 91
     {
106 92
         Long deptId = dept.getDeptId();
107 93
         deptService.checkDeptDataScope(deptId);
108
-        if (!deptService.checkDeptNameUnique(dept))
109
-        {
110
-            return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
111
-        }
112
-        else if (dept.getParentId().equals(deptId))
94
+        if (dept.getParentId().equals(deptId))
113 95
         {
114 96
             return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
115 97
         }

Разница между файлами не показана из-за своего большого размера
+ 4411 - 0
doc/测试/智慧巴青-软件测试用例.md


BIN
doc/测试/智慧巴青-软件测试用例.xlsx


BIN
doc/测试/智慧巴青-软件测试用例312条.xlsx


Разница между файлами не показана из-за своего большого размера
+ 425 - 0
doc/测试/牧业大脑-软件测试报告.docx


Разница между файлами не показана из-за своего большого размера
+ 757 - 0
doc/测试/行业数字化服务链-软件测试报告.docx


+ 0 - 9
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java

@@ -68,15 +68,6 @@ public interface SysDeptMapper
68 68
      */
69 69
     public int checkDeptExistUser(Long deptId);
70 70
 
71
-    /**
72
-     * 校验部门名称是否唯一(全局:未删除记录中部门名称不可重复)
73
-     * 
74
-     * @param deptName 部门名称
75
-     * @param parentId 父部门ID(保留参数兼容调用方,校验时不按上级过滤)
76
-     * @return 结果
77
-     */
78
-    public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
79
-
80 71
     /**
81 72
      * 新增部门信息
82 73
      * 

+ 0 - 8
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java

@@ -91,14 +91,6 @@ public interface ISysDeptService
91 91
      */
92 92
     public boolean checkDeptExistUser(Long deptId);
93 93
 
94
-    /**
95
-     * 校验部门名称是否唯一(全局:未删除记录中部门名称不可重复)
96
-     * 
97
-     * @param dept 部门信息
98
-     * @return 结果 true唯一 false不唯一
99
-     */
100
-    public boolean checkDeptNameUnique(SysDept dept);
101
-
102 94
     /**
103 95
      * 校验部门是否有数据权限
104 96
      * 

+ 4 - 28
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -170,30 +170,6 @@ public class SysDeptServiceImpl implements ISysDeptService
170 170
         return result > 0;
171 171
     }
172 172
 
173
-    /**
174
-     * 校验部门名称是否唯一(全局未删除范围内唯一)
175
-     * 
176
-     * @param dept 部门信息
177
-     * @return 结果
178
-     */
179
-    @Override
180
-    public boolean checkDeptNameUnique(SysDept dept)
181
-    {
182
-        if (dept == null || StringUtils.isEmpty(dept.getDeptName()))
183
-        {
184
-            return UserConstants.UNIQUE;
185
-        }
186
-        String deptName = dept.getDeptName().trim();
187
-        dept.setDeptName(deptName);
188
-        Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
189
-        SysDept info = deptMapper.checkDeptNameUnique(deptName, dept.getParentId());
190
-        if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
191
-        {
192
-            return UserConstants.NOT_UNIQUE;
193
-        }
194
-        return UserConstants.UNIQUE;
195
-    }
196
-
197 173
     /**
198 174
      * 校验部门是否有数据权限
199 175
      * 
@@ -223,9 +199,9 @@ public class SysDeptServiceImpl implements ISysDeptService
223 199
     @Override
224 200
     public int insertDept(SysDept dept)
225 201
     {
226
-        if (!checkDeptNameUnique(dept))
202
+        if (dept != null && StringUtils.isNotEmpty(dept.getDeptName()))
227 203
         {
228
-            throw new ServiceException("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
204
+            dept.setDeptName(dept.getDeptName().trim());
229 205
         }
230 206
         SysDept info = deptMapper.selectDeptById(dept.getParentId());
231 207
         // 如果父节点不为正常状态,则不允许新增子节点
@@ -246,9 +222,9 @@ public class SysDeptServiceImpl implements ISysDeptService
246 222
     @Override
247 223
     public int updateDept(SysDept dept)
248 224
     {
249
-        if (!checkDeptNameUnique(dept))
225
+        if (dept != null && StringUtils.isNotEmpty(dept.getDeptName()))
250 226
         {
251
-            throw new ServiceException("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
227
+            dept.setDeptName(dept.getDeptName().trim());
252 228
         }
253 229
         SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
254 230
         SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId());

+ 0 - 5
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -82,11 +82,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
82 82
 		select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
83 83
 	</select>
84 84
 	
85
-	<select id="checkDeptNameUnique" resultMap="SysDeptResult">
86
-	    <include refid="selectDeptVo"/>
87
-		where dept_name = #{deptName} and del_flag = '0' limit 1
88
-	</select>
89
-    
90 85
     <insert id="insertDept" parameterType="SysDept">
91 86
  		insert into sys_dept(
92 87
  			<if test="deptId != null and deptId != 0">dept_id,</if>