mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-01-01 12:55:05 +08:00
feat: skyeye-business-flow合入skyeye-adm
This commit is contained in:
parent
9e6673df07
commit
4b9b38d1a0
29 changed files with 16 additions and 652 deletions
|
@ -59,7 +59,6 @@
|
|||
|skyeye-rmprogram |8089 |小程序设计器模块 |rmprogram-web.jar |
|
||||
|skyeye-knowlg |8090 |知识库模块 |knowlg-web.jar |
|
||||
|skyeye-disk-cloud |8092 |云盘模块 |disk-cloud-web.jar |
|
||||
|skyeye-business-flow |8094 |业务流程模块 |business-flow-web.jar |
|
||||
|skyeye-notice |8096 |公告模块 |notice-web.jar |
|
||||
|skyeye-forum |8097 |论坛模块 |forum-web.jar |
|
||||
|skyeye-jobdiary |8098 |工作日报模块 |jobdiary-web.jar |
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.controller;
|
||||
package com.skyeye.eve.businessflow.controller;
|
||||
|
||||
import com.skyeye.annotation.api.Api;
|
||||
import com.skyeye.annotation.api.ApiImplicitParam;
|
||||
|
@ -10,7 +10,7 @@ import com.skyeye.annotation.api.ApiImplicitParams;
|
|||
import com.skyeye.annotation.api.ApiOperation;
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.eve.service.PlanProjectService;
|
||||
import com.skyeye.eve.businessflow.service.PlanProjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
|
@ -2,11 +2,11 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.controller;
|
||||
package com.skyeye.eve.businessflow.controller;
|
||||
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.eve.service.PlanProjectFlowService;
|
||||
import com.skyeye.eve.businessflow.service.PlanProjectFlowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.dao;
|
||||
package com.skyeye.eve.businessflow.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.dao;
|
||||
package com.skyeye.eve.businessflow.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.service;
|
||||
package com.skyeye.eve.businessflow.service;
|
||||
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.service;
|
||||
package com.skyeye.eve.businessflow.service;
|
||||
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
|
@ -2,13 +2,13 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.service.impl;
|
||||
package com.skyeye.eve.businessflow.service.impl;
|
||||
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.common.util.DataCommonUtil;
|
||||
import com.skyeye.eve.dao.PlanProjectFlowDao;
|
||||
import com.skyeye.eve.service.PlanProjectFlowService;
|
||||
import com.skyeye.eve.businessflow.dao.PlanProjectFlowDao;
|
||||
import com.skyeye.eve.businessflow.service.PlanProjectFlowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.eve.service.impl;
|
||||
package com.skyeye.eve.businessflow.service.impl;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -10,9 +10,9 @@ import com.skyeye.common.object.InputObject;
|
|||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.common.util.DataCommonUtil;
|
||||
import com.skyeye.common.util.DateUtil;
|
||||
import com.skyeye.eve.dao.PlanProjectDao;
|
||||
import com.skyeye.eve.businessflow.dao.PlanProjectDao;
|
||||
import com.skyeye.eve.service.IAuthUserService;
|
||||
import com.skyeye.eve.service.PlanProjectService;
|
||||
import com.skyeye.eve.businessflow.service.PlanProjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.skyeye.eve.dao.PlanProjectFlowDao">
|
||||
<mapper namespace="com.skyeye.eve.businessflow.dao.PlanProjectFlowDao">
|
||||
|
||||
<select id="queryPlanProjectFlowList" parameterType="java.util.Map" resultType="java.util.Map">
|
||||
SELECT
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.skyeye.eve.dao.PlanProjectDao">
|
||||
<mapper namespace="com.skyeye.eve.businessflow.dao.PlanProjectDao">
|
||||
|
||||
<select id="queryPlanProjectList" parameterType="java.util.Map" resultType="java.util.Map">
|
||||
SELECT
|
|
@ -39,7 +39,6 @@ import java.util.Properties;
|
|||
|
||||
@Configuration
|
||||
@MapperScan(basePackages = {
|
||||
"com.skyeye.eve.*.dao",
|
||||
"com.skyeye.eve.*.dao"}, sqlSessionFactoryRef = "baseSqlSessionFactory")
|
||||
public class BaseDataSourceConfig {
|
||||
|
||||
|
|
18
skyeye-business-flow/.gitignore
vendored
18
skyeye-business-flow/.gitignore
vendored
|
@ -1,18 +0,0 @@
|
|||
*.class
|
||||
|
||||
# Package Files #
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
class
|
||||
.idea
|
||||
*.iml
|
||||
.settings
|
||||
*.classpath
|
||||
/bin
|
||||
/images/
|
||||
classes
|
||||
/target/
|
||||
/.project/
|
||||
/.metadata/
|
||||
/logs/
|
|
@ -1,18 +0,0 @@
|
|||
*.class
|
||||
|
||||
# Package Files #
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
class
|
||||
.idea
|
||||
*.iml
|
||||
.settings
|
||||
*.classpath
|
||||
/bin
|
||||
/images/
|
||||
classes
|
||||
/target/
|
||||
/.project/
|
||||
/.metadata/
|
||||
/logs/
|
|
@ -1,25 +0,0 @@
|
|||
<?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>skyeye-business-flow</artifactId>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>business-flow-common</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 引入公共Rest模块 -->
|
||||
<dependency>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<artifactId>skyeye-common-rest</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,18 +0,0 @@
|
|||
*.class
|
||||
|
||||
# Package Files #
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
class
|
||||
.idea
|
||||
*.iml
|
||||
.settings
|
||||
*.classpath
|
||||
/bin
|
||||
/images/
|
||||
classes
|
||||
/target/
|
||||
/.project/
|
||||
/.metadata/
|
||||
/logs/
|
|
@ -1,24 +0,0 @@
|
|||
<?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>skyeye-business-flow</artifactId>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>business-flow-entity</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<artifactId>business-flow-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,18 +0,0 @@
|
|||
*.class
|
||||
|
||||
# Package Files #
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
class
|
||||
.idea
|
||||
*.iml
|
||||
.settings
|
||||
*.classpath
|
||||
/bin
|
||||
/images/
|
||||
classes
|
||||
/target/
|
||||
/.project/
|
||||
/.metadata/
|
||||
/logs/
|
|
@ -1,24 +0,0 @@
|
|||
<?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>skyeye-business-flow</artifactId>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>business-flow-pro</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<artifactId>business-flow-entity</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,18 +0,0 @@
|
|||
*.class
|
||||
|
||||
# Package Files #
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
class
|
||||
.idea
|
||||
*.iml
|
||||
.settings
|
||||
*.classpath
|
||||
/bin
|
||||
/images/
|
||||
classes
|
||||
/target/
|
||||
/.project/
|
||||
/.metadata/
|
||||
/logs/
|
|
@ -1,106 +0,0 @@
|
|||
<?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>skyeye-business-flow</artifactId>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>business-flow-web</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<artifactId>business-flow-pro</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web-services</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- actuator监控 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- admin监听包 -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</dependency>
|
||||
<!-- Spring Boot Actuator对外暴露引用的监控信息, Jolokia提供使用HTTP接口获取json -->
|
||||
<dependency>
|
||||
<groupId>org.jolokia</groupId>
|
||||
<artifactId>jolokia-core</artifactId>
|
||||
</dependency>
|
||||
<!-- 服务包 -->
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 资源文件拷贝插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!--spring-boot打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>springloaded</artifactId>
|
||||
<version>1.2.5.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
<!--打包跳过测试 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- java编译插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,30 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAutoConfiguration(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@EnableTransactionManagement//启注解事务管理,等同于xml配置方式的 <tx:annotation-driven />
|
||||
@ComponentScan(basePackages = {"com.skyeye"})
|
||||
@EnableDiscoveryClient // 开启服务发现
|
||||
@EnableFeignClients
|
||||
public class SkyBusinessFlowApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(SkyBusinessFlowApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.db.config;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
import com.skyeye.common.constans.CommonConstants;
|
||||
import com.skyeye.exception.CustomException;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.core.io.support.ResourcePatternResolver;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
@Configuration
|
||||
@MapperScan(basePackages = {
|
||||
"com.skyeye.eve.dao",
|
||||
"com.skyeye.eve.*.dao"}, sqlSessionFactoryRef = "baseSqlSessionFactory")
|
||||
public class BaseDataSourceConfig {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BaseDataSourceConfig.class);
|
||||
|
||||
protected static Properties databaseTypeMappings = CommonConstants.getDefaultDatabaseTypeMappings();
|
||||
|
||||
@Autowired
|
||||
protected ResourceLoader resourceLoader;
|
||||
|
||||
/**
|
||||
* Primary 必须加此注解,不然报错,下一个类则不需要添加,表示这个数据源是默认数据源
|
||||
* ConfigurationProperties(prefix)值必须是application.properteis中对应属性的前缀
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean(name = "baseDataSource")
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource")
|
||||
public DataSource baseDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
/**
|
||||
* a、SqlSessionFactory 一旦被创建就应该在应用的运行期间一直存在,没有任何理由对它进行清除或重建。
|
||||
* b、使用 SqlSessionFactory 的最佳实践是在应用运行期间不要重复创建多次,多次重建 SqlSessionFactory 被视为一种代码“坏味道(bad smell)”。
|
||||
* c、因此 SqlSessionFactory 的最佳作用域是应用作用域。有很多方法可以做到,最简单的就是使用单例模式或者静态单例模式。
|
||||
*
|
||||
* @param dataSource
|
||||
* @return
|
||||
*/
|
||||
@Primary
|
||||
@Bean(name = "baseSqlSessionFactory")
|
||||
public SqlSessionFactory baseSqlSessionFactory(@Qualifier("baseDataSource") DataSource dataSource) {
|
||||
MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
|
||||
|
||||
mybatisSqlSessionFactoryBean.setDataSource(dataSource);
|
||||
String databaseType = this.initDatabaseType(dataSource);
|
||||
if (databaseType == null) {
|
||||
throw new CustomException("couldn't deduct database type");
|
||||
} else {
|
||||
try {
|
||||
// 添加XML目录
|
||||
mybatisSqlSessionFactoryBean.setMapperLocations(resolveMapperLocations());
|
||||
mybatisSqlSessionFactoryBean.afterPropertiesSet();
|
||||
return mybatisSqlSessionFactoryBean.getObject();
|
||||
} catch (Exception var5) {
|
||||
throw new CustomException("Could not create sqlSessionFactory", var5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Resource[] resolveMapperLocations() {
|
||||
ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
|
||||
List<String> mapperLocations = new ArrayList<>();
|
||||
mapperLocations.add("classpath*:mapper/**/*.xml");
|
||||
List<Resource> resources = new ArrayList();
|
||||
if (!CollectionUtils.isEmpty(mapperLocations)) {
|
||||
for (String mapperLocation : mapperLocations) {
|
||||
try {
|
||||
Resource[] mappers = resourceResolver.getResources(mapperLocation);
|
||||
resources.addAll(Arrays.asList(mappers));
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Get myBatis resources happened exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resources.toArray(new Resource[resources.size()]);
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "transactionManager")
|
||||
public PlatformTransactionManager transactionManager(@Qualifier("baseDataSource") DataSource dataSourceOne) {
|
||||
return new DataSourceTransactionManager(dataSourceOne);
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "sqlSessionTemplate")
|
||||
public SqlSessionTemplate sqlSessionTemplate(@Qualifier("baseSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
|
||||
// 使用上面配置的Factory
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
* @param dataSource
|
||||
* @return
|
||||
*/
|
||||
protected String initDatabaseType(@Qualifier("baseDataSource") DataSource dataSource) {
|
||||
String databaseType = null;
|
||||
Connection connection = null;
|
||||
|
||||
try {
|
||||
connection = dataSource.getConnection();
|
||||
DatabaseMetaData databaseMetaData = connection.getMetaData();
|
||||
String databaseProductName = databaseMetaData.getDatabaseProductName();
|
||||
LOGGER.info("database product name: '{}'", databaseProductName);
|
||||
databaseType = databaseTypeMappings.getProperty(databaseProductName);
|
||||
if (databaseType == null) {
|
||||
throw new CustomException("couldn't deduct database type from database product name '" + databaseProductName + "'");
|
||||
}
|
||||
|
||||
LOGGER.info("using database type: {}", databaseType);
|
||||
} catch (SQLException var14) {
|
||||
LOGGER.error("Exception while initializing Database connection", var14);
|
||||
} finally {
|
||||
try {
|
||||
if (connection != null) {
|
||||
connection.close();
|
||||
}
|
||||
} catch (SQLException var13) {
|
||||
LOGGER.error("Exception while closing the Database connection", var13);
|
||||
}
|
||||
|
||||
}
|
||||
databaseType = ("dm".equals(databaseType)) ? "oracle" : databaseType;
|
||||
return databaseType;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
/**
|
||||
* _ooOoo_
|
||||
* o8888888o
|
||||
* 88" . "88
|
||||
* (| -_- |)
|
||||
* O\ = /O
|
||||
* ____/`---'\____
|
||||
* .' \\| |// `.
|
||||
* / \\||| : |||// \
|
||||
* / _||||| -:- |||||- \
|
||||
* | | \\\ - /// | |
|
||||
* | \_| ''\---/'' | |
|
||||
* \ .-\__ `-` ___/-. /
|
||||
* ___`. .' /--.--\ `. . __
|
||||
* ."" '< `.___\_<|>_/___.' >'"".
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | |
|
||||
* \ \ `-. \_ __\ /__ _/ .-` / /
|
||||
* ======`-.____`-.___\_____/___.-`____.-'======
|
||||
* `=---='
|
||||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
* 佛祖保佑 永无BUG
|
||||
* 佛曰:
|
||||
* 写字楼里写字间,写字间里程序员;
|
||||
* 程序人员写程序,又拿程序换酒钱。
|
||||
* 酒醒只在网上坐,酒醉还来网下眠;
|
||||
* 酒醉酒醒日复日,网上网下年复年。
|
||||
* 但愿老死电脑间,不愿鞠躬老板前;
|
||||
* 奔驰宝马贵者趣,公交自行程序员。
|
||||
* 别人笑我忒疯癫,我笑自己命太贱;
|
||||
* 不见满街漂亮妹,哪个归得程序员?
|
||||
* :: springboot 2.x
|
||||
* :: Skyeye系列框架,作者:卫志强
|
||||
* :: 作者独家专属,未购买禁止私自使用
|
||||
* 启动:nohup java -jar -Dspring.cloud.nacos.discovery.server-addr=localhost:9000 -Dspring.cloud.nacos.config.server-addr=localhost:9000 -Dspring.profiles.active=dev business-flow-web.jar >> /opt/service/project/nohup-business-flow.out 2>&1 &
|
||||
* 清空日志:cat /dev/null > xxx-web.out
|
||||
*/
|
|
@ -1,37 +0,0 @@
|
|||
server:
|
||||
port: 8094
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: skyeye-business-flow-${spring.profiles.active} # 服务名
|
||||
profiles:
|
||||
active: public
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: localhost:9000 # 配置服务注册nacos地址
|
||||
namespace: ${spring.profiles.active} # 配置命名空间
|
||||
service: ${spring.application.name} # 配置服务名
|
||||
config:
|
||||
# 指定nacos server的地址
|
||||
server-addr: localhost:9000
|
||||
# 配置文件后缀
|
||||
file-extension: yml
|
||||
# 命名空间 常用场景之一是不同环境的配置的区分隔离,例如开发测试环境和生产环境的资源(如配置、服务)隔离等
|
||||
namespace: ${spring.profiles.active} # 配置命名空间
|
||||
# 支持多个共享 Data Id 的配置,优先级小于ext-config,自定义 Data Id 配置 属性是个集合,内部由 Config POJO 组成。Config 有 3 个属性,分别是 dataId, group 以及 refresh
|
||||
ext-config:
|
||||
- data-id: skyeye-common.yml # 配置文件名-Data Id
|
||||
group: DEFAULT_GROUP # 默认为DEFAULT_GROUP
|
||||
refresh: false # 是否动态刷新,默认为false
|
||||
logging:
|
||||
level:
|
||||
com.skyeye: debug
|
||||
|
||||
feign:
|
||||
client:
|
||||
config:
|
||||
# 全局配置
|
||||
default:
|
||||
loggerLevel: FULL
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
-- jvm堆的最小值3G
|
||||
-Xms3072m
|
||||
-- jvm堆的最大值3G
|
||||
-Xmx3072m
|
||||
-- 新生代内存区域的大小,设置新生代区域后,老年代内存=堆内存 - 新生代内存;老年代的最大内存 = 堆内存 - 新生代最大内存
|
||||
-Xmn2048M
|
||||
-- 新生代内存区域中Eden和Survivor的比例,SurvivorRatio=8,那么Eden区占8/10,2个Survivor区各占1/10
|
||||
-XX:SurvivorRatio=8
|
||||
-- 大小为区间为[0,15],如果高于15,JDK7 会默认15,JDK 8会启动报错
|
||||
-XX:MaxTenuringThreshold=15
|
||||
-- 输出GC的时间戳(以日期的形式,如 2019-05-04T21:53:59.234+0800)
|
||||
-XX:+PrintGCDateStamps
|
||||
-- 打印出GC的详细信息
|
||||
-XX:+PrintGCDetails
|
||||
-- 在进行GC的前后打印出堆的信息
|
||||
-XX:+PrintHeapAtGC
|
||||
-- 打印年轻代各个引用的数量以及时长
|
||||
-XX:+PrintReferenceGC
|
||||
-- 开启gc日志
|
||||
-verbose:gc
|
||||
-- gc日志的存放位置
|
||||
-Xloggc:d:/gc.log
|
|
@ -1,53 +0,0 @@
|
|||
### set log levels这里的INFO,Stdout,D,E可以理解为变量,也可以说是输出平台,在下面我们可以看到 ###
|
||||
log4j.rootLogger = INFO, C, D, E
|
||||
|
||||
### console控制台输出 ###
|
||||
log4j.appender.C = org.apache.log4j.ConsoleAppender
|
||||
### System.out也就是输出 out输出是黑色字体,err输出的字体是红色 ###
|
||||
log4j.appender.C.Target = System.out
|
||||
### layout是指布局,也就是说输出日志信息的格式样式,在这里我们使用的是log4j提供的 ###
|
||||
log4j.appender.C.layout = org.apache.log4j.PatternLayout
|
||||
### 这里就是指定我们日志文件以哪一种格式去输出 ###
|
||||
log4j.appender.C.layout.ConversionPattern = [skyeye-promote][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
|
||||
|
||||
|
||||
### log file INFO级别输出日志文件 ###
|
||||
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
|
||||
### 指定日志输出位置 ###
|
||||
log4j.appender.D.File = ../logs/skyeye.log
|
||||
### 这个的意思是指是追加还是覆盖 默认是 true true是追加 false是覆盖 ###
|
||||
log4j.appender.D.Append = true
|
||||
### 这个是指日志输出的级别在这里指定的是 INFO级别 ###
|
||||
log4j.appender.D.Threshold = INFO
|
||||
### layout是指布局,也就是说输出日志信息的格式样式,在这里我们使用的是log4j提供的 ###
|
||||
log4j.appender.D.layout = org.apache.log4j.PatternLayout
|
||||
### 这里就是指定我们日志文件以哪一种格式去输出 ###
|
||||
log4j.appender.D.layout.ConversionPattern = [skyeye-promote][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
|
||||
|
||||
|
||||
### exception ERROR级别输出日志文件 ###
|
||||
#这个跟上面一样 只不过是日志级别是 ERROR级的,方便我们直接查看系统异常信息
|
||||
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.E.File = ../logs/skyeye_error.log
|
||||
log4j.appender.E.Append = true
|
||||
log4j.appender.E.Threshold = ERROR
|
||||
log4j.appender.E.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.E.layout.ConversionPattern = [skyeye-promote][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
|
||||
|
||||
#localhost日志文件输出级别为INFO
|
||||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
|
||||
#localhost日志文件输出处理类2localhost.org.apache.juli.FileHandler
|
||||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler
|
||||
|
||||
#manager日志文件输出级别为INFO
|
||||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
|
||||
#manager日志文件输出处理类3manager.org.apache.juli.FileHandler
|
||||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler
|
||||
|
||||
#host-manager日志文件输出级别为INFO
|
||||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
|
||||
#host-manager日志文件输出处理类4host-manager.org.apache.juli.FileHandler
|
||||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler
|
||||
|
||||
#设置包名的输出级别
|
||||
log4j.logger.com.skyeye.common.filter=info
|
|
@ -1,24 +0,0 @@
|
|||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>business-flow-common</module>
|
||||
<module>business-flow-entity</module>
|
||||
<module>business-flow-pro</module>
|
||||
<module>business-flow-web</module>
|
||||
</modules>
|
||||
|
||||
<parent>
|
||||
<groupId>com.skyeye</groupId>
|
||||
<artifactId>skyeye-parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.skyeye</groupId>
|
||||
<artifactId>skyeye-business-flow</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
</project>
|
Loading…
Reference in a new issue