Parcourir la source

获取用户信息新增 null 值判断

zhulu il y a 2 ans
Parent
commit
e98bfbd038

+ 5 - 6
project_data/sql/0.0.2/soc/soc 9月14号11.30 以后的增量部分脚本.sql

@@ -7,12 +7,11 @@ SET FOREIGN_KEY_CHECKS = 0;
 -- ----------------------------
 DROP TABLE IF EXISTS `sync_fjnx_org_move`;
 CREATE TABLE `sync_fjnx_org_move` (
-  `id` bigint NOT NULL AUTO_INCREMENT,
-  `org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '需要移动到自定义机构下的机构编码',
-  `org_type` int DEFAULT NULL COMMENT '1: 部门 2: 机构 ',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='配置特殊的机构和部门机构,决定是否要移动到机关机构下';
-
+                                      `id` bigint NOT NULL AUTO_INCREMENT,
+                                      `org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '特殊机构编码',
+                                      `org_type` int DEFAULT NULL COMMENT '1: 部门(强行将机构类型指定为部门) 2: 机构  (强行将机构类型指定为机构)',
+                                      PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='配置特殊的机构和部门机构,决定是否要移动到机关机构下';
 -- ----------------------------
 -- Records of core_announcement_notification
 -- ----------------------------

+ 4 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java

@@ -1,5 +1,6 @@
 package com.xunmei.system.controller;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xunmei.common.core.domain.R;
@@ -167,7 +168,9 @@ public class SysUserController extends BaseController {
         SysOrg org = orgMapper.selectOne(new LambdaQueryWrapper<SysOrg>()
                 .eq(SysOrg::getId, user.getOrgId())
                 .select(SysOrg::getType));
-        user.setOrgType(org.getType());
+        if(ObjectUtil.isNotEmpty(org)){
+            user.setOrgType(org.getType());
+        }
         // 角色集合
         Set<String> roles = permissionService.getRolePermission(user);
         // 权限集合