Commit e990e23c by 张富康

全局异常抛出

1 parent 846a6215
...@@ -330,11 +330,6 @@ ...@@ -330,11 +330,6 @@
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.14.1</version> <version>2.14.1</version>
</dependency> </dependency>
<dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>5.2.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -6,6 +6,8 @@ import com.glsk.util.MysqlUtils; ...@@ -6,6 +6,8 @@ import com.glsk.util.MysqlUtils;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.stream.Collectors;
/** /**
* @author fangfang * @author fangfang
...@@ -23,20 +25,20 @@ public class QuerySql { ...@@ -23,20 +25,20 @@ public class QuerySql {
Connection connQuery = MysqlUtils.getConnection("dj_smartcarlife"); Connection connQuery = MysqlUtils.getConnection("dj_smartcarlife");
// String queryUpdateOrderDate = QuerySql.getqueryUpdateDate(DateUtils.getDay(1), DateUtils.getDay(-1),connInsert); String queryUpdateOrderDate = QuerySql.getqueryUpdateDate(DateUtils.getDay(1), DateUtils.getDay(-1),connInsert);
// ResultSet queryUpdateOrderDateRS = connQuery.prepareStatement(queryUpdateOrderDate).executeQuery(queryUpdateOrderDate); ResultSet queryUpdateOrderDateRS = connQuery.prepareStatement(queryUpdateOrderDate).executeQuery(queryUpdateOrderDate);
//
// ArrayList<String> OrderDateList =new ArrayList<>(); ArrayList<String> OrderDateList =new ArrayList<>();
// while (queryUpdateOrderDateRS.next()){ while (queryUpdateOrderDateRS.next()){
// OrderDateList.add(queryUpdateOrderDateRS.getString("order_time")); OrderDateList.add(queryUpdateOrderDateRS.getString("order_time"));
// } }
// String OrderDateStr = OrderDateList.stream().map(String::valueOf).collect(Collectors.joining("','", "('", "')")); String OrderDateStr = OrderDateList.stream().map(String::valueOf).collect(Collectors.joining("','", "('", "')"));
//
//
// String sql01 = getquerySaleManRanking(DateUtils.getDay(1), DateUtils.getDay(-1),OrderDateStr,connInsert); String sql01 = getquerySaleManRanking(DateUtils.getDay(1), DateUtils.getDay(-1),OrderDateStr, connInsert ,null);
// String sql01 = getqueryMerchantDatasql04("('44210895','44210894')",connInsert); // String sql01 = getqueryMerchantDatasql04("('44210895','44210894')",connInsert);
// System.out.println(sql01); System.out.println(sql01);
} }
......
...@@ -8,10 +8,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -8,10 +8,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author Jinglf * @author Jinglf
...@@ -32,14 +29,8 @@ public class TalentAnalysisController { ...@@ -32,14 +29,8 @@ public class TalentAnalysisController {
@GetMapping("/getBasicData") @GetMapping("/getBasicData")
@ApiOperation("获取基础数据") @ApiOperation("获取基础数据")
public RopResponse<ReqRet.TalentAnalysisBasicDataRet> getBasicData(ReqRet.TalentAnalysisBasicDataReq req) throws Exception { public RopResponse<ReqRet.TalentAnalysisBasicDataRet> getBasicData(@RequestBody ReqRet.TalentAnalysisBasicDataReq req) throws Exception {
logger.info("getBasicData:req={}", req.toString()); logger.info("getBasicData:req={}", req.toString());
System.out.println(req.getStaffId() + ">>>>>>>>>>>>>>");
System.out.println(req.getStaffName() + ">>>>>>>>>>>>>>");
System.out.println(req.getStaffPhone() + ">>>>>>>>>>>>>>");
// 进入时间 --埋点
// 登录页面类型 BusinessType --埋点
// 查询时段 QueryType --埋点
ReqRet.TalentAnalysisBasicDataRet ret = talentAnalysisService.getBasicData(req); ReqRet.TalentAnalysisBasicDataRet ret = talentAnalysisService.getBasicData(req);
return RopResponse.success(ret); return RopResponse.success(ret);
...@@ -48,7 +39,7 @@ public class TalentAnalysisController { ...@@ -48,7 +39,7 @@ public class TalentAnalysisController {
@GetMapping("/getSummaryRetentionAnalysis") @GetMapping("/getSummaryRetentionAnalysis")
@ApiOperation("汇总留存分析") @ApiOperation("汇总留存分析")
public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getSummaryRetentionAnalysis(ReqRet.SummaryRetentionAnalysisReq req) throws Exception { public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getSummaryRetentionAnalysis(@RequestBody ReqRet.SummaryRetentionAnalysisReq req) throws Exception {
logger.info("getSummaryRetentionAnalysis:req={}", req.toString()); logger.info("getSummaryRetentionAnalysis:req={}", req.toString());
ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getSummaryRetentionAnalysis(req); ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getSummaryRetentionAnalysis(req);
return RopResponse.success(ret); return RopResponse.success(ret);
...@@ -58,7 +49,7 @@ public class TalentAnalysisController { ...@@ -58,7 +49,7 @@ public class TalentAnalysisController {
@GetMapping("/getSummaryRetentionAnalysisDetail") @GetMapping("/getSummaryRetentionAnalysisDetail")
@ApiOperation("汇总留存分析详细分析") @ApiOperation("汇总留存分析详细分析")
public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getSummaryRetentionAnalysisDetail(ReqRet.SummaryRetentionAnalysisDetailReq req) throws Exception { public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getSummaryRetentionAnalysisDetail(@RequestBody ReqRet.SummaryRetentionAnalysisDetailReq req) throws Exception {
logger.info("getSummaryRetentionAnalysisDetail:req={}", req.toString()); logger.info("getSummaryRetentionAnalysisDetail:req={}", req.toString());
ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getSummaryRetentionAnalysisDetail(req); ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getSummaryRetentionAnalysisDetail(req);
return RopResponse.success(ret); return RopResponse.success(ret);
...@@ -68,7 +59,7 @@ public class TalentAnalysisController { ...@@ -68,7 +59,7 @@ public class TalentAnalysisController {
@GetMapping("/getCurrentActivePersonnelAnalysis") @GetMapping("/getCurrentActivePersonnelAnalysis")
@ApiOperation("当前在职人数分析") @ApiOperation("当前在职人数分析")
public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getCurrentActivePersonnelAnalysis(ReqRet.SummaryRetentionAnalysisReq req) throws Exception { public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getCurrentActivePersonnelAnalysis(@RequestBody ReqRet.SummaryRetentionAnalysisReq req) throws Exception {
logger.info("getCurrentActivePersonnelAnalysis:req={}", req.toString()); logger.info("getCurrentActivePersonnelAnalysis:req={}", req.toString());
ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getCurrentActivePersonnelAnalysis(req); ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getCurrentActivePersonnelAnalysis(req);
return RopResponse.success(ret); return RopResponse.success(ret);
...@@ -78,7 +69,7 @@ public class TalentAnalysisController { ...@@ -78,7 +69,7 @@ public class TalentAnalysisController {
@GetMapping("/getCurrentActivePersonnelAnalysisDetail") @GetMapping("/getCurrentActivePersonnelAnalysisDetail")
@ApiOperation("当前在职人数分析详细分析") @ApiOperation("当前在职人数分析详细分析")
public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getCurrentActivePersonnelAnalysisDetail(ReqRet.SummaryRetentionAnalysisDetailReq req) throws Exception { public RopResponse<ReqRet.SummaryRetentionAnalysisRet> getCurrentActivePersonnelAnalysisDetail(@RequestBody ReqRet.SummaryRetentionAnalysisDetailReq req) throws Exception {
logger.info("getCurrentActivePersonnelAnalysisDetail:req={}", req.toString()); logger.info("getCurrentActivePersonnelAnalysisDetail:req={}", req.toString());
ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getCurrentActivePersonnelAnalysisDetail(req); ReqRet.SummaryRetentionAnalysisRet ret = talentAnalysisService.getCurrentActivePersonnelAnalysisDetail(req);
return RopResponse.success(ret); return RopResponse.success(ret);
...@@ -88,7 +79,7 @@ public class TalentAnalysisController { ...@@ -88,7 +79,7 @@ public class TalentAnalysisController {
@GetMapping("/getResignEmployeelAnalysis") @GetMapping("/getResignEmployeelAnalysis")
@ApiOperation("离职人数分析") @ApiOperation("离职人数分析")
public RopResponse<ReqRet.ResignEmployeelAnalysisRet> getResignEmployeelAnalysis(ReqRet.SummaryRetentionAnalysisReq req) throws Exception { public RopResponse<ReqRet.ResignEmployeelAnalysisRet> getResignEmployeelAnalysis(@RequestBody ReqRet.SummaryRetentionAnalysisReq req) throws Exception {
logger.info("getResignEmployeelAnalysis:req={}", req.toString()); logger.info("getResignEmployeelAnalysis:req={}", req.toString());
ReqRet.ResignEmployeelAnalysisRet ret = talentAnalysisService.getResignEmployeelAnalysis(req); ReqRet.ResignEmployeelAnalysisRet ret = talentAnalysisService.getResignEmployeelAnalysis(req);
return RopResponse.success(ret); return RopResponse.success(ret);
...@@ -97,7 +88,7 @@ public class TalentAnalysisController { ...@@ -97,7 +88,7 @@ public class TalentAnalysisController {
@GetMapping("/getResignEmployeelAnalysisDetail") @GetMapping("/getResignEmployeelAnalysisDetail")
@ApiOperation("离职人数分析详细分析") @ApiOperation("离职人数分析详细分析")
public RopResponse<ReqRet.ResignEmployeelAnalysisRet> getResignEmployeelAnalysisDetail(ReqRet.SummaryRetentionAnalysisDetailReq req) throws Exception { public RopResponse<ReqRet.ResignEmployeelAnalysisRet> getResignEmployeelAnalysisDetail(@RequestBody ReqRet.SummaryRetentionAnalysisDetailReq req) throws Exception {
logger.info("getResignEmployeelAnalysisDetail:req={}", req.toString()); logger.info("getResignEmployeelAnalysisDetail:req={}", req.toString());
ReqRet.ResignEmployeelAnalysisRet ret = talentAnalysisService.getResignEmployeelAnalysisDetail(req); ReqRet.ResignEmployeelAnalysisRet ret = talentAnalysisService.getResignEmployeelAnalysisDetail(req);
return RopResponse.success(ret); return RopResponse.success(ret);
......
package com.glsk.exception;
/**
* @Description 业务异常处理
* @Author yelq
* @Date 2025/9/19-21:21
* @Version 1.0
*/
public class BusinessException extends RuntimeException {
private final Integer code;
public BusinessException(String message) {
super(message);
this.code = ErrorCodeEnum.SYSTEM_ERROR.getCode();
}
public BusinessException(ErrorCodeEnum errorCodeEnum) {
super(errorCodeEnum.getMessage());
this.code = errorCodeEnum.getCode();
}
public BusinessException(Integer code, String message) {
super(message);
this.code = code;
}
public BusinessException(Integer code, String message, Throwable cause) {
super(message, cause);
this.code = code;
}
public Integer getCode() {
return code;
}
}
\ No newline at end of file \ No newline at end of file
package com.glsk.exception;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 业务错误码枚举
*/
@Getter
@AllArgsConstructor
public enum ErrorCodeEnum {
SESSION_INVALID(21, "登录失效,请重新登录"),
SESSION_NOT_EXIST(22, "sessionId不存在"),
// ========== 通用错误 ==========
SYSTEM_ERROR(1000, "系统异常,请稍后重试"),
PARAM_INVALID(1001, "参数校验失败"),
DATABASE_ERROR(1002, "数据库操作失败"),
FEIGN_ERROR(1003, "feign调用失败"),
DATA_NOT_EXIST(1004, "数据不存在");
private final Integer code;
private final String message;
}
\ No newline at end of file \ No newline at end of file
package com.glsk.exception;
import com.glsk.vo.RopResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletRequest;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @Description 本地全局异常处理类(集成TraceId版本)
* @Author yelq
* @Date 2025/9/19-20:47
* @Version 1.0
*/
@Order(9999)
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
public GlobalExceptionHandler() {
}
/**
* 处理业务异常
*/
@ExceptionHandler(BusinessException.class)
public ResponseEntity<RopResponse<?>> handleBusinessException(BusinessException e) {
log.error("业务异常: code={}, message={}", e.getCode(), e.getMessage(), e);
RopResponse<?> restResult = new RopResponse<>();
restResult.setCode(e.getCode().toString());
restResult.setMessage(e.getMessage());
return ResponseEntity
.status(HttpStatus.OK)
.body(restResult);
}
/**
* 参数校验异常统一处理
*/
@ExceptionHandler({MethodArgumentNotValidException.class, BindException.class})
public ResponseEntity<RopResponse<?>> handleValidationException(Exception e) {
BindingResult bindingResult = null;
if (e instanceof MethodArgumentNotValidException) {
bindingResult = ((MethodArgumentNotValidException) e).getBindingResult();
} else if (e instanceof BindException) {
bindingResult = ((BindException) e).getBindingResult();
}
String message = Optional.ofNullable(bindingResult)
.map(result -> result.getAllErrors().stream()
.map(ObjectError::getDefaultMessage)
.collect(Collectors.joining("; ")))
.orElse("参数校验失败");
log.error("参数校验异常: {}", message, e);
RopResponse<?> restResult = new RopResponse<>();
restResult.setMessage(e.getMessage());
return ResponseEntity
.status(HttpStatus.OK)
.body(restResult);
}
/**
* 处理请求方法不支持异常
*/
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public ResponseEntity<RopResponse<?>> handleHttpRequestMethodNotSupportedException(
HttpRequestMethodNotSupportedException e) {
log.error("请求方法不支持: {}", e.getMessage(), e);
RopResponse<?> restResult = new RopResponse<>();
restResult.setCode("405");
restResult.setMessage(e.getMessage());
return ResponseEntity
.status(HttpStatus.METHOD_NOT_ALLOWED)
.body(restResult);
}
/**
* 处理媒体类型不支持异常
*/
@ExceptionHandler(HttpMediaTypeNotSupportedException.class)
public ResponseEntity<RopResponse<?>> handleHttpMediaTypeNotSupportedException(
HttpMediaTypeNotSupportedException e) {
log.error("媒体类型不支持: {}", e.getMessage(), e);
RopResponse<?> restResult = new RopResponse<>();
restResult.setCode("415");
restResult.setMessage(e.getMessage());
return ResponseEntity
.status(HttpStatus.UNSUPPORTED_MEDIA_TYPE)
.body(restResult);
}
/**
* 处理其他所有异常
*/
@ExceptionHandler(Exception.class)
public ResponseEntity<RopResponse<?>> handleException(Exception e, HttpServletRequest request) {
log.error("系统异常: {}", e.getMessage(), e);
RopResponse<?> restResult = new RopResponse<>();
restResult.setCode(ErrorCodeEnum.SYSTEM_ERROR.getCode().toString());
restResult.setMessage(ErrorCodeEnum.SYSTEM_ERROR.getMessage());
return ResponseEntity.status(HttpStatus.OK).body(restResult);
}
}
\ No newline at end of file \ No newline at end of file
package com.glsk.service; package com.glsk.service;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.glsk.compute.fullupdatedata.QuerySql; import com.glsk.compute.fullupdatedata.QuerySql;
import com.glsk.exception.BusinessException;
import com.glsk.util.MysqlUtils; import com.glsk.util.MysqlUtils;
import com.glsk.vo.BusinessType; import com.glsk.vo.BusinessType;
import com.glsk.vo.ReqRet; import com.glsk.vo.ReqRet;
...@@ -109,6 +109,7 @@ public class TalentAnalysisService { ...@@ -109,6 +109,7 @@ public class TalentAnalysisService {
wheremobliePhonexxxxxx = "and mobile_phone in (mobilePhonexxxxxx)"; wheremobliePhonexxxxxx = "and mobile_phone in (mobilePhonexxxxxx)";
wheremobliePhonexxxxxx = wheremobliePhonexxxxxx.replace("mobilePhonexxxxxx", staffPhoneStr); wheremobliePhonexxxxxx = wheremobliePhonexxxxxx.replace("mobilePhonexxxxxx", staffPhoneStr);
} }
log.info("wheremobliePhonexxxxxx = {}", wheremobliePhonexxxxxx);
configSt = connInsert.prepareStatement(configSql); configSt = connInsert.prepareStatement(configSql);
configRs = configSt.executeQuery(); configRs = configSt.executeQuery();
while (configRs.next()) { while (configRs.next()) {
...@@ -1641,7 +1642,7 @@ public class TalentAnalysisService { ...@@ -1641,7 +1642,7 @@ public class TalentAnalysisService {
// map 最后处理成需要查询的员工手机号集合 // map 最后处理成需要查询的员工手机号集合
staffPhoneList = new ArrayList<>(staffMap.values()); staffPhoneList = new ArrayList<>(staffMap.values());
} else { } else {
throw new RpcServiceException("您暂无使用权限,请确认后重新操作。"); throw new BusinessException("您暂无使用权限,请确认后重新操作。");
} }
return staffPhoneList; return staffPhoneList;
} finally { } finally {
......
...@@ -44,23 +44,36 @@ public class MybatisUtil { ...@@ -44,23 +44,36 @@ public class MybatisUtil {
dataSource.setUsername(username); dataSource.setUsername(username);
dataSource.setPassword(password); dataSource.setPassword(password);
// dataSource.setTestOnBorrow(false); // 设置连接池配置以提高稳定性和性能
//
// dataSource.setLogAbandoned(true);//minEvictableldleTimeMillis
//
// dataSource.setRemoveAbandoned(false);
// dataSource.setRemoveAbandonedTimeout(60);
//
// dataSource.setPhyTimeoutMillis(10000);
//
// dataSource.setMinEvictableIdleTimeMillis(10000);
// dataSource.setMaxEvictableIdleTimeMillis(20000);
// dataSource.setTimeBetweenEvictionRunsMillis(5000);
// dataSource.setKeepAliveBetweenTimeMillis(30000);
//
// dataSource.setKeepAlive(true);
dataSource.setInitialSize(3); dataSource.setInitialSize(3);
dataSource.setMinIdle(5);
dataSource.setMaxActive(20);
// 设置连接超时时间
dataSource.setMaxWait(60000);
// 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
dataSource.setTimeBetweenEvictionRunsMillis(60000);
// 配置一个连接在池中最小生存的时间,单位是毫秒
dataSource.setMinEvictableIdleTimeMillis(300000);
// 用来检测连接是否有效的sql
dataSource.setValidationQuery("SELECT 1");
dataSource.setTestWhileIdle(true);
dataSource.setTestOnBorrow(false);
dataSource.setTestOnReturn(false);
// 是否打开PSCache,并且指定每个连接上PSCache的大小
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxPoolPreparedStatementPerConnectionSize(20);
// 配置监控统计拦截的filters
try {
dataSource.setFilters("stat");
} catch (Exception e) {
logger.warning("Failed to set druid filters: " + e.getMessage());
}
SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(dataSource); bean.setDataSource(dataSource);
...@@ -70,9 +83,4 @@ public class MybatisUtil { ...@@ -70,9 +83,4 @@ public class MybatisUtil {
SqlSessionFactory sqlSessionFactory = bean.getObject(); SqlSessionFactory sqlSessionFactory = bean.getObject();
return sqlSessionFactory.openSession(); return sqlSessionFactory.openSession();
} }
} }
\ No newline at end of file \ No newline at end of file
package com.glsk.util; package com.glsk.util;
import lombok.extern.slf4j.Slf4j;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
...@@ -7,13 +9,16 @@ import java.sql.DriverManager; ...@@ -7,13 +9,16 @@ import java.sql.DriverManager;
* @author fangfang * @author fangfang
* @create 2024-04-26 16:13 * @create 2024-04-26 16:13
*/ */
@Slf4j
public class MysqlUtils { public class MysqlUtils {
public static Connection getConnection(String propName) throws Exception { public static Connection getConnection(String propName) throws Exception {
String username = ConfigurationManager.getProperty("spring.datasource." + propName + ".username"); String username = ConfigurationManager.getProperty("spring.datasource." + propName + ".username");
String password = ConfigurationManager.getProperty("spring.datasource." + propName + ".password"); String password = ConfigurationManager.getProperty("spring.datasource." + propName + ".password");
String driverClassName = ConfigurationManager.getProperty("spring.datasource." + propName + ".driver-class-name"); String driverClassName = ConfigurationManager.getProperty("spring.datasource." + propName + ".driver-class-name");
String url = ConfigurationManager.getProperty("spring.datasource." + propName + ".jdbc-url"); String url = ConfigurationManager.getProperty("spring.datasource." + propName + ".jdbc-url");
Class.forName("com.mysql.cj.jdbc.Driver");//20240619 Class.forName("com.mysql.cj.jdbc.Driver");//20240619
// Class.forName(driverClassName);//20240619
// Class.forName("com.mysql.jdbc.Driver"); // Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(url, username, password); Connection conn = DriverManager.getConnection(url, username, password);
return conn; return conn;
......
# #
#####广联正式 #####广联正式
server.port=8091
#广联正式
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.5.24:3306/dj_operationreport?rewriteBatchedStatements=true&allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&connectTimeout=30000&socketTimeout=60000
spring.datasource.username=user_jinglf
spring.datasource.password=jr2vL8Tx
##
####开发测试#8091
#server.port=8091 #server.port=8091
# #
# #
##开发测试 ##广联正式
##spring.datasource.driverClassName=com.mysql.jdbc.Driver
#spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver #spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&connectTimeout=30000&socketTimeout=60000 #spring.datasource.url=jdbc:mysql://192.168.5.24:3306/dj_operationreport?rewriteBatchedStatements=true&allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&connectTimeout=30000&socketTimeout=60000
#spring.datasource.username=dev_admin #spring.datasource.username=user_jinglf
#spring.datasource.password=1f7e1ed2 #spring.datasource.password=jr2vL8Tx
##
###开发测试#8091
server.port=8091
#开发测试
#spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&connectTimeout=30000&socketTimeout=60000
spring.datasource.username=dev_admin
spring.datasource.password=1f7e1ed2
......
...@@ -65,34 +65,34 @@ spring.datasource.dj_smartcarlife1.password=jr2vL8Tx ...@@ -65,34 +65,34 @@ spring.datasource.dj_smartcarlife1.password=jr2vL8Tx
#开发环境 #开发环境
#spring.datasource.dj_business_school.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_business_school?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 spring.datasource.dj_business_school.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_business_school?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
#spring.datasource.dj_business_school.driver-class-name=com.mysql.jdbc.Driver spring.datasource.dj_business_school.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.dj_business_school.username=dev_admin spring.datasource.dj_business_school.username=dev_admin
#spring.datasource.dj_business_school.password=1f7e1ed2 spring.datasource.dj_business_school.password=1f7e1ed2
#
#spring.datasource.dj_smartcarlife.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 spring.datasource.dj_smartcarlife.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
#spring.datasource.dj_smartcarlife.driver-class-name=com.mysql.jdbc.Driver spring.datasource.dj_smartcarlife.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.dj_smartcarlife.username=dev_admin spring.datasource.dj_smartcarlife.username=dev_admin
#spring.datasource.dj_smartcarlife.password=1f7e1ed2 spring.datasource.dj_smartcarlife.password=1f7e1ed2
#
#spring.datasource.scrm_account.jdbc-url=jdbc:mysql://192.168.3.227:3306/scrm_account?rewriteBatchedStatements=true&allowMultiQueries=true&characterEncoding=utf-8 spring.datasource.scrm_account.jdbc-url=jdbc:mysql://192.168.3.227:3306/scrm_account?rewriteBatchedStatements=true&allowMultiQueries=true&characterEncoding=utf-8
#spring.datasource.scrm_account.driver-class-name=com.mysql.jdbc.Driver spring.datasource.scrm_account.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.scrm_account.username=dev_admin spring.datasource.scrm_account.username=dev_admin
#spring.datasource.scrm_account.password=1f7e1ed2 spring.datasource.scrm_account.password=1f7e1ed2
#
#spring.datasource.insert.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 spring.datasource.insert.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
#spring.datasource.insert.driver-class-name=com.mysql.jdbc.Driver spring.datasource.insert.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.insert.username=dev_admin spring.datasource.insert.username=dev_admin
#spring.datasource.insert.password=1f7e1ed2 spring.datasource.insert.password=1f7e1ed2
#
#spring.datasource.query.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 spring.datasource.query.jdbc-url=jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
#spring.datasource.query.driver-class-name=com.mysql.jdbc.Driver spring.datasource.query.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.query.username=dev_admin spring.datasource.query.username=dev_admin
#spring.datasource.query.password=1f7e1ed2 spring.datasource.query.password=1f7e1ed2
###本地 ##本地
#absolutePath =src/main/resources/config/品牌.json absolutePath =src/main/resources/config/品牌.json
#apiUrlName=测试 apiUrlName=测试
#whereupgradegoodstypesuppliercode=upgradegoodstypesuppliercode_test whereupgradegoodstypesuppliercode=upgradegoodstypesuppliercode_test
...@@ -142,49 +142,49 @@ spring.datasource.dj_smartcarlife1.password=jr2vL8Tx ...@@ -142,49 +142,49 @@ spring.datasource.dj_smartcarlife1.password=jr2vL8Tx
###生产环境 application.properties ###生产环境 application.properties
spring.datasource.dj_business_school.jdbc-url=jdbc:mysql://192.168.5.23:3306/dj_business_school?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 #spring.datasource.dj_business_school.jdbc-url=jdbc:mysql://192.168.5.23:3306/dj_business_school?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
spring.datasource.dj_business_school.driver-class-name=com.mysql.jdbc.Driver #spring.datasource.dj_business_school.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.dj_business_school.username=user_jinglf #spring.datasource.dj_business_school.username=user_jinglf
spring.datasource.dj_business_school.password=jr2vL8Tx #spring.datasource.dj_business_school.password=jr2vL8Tx
#
spring.datasource.dj_smartcarlife.jdbc-url=jdbc:mysql://192.168.5.23:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 #spring.datasource.dj_smartcarlife.jdbc-url=jdbc:mysql://192.168.5.23:3306/dj_smartcarlife?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
spring.datasource.dj_smartcarlife.driver-class-name=com.mysql.jdbc.Driver #spring.datasource.dj_smartcarlife.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.dj_smartcarlife.username=user_jinglf #spring.datasource.dj_smartcarlife.username=user_jinglf
spring.datasource.dj_smartcarlife.password=jr2vL8Tx #spring.datasource.dj_smartcarlife.password=jr2vL8Tx
#
spring.datasource.scrm_account.jdbc-url=jdbc:mysql://192.168.5.1:3310/scrm_account?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 #spring.datasource.scrm_account.jdbc-url=jdbc:mysql://192.168.5.1:3310/scrm_account?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
spring.datasource.scrm_account.driver-class-name=com.mysql.jdbc.Driver #spring.datasource.scrm_account.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.scrm_account.username=user_jinglf #spring.datasource.scrm_account.username=user_jinglf
spring.datasource.scrm_account.password=jr2vL8Tx #spring.datasource.scrm_account.password=jr2vL8Tx
#
#
spring.datasource.insert.jdbc-url=jdbc:mysql://192.168.5.24:3306/dj_operationreport?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 #spring.datasource.insert.jdbc-url=jdbc:mysql://192.168.5.24:3306/dj_operationreport?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
spring.datasource.insert.driver-class-name=com.mysql.jdbc.Driver #spring.datasource.insert.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.insert.username=user_jinglf #spring.datasource.insert.username=user_jinglf
spring.datasource.insert.password=jr2vL8Tx #spring.datasource.insert.password=jr2vL8Tx
#
#
spring.datasource.query.jdbc-url=jdbc:mysql://192.168.5.24:3306/dj_operationreport?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8 #spring.datasource.query.jdbc-url=jdbc:mysql://192.168.5.24:3306/dj_operationreport?rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8
spring.datasource.query.driver-class-name=com.mysql.jdbc.Driver #spring.datasource.query.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.query.username=user_jinglf #spring.datasource.query.username=user_jinglf
spring.datasource.query.password=jr2vL8Tx #spring.datasource.query.password=jr2vL8Tx
binlogip=192.168.5.23
binlogport=3306
binlogdb=dj_smartcarlife
binlogusername=user_jinglf
binlogpassword=jr2vL8Tx
binlogip2=192.168.5.1 #binlogip=192.168.5.23
binlogport2=3310 #binlogport=3306
binlogdb2=scrm_account #binlogdb=dj_smartcarlife
binlogusername2=user_jinglf #binlogusername=user_jinglf
binlogpassword2=jr2vL8Tx #binlogpassword=jr2vL8Tx
#
#binlogip2=192.168.5.1
#binlogport2=3310
#binlogdb2=scrm_account
#binlogusername2=user_jinglf
#binlogpassword2=jr2vL8Tx
##生产环境 ##生产环境
absolutePath =/app/soft/java_project/appletBusinessAnalysis/品牌.json #absolutePath =/app/soft/java_project/appletBusinessAnalysis/品牌.json
apiUrlName=正式 #apiUrlName=正式
whereupgradegoodstypesuppliercode=upgradegoodstypesuppliercode_product #whereupgradegoodstypesuppliercode=upgradegoodstypesuppliercode_product
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!