修改企业端单点登录

wushunjie
吴顺杰 11 months ago
parent cf31a4415e
commit b191d6140b

@ -21,7 +21,7 @@ public interface BmsEnterpriseBasicInfoMapper extends BaseMapper<BmsEnterpriseBa
* @param bmsEnterpriseBasicInfo * @param bmsEnterpriseBasicInfo
* @return * @return
*/ */
public Page<BmsEnterpriseBasicInfo> page(Page<BmsEnterpriseBasicInfo> page,@Param("req") BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo); public Page<BmsEnterpriseBasicInfo> page(Page<BmsEnterpriseBasicInfo> page, @Param("req") BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo);
/** /**
@ -30,14 +30,23 @@ public interface BmsEnterpriseBasicInfoMapper extends BaseMapper<BmsEnterpriseBa
* @param bmsEnterpriseBasicInfo * @param bmsEnterpriseBasicInfo
* @return * @return
*/ */
List<BmsEnterpriseBasicInfo> page(@Param("req") BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo); List<BmsEnterpriseBasicInfo> page(@Param("req") BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo);
/** /**
* *
*/ */
List<BmsEnterpriseBasicInfo> workSearch(@Param("req") EnterpriseInfoWorkRequest enterpriseInfoWorkRequest); List<BmsEnterpriseBasicInfo> workSearch(@Param("req") EnterpriseInfoWorkRequest enterpriseInfoWorkRequest);
/** /**
* id * id
*/ */
BmsEnterpriseBasicInfo selectGetCreditCode(String getCreditCode); BmsEnterpriseBasicInfo selectGetCreditCode(String getCreditCode);
/**
*
*
* @param uscc
* @return
*/
BmsEnterpriseBasicInfo findByQytyxydm(@Param("uscc") String uscc);
} }

