Explorar el Código

Merge branch 'master' of http://git.meloinfo.com/wangwei/auth_perm_system

# Conflicts:
#	hr-api/hr-api-system/src/main/java/com/hr/system/api/domain/SysRole.java
#	hr-modules/hr-system/src/main/java/com/hr/system/controller/SysUserController.java
#	hr-modules/hr-system/src/main/resources/mapper/system/SysDeptMapper.xml
yaoyi hace 1 mes
padre
commit
1ad2206503
Se han modificado 21 ficheros con 422 adiciones y 320 borrados
  1. 39 2
      .gitignore
  2. 23 0
      .idea/compiler.xml
  3. 15 5
      .idea/jarRepositories.xml
  4. 8 4
      hr-api/hr-api-system/src/main/java/com/hr/system/api/domain/SysRole.java
  5. 29 0
      hr-api/hr-api-system/src/main/java/com/hr/system/api/domain/SysUser.java
  6. 2 2
      hr-auth/src/main/java/com/hr/auth/HrAuthApplication.java
  7. 2 1
      hr-common/hr-common-security/src/main/java/com/hr/common/security/utils/SecurityUtils.java
  8. 19 0
      hr-gateway/src/main/java/com/hr/gateway/HrGatewayApplication.java
  9. 0 29
      hr-gateway/src/main/java/com/hr/gateway/RuoYiGatewayApplication.java
  10. 8 4
      hr-gateway/src/main/resources/bootstrap.yml
  11. 20 0
      hr-modules/hr-file/src/main/java/com/hr/file/HrFileApplication.java
  12. 0 29
      hr-modules/hr-file/src/main/java/com/hr/file/RuoYiFileApplication.java
  13. 2 2
      hr-modules/hr-gen/src/main/java/com/hr/gen/HrGenApplication.java
  14. 2 2
      hr-modules/hr-job/src/main/java/com/hr/job/HrJobApplication.java
  15. 4 1
      hr-modules/hr-system/src/main/java/com/hr/system/controller/SysRoleController.java
  16. 189 161
      hr-modules/hr-system/src/main/java/com/hr/system/controller/SysUserController.java
  17. 6 15
      hr-modules/hr-system/src/main/java/com/hr/system/service/impl/SysUserServiceImpl.java
  18. 2 1
      hr-modules/hr-system/src/main/resources/logback.xml
  19. 4 12
      hr-modules/hr-system/src/main/resources/mapper/system/SysRoleMapper.xml
  20. 46 48
      hr-modules/hr-system/src/main/resources/mapper/system/SysUserMapper.xml
  21. 2 2
      hr-visual/hr-monitor/src/main/java/com/hr/modules/monitor/HrMonitorApplication.java

+ 39 - 2
.gitignore

