| 
					
				 | 
			
			
				@@ -128,11 +128,12 @@ import java.util.Arrays; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.Calendar; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.Date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.HashMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Iterator; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.HashSet; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.LinkedHashMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.LinkedList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Set; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -597,23 +598,21 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!pmDemandReqVo.getIsAdmin()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (Arrays.asList(1, 2).contains(reqType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (!ObjectUtils.isEmpty(list)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toSet())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //采购执行管理中,本单位超额项目交给上级处理,本单位不处理。 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else if (3 == reqType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (!ObjectUtils.isEmpty(list)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //查出审核此项目的单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<Long> longList = list.stream().map(PmAuditDeptRef::getDeptId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 如果有上级单位存在,将本单位剔除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     SysDept sysDept = deptMapper.selectDeptById(sysUser.getDeptId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //本单位所有参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //替身,取交集用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<Long> refListL = refList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Set<Long> refList = new HashSet<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    for (PmAuditDeptRef deptRef : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        refList.add(deptRef.getRefId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //上级参与审核的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     List<Long> refListf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     List<PmAuditDeptRef> listf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (sysDept.getParentId() != 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -623,16 +622,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //上级参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //取集合交集,交集中的是上级处理,本单位不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //取集合差集,只处理差集中的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (!ObjectUtils.isEmpty(refListf)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        refListL.retainAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Iterator<Long> it = refList.iterator(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        while (it.hasNext()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            //只留下本单位要处理的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            if (refListL.contains(it.next())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                it.remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        refList.removeAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //为空就返回空 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -689,7 +681,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<PmDemandResVo> pmDemandResVos = demandChangeTo(pageRes.getRecords()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (PmDemandResVo vo : pmDemandResVos) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (Arrays.asList(1, 2, 3).contains(reqType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (Arrays.asList(1, 2).contains(reqType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 根据项目id 和 部门id 和 参数类型 获取 部门级别 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     List<PmAuditDeptRef> collect = list.stream() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             .filter(o -> o.getRefId().equals(vo.getDemandId())) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4072,12 +4064,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         list = pmAuditDeptRefService.list(l); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //本单位所有参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //替身,取交集用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Long> refListL = refList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //上级参与审核的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> refListf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<PmAuditDeptRef> listf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (sysDept.getParentId() != 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4087,18 +4076,10 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //上级参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //取集合交集,交集中的是上级处理,本单位不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //取集合差集,只处理差集中的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!ObjectUtils.isEmpty(refListf)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            refListL.retainAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Iterator<Long> it = refList.iterator(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            while (it.hasNext()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //只留下本单位要处理的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (refListL.contains(it.next())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    it.remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            refList.removeAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         lw.in(PmDemand::getProjectStatus, projectStatus); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         lw.last(" order by project_status, plan_demand_sub_time"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.baseMapper.selectList(lw); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4149,12 +4130,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         list = pmAuditDeptRefService.list(l); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //本单位所有参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //替身,取交集用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Long> refListL = refList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //上级参与审核的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> refListf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<PmAuditDeptRef> listf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (sysDept.getParentId() != 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4164,16 +4142,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //上级参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //取集合交集,交集中的是上级处理,本单位不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //取集合差集,只处理差集中的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!ObjectUtils.isEmpty(refListf)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            refListL.retainAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Iterator<Long> it = refList.iterator(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            while (it.hasNext()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //只留下本单位要处理的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (refListL.contains(it.next())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    it.remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            refList.removeAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //为空就返回空 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4243,12 +4214,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         list = pmAuditDeptRefService.list(l); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //本单位所有参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //替身,取交集用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Long> refListL = refList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //上级参与审核的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> refListf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<PmAuditDeptRef> listf = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (sysDept.getParentId() != 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4258,16 +4226,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //上级参与审核的项目id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //取集合交集,交集中的是上级处理,本单位不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //取集合差集,只处理差集中的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!ObjectUtils.isEmpty(refListf)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            refListL.retainAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Iterator<Long> it = refList.iterator(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            while (it.hasNext()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //只留下本单位要处理的项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (refListL.contains(it.next())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    it.remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            refList.removeAll(refListf); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //为空就返回空 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) { 
			 |