Browse Source

fix: user list in null

shc 3 years ago
parent
commit
f07868eb58

+ 14 - 13
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysUserController.java

@@ -1437,21 +1437,22 @@ public class SysUserController {
 		// 封装结算通道
 		Set<Integer> deptIds = userVosPage.getRecords().stream().map(UserVO::getDeptId).collect(Collectors.toSet());
 
-		Map<Integer, Map<String, Integer>> coll = sysDeptSubService.list(Wrappers.<SysDeptSub>lambdaQuery().in(SysDeptSub::getDeptId, deptIds))
-				.stream()
-				.collect(Collectors.groupingBy(SysDeptSub::getDeptId, Collectors.toMap(SysDeptSub::getSubjectType, SysDeptSub::getSubjectChannel)));
-
-		userVosPage.getRecords().forEach(item -> {
-			if ("0".equals(userDTO.getSubType())) {
-				item.setCertStatus(null);
-			} else if ("1".equals(userDTO.getSubType())) {
-				item.setRljCertStatus(null);
-			}
-
-			item.setSubjectTypeAndChannel(coll.get(item.getDeptId()));
+		if (CollUtil.isNotEmpty(deptIds)) {
+			Map<Integer, Map<String, Integer>> coll = sysDeptSubService.list(Wrappers.<SysDeptSub>lambdaQuery().in(SysDeptSub::getDeptId, deptIds))
+					.stream()
+					.collect(Collectors.groupingBy(SysDeptSub::getDeptId, Collectors.toMap(SysDeptSub::getSubjectType, SysDeptSub::getSubjectChannel)));
+
+			userVosPage.getRecords().forEach(item -> {
+				if ("0".equals(userDTO.getSubType())) {
+					item.setCertStatus(null);
+				} else if ("1".equals(userDTO.getSubType())) {
+					item.setRljCertStatus(null);
+				}
 
-		});
+				item.setSubjectTypeAndChannel(coll.get(item.getDeptId()));
 
+			});
+		}
 
 		return R.ok(userVosPage);
 	}