@@ -1,4 +1,41 @@
-.idea/
+
+target/
+.DS_Store
+logs/**
+
+
+# maven ignore
 target/
+*.jar
+!.mvn/wrapper/*
+*.war
+*.zip
+*.tar
+*.tar.gz
+
+# eclipse ignore
+.settings/
+.project
+.classpath
+
+# idea ignore
+.idea/
+*.ipr
+*.iml
+*.iws
+*.xml
+
+# temp ignore
+*.log
+*.cache
+*.diff
+*.patch
+*.tmp
+
+# system ignore
 .DS_Store
-logs/**
+Thumbs.db
+*.orig
+*.out
+*.pid
+/.idea/

+ 23 - 0
.idea/compiler.xml

@@ -26,5 +26,28 @@
         <module name="hr-common-redis" />
       </profile>
     </annotationProcessing>
+    <bytecodeTargetLevel>
+      <module name="ruoyi-api" target="1.8" />
+      <module name="ruoyi-api-system" target="1.8" />
+      <module name="ruoyi-auth" target="1.8" />
+      <module name="ruoyi-common" target="1.8" />
+      <module name="ruoyi-common-core" target="1.8" />
+      <module name="ruoyi-common-datascope" target="1.8" />
+      <module name="ruoyi-common-datasource" target="1.8" />
+      <module name="ruoyi-common-log" target="1.8" />
+      <module name="ruoyi-common-redis" target="1.8" />
+      <module name="ruoyi-common-seata" target="1.8" />
+      <module name="ruoyi-common-security" target="1.8" />
+      <module name="ruoyi-common-sensitive" target="1.8" />
+      <module name="ruoyi-common-swagger" target="1.8" />
+      <module name="ruoyi-gateway" target="1.8" />
+      <module name="ruoyi-modules" target="1.8" />
+      <module name="ruoyi-modules-file" target="1.8" />
+      <module name="ruoyi-modules-gen" target="1.8" />
+      <module name="ruoyi-modules-job" target="1.8" />
+      <module name="ruoyi-modules-system" target="1.8" />
+      <module name="ruoyi-visual" target="1.8" />
+      <module name="ruoyi-visual-monitor" target="1.8" />
+    </bytecodeTargetLevel>
   </component>
 </project>

+ 15 - 5
.idea/jarRepositories.xml

@@ -21,6 +21,11 @@
       <option name="name" value="central" />
       <option name="url" value="https://maven.aliyun.com/repository/central" />
     </remote-repository>
+    <remote-repository>
+      <option name="id" value="snapshots" />
+      <option name="name" value="snapshots" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
+    </remote-repository>
     <remote-repository>
       <option name="id" value="local-snapshots" />
       <option name="name" value="local-snapshots" />
@@ -41,6 +46,11 @@
       <option name="name" value="aliyun nexus" />
       <option name="url" value="https://maven.aliyun.com/repository/public" />
     </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="central" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
+    </remote-repository>
     <remote-repository>
       <option name="id" value="rdc-releases" />
       <option name="name" value="rdc-releases" />
@@ -56,15 +66,15 @@
       <option name="name" value="JBoss Community repository" />
       <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
     </remote-repository>
-    <remote-repository>
-      <option name="id" value="snapshots" />
-      <option name="name" value="snapshots" />
-      <option name="url" value="https://maven.aliyun.com/nexus/content/groups/public" />
-    </remote-repository>
     <remote-repository>
       <option name="id" value="rdc-snapshots" />
       <option name="name" value="rdc-snapshots" />
       <option name="url" value="https://repo.rdc.aliyun.com/repository/78804-snapshot-Zvh7kl/" />
     </remote-repository>
+    <remote-repository>
+      <option name="id" value="snapshots" />
+      <option name="name" value="snapshots" />
+      <option name="url" value="https://maven.aliyun.com/nexus/content/groups/public" />
+    </remote-repository>
   </component>
 </project>

+ 8 - 4
hr-api/hr-api-system/src/main/java/com/hr/system/api/domain/SysRole.java

@@ -39,6 +39,10 @@ public class SysRole extends BaseEntity
 
     @Excel(name = "角色业务组织类型")
     private String roleDeptType;
+//    @Excel(name = "角色业务组织类型")
+//    private String roleDeptType;
+    @Excel(name = "所属部门Id")
+    private Integer deptId;
 
     /** 角色排序 */
     @Excel(name = "角色排序")
@@ -78,12 +82,12 @@ public class SysRole extends BaseEntity
 
     }
 
