Commit 621a70c4 authored by 贾国凯's avatar 贾国凯

用户权限表相关修改

parent 7ee888fb
...@@ -33,7 +33,7 @@ public class UserDetailsServiceImpl implements UserDetailsService { ...@@ -33,7 +33,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
} }
SystemUser systemUser = userRes.getData(); SystemUser systemUser = userRes.getData();
//根据用户id获取用户权限 //根据用户id获取用户权限
Result<List<Long>> roles = systemUserFeignService.loadUserRolesByUserId(systemUser.getId()); Result<List<Long>> roles = systemUserFeignService.loadUserRolesByUserId(systemUser.getUserId());
UserLoginInfoVO userLoginInfoVO = new UserLoginInfoVO(systemUser); UserLoginInfoVO userLoginInfoVO = new UserLoginInfoVO(systemUser);
userLoginInfoVO.setAuthorities(roles.getData()); userLoginInfoVO.setAuthorities(roles.getData());
......
package com.hungraim.ism.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
* @author jiaguokai
*/
@Data
@TableName("CH_SRV_BUILD_BED")
public class ChSrvBuildBed {
private Integer buildBedId;
}
package com.hungraim.ism.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
* @author jiaguokai
*/
@Data
@TableName("CH_SRV_REMOVE_BED")
public class ChSrvRemoveBed {
private Integer removeBedId;
private Integer srvOrganId;
private Integer disabInfoId;
private Integer buildBedId;
private Integer programId;
private String realName;
private String gender;
private Date birthday;
private String tel;
private Integer rating;
private Integer guaranteeMode;
private Date buildBedTime;
private String specialZone;
private String changhuNo;
private String bedNumber;
private Date removeBedTime;
private Integer bedDays;
private String diagnosis;
private String bedConstruction;
private String nursingProcess;
private Integer removeBedReason;
private String removeBedProposal;
private Integer status;
private Date fcd;
private Integer fcu;
private Date lcd;
private Integer lcu;
private String removeBedReasonRemarks;
}
...@@ -7,7 +7,7 @@ import lombok.Data; ...@@ -7,7 +7,7 @@ import lombok.Data;
* @author hubin * @author hubin
*/ */
@Data @Data
@TableName("oauth_client_details") @TableName("OAUTH_CLIENT_DETAILS")
public class SystemClientDetails { public class SystemClientDetails {
private String clientId; private String clientId;
...@@ -23,8 +23,4 @@ public class SystemClientDetails { ...@@ -23,8 +23,4 @@ public class SystemClientDetails {
private String autoapprove; private String autoapprove;
private String clientName; private String clientName;
} }
...@@ -8,21 +8,22 @@ import java.util.Date; ...@@ -8,21 +8,22 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
*
*
* 系统资源表,用于权限验证 * 系统资源表,用于权限验证
*
* @author hubin * @author hubin
*/ */
@Data @Data
@TableName("ISM_RESOURCE") @TableName("LTC_RESOURCE")
public class SystemResource { public class SystemResource {
private Long id; private Long resourceId;
private String resourceName; private String resourceName;
private String resourceUrl; private String resourceUrl;
private String method;
private String resourceType; private String resourceType;
private Date createTime; private String method;
private Long parentId;
private String resourceIcon;
private Date createdTime;
@TableField(exist = false) @TableField(exist = false)
private List<Long> roleIds; private List<Long> roleIds;
......
...@@ -7,18 +7,17 @@ import java.util.Date; ...@@ -7,18 +7,17 @@ import java.util.Date;
/** /**
* 角色表,根据该表与 {@link SystemResource} 共同实现权限管理 * 角色表,根据该表与 {@link SystemResource} 共同实现权限管理
*
* @author hubin * @author hubin
*/ */
@Data @Data
@TableName("ISM_ROLE") @TableName("LTC_ROLE")
public class SystemRole { public class SystemRole {
private Long id; private Long roleId;
private String name; private String roleName;
private String status; private String status;
private Date createTime; private Date createdTime;
private Date modifyTime; private Date updatedTime;
} }
...@@ -4,14 +4,14 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -4,14 +4,14 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
/** /**
*
* 资源权限关联表 * 资源权限关联表
*
* @author hubin * @author hubin
*/ */
@Data @Data
@TableName("ISM_ROLE_RESOURCE") @TableName("LTC_ROLE_RESOURCE")
public class SystemRoleResource { public class SystemRoleResource {
private Long id;
private Long roleId; private Long roleId;
private Long resourceId; private Long resourceId;
......
...@@ -15,11 +15,10 @@ import java.util.List; ...@@ -15,11 +15,10 @@ import java.util.List;
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@TableName("ISM_USER") @TableName("LTC_USER")
public class SystemUser { public class SystemUser {
@TableId(type = IdType.AUTO) private Long userId;
private Long id;
private String account; private String account;
private String password; private String password;
private String realName; private String realName;
......
...@@ -7,16 +7,13 @@ import lombok.Data; ...@@ -7,16 +7,13 @@ import lombok.Data;
/** /**
* 用户-角色关联表 * 用户-角色关联表
* @author hubin
* *
* @author hubin
*/ */
@Data @Data
@TableName("ISM_USER_ROLE") @TableName("LTC_USER_ROLE")
public class SystemUserRole { public class SystemUserRole {
private Long id;
private Long userId; private Long userId;
private Long roleId; private Long roleId;
} }
...@@ -28,7 +28,7 @@ public class UserLoginInfoVO implements UserDetails { ...@@ -28,7 +28,7 @@ public class UserLoginInfoVO implements UserDetails {
this.username = user.getAccount(); this.username = user.getAccount();
this.password = user.getPassword(); this.password = user.getPassword();
this.name = user.getRealName(); this.name = user.getRealName();
this.userId = user.getId(); this.userId = user.getUserId();
this.enable = "1".equals(user.getUserStatus()) ; this.enable = "1".equals(user.getUserStatus()) ;
} }
......
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
<version>3.3.1</version> <version>3.3.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.oracle</groupId> <groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId> <artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version> <version>11.2.0.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis.generator</groupId> <groupId>org.mybatis.generator</groupId>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>long-term-care</artifactId>
<groupId>com.hungraim.ism</groupId>
<version>0.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<!--管控服务-->
<artifactId>governance</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba.cloud/spring-cloud-starter-alibaba-nacos-config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<!--基础包-->
<dependency>
<groupId>com.hungraim.ism</groupId>
<artifactId>common-core</artifactId>
<version>0.0.1</version>
<exclusions>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-jose</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.hungraim.ism</groupId>
<artifactId>common-mybatis</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.hungraim.ism</groupId>
<artifactId>common-redis</artifactId>
<version>0.0.1</version>
</dependency>
<!--基础包 end-->
<!-- spring boot web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork> <!--重要-->
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://121.5.28.27:9091/nexus/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://121.5.28.27:9091/nexus/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
\ No newline at end of file
package com.hungraim.ch.governance;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* @author jiaguokai
*/
@SpringBootApplication
@EnableDiscoveryClient
public class GovernanceApplication {
public static void main(String[] args) {
SpringApplication.run(GovernanceApplication.class, args);
}
}
spring:
devtools:
restart:
enabled: true
additional-paths: src/main/java
application:
name: ISM-GOVERNANCE-SERVICE
cloud:
nacos:
discovery:
server-addr: qw.hungraim.com:31158
namespace: 87d6f6f1-6583-46ea-ad02-7e8125f03c90
config:
namespace: 87d6f6f1-6583-46ea-ad02-7e8125f03c90
server-addr: qw.hungraim.com:31158
file-extension: yaml # 必须修改成yaml
extension-configs:
- data-id: ism-database.yaml
group: common
refresh: true
- data-id: ism-basic.yaml
group: common
refresh: true
- data-id: thread-config.yaml
group: system
refresh: true
server:
port: 8009
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<module>common</module> <module>common</module>
<module>system</module> <module>system</module>
<module>apply</module> <module>apply</module>
<module>governance</module>
</modules> </modules>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
</parent> </parent>
<packaging>pom</packaging> <packaging>pom</packaging>
<groupId>com.hungraim.ism</groupId> <groupId>com.hungraim.ism</groupId>
<artifactId>ism</artifactId> <artifactId>long-term-care</artifactId>
<version>0.0.1</version> <version>0.0.1</version>
<name>spring-cloud-init</name> <name>spring-cloud-init</name>
<description>parent</description> <description>parent</description>
......
...@@ -32,4 +32,12 @@ public interface SystemUserFeignService { ...@@ -32,4 +32,12 @@ public interface SystemUserFeignService {
@GetMapping("/api.system/user/loadUserRolesByUserId/{id}") @GetMapping("/api.system/user/loadUserRolesByUserId/{id}")
Result<List<Long>> loadUserRolesByUserId(@PathVariable Long id); Result<List<Long>> loadUserRolesByUserId(@PathVariable Long id);
/**
* feign api 根据用户表关联的marketerCode获取用户绑定的营销员信息
* @param code marketerCode
* @return 营销员信息
*/
// @GetMapping("/api.system/user/loadUserDetailByCode/{code}")
// Result<SystemMarketer> loadUserDetailByCode(@PathVariable String code);
} }
...@@ -17,7 +17,7 @@ public interface SystemResourceMapper extends BaseMapper<SystemResource> { ...@@ -17,7 +17,7 @@ public interface SystemResourceMapper extends BaseMapper<SystemResource> {
* 查询所有资源对应的角色 * 查询所有资源对应的角色
* @return list * @return list
*/ */
@Select("SELECT ID,RESOURCE_NAME,RESOURCE_URL,METHOD FROM ISM_RESOURCE") @Select("SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE_URL,METHOD FROM LTC_RESOURCE")
@Results({ @Results({
@Result(property = "roleIds", column = "id",many = @Many(select = "com.hungraim.ism.system.dao.SystemRoleResourceMapper.listRoleIds")) @Result(property = "roleIds", column = "id",many = @Many(select = "com.hungraim.ism.system.dao.SystemRoleResourceMapper.listRoleIds"))
}) })
......
...@@ -20,6 +20,6 @@ public interface SystemRoleResourceMapper extends BaseMapper<SystemRoleResource> ...@@ -20,6 +20,6 @@ public interface SystemRoleResourceMapper extends BaseMapper<SystemRoleResource>
* @param resourceId 资源id * @param resourceId 资源id
* @return 角色id * @return 角色id
*/ */
@Select("SELECT ROLE_ID FROM ISM_ROLE_RESOURCE WHERE RESOURCE_ID = #{resourceId} ") @Select("SELECT ROLE_ID FROM LTC_ROLE_RESOURCE WHERE RESOURCE_ID = #{resourceId} ")
List<Long> listRoleIds(long resourceId); List<Long> listRoleIds(long resourceId);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment