hexiao 2 lat temu
rodzic
commit
9871c61062

+ 3 - 3
purchase-system/src/main/java/com/ozs/pm/service/impl/PmAuditDeptRefServiceImpl.java

@@ -59,11 +59,11 @@ public class PmAuditDeptRefServiceImpl extends ServiceImpl<PmAuditDeptRefMapper,
             deptLevel = "C";
         } else if (ancestors.length == 3) { //B级
             deptLevel = "B";
-            cdeptId = Long.valueOf(ancestors[1]);
+            cdeptId = Long.valueOf(ancestors[2]);
         } else if (ancestors.length == 4) { //A级
             deptLevel = "A";
-            cdeptId = Long.valueOf(ancestors[1]);
-            bdeptId = Long.valueOf(ancestors[2]);
+            cdeptId = Long.valueOf(ancestors[2]);
+            bdeptId = Long.valueOf(ancestors[3]);
         }
         if (!Arrays.asList("A", "B", "C").contains(deptLevel)) {
             throw new BaseException("当前用户单位不属于ABC三级,无权提交");