5 Commits

13 changed files with 68 additions and 30 deletions

View File

@@ -9,43 +9,33 @@ spring:
datasource:
master:
# MYSQL数据库 主库,业务库
# url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://192.168.126.128:33306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root
password: root
lideeyunji: # 从库,框架库
# url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://192.168.126.128:33306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: root
slave: # 日志库单独
lazy: true # 开启懒加载,保证启动速度
# url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://192.168.126.128:33306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: root
oracle_gryybi: # 报表平台 oracle
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@//192.168.1.247:1521/gryy?oracle.jdbc.defaultNChar=true&oracle.jdbc.convertNcharLiterals=true
username: GRYYBI
password: xxb147258367
# driver-class-name: oracle.jdbc.OracleDriver
driver-class-name: oracle.jdbc.driver.OracleDriver
erp_bi_data: # 报表平台 mysql
# url: jdbc:mysql://127.0.0.1:3306/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://192.168.126.128:33306/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: root
# redis:
# host: 127.0.0.1 # 地址
# port: 6379 # 端口
# database: 2 # 数据库索引
# password: lidee@123 # 密码,建议生产环境开启
redis:
host: 192.168.126.128 # 地址
host: 127.0.0.1 # 地址
port: 6379 # 端口
database: 2 # 数据库索引
password: 123456 # 密码,建议生产环境开启
password: lidee@123 # 密码,建议生产环境开启
--- #################### 地代码平台相关配置 ####################

View File

@@ -9,18 +9,28 @@ spring:
datasource:
master:
# MYSQL数据库 主库,业务库
url: jdbc:mysql://127.0.0.1:3306/gr_repoort?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root
password: gryy@8888
lideeyunji: # 从库,框架库
url: jdbc:mysql://127.0.0.1:3306/gr_repoort?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: gryy@8888
slave: # 日志库单独
lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/gr_repoort?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://127.0.0.1:3306/gr_report?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: gryy@8888
oracle_gryybi: # 报表平台 oracle
url: jdbc:oracle:thin:@//192.168.1.247:1521/gryy?oracle.jdbc.defaultNChar=true&oracle.jdbc.convertNcharLiterals=true
username: GRYYBI
password: xxb147258367
# driver-class-name: oracle.jdbc.OracleDriver
driver-class-name: oracle.jdbc.driver.OracleDriver
erp_bi_data: # 报表平台 mysql
url: jdbc:mysql://127.0.0.1:3306/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: root
redis:
host: 127.0.0.1 # 地址
port: 6379 # 端口

View File