-    public String getRoleDeptType() {
-        return roleDeptType;
+    public Integer getDeptId() {
+        return deptId;
     }
 
-    public void setRoleDeptType(String roleDeptType) {
-        this.roleDeptType = roleDeptType;
+    public void setDeptId(Integer deptId) {
+        this.deptId = deptId;
     }
 
     public SysRole(Long roleId)

+ 29 - 0
hr-api/hr-api-system/src/main/java/com/hr/system/api/domain/SysUser.java

@@ -3,6 +3,8 @@ package com.hr.system.api.domain;
 import java.util.Date;
 import java.util.List;
 import javax.validation.constraints.*;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.hr.common.core.annotation.Excel;
@@ -38,6 +40,14 @@ public class SysUser extends BaseEntity
     @Excel(name = "用户名称")
     private String nickName;
 
+    /** 岗位名称 */
+    @Excel(name = "岗位名称")
+    private String postName;
+
+    /** 用户类型 */
+    @Excel(name = "用户类型", readConverterExp = "00=普通用户,99=超级管理员")
+    private String userType;
+
     /** 用户邮箱 */
     @Excel(name = "用户邮箱")
     private String email;
@@ -69,6 +79,7 @@ public class SysUser extends BaseEntity
 
     /** 最后登录时间 */
     @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date loginDate;
 
     /** 部门对象 */
@@ -308,6 +319,22 @@ public class SysUser extends BaseEntity
         this.roleId = roleId;
     }
 
+    public String getPostName() {
+        return postName;
+    }
+
+    public void setPostName(String postName) {
+        this.postName = postName;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -315,6 +342,8 @@ public class SysUser extends BaseEntity
             .append("deptId", getDeptId())
             .append("userName", getUserName())
             .append("nickName", getNickName())
+            .append("postName", getPostName())
+            .append("userType", getUserType())
             .append("email", getEmail())
             .append("phonenumber", getPhonenumber())
             .append("sex", getSex())

+ 2 - 2
hr-auth/src/main/java/com/hr/auth/RuoYiAuthApplication.java → hr-auth/src/main/java/com/hr/auth/HrAuthApplication.java

@@ -12,11 +12,11 @@ import com.hr.common.security.annotation.EnableRyFeignClients;
  */
 @EnableRyFeignClients
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
-public class RuoYiAuthApplication
+public class HrAuthApplication
 {
     public static void main(String[] args)
     {
-        SpringApplication.run(RuoYiAuthApplication.class, args);
+        SpringApplication.run(HrAuthApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  认证授权中心启动成功   ლ(´ڡ`ლ)゙  \n" );
     }
 }

+ 2 - 1
hr-common/hr-common-security/src/main/java/com/hr/common/security/utils/SecurityUtils.java

@@ -29,7 +29,8 @@ public class SecurityUtils
      */
     public static String getUsername()
     {
-        return SecurityContextHolder.getUserName();
+        String username = SecurityContextHolder.getUserName();
+        return StringUtils.isNotEmpty(username) ? username : getLoginUser().getUsername();
     }
 
     /**

+ 19 - 0
hr-gateway/src/main/java/com/hr/gateway/HrGatewayApplication.java

@@ -0,0 +1,19 @@
+package com.hr.gateway;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+/**
+ * 网关启动程序
+ * 
+ * @author ruoyi
+ */
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
+public class HrGatewayApplication
+{
+    public static void main(String[] args)
+    {
+        SpringApplication.run(HrGatewayApplication.class, args);
+    }
+}

+ 0 - 29
hr-gateway/src/main/java/com/hr/gateway/RuoYiGatewayApplication.java

@@ -1,29 +0,0 @@
-package com.hr.gateway;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-
-/**
- * 网关启动程序
- * 
- * @author ruoyi
- */
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
-public class RuoYiGatewayApplication
-{
-    public static void main(String[] args)
-    {
-        SpringApplication.run(RuoYiGatewayApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  若依网关启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
-    }
-}

+ 8 - 4
hr-gateway/src/main/resources/bootstrap.yml

@@ -14,10 +14,14 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: 127.0.0.1:8848
+        server-addr: 192.168.1.168:8848
+        username: nacosReadUser
+        password: nacosReadUser*
       config:
         # 配置中心地址
-        server-addr: 127.0.0.1:8848
+        server-addr: 192.168.1.168:8848
+        username: nacosReadUser
+        password: nacosReadUser*
         # 配置文件格式
         file-extension: yml
         # 共享配置
@@ -28,12 +32,12 @@ spring:
       eager: true
       transport:
         # 控制台地址
-        dashboard: 127.0.0.1:8718
+        dashboard: 192.168.1.168:8718
       # nacos配置持久化
       datasource:
         ds1:
           nacos:
-            server-addr: 127.0.0.1:8848
+            server-addr: 192.168.1.168:8848
             dataId: sentinel-ruoyi-gateway
             groupId: DEFAULT_GROUP
             data-type: json

+ 20 - 0
hr-modules/hr-file/src/main/java/com/hr/file/HrFileApplication.java

@@ -0,0 +1,20 @@
+package com.hr.file;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+/**
+ * 文件服务
+ * 
+ * @author ruoyi
+ */
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
+public class HrFileApplication
+{
+    public static void main(String[] args)
+    {
+        SpringApplication.run(HrFileApplication.class, args);
+
+    }
+}

+ 0 - 29
hr-modules/hr-file/src/main/java/com/hr/file/RuoYiFileApplication.java

@@ -1,29 +0,0 @@
-package com.hr.file;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-
-/**
- * 文件服务
- * 
- * @author ruoyi
- */
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
-public class RuoYiFileApplication
-{
-    public static void main(String[] args)
-    {
-        SpringApplication.run(RuoYiFileApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  文件服务模块启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
-    }
-}

+ 2 - 2
hr-modules/hr-gen/src/main/java/com/hr/gen/RuoYiGenApplication.java → hr-modules/hr-gen/src/main/java/com/hr/gen/HrGenApplication.java

@@ -17,11 +17,11 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 @SpringBootApplication
 @MapperScan("com.hr.**.mapper")
 @EnableFeignClients(basePackages = "com.hr.system.api")
-public class RuoYiGenApplication
+public class HrGenApplication
 {
     public static void main(String[] args)
     {
-        SpringApplication.run(RuoYiGenApplication.class, args);
+        SpringApplication.run(HrGenApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  代码生成模块启动成功   ლ(´ڡ`ლ)゙  \n" +
                 " .-------.       ____     __        \n" +
                 " |  _ _   \\      \\   \\   /  /    \n" +

+ 2 - 2
hr-modules/hr-job/src/main/java/com/hr/job/RuoYiJobApplication.java → hr-modules/hr-job/src/main/java/com/hr/job/HrJobApplication.java

@@ -13,11 +13,11 @@ import com.hr.common.security.annotation.EnableRyFeignClients;
 @EnableCustomConfig
 @EnableRyFeignClients   
 @SpringBootApplication
-public class RuoYiJobApplication
+public class HrJobApplication
 {
     public static void main(String[] args)
     {
-        SpringApplication.run(RuoYiJobApplication.class, args);
+        SpringApplication.run(HrJobApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  定时任务模块启动成功   ლ(´ڡ`ლ)゙  \n" +
                 " .-------.       ____     __        \n" +
                 " |  _ _   \\      \\   \\   /  /    \n" +

+ 4 - 1
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysRoleController.java

@@ -47,7 +47,7 @@ public class SysRoleController extends BaseController
     private ISysDeptService deptService;
 
     @RequiresPermissions("system:role:list")
-    @GetMapping("/list")
+    @PostMapping("/list")
     public TableDataInfo list(SysRole role)
     {
         startPage();
@@ -55,6 +55,9 @@ public class SysRoleController extends BaseController
         return getDataTable(list);
     }
 
+
+
+
     @Log(title = "角色管理", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:role:export")
     @PostMapping("/export")

+ 189 - 161
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysUserController.java

@@ -75,20 +75,203 @@ public class SysUserController extends BaseController
     @Autowired
     private ISysMenuService menuService;
 
-
-
     /**
      * 获取用户列表
      */
     @RequiresPermissions("system:user:list")
-    @GetMapping("/list")
-    public TableDataInfo list(SysUser user)
+    @PostMapping("/list")
+    public TableDataInfo queryUserList(@RequestBody SysUser user)
     {
         startPage();
-        List<SysUser> list = userService.selectUserListBaseOrg(user);
+        List<SysUser> list = userService.selectUserList(user);
         return getDataTable(list);
     }
 
+//    /**
+//     * 注册用户信息
+//     */
+//    @InnerAuth
+//    @PostMapping("/register")
+//    public R<Boolean> register(@RequestBody SysUser sysUser)
+//    {
+//        String username = sysUser.getUserName();
+//        if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
+//        {
+//            return R.fail("当前系统没有开启注册功能!");
+//        }
+//        if (!userService.checkUserNameUnique(sysUser))
+//        {
+//            return R.fail("保存用户'" + username + "'失败,注册账号已存在");
+//        }
+//        return R.ok(userService.registerUser(sysUser));
+//    }
+
+
+    /**
+     * 新增用户
+     */
+    @RequiresPermissions("system:user:add")
+    @Log(title = "用户管理", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@Validated @RequestBody SysUser user)
+    {
+        //判断选择的部门和角色是否存在
+        SysDept dept = deptService.selectDeptById(user.getDeptId());
+        if (dept == null || "2".equals(dept.getDelFlag())){
+            return error("新增用户'" + user.getUserName() + "'失败,选择的部门不存在");
+        }
+        SysRole role = roleService.selectRoleById(user.getRoleId());
+        if (role == null || "2".equals(role.getDelFlag())){
+            return error("新增用户'" + user.getUserName() + "'失败,选择的角色不存在");
+        }
+        //检查用户名是否唯一
+        if (!userService.checkUserNameUnique(user))
+        {
+            return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
+        }
+        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
+        {
+            return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
+        }
+        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
+        {
+            return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
+        }
+        user.setCreateBy(SecurityUtils.getUsername());
+        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        return toAjax(userService.insertUser(user));
+    }
+
+    /**
+     * 修改用户
+     */
+    @RequiresPermissions("system:user:edit")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@Validated @RequestBody SysUser user)
+    {
+        //判断选择的部门和角色是否存在
+        SysDept dept = deptService.selectDeptById(user.getDeptId());
+        if (dept == null || "2".equals(dept.getDelFlag())){
+            return error("新增用户'" + user.getUserName() + "'失败,选择的部门不存在");
+        }
+        SysRole role = roleService.selectRoleById(user.getRoleId());
+        if (role == null || "2".equals(role.getDelFlag())){
+            return error("新增用户'" + user.getUserName() + "'失败,选择的角色不存在");
+        }
+        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
+        {
+            return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
+        }
+        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
+        {
+            return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
+        }
+        user.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(userService.updateUser(user));
+    }
+
+    /**
+     * 删除用户
+     */
+    @RequiresPermissions("system:user:remove")
+    @Log(title = "用户管理", businessType = BusinessType.DELETE)
+    @PostMapping("/delete")
+    public AjaxResult delete(@Validated @RequestBody Long[] userIds)
+    {
+        if (ArrayUtils.contains(userIds, SecurityUtils.getUserId()))
+        {
+            return error("当前登录用户“"+SecurityUtils.getUsername()+"”不能删除");
+        }
+        return toAjax(userService.deleteUserByIds(userIds));
+    }
+
+    /**
+     * 获取当前登录的用户信息
+     *
+     * @return 用户信息
+     */
+    @GetMapping("getInfo")
+    public AjaxResult getInfo()
+    {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        SysUser user = loginUser.getSysUser();
+        // 角色集合
+        Set<String> roles = permissionService.getRolePermission(user);
+        // 权限集合
+        Set<String> permissions = permissionService.getMenuPermission(user);
+        if (!loginUser.getPermissions().equals(permissions))
+        {
+            loginUser.setPermissions(permissions);
+            tokenService.refreshToken(loginUser);
+        }
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("user", user);
+        ajax.put("roles", roles);
+        ajax.put("permissions", permissions);
+        return ajax;
+    }
+
+    /**
+     *记录用户登录IP地址和登录时间
+     */
+    @InnerAuth
+    @PostMapping("/recordlogin")
+    public R<Boolean> recordlogin(@RequestBody SysUser sysUser)
+    {
+        SysUser updateSysUser = userService.selectUserById(sysUser.getUserId());
+        updateSysUser.setLoginIp(sysUser.getLoginIp());
+        updateSysUser.setLoginDate(sysUser.getLoginDate());
+        return R.ok(userService.updateUserProfile(updateSysUser));
+    }
+
+    /**
+     * 根据用户ID获取用户信息
+     */
+    @PostMapping("/getUserInfoById")
+    public AjaxResult getUserInfoById(@RequestBody SysUser sysUser)
+    {
+        SysUser user = userService.selectUserById(sysUser.getUserId());
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("user", user);
+        return ajax;
+    }
+
+
+
+
+
+
+
+
+
+    /****************下面接口无用********************/
+
+    /**
+     * 用户授权角色
+     */
+    @RequiresPermissions("system:user:edit")
+    @Log(title = "用户管理", businessType = BusinessType.GRANT)
+    @PutMapping("/authRole")
+    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
+    {
+        userService.checkUserDataScope(userId);
+        roleService.checkRoleDataScope(roleIds);
+        userService.insertUserAuth(userId, roleIds);
+        return success();
+    }
+
+    /**
+     * 获取部门树列表
+     */
+    @RequiresPermissions("system:user:list")
+    @GetMapping("/deptTree")
+    public AjaxResult deptTree(SysDept dept)
+    {
+        return success(deptService.selectDeptTreeList(dept));
+    }
+
+
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:user:export")
     @PostMapping("/export")
@@ -357,60 +540,8 @@ public class SysUserController extends BaseController
     }
 
 
-    /**
-     * 注册用户信息
-     */
-    @InnerAuth
-    @PostMapping("/register")
-    public R<Boolean> register(@RequestBody SysUser sysUser)
-    {
-        String username = sysUser.getUserName();
-        if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
-        {
-            return R.fail("当前系统没有开启注册功能!");
-        }
-        if (!userService.checkUserNameUnique(sysUser))
-        {
-            return R.fail("保存用户'" + username + "'失败,注册账号已存在");
-        }
-        return R.ok(userService.registerUser(sysUser));
-    }
 
-    /**
-     *记录用户登录IP地址和登录时间
-     */
-    @InnerAuth
-    @PutMapping("/recordlogin")
-    public R<Boolean> recordlogin(@RequestBody SysUser sysUser)
-    {
-        return R.ok(userService.updateUserProfile(sysUser));
-    }
 
-    /**
-     * 获取用户信息
-     * 
-     * @return 用户信息
-     */
-    @GetMapping("getInfo")
-    public AjaxResult getInfo()
-    {
-        LoginUser loginUser = SecurityUtils.getLoginUser();
-        SysUser user = loginUser.getSysUser();
-        // 角色集合
-        Set<String> roles = permissionService.getRolePermission(user);
-        // 权限集合
-        Set<String> permissions = permissionService.getMenuPermission(user);
-        if (!loginUser.getPermissions().equals(permissions))
-        {
-            loginUser.setPermissions(permissions);
-            tokenService.refreshToken(loginUser);
-        }
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("user", user);
-        ajax.put("roles", roles);
-        ajax.put("permissions", permissions);
-        return ajax;
-    }
 
     /**
      * 根据用户编号获取详细信息
@@ -434,75 +565,9 @@ public class SysUserController extends BaseController
         return ajax;
     }
 
-    /**
-     * 新增用户
-     */
-    @RequiresPermissions("system:user:add")
-    @Log(title = "用户管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysUser user)
-    {
-        deptService.checkDeptDataScope(user.getDeptId());
-        roleService.checkRoleDataScope(user.getRoleIds());
-        if (!userService.checkUserNameUnique(user))
-        {
-            return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
-            return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
-            return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
-        }
-        user.setCreateBy(SecurityUtils.getUsername());
-        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
-        return toAjax(userService.insertUser(user));
-    }
 
-    /**
-     * 修改用户
-     */
-    @RequiresPermissions("system:user:edit")
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysUser user)
-    {
-        userService.checkUserAllowed(user);
-        userService.checkUserDataScope(user.getUserId());
-        deptService.checkDeptDataScope(user.getDeptId());
-        roleService.checkRoleDataScope(user.getRoleIds());
-        if (!userService.checkUserNameUnique(user))
-        {
-            return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
-            return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
-            return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
-        }
-        user.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(userService.updateUser(user));
-    }
 
-    /**
-     * 删除用户
-     */
-    @RequiresPermissions("system:user:remove")
-    @Log(title = "用户管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        if (ArrayUtils.contains(userIds, SecurityUtils.getUserId()))
-        {
-            return error("当前用户不能删除");
-        }
-        return toAjax(userService.deleteUserByIds(userIds));
-    }
+
 
     /**
      * 重置密码
@@ -533,42 +598,5 @@ public class SysUserController extends BaseController
         return toAjax(userService.updateUserStatus(user));
     }
 
-    /**
-     * 根据用户编号获取授权角色
-     */
-    @RequiresPermissions("system:user:query")
-    @GetMapping("/authRole/{userId}")
-    public AjaxResult authRole(@PathVariable("userId") Long userId)
-    {
-        AjaxResult ajax = AjaxResult.success();
-        SysUser user = userService.selectUserById(userId);
-        List<SysRole> roles = roleService.selectRolesByUserId(userId);
-        ajax.put("user", user);
-        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
-        return ajax;
-    }
 
-    /**
-     * 用户授权角色
-     */
-    @RequiresPermissions("system:user:edit")
-    @Log(title = "用户管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authRole")
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
-    {
-        userService.checkUserDataScope(userId);
-        roleService.checkRoleDataScope(roleIds);
-        userService.insertUserAuth(userId, roleIds);
-        return success();
-    }
-
-    /**
-     * 获取部门树列表
-     */
-    @RequiresPermissions("system:user:list")
-    @GetMapping("/deptTree")
-    public AjaxResult deptTree(SysDept dept)
-    {
-        return success(deptService.selectDeptTreeList(dept));
-    }
 }

+ 6 - 15
hr-modules/hr-system/src/main/java/com/hr/system/service/impl/SysUserServiceImpl.java

@@ -177,7 +177,7 @@ public class SysUserServiceImpl implements ISysUserService
     }
 
     /**
-     * 校验用户名称是否唯一
+     * 校验登录账号是否唯一
      * 
      * @param user 用户信息
      * @return 结果
@@ -276,12 +276,8 @@ public class SysUserServiceImpl implements ISysUserService
     {
         // 新增用户信息
         int rows = userMapper.insertUser(user);
-        // 新增用户岗位关联
-        insertUserPost(user);
         // 新增用户与角色管理
         insertUserRole(user);
-
-        insertUserDep(user);
         return rows;
     }
 
@@ -310,15 +306,8 @@ public class SysUserServiceImpl implements ISysUserService
         Long userId = user.getUserId();
         // 删除用户与角色关联
         userRoleMapper.deleteUserRoleByUserId(userId);
-
-        userDepMapper.deleteUserDepByUserId(userId);
-        insertUserDep(user);
         // 新增用户与角色管理
         insertUserRole(user);
-        // 删除用户与岗位关联
-        userPostMapper.deleteUserPostByUserId(userId);
-        // 新增用户与岗位管理
-        insertUserPost(user);
         return userMapper.updateUser(user);
     }
 
@@ -405,7 +394,11 @@ public class SysUserServiceImpl implements ISysUserService
      */
     public void insertUserRole(SysUser user)
     {
-        this.insertUserRole(user.getUserId(), user.getRoleIds());
+        //将用户中的角色id放入角色数组
+        Long[] roles = new Long[] {
+            user.getRoleId()
+        };
+        this.insertUserRole(user.getUserId(), roles);
     }
 
 
@@ -525,8 +518,6 @@ public class SysUserServiceImpl implements ISysUserService
         }
         // 删除用户与角色关联
         userRoleMapper.deleteUserRole(userIds);
-        // 删除用户与岗位关联
-        userPostMapper.deleteUserPost(userIds);
         return userMapper.deleteUserByIds(userIds);
     }
 

+ 2 - 1
hr-modules/hr-system/src/main/resources/logback.xml

@@ -58,7 +58,8 @@
     </appender>
 
     <!-- 系统模块日志级别控制  -->
-	<logger name="com.hr" level="info" />
+<!--	<logger name="com.hr" level="info" />-->
+    <logger name="com.hr" level="debug" />
 	<!-- Spring日志级别控制  -->
 	<logger name="org.springframework" level="warn" />
 

+ 4 - 12
hr-modules/hr-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="roleKey"            column="role_key"              />
 		<result property="roleSort"           column="role_sort"             />
 		<result property="dataScope"          column="data_scope"            />
-		<result property="roleDeptType"          column="role_dept_type"            />
+		<result property="deptId"         	  column="dept_id"            />
 
 		<result property="menuCheckStrictly"  column="menu_check_strictly"   />
 		<result property="deptCheckStrictly"  column="dept_check_strictly"   />
@@ -46,11 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="status != null and status != ''">
 			AND r.status = #{status}
 		</if>
-		<if test="roleDeptType != null and roleDeptType != ''">
-			AND r.role_dept_type =  #{roleDeptType}
-		</if>
-
-
 		<if test="roleKey != null and roleKey != ''">
 			AND r.role_key like concat('%', #{roleKey}, '%')
 		</if>
@@ -60,8 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 			and date_format(r.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
 		</if>
-		<!-- 数据范围过滤 -->
-		${params.dataScope}
 		order by r.role_sort
 	</select>
     
@@ -111,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
  			<if test="roleSort != null">role_sort,</if>
  			<if test="dataScope != null and dataScope != ''">data_scope,</if>
-		<if test="roleDeptType != null and roleDeptType != ''">role_dept_type,</if>
+			<if test="deptId != null and deptId != ''">dept_id,</if>
 
  			<if test="menuCheckStrictly != null">menu_check_strictly,</if>
  			<if test="deptCheckStrictly != null">dept_check_strictly,</if>
@@ -126,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="roleUrlmatchKey != null and roleUrlmatchKey != ''">#{roleUrlmatchKey},</if>
  			<if test="roleSort != null">#{roleSort},</if>
  			<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
-		<if test="roleDeptType != null and roleDeptType != ''">#{roleDeptType},</if>
+			<if test="deptId != null and deptId != ''">#{dept_id},</if>
 
  			<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
  			<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
@@ -148,8 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
  			<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
-			<if test="roleDeptType != null and roleDeptType != ''">role_dept_type = #{roleDeptType},</if>
-
+			<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()

+ 46 - 48
hr-modules/hr-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"       column="dept_id"      />
         <result property="userName"     column="user_name"    />
         <result property="nickName"     column="nick_name"    />
+		<result property="postName"     column="post_name"    />
+		<result property="userType"     column="user_type"    />
         <result property="email"        column="email"        />
         <result property="phonenumber"  column="phonenumber"  />
         <result property="sex"          column="sex"          />
@@ -23,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"     column="update_by"    />
         <result property="updateTime"   column="update_time"  />
         <result property="remark"       column="remark"       />
-        <association property="dept"    javaType="SysDept"         resultMap="deptResult" />
+<!--        <association property="dept"    javaType="SysDept"         resultMap="deptResult" />-->
         <collection  property="roles"   javaType="java.util.List"  resultMap="RoleResult" />
     </resultMap>
 	
@@ -45,46 +47,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dataScope"    column="data_scope"     />
         <result property="status"       column="role_status"    />
     </resultMap>
-	
-	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, 
-        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
-        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
-        from sys_user u
-		    left join sys_dept d on u.dept_id = d.dept_id
-		    left join sys_user_role ur on u.user_id = ur.user_id
-		    left join sys_role r on r.role_id = ur.role_id
-    </sql>
-
 
-	<select id="selectUserListBaseOrg" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
-		inner join sys_user_dep ud on  u.user_id=ud.user_id
-		inner join sys_user_dep ud2 on  u.user_id=ud2.user_id
-		inner join sys_dept d on ud2.dep_id = d.dept_id and d.dep_type='base'
-		where u.del_flag = '0'
+	<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
+		select u.user_id, u.dept_id, u.nick_name,u.post_name,u.user_type, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
+		r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
+		from sys_user u
+		left join sys_dept d on u.dept_id = d.dept_id
+		left join sys_user_role ur on u.user_id = ur.user_id
+		left join sys_role r on ur.role_id = r.role_id
+		where 1=1
+		and u.del_flag = '0' /*查询未删除的数据*/
+		and d.del_flag = '0' /*查询未删除的数据*/
+		and r.del_flag = '0' /*查询未删除的数据*/
 		<if test="userId != null and userId != 0">
 			AND u.user_id = #{userId}
-		</if>
-		<if test="userName==null and userId==null and status==null and phonenumber==null and params.beginTime==null and params.endTime==null and deptId==null and deptIds != null and deptIds.length>0">
-			and (
-
-			ud.dep_id in
-			<foreach collection="deptIds" item="depId" open="(" separator="," close=")">
-				#{depId}
-			</foreach>
-
-			or ud.dep_id in (select d4.dept_id from sys_dept d3 left join sys_dept d4 on d4.ancestors like CONCAT(d3.ancestors,'%') where d3.parent_id in
-			<foreach collection="deptIds" item="depId" open="(" separator="," close=")">
-				#{depId}
-			</foreach>
-			)  )
-
-
 		</if>
 		<if test="userName != null and userName != ''">
 			AND u.user_name like concat('%', #{userName}, '%')
 		</if>
+		<if test="nickName != null and nickName != ''">
+			AND u.nick_name like concat('%', #{nickName}, '%')
+		</if>
 		<if test="status != null and status != ''">
 			AND u.status = #{status}
 		</if>
@@ -98,22 +81,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
 		</if>
 		<if test="deptId != null ">
-			and ud.dep_id = #{deptId}
-			-- 			AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
-		</if>
+			and u.dep_id = #{deptId}
+			-- 		</if>
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
-
-		group by  u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
 	</select>
 
+	
+	<sql id="selectUserVo">
+        select u.user_id, u.dept_id, u.user_name, u.nick_name,u.post_name,u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
+        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
+        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
+        from sys_user u
+		    left join sys_dept d on u.dept_id = d.dept_id
+		    left join sys_user_role ur on u.user_id = ur.user_id
+		    left join sys_role r on r.role_id = ur.role_id
+    </sql>
 
 
-    <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
+	<select id="selectUserListBaseOrg" parameterType="SysUser" resultMap="SysUserResult">
+		select u.user_id, u.dept_id, u.nick_name,u.post_name,u.user_type, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 		inner join sys_user_dep ud on  u.user_id=ud.user_id
-		left join sys_dept d on u.dept_id = d.dept_id
-
+		inner join sys_user_dep ud2 on  u.user_id=ud2.user_id
+		inner join sys_dept d on ud2.dep_id = d.dept_id and d.dep_type='base'
 		where u.del_flag = '0'
 		<if test="userId != null and userId != 0">
 			AND u.user_id = #{userId}
@@ -121,12 +111,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="userName==null and userId==null and status==null and phonenumber==null and params.beginTime==null and params.endTime==null and deptId==null and deptIds != null and deptIds.length>0">
 			and (
 
-			    ud.dep_id in
+			ud.dep_id in
 			<foreach collection="deptIds" item="depId" open="(" separator="," close=")">
 				#{depId}
 			</foreach>
 
-			          or ud.dep_id in (select d4.dept_id from sys_dept d3 left join sys_dept d4 on d4.ancestors like CONCAT(d3.ancestors,'%') where d3.parent_id in
+			or ud.dep_id in (select d4.dept_id from sys_dept d3 left join sys_dept d4 on d4.ancestors like CONCAT(d3.ancestors,'%') where d3.parent_id in
 			<foreach collection="deptIds" item="depId" open="(" separator="," close=")">
 				#{depId}
 			</foreach>
@@ -151,16 +141,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</if>
 		<if test="deptId != null ">
 			and ud.dep_id = #{deptId}
--- 			AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
+			-- 			AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
 		</if>
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 
 		group by  u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
 	</select>
+
+
 	
 	<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id, u.dept_id, u.user_name,u.post_name,u.user_type, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
@@ -177,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	
 	<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name,u.post_name,u.user_type, u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
@@ -222,6 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="deptId != null and deptId != 0">dept_id,</if>
  			<if test="userName != null and userName != ''">user_name,</if>
  			<if test="nickName != null and nickName != ''">nick_name,</if>
+			<if test="postName != null and postName != ''">post_name,</if>
+			<if test="userType != null and userType != ''">user_type,</if>
  			<if test="email != null and email != ''">email,</if>
  			<if test="avatar != null and avatar != ''">avatar,</if>
  			<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
@@ -236,6 +230,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="deptId != null and deptId != ''">#{deptId},</if>
  			<if test="userName != null and userName != ''">#{userName},</if>
  			<if test="nickName != null and nickName != ''">#{nickName},</if>
+			<if test="postName != null and postName != ''">#{postName},</if>
+			<if test="userType != null and userType != ''">#{userType},</if>
  			<if test="email != null and email != ''">#{email},</if>
  			<if test="avatar != null and avatar != ''">#{avatar},</if>
  			<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
@@ -253,6 +249,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		<set>
  			<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
  			<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
+			<if test="postName != null and postName != ''">post_name = #{postName},</if>
+			<if test="userType != null and userType != ''">user_type = #{userType},</if>
  			<if test="email != null ">email = #{email},</if>
  			<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
  			<if test="sex != null and sex != ''">sex = #{sex},</if>

+ 2 - 2
hr-visual/hr-monitor/src/main/java/com/hr/modules/monitor/RuoYiMonitorApplication.java → hr-visual/hr-monitor/src/main/java/com/hr/modules/monitor/HrMonitorApplication.java

@@ -11,11 +11,11 @@ import de.codecentric.boot.admin.server.config.EnableAdminServer;
  */
 @EnableAdminServer
 @SpringBootApplication
-public class RuoYiMonitorApplication
+public class HrMonitorApplication
 {
     public static void main(String[] args)
     {
-        SpringApplication.run(RuoYiMonitorApplication.class, args);
+        SpringApplication.run(HrMonitorApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  监控中心启动成功   ლ(´ڡ`ლ)゙  \n" +
                 " .-------.       ____     __        \n" +
                 " |  _ _   \\      \\   \\   /  /    \n" +