@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -35,7 +34,7 @@ public class SmsEnterChange {
@Value("${isTiming}") @Value("${isTiming}")
private Boolean isTiming; private Boolean isTiming;
// 每三小时执行一次 // 每三小时执行一次
@Scheduled(cron = "0 0 */3 * * *") @Scheduled(cron = "0 0 */12 * * *")
private void runTask() { private void runTask() {
if(isTiming){ if(isTiming){
//查询初审的所有用户 //查询初审的所有用户

@ -5,11 +5,11 @@ package com.ruoyi.jjh.declaration.single.controller;
* @since 2024/5/22 15:50 * @since 2024/5/22 15:50
*/ */
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
@ -32,7 +32,10 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Base64; import java.util.Base64;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -44,14 +47,13 @@ import java.util.concurrent.TimeUnit;
@RequestMapping("/system/singlelogin") @RequestMapping("/system/singlelogin")
public class SingleLoginController { public class SingleLoginController {
private static final Logger log = LoggerFactory.getLogger(SingleLoginController.class); private static final Logger log = LoggerFactory.getLogger(SingleLoginController.class);
@Value("${url}") @Value("${url}")
private String url; private String url;
@Value("${infoUrl}") @Value("${infoUrl}")
private String infoUrl; private String infoUrl;
@Value("${logoutUrl}") @Value("${logoutUrl}")
private String logoutUrl; private String logoutUrl;
@ -69,16 +71,17 @@ public class SingleLoginController {
@Value("${enterpriseAppId}") @Value("${enterpriseAppId}")
private String enterpriseAppId; private String enterpriseAppId;
@Value("${enterpriseAppsecret}")
private String enterpriseAppsecret;
/** /**
* *
*
* @return
*/ */
@ApiOperation("统一登陆") @ApiOperation("统一登陆")
@GetMapping("/login") @GetMapping("/login")
public void login(HttpServletResponse response) throws IOException { public void login(HttpServletResponse response) throws IOException {
//变成参数模式,appid 用于校验提交的来源地址,生产环境会校验,试用环境暂不校验 //变成参数模式,appid 用于校验提交的来源地址,生产环境会校验,试用环境暂不校验
String scUrl = "clientUrl=" + URLEncoder.encode(returnUrl, "UTF-8") + "?appid="+enterpriseAppId; String scUrl = "clientUrl=" + URLEncoder.encode(returnUrl, "UTF-8") + "?appid=" + enterpriseAppId;
//加密后的客户端地址 //加密后的客户端地址
scUrl = Base64.getEncoder().encodeToString(scUrl.getBytes()); scUrl = Base64.getEncoder().encodeToString(scUrl.getBytes());
//最终跳转地址 //最终跳转地址
@ -86,10 +89,6 @@ public class SingleLoginController {
// 添加请求头 // 添加请求头
response.setHeader("Content-Type", "application/json"); response.setHeader("Content-Type", "application/json");
response.setHeader("X-Requested-With", "XMLHttpRequest"); response.setHeader("X-Requested-With", "XMLHttpRequest");
// Map<String, String> stringStringMap = singleLoginService.generationHeader();
// response.setHeader("time",stringStringMap.get("time"));
// response.setHeader("appid",stringStringMap.get("appid"));
// response.setHeader("sign",stringStringMap.get("sign"));
response.sendRedirect(jumpurl); response.sendRedirect(jumpurl);
} }
@ -97,16 +96,16 @@ public class SingleLoginController {
/** /**
* *
* *
* @return * @return
*/ */
@ApiOperation(value = "获取用户信息",response = UserResponse.class) @ApiOperation(value = "获取用户信息", response = UserResponse.class)
@GetMapping("/getInfo") @GetMapping("/getInfo")
public AjaxResult getInfo(@RequestParam("clientToken") String clientToken) throws Exception { public AjaxResult getInfo(String clientToken) throws Exception {
String url = infoUrl + "?clienttoken=" + clientToken; HttpResponse response = HttpUtil.createGet(infoUrl)
HttpResponse response = HttpUtil.createGet(url) .form("clienttoken", clientToken)
// .addHeaders(singleLoginService.generationHeader()) // .addHeaders(generationHeader())
.execute(); .execute();
String responseBody = null; String responseBody;
// 获取响应状态码 // 获取响应状态码
int statusCode = response.getStatus(); int statusCode = response.getStatus();
if (statusCode == 200) { if (statusCode == 200) {
@ -119,30 +118,28 @@ public class SingleLoginController {
// 将用户信息存储到Redis中 // 将用户信息存储到Redis中
String key = "user:" + clientToken; String key = "user:" + clientToken;
//判断是法人用户 //判断是法人用户
if("ep".equals(dataObj.get("usertype"))){ if ("ep".equals(dataObj.get("usertype"))) {
JSONObject mainobj = dataObj.getJSONObject("mainbody"); JSONObject mainobj = dataObj.getJSONObject("mainbody");
UserResponse res = JSONUtil.toBean(dataObj, UserResponse.class); UserResponse res = JSONUtil.toBean(dataObj, UserResponse.class);
UserMainResponse req = JSONUtil.toBean(mainobj, UserMainResponse.class); UserMainResponse req = JSONUtil.toBean(mainobj, UserMainResponse.class);
//如果在企业库里面找不到该企业就返回错误 //如果在企业库里面找不到该企业就返回错误
QueryWrapper<BmsEnterpriseBasicInfo> queryWrapper = new QueryWrapper<>(); BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo = bmsEnterpriseBasicInfoMapper.findByQytyxydm(req.getUscc());
queryWrapper.eq("tyshxydm", req.getUscc());
BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo = bmsEnterpriseBasicInfoMapper.selectOne(queryWrapper);
Long id; Long id;
if (bmsEnterpriseBasicInfo == null) { if (bmsEnterpriseBasicInfo == null) {
throw new ServiceException("该企业不在库!请稍后再试!"); throw new ServiceException("该企业不在库!请稍后再试!");
}else { } else {
id = bmsEnterpriseBasicInfo.getId(); id = bmsEnterpriseBasicInfo.getId();
} }
// 设置过期时间为8小时 // 设置过期时间为8小时
String token = singleLoginService.singleLogin(req.getUscc(),req.getEpname(),id,"01",null); String token = singleLoginService.singleLogin(req.getUscc(), req.getEpname(), id, "01", null);
res.setToken(token); res.setToken(token);
res.setMain(req); res.setMain(req);
redisCache.setCacheObject(key, res, expirationSeconds, TimeUnit.MINUTES); redisCache.setCacheObject(key, res, expirationSeconds, TimeUnit.MINUTES);
return AjaxResult.success(res); return AjaxResult.success(res);
}else { } else {
log.error(response.body()); log.error(response.body());
throw new ServiceException("未知异常请联系管理员"); throw new ServiceException("该用户不是企业法人");
} }
} else { } else {
log.error(response.body()); log.error(response.body());
@ -150,24 +147,44 @@ public class SingleLoginController {
} }
} }
/**
* 退
*
* @param clienttoken clienttoken
* @return
*/
@ApiOperation(value = "退出登录") @ApiOperation(value = "退出登录")
@GetMapping("/enterpriseLogout") @GetMapping("/enterpriseLogout")
public AjaxResult enterpriseLogout(@RequestParam("clienttoken") String clienttoken) { public AjaxResult enterpriseLogout(@RequestParam("clienttoken") String clienttoken) {
String url = logoutUrl + "?clienttoken=" + clienttoken; String url = logoutUrl + "?clienttoken=" + clienttoken;
HttpResponse execute = HttpUtil.createGet(url) HttpResponse execute = HttpUtil.createGet(url)
// .addHeaders(singleLoginService.generationHeader()) // .addHeaders(generationHeader())
.execute(); .execute();
String str; String str;
// 获取响应状态码 // 获取响应状态码
int statusCode = execute.getStatus(); int statusCode = execute.getStatus();
if(statusCode==200){ if (statusCode == 200) {
str = "退出成功"; str = "退出成功";
}else { } else {
str = "退出失败"; str = "退出失败";
} }
return AjaxResult.success(str); return AjaxResult.success(str);
} }
/**
*
*
* @return
*/
private Map<String, String> generationHeader() {
// 定义时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String format = LocalDateTime.now().format(formatter);
//正式端需要请求头
HashMap<String, String> headers = new HashMap<>();//存放请求头,可以存放多个请求头
headers.put("appid", enterpriseAppId);
headers.put("time", format);
headers.put("sign", DigestUtil.md5Hex(enterpriseAppId + enterpriseAppsecret + format));
return headers;
}
} }

@ -1,22 +1,16 @@
package com.ruoyi.jjh.declaration.single.service; package com.ruoyi.jjh.declaration.single.service;
import java.util.Map;
/** /**
* *
*
* @author du * @author du
* @since 2024/6/4 15:16 * @since 2024/6/4 15:16
*/ */
public interface SingleLoginService { public interface SingleLoginService {
/** /**
* token * token
*/ */
String singleLogin(String userName,String nickName,Long id,String userType,String phone); String singleLogin(String userName, String nickName, Long id, String userType, String phone);
/**
*
* @return
*/
Map<String,String> generationHeader();
} }

@ -1,8 +1,5 @@
package com.ruoyi.jjh.declaration.single.service.impl; package com.ruoyi.jjh.declaration.single.service.impl;
import cn.hutool.core.codec.Base64;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
@ -15,7 +12,6 @@ import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.context.AuthenticationContextHolder; import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.framework.web.service.TokenService; import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.jjh.declaration.single.service.SingleLoginService; import com.ruoyi.jjh.declaration.single.service.SingleLoginService;
import com.ruoyi.jjh.declaration.single.util.HMAC256Config;
import com.ruoyi.jjh.ent.service.SmsAlertsService; import com.ruoyi.jjh.ent.service.SmsAlertsService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -26,9 +22,6 @@ import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@ -53,14 +46,11 @@ public class SingleLoginServiceImpl implements SingleLoginService {
@Value("${isTiming}") @Value("${isTiming}")
private Boolean isTiming; private Boolean isTiming;
@Value("${enterpriseAppId}")
private String enterpriseAppId;
/** /**
* token * token
*/ */
@Override @Override
public String singleLogin(String userName, String nickName, Long id, String userType,String phone) { public String singleLogin(String userName, String nickName, Long id, String userType, String phone) {
// 用户验证 // 用户验证
Authentication authentication; Authentication authentication;
try { try {
@ -70,11 +60,11 @@ public class SingleLoginServiceImpl implements SingleLoginService {
user.setPassword("admin123"); user.setPassword("admin123");
user.setPhonenumber(phone); user.setPhonenumber(phone);
Long[] roles = new Long[1]; Long[] roles = new Long[1];
if("01".equals(userType)){ if ("01".equals(userType)) {
roles[0]=101L; roles[0] = 101L;
}else if("02".equals(userType)){ } else if ("02".equals(userType)) {
//在这里可以判断具体要给什么权限 要给dept部门id //在这里可以判断具体要给什么权限 要给dept部门id
roles[0]=102L; roles[0] = 102L;
user.setDeptId(100L); user.setDeptId(100L);
user.setZwuser(userName); user.setZwuser(userName);
} }
@ -83,12 +73,11 @@ public class SingleLoginServiceImpl implements SingleLoginService {
user.setUserType(userType); user.setUserType(userType);
user.setEnterpriseId(id); user.setEnterpriseId(id);
//如果用户名也就是信用代码没有重复的就新增用户 //如果用户名也就是信用代码没有重复的就新增用户
if (userService.checkUserNameUnique(user)) if (userService.checkUserNameUnique(user)) {
{
user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
userService.insertUser(user); userService.insertUser(user);
if("02".equals(userType)&isTiming){ if ("02".equals(userType) & isTiming) {
if(user.getPhonenumber()!=null){ if (user.getPhonenumber() != null) {
smsAlertsService.addSsmPhone(user.getPhonenumber()); smsAlertsService.addSsmPhone(user.getPhonenumber());
} }
} }
@ -116,23 +105,5 @@ public class SingleLoginServiceImpl implements SingleLoginService {
return String.valueOf(token.get("access_token")); return String.valueOf(token.get("access_token"));
} }
/**
*
* @return
*/
@Override
public Map<String, String> generationHeader() {
// 定义时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String format = LocalDateTime.now().format(formatter);
//正式端需要请求头
HashMap<String, String> headers = new HashMap<>();//存放请求头,可以存放多个请求头
headers.put("appid", enterpriseAppId);
headers.put("time", format);
headers.put("sign", DigestUtil.md5Hex(enterpriseAppId+"03f71c58-39e9-11ef-bbd6-fa163e2b2e10"+format));
return headers;
}
} }

@ -1,66 +1,66 @@
# 数据源配置 # 数据源配置
spring: spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
druid: druid:
# 主库数据源 # 主库数据源
master: master:
# url: jdbc:mysql://localhost:3306/jingji_hu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://localhost:3306/jingji_hu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://39.101.188.84:3307/jingji_hu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://39.101.188.84:3307/jingji_hu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
# password: root # password: root
password: Admin123@ password: Admin123@
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: false
url: url:
username: username:
password: password:
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
minIdle: 10 minIdle: 10
# 最大连接池数量 # 最大连接池数量
maxActive: 20 maxActive: 20
# 配置获取连接等待超时的时间 # 配置获取连接等待超时的时间
maxWait: 60000 maxWait: 60000
# 配置连接超时时间 # 配置连接超时时间
connectTimeout: 30000 connectTimeout: 30000
# 配置网络超时时间 # 配置网络超时时间
socketTimeout: 60000 socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒 # 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒 # 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000 maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效 # 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter: webStatFilter:
enabled: true enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
# 设置白名单,不填则允许所有访问 # 设置白名单,不填则允许所有访问
allow: allow:
url-pattern: /druid/* url-pattern: /druid/*
# 控制台管理用户名和密码 # 控制台管理用户名和密码
login-username: ruoyi login-username: ruoyi
login-password: 123456 login-password: 123456
filter: filter:
stat: stat:
enabled: true enabled: true
# 慢SQL记录 # 慢SQL记录
log-slow-sql: true log-slow-sql: true
slow-sql-millis: 1000 slow-sql-millis: 1000
merge-sql: true merge-sql: true
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
#自己客户端地址 #自己客户端地址
returnUrl: http://39.101.188.84:9999/demo/JinJiHu returnUrl: http://39.101.188.84:9999/demo/JinJiHu
#returnUrl: http://192.168.0.111:80 #returnUrl: http://192.168.0.111:80
@ -69,24 +69,26 @@ isTiming: false
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 9040 port: 9040
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
tomcat: tomcat:
# tomcat的URI编码 # tomcat的URI编码
uri-encoding: UTF-8 uri-encoding: UTF-8
# 连接数满后的排队数默认为100 # 连接数满后的排队数默认为100
accept-count: 1000 accept-count: 1000
threads: threads:
# tomcat最大线程数默认为200 # tomcat最大线程数默认为200
max: 800 max: 800
# Tomcat启动初始化的线程数默认值10 # Tomcat启动初始化的线程数默认值10
min-spare: 100 min-spare: 100
#企业端测试环境应用系统编号 #企业端测试环境应用系统编号
enterpriseAppId: BwAWS8uh enterpriseAppId: BwAWS8uh
# 应用私钥
enterpriseAppsecret: 03f70874-39e9-11ef-bbd6-fa163e2b2e10
#企业端单点登陆url #企业端单点登陆url
url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin
#企业端用户信息url #企业端用户信息url
@ -102,7 +104,7 @@ paramType: cs
smsV: oVFPU1y1wYJIatvqrGoTAE5ycguUyjaY smsV: oVFPU1y1wYJIatvqrGoTAE5ycguUyjaY
#工单编号 #工单编号
code: SC24071600001 code: SC24071600001
#PaaSID #短信PaaSID
paaSID: xdfwy paaSID: xdfwy
#短信token #短信token
smsToken: iM89cd4b0cGNVYAqKu7jl7EONyHgTa0N smsToken: iM89cd4b0cGNVYAqKu7jl7EONyHgTa0N

@ -1,114 +1,114 @@
# 项目相关配置 # 项目相关配置
ruoyi: ruoyi:
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath # 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: /home/ruoyi/uploadPath profile: /home/ruoyi/uploadPath
# 正式环境配置 # 正式环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8910 port: 8910
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: /api context-path: /api
tomcat: tomcat:
# tomcat的URI编码 # tomcat的URI编码
uri-encoding: UTF-8 uri-encoding: UTF-8
# 连接数满后的排队数默认为100 # 连接数满后的排队数默认为100
accept-count: 1000 accept-count: 1000
threads: threads:
# tomcat最大线程数默认为200 # tomcat最大线程数默认为200
max: 800 max: 800
# Tomcat启动初始化的线程数默认值10 # Tomcat启动初始化的线程数默认值10
min-spare: 100 min-spare: 100
# 日志配置 # 日志配置
logging: logging:
level: level:
com.ruoyi: error com.ruoyi: error
org.springframework: error org.springframework: error
# 数据源配置 # 数据源配置
spring: spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.114.0.247:3306/jinji_hu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.114.0.247:3306/jinji_hu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: Cloud@1234
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 192.114.0.247
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: Cloud@1234 password: Cloud@1234
# 连接超时时间 # 从库数据源
timeout: 10s slave:
lettuce: # 从数据源开关/默认关闭
pool: enabled: false
# 连接池中的最小空闲连接 url:
min-idle: 0 username:
# 连接池中的最大空闲连接 password:
max-idle: 8 # 初始连接数
# 连接池的最大数据库连接数 initialSize: 5
max-active: 8 # 最小连接池数量
# #连接池最大阻塞等待时间(使用负值表示没有限制) minIdle: 10
max-wait: -1ms # 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 192.114.0.247
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: Cloud@1234
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
#自己客户端地址 #自己客户端地址
returnUrl: https://idp.sipac.gov.cn/bms returnUrl: https://idp.sipac.gov.cn/bms
#定时任务更新企业信息和联系人的开启 #定时任务更新企业信息和联系人的开启
@ -116,10 +116,14 @@ isTiming: true
#企业端正式环境应用系统编号 #企业端正式环境应用系统编号
enterpriseAppId: 03f70874-39e9-11ef-bbd6-fa163e2b2e10 enterpriseAppId: 03f70874-39e9-11ef-bbd6-fa163e2b2e10
# 应用私钥
enterpriseAppsecret: 03f70874-39e9-11ef-bbd6-fa163e2b2e10
#企业端单点登陆url #企业端单点登陆url
url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin
#url: http://114.216.202.175:8008/api/usercenter/User/ssoLogin
#企业端用户信息url #企业端用户信息url
infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo
#infoUrl: http://114.216.202.175:8008/api/usercenter/User/getInfo
#短信发送接口 #短信发送接口
smsSend: http://zwyyone.sipac.gov.cn/ebus/szyqznzs/dx smsSend: http://zwyyone.sipac.gov.cn/ebus/szyqznzs/dx
@ -131,7 +135,7 @@ paramType: zs
smsV: 3b3jaDmYcf87Mk7NqEmzis=3AaaFeYmV4DIf smsV: 3b3jaDmYcf87Mk7NqEmzis=3AaaFeYmV4DIf
#工单编号 #工单编号
code: SC24071600001 code: SC24071600001
#PaaSID #短信PaaSID
paaSID: xdfwy paaSID: xdfwy
#短信token #短信token
smsToken: iM89cd4b0cGNVYAqKu7jl7EONyHgTa0N smsToken: iM89cd4b0cGNVYAqKu7jl7EONyHgTa0N

@ -34,7 +34,7 @@ spring:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: internet
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:

@ -31,4 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="findByQytyxydm" resultType="com.ruoyi.jjh.declaration.entity.BmsEnterpriseBasicInfo">
select *
from bms_enterprise_basic_info
where tyshxydm = #{uscc}
</select>
</mapper> </mapper>
Loading…
Cancel
Save