@@ -78,5 +78,10 @@
<artifactId>lidee-service-infra-api</artifactId>
<version>${lidee.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<version>21.1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@@ -13,8 +13,8 @@ import org.springframework.stereotype.Component;
* 同步销售明细表
* oracle gryybi GR_BI_SA_SETDTL --> mysql erp_bi_data GR_BI_SA_SETDTL
*/
@Component
@Slf4j
@Component("SaSetdtlSyncJob")
public class SaSetdtlSyncJob implements JobHandler {
@Autowired

View File

@@ -60,9 +60,6 @@ public class anyToGrBiSasetdtl implements JobHandler {
while (rs.next()) {
//写入到数据中台表
System.out.println(rs.getString("SASETTLEDTLID"));
}

View File

@@ -97,6 +97,11 @@
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java-sms</artifactId>
</dependency>
<dependency>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-boot-starter</artifactId>
<version>1.4.11</version>
</dependency>
<dependency>
<groupId>com.lideeyunji</groupId>
<artifactId>lidee-module-api</artifactId>

View File

@@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
import com.lideeyunji.service.system.config.convert.auth.AuthConvert;
import com.lideeyunji.service.system.constant.ErrorCodeConstants;
import com.lideeyunji.service.system.controller.vo.auth.*;
import com.lideeyunji.service.system.controller.vo.auth.*;
import com.lideeyunji.service.system.controller.vo.user.user.UserRespVO;
import com.lideeyunji.service.system.entity.AdminUserDO;
import com.lideeyunji.service.system.entity.MenuDO;
@@ -23,7 +22,6 @@ import com.lideeyunji.tool.framework.operatelog.core.annotations.OperateLog;
import com.lideeyunji.tool.framework.security.config.SecurityProperties;
import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils;
import com.lideeyunji.tool.framework.tenant.core.context.TenantContextHolder;
import com.lideeyunji.service.system.service.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
@@ -165,8 +163,8 @@ public class AuthController {
@Operation(tags = "根据token获取用户信息",summary = "根据token获取用户信息")
@Parameter(name = "refreshToken", description = "根据token获取用户信息", required = true)
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
public CommonResult<AuthLoginRespVO> getUerInfo(@RequestParam("refreshToken") String refreshToken) {
return success(authService.refreshToken(refreshToken));
public CommonResult<AdminUserDO> getUerInfo(@RequestParam("refreshToken") String refreshToken) {
return success(authService.getTokenTouserInfo(refreshToken));
}
@GetMapping("/get-permission-info")

View File

@@ -73,7 +73,7 @@ public class OAuth2ClientController {
@GetMapping("/myPage")
@Operation(tags = "OAuth2.0管理",summary = "获得用户角色下 OAuth2 客户端分页")
@PreAuthorize("@ss.hasPermission('system:oauth2-client:query')")
// @PreAuthorize("@ss.hasPermission('system:oauth2-client:query')")
public CommonResult<PageResult<OAuth2ClientRespVO>> getMyPage(@Valid OAuth2ClientPageReqVO pageVO) {
PageResult<OAuth2ClientDO> pageResult = oAuth2ClientService.getMyPage(pageVO);
return success(BeanUtils.toBean(pageResult, OAuth2ClientRespVO.class));

View File

@@ -78,4 +78,6 @@ public interface IAdminAuthService {
*/
AuthLoginRespVO refreshToken(String refreshToken);
AdminUserDO getTokenTouserInfo(String refreshToken);
}

View File

@@ -1,5 +1,6 @@
package com.lideeyunji.service.system.service;
import com.lideeyunji.service.system.entity.AdminUserDO;
import com.lideeyunji.tool.framework.common.pojo.PageResult;
import com.lideeyunji.service.system.controller.vo.oauth2.token.OAuth2AccessTokenPageReqVO;
import com.lideeyunji.service.system.entity.OAuth2AccessTokenDO;
@@ -41,6 +42,10 @@ public interface IOAuth2TokenService {
*/
OAuth2AccessTokenDO refreshAccessToken(String refreshToken, String clientId);
AdminUserDO getTokenTouserInfo(String refreshToken);
/**
* 获得访问令牌
*

View File

@@ -362,6 +362,15 @@ public class AdminAuthServiceImpl implements IAdminAuthService {
return AuthConvert.INSTANCE.convert(accessTokenDO);
}
@Override
public AdminUserDO getTokenTouserInfo(String refreshToken) {
AdminUserDO user= oauth2TokenService.getTokenTouserInfo(refreshToken);
return user;
}
@Override
public void logout(String token, Integer logType) {
// 删除访问令牌

View File

@@ -61,6 +61,7 @@ public class OAuth2TokenServiceImpl implements IOAuth2TokenService {
@Lazy // 懒加载,避免循环依赖
private IAdminUserService adminUserService;
@Override
public OAuth2AccessTokenDO createAccessToken(Long userId, Long lastLoginDeptId, Long lastLoginRoleId, Integer userType, String clientId, List<String> scopes) {
return createAccessToken(userId, lastLoginDeptId, lastLoginRoleId, userType, clientId, scopes,false);
@@ -77,6 +78,16 @@ public class OAuth2TokenServiceImpl implements IOAuth2TokenService {
}
@Override
public AdminUserDO getTokenTouserInfo(String refreshToken ) {
// 获得用户基本信息
OAuth2AccessTokenDO accessTokenDO= oauth2AccessTokenMapper.selectByAccessToken(refreshToken);
AdminUserDO user = adminUserService.getUser(accessTokenDO.getUserId());
return user;
}
@Override
public OAuth2AccessTokenDO refreshAccessToken(String refreshToken, String clientId) {
boolean supAdmin = SecurityFrameworkUtils.isSupAdmin();
@@ -110,6 +121,12 @@ public class OAuth2TokenServiceImpl implements IOAuth2TokenService {
return createOAuth2AccessToken(refreshTokenDO, clientDO, supAdmin);
}
@Override
public OAuth2AccessTokenDO getAccessToken(String accessToken) {
// 优先从 Redis 中获取