shc 1 жил өмнө
parent
commit
d523a15d0c

+ 4 - 9
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/ApiController.java

@@ -748,7 +748,7 @@ public class ApiController {
 		Map<Integer, SysDept> deptMap = sysDeptService.list().stream().collect(Collectors.toMap(SysDept::getDeptId, Function.identity()));
 
 		Map<Integer, List<SysDeptCsm>> csmMap = null;
-		if (CollUtil.isNotEmpty(deptMap)){
+		if (CollUtil.isNotEmpty(deptMap)) {
 			// 获取csm信息
 			List<SysDeptCsm> deptCsms = deptCsmService.list(Wrappers.<SysDeptCsm>lambdaQuery().in(SysDeptCsm::getDeptId, deptMap.keySet()));
 			csmMap = deptCsms.stream().collect(Collectors.groupingBy(SysDeptCsm::getDeptId));
@@ -757,11 +757,6 @@ public class ApiController {
 		Map<String, List<WmDaAgent>> agentMap = wmDaAgentService.list().stream().collect(Collectors.groupingBy(WmDaAgent::getDeptId));
 
 
-
-
-
-
-
 		List<Integer> roleList = new ArrayList<>();
 		List<Map<String, Object>> list = new ArrayList<>(sysUserList.size());
 
@@ -814,8 +809,8 @@ public class ApiController {
 
 			// 获取部门信息 && 获取csm信息 && 管理者
 			Integer deptId = sysU.getDeptId();
-			SysDept sysDept =deptMap.get(deptId);
-			SysDeptCsm deptCsm = CollUtil.isNotEmpty(csmMap) ? csmMap.get(deptId).get(0) : null;
+			SysDept sysDept = deptMap.get(deptId);
+			SysDeptCsm deptCsm = CollUtil.isNotEmpty(csmMap) ? csmMap.get(deptId) == null ? null : csmMap.get(deptId).get(0) : null;
 			mapOne.put("deptId", deptId);
 			mapOne.put("deptName", sysDept.getName());
 			mapOne.put("csm", deptCsm);
@@ -976,7 +971,7 @@ public class ApiController {
 
 
 		// 更新用户的openID和头像
-		ThreadUtil.execAsync(() -> this.updateUserOpenIdAndAvatar(hnqzUser.getId(), code,avatar));
+		ThreadUtil.execAsync(() -> this.updateUserOpenIdAndAvatar(hnqzUser.getId(), code, avatar));
 
 		return R.ok(result);
 	}