Commit e11aedb9 authored by 夏仁吉's avatar 夏仁吉

flow单独立项目因此删除

parent 18fde4db
<?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>
<artifactId>government-flowable</artifactId>
<packaging>jar</packaging>
<description>工作流程引擎服务</description>
<parent>
<groupId>com.mortals.xhx</groupId>
<artifactId>government-platform</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring.cloud.alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mortals.xhx</groupId>
<artifactId>common-lib</artifactId>
</dependency>
<!-- 引入 SpringMVC 相关依赖,并实现对其的自动配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
<!--flowable工作流依赖-->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>${flowable.version}</version>
</dependency>
<!-- flowable-engine -->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-engine</artifactId>
<version>${flowable.version}</version>
</dependency>
<!-- flowable 集成依赖 rest,logic,conf -->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-modeler-rest</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-modeler-logic</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-modeler-conf</artifactId>
<version>${flowable.version}</version>
<exclusions>
<exclusion>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>4.3.1</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>*</include>
<include>*/**</include>
</includes>
</resource>
</resources>
</build>
</project>
#!/bin/sh
RETVAL=$?
. /etc/profile #加载环境变量(Jenkins远程启动程序报找不到Java文件问题,需加载环境变量)
export CATALINA_BASE="$PWD"
case "$1" in
start)
if [ -f $CATALINA_BASE/start.sh ];then
$CATALINA_BASE/start.sh 17022 &
fi
;;
stop)
if [ -f $CATALINA_BASE/stop.sh ];then
$CATALINA_BASE/stop.sh 17022
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
\ No newline at end of file
#!/bin/sh
PORT=$1
BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
ENCRYPT_KEY="foobar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/$PORT"-gc.log"
HS_ERR_PATH=$LOG_PATH/$PORT"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/$PORT"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0
FAIL=9
if [ ! -n "$PORT" ]; then
echo $"Usage: $0 {port}"
exit $FAIL
fi
if [ ! -d $LOG_PATH ];
then
mkdir -p $LOG_PATH;
fi
if [ ! -d $TEMP_PATH ];
then
mkdir -p $TEMP_PATH;
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD=`which java > /dev/null 2>&1`
echo "Error: JAVA_HOME is not defined correctly."
exit $ERR_NO_JAVA
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "We cannot execute $JAVACMD"
exit $ERR_NO_JAVA
fi
if [ -e "$BASEDIR" ]
then
JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi
CLASSPATH=$CLASSPATH_PREFIX:
EXTRA_JVM_ARGUMENTS=""
cd "$BASEDIR/boot";
echo "starting application $PROJECT_NAME......"
exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \
-Dapp.name="$PROJECT_NAME" \
-Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \
-Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-jar $MAIN_CLASS \
--server.port="$PORT" \
--encrypt.key="$ENCRYPT_KEY" \
> /dev/null &
for i in {1..60}
do
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ $jcpid ]; then
echo "The $PROJECT_NAME start finished, PID is $jcpid"
exit $SUCCESS
else
echo "starting the application .. $i"
sleep 1
fi
done
echo "$PROJECT_NAME start failure!"
\ No newline at end of file
#! /bin/sh
PORT=$1
BASEDIR=`dirname $0`
BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"
MAIN_CLASS="$PROJECT_NAME";
SECURITY_USERNAME="admin";
SECURITY_PASSWORD="1";
if [ ! -n "$PORT" ]; then
echo $"Usage: $0 {port}"
exit $FAIL
fi
echo "stoping application $PROJECT_NAME......"
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ -z $jcpid ]; then
echo "$PROJECT_NAME is not started or has been stopped!"
else
curl -X POST -i -u $SECURITY_USERNAME:$SECURITY_PASSWORD http://127.0.0.1:$PORT/xxx_manager/shutdown
for i in {1..60}
do
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ -z $jcpid ]; then
echo "$PROJECT_NAME has been stopped!"
break
else
echo "stoping the application .. $i"
sleep 1
fi
done
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ $jcpid ]; then
[ -z $jcpid ] || kill -15 $jcpid
for i in {1..30}
do
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ -z $jcpid ]; then
echo "$PROJECT_NAME has been stopped!"
break
else
echo "stoping the application .. $i"
sleep 1
fi
done
fi
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ $jcpid ]; then
[ -z $jcpid ] || kill -9 $jcpid
[ $? -eq 0 ] && echo "Stop $PROJECT_NAME OK!" || echo "Stop $PROJECT_NAME Fail!"
fi
fi
\ No newline at end of file
package com.mortals.xhx;
import com.mortals.framework.springcloud.boot.BaseWebApplication;
import com.mortals.xhx.exception.GlobalExceptionHandler;
import com.mortals.xhx.flowable.conf.AppDispatcherServletConfiguration;
import com.mortals.xhx.flowable.conf.ApplicationConfiguration;
import com.mortals.xhx.flowable.conf.DatabaseAutoConfiguration;
import org.flowable.ui.modeler.conf.DatabaseConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
@Import(value={GlobalExceptionHandler.class,
// 引入修改的配置
ApplicationConfiguration.class,
AppDispatcherServletConfiguration.class,
// 引入 DatabaseConfiguration 表更新转换
DatabaseConfiguration.class
// 引入 DatabaseConfiguration 表更新转换
//DatabaseAutoConfiguration.class
})
@EnableFeignClients
@ComponentScan(basePackages = {"com.mortals.*"})
@MapperScan("com.mortals.*.dao")
@SpringBootApplication(exclude={SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class, SecurityFilterAutoConfiguration.class})
@ImportResource(locations = { "classpath:config/spring-config.xml" })
public class FlowableApplication extends BaseWebApplication {
public static void main(String[] args) {
SpringApplication.run(FlowableApplication.class, args);
}
}
package com.mortals.xhx.base.framework.config;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;
import javax.sql.DataSource;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.io.VFS;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
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 com.mortals.framework.springcloud.config.SpringBootVFS;
import org.springframework.core.io.support.ResourcePatternUtils;
//@Configuration
public class MybatisConfiguration {
private static Log logger = LogFactory.getLog(MybatisConfiguration.class);
// 配置类型别名
@Value("${spring.application.name}")
private String name;
// 配置类型别名
@Value("${mybatis.root-path}")
private String rootPath;
private static final String ROOT_PATH_SPLIT = ",";
// 配置类型别名
@Value("${mybatis.type-aliases-package}")
private String typeAliasesPackage;
// 配置mapper的扫描,找到所有的mapper.xml映射文件
@Value("${mybatis.mapper-locations}")
private String mapperLocations;
// 加载全局的配置文件
@Value("${mybatis.config-location}")
private String configLocation;
private final String PATH_SEPARATOR = "/";
@Autowired
protected ResourceLoader resourceLoader;
// 提供SqlSeesion
@Bean(name = "sqlSessionFactory")
public SqlSessionFactory sqlSessionFactoryBean(@Qualifier("dataSource") DataSource dataSource) {
return getSqlSessionFactoryBean(dataSource);
}
public SqlSessionFactory getSqlSessionFactoryBean(DataSource dataSource) {
try {
// 解决myBatis下 不能从嵌套jar文件中读取class的问题
VFS.addImplClass(SpringBootVFS.class);
SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
sessionFactoryBean.setDataSource(dataSource);
// 读取配置
sessionFactoryBean.setTypeAliasesPackage(getTypeAliasesPackage());
//
// Resource[] resources = new PathMatchingResourcePatternResolver().getResources(mapperLocations);
// sessionFactoryBean.setMapperLocations(resources);
// //
Resource[] configLocations = new PathMatchingResourcePatternResolver().getResources(configLocation);
sessionFactoryBean.setConfigLocation(configLocations[0]);
Properties properties = new Properties();
properties.put("prefix", "");
properties.put("blobType", "BLOB");
properties.put("boolValue", "TRUE");
sessionFactoryBean.setConfigurationProperties(properties);
sessionFactoryBean.setMapperLocations(resolveMapperLocations());
//sessionFactoryBean.setMapperLocations(ResourcePatternUtils.getResourcePatternResolver(this.resourceLoader).getResources("classpath:/META-INF/modeler-mybatis-mappings/*.xml"));
//sessionFactoryBean.setMapperLocations(ResourcePatternUtils.getResourcePatternResolver(this.resourceLoader).getResources("classpath*:mapper/*.xml"));
//sessionFactoryBean.afterPropertiesSet();
//sessionFactoryBean.afterPropertiesSet();
// 添加插件 (改为使用配置文件加载了)
// sqlSessionFactoryBean.setPlugins(new
// Interceptor[]{pageHelper()});
return sessionFactoryBean.getObject();
} catch (IOException e) {
logger.error("mybatis resolver mapper*xml is error", e);
return null;
} catch (Exception e) {
logger.error("mybatis sqlSessionFactoryBean create error", e);
return null;
}
}
public Resource[] resolveMapperLocations() {
ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
List<String> mapperLocations = Arrays.stream(this.mapperLocations.split(",")).collect(Collectors.toList());
List<Resource> resources = new ArrayList();
if (mapperLocations != null) {
for (String mapperLocation : mapperLocations) {
try {
Resource[] mappers =ResourcePatternUtils.getResourcePatternResolver(this.resourceLoader).getResources(mapperLocation.trim());
//Resource[] mappers = resourceResolver.getResources(mapperLocation);
resources.addAll(Arrays.asList(mappers));
} catch (IOException e) {
// ignore
}
}
}
return resources.toArray(new Resource[resources.size()]);
}
public String getTypeAliasesPackage() {
if (StringUtils.isEmpty(typeAliasesPackage)) {
return "";
}
rootPath = rootPath.trim().replace(".", PATH_SEPARATOR);
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
StringBuffer typeAliasesPackageStringBuffer = new StringBuffer();
try {
for (String location : typeAliasesPackage.split(ROOT_PATH_SPLIT)) {
if (StringUtils.isEmpty(location)) {
continue;
}
if (location.contains("*")) {
location = "classpath*:" + location.trim().replace(".", PATH_SEPARATOR);
location = getResources(resolver, location);
}
if (location.endsWith(PATH_SEPARATOR)) {
location = location.substring(0, location.length() - 1);
}
typeAliasesPackageStringBuffer.append(location + ROOT_PATH_SPLIT);
}
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
if (typeAliasesPackageStringBuffer.length() == 0) {
throw new RuntimeException(
"mybatis typeAliasesPackage 路径扫描错误!请检查applicationContext.xml@sqlSessionFactory配置!");
}
String allTypeAliasesPackage = typeAliasesPackageStringBuffer.toString().replace(PATH_SEPARATOR, ".");
logger.info("allTypeAliasesPackage:" + allTypeAliasesPackage);
return allTypeAliasesPackage;
}
private String getResources(ResourcePatternResolver resolver, String location) throws IOException {
StringBuffer resourcePathStringBuffer = new StringBuffer();
for (Resource resource : resolver.getResources(location)) {
if (resource == null || resource.getURL() == null) {
continue;
}
String path = resource == null ? "" : resource.getURL().getPath();
path = URLDecoder.decode(path, "UTF-8");// 对URL进行解码
path = path.replaceAll("\\\\", PATH_SEPARATOR);// 将所有反斜杠(\)替换成正斜杠(/)
if (StringUtils.isEmpty(path) || path.indexOf(rootPath) == -1) {
continue;
}
if (path.endsWith(PATH_SEPARATOR)) {
path = path.substring(0, path.length() - 1);
}
resourcePathStringBuffer.append(path.substring(path.indexOf(rootPath))).append(ROOT_PATH_SPLIT);
}
return resourcePathStringBuffer.toString();
}
}
\ No newline at end of file
package com.mortals.xhx.base.framework.exception;
import com.mortals.framework.exception.AppException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject;
/**
* 统一异常处理
*/
@ControllerAdvice
public class ExceptionHandle {
private final static Logger log = LoggerFactory.getLogger(ExceptionHandle.class);
public static final String KEY_RESULT_CODE = "code";
public static final String KEY_RESULT_MSG = "msg";
public static final String KEY_RESULT_DATA = "data";
public static final int VALUE_RESULT_FAILURE = -1;
@ExceptionHandler(value = Exception.class)
@ResponseBody
public String handle(Exception e) {
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
if (e instanceof AppException) {
StackTraceElement stack = e.getStackTrace()[0];
log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(),
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage());
} else {
log.error("[system error]{}", e);
ret.put(KEY_RESULT_MSG, "unknown exception!");
}
return ret.toJSONString();
}
}
package com.mortals.xhx.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.CompositeCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.cache.RedisCacheManager;
@DependsOn({"redisCacheManager", "ehcacheCacheManager"})
public class CacheConfig {
@Autowired
private RedisCacheManager redisCacheManager;
@Bean("cacheManager")
@Primary
public CacheManager compositeCacheManager() {
CompositeCacheManager compositeCacheManager = new CompositeCacheManager(redisCacheManager);
return compositeCacheManager;
}
}
package com.mortals.xhx.config;
import com.mortals.xhx.interceptor.CorsInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CorssDomainConfig implements WebMvcConfigurer {
@Autowired
private CorsInterceptor corsInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
InterceptorRegistration registration = registry.addInterceptor(corsInterceptor);
registration.addPathPatterns("/**");
}
}
//package com.mortals.xhx.config;
//
//import com.alibaba.druid.filter.config.ConfigTools;
//import com.alibaba.druid.pool.DruidDataSource;
//import lombok.Data;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//
//import javax.sql.DataSource;
//import java.sql.SQLException;
//import java.util.Properties;
//
//
//@Configuration
//@Data
//public class DruidDatsSourceConfig {
//
// private Logger logger = LoggerFactory.getLogger(DruidDatsSourceConfig.class);
//
// @Value("${spring.datasource.url}")
// private String url;
//
// @Value("${spring.datasource.driver-class-name}")
// private String driverClassName;
//
// @Value("${spring.datasource.username}")
// private String username;
//
// @Value("${spring.datasource.password}")
// private String password;
//
// @Value("${spring.datasource.type}")
// private String type;
//
//// @Value("${spring.datasource.publicKey}")
//// private String publicKey;
//
// @Value("${spring.datasource.druid.initial-size}")
// private Integer initialSize;
//
// @Value("${spring.datasource.druid.min-idle}")
// private Integer minIdle;
//
// @Value("${spring.datasource.druid.max-active}")
// private Integer maxActive;
//
// @Value("${spring.datasource.druid.max-wait}")
// private Integer maxWait;
//
// @Value("${spring.datasource.druid.time-between-eviction-runs-millis}")
// private Integer timeBetweenEvictionRunsMillis;
//
// @Value("${spring.datasource.druid.min-evictable-idle-time-millis}")
// private Integer minEvictableIdleTimeMillis;
//
// @Value("${spring.datasource.druid.validation-query}")
// private String validationQuery;
//
// @Value("${spring.datasource.druid.test-while-idle}")
// private Boolean testWhileIdle;
//
// @Value("${spring.datasource.druid.test-on-borrow}")
// private Boolean testOnBorrow;
//
// @Value("${spring.datasource.druid.test-on-return}")
// private Boolean testOnReturn;
//
// @Value("${spring.datasource.druid.pool-prepared-statements}")
// private Boolean poolPreparedStatements;
//
// @Value("${spring.datasource.druid.max-pool-prepared-statement-per-connection-size}")
// private Integer maxPoolPreparedStatementPerConnectionSize;
//
// @Value("${spring.datasource.druid.filters}")
// private String filters;
//
// @Value("${spring.datasource.druid.use-global-data-source-stat}")
// private Boolean useGlobalDataSourceStat;
//
// @Value("${spring.datasource.druid.connect-properties}")
// private Properties connectProperties;
//
// @Bean
// @Primary
// public DataSource druidDataSource() throws Exception {
// DruidDataSource datasource = new DruidDataSource();
// datasource.setUrl(url);
// datasource.setDriverClassName(driverClassName);
// datasource.setUsername(username);
// datasource.setPassword(password);
// // logger.info("密码:" + ConfigTools.decrypt(publicKey, password));
// datasource.setInitialSize(initialSize);
// datasource.setMinIdle(minIdle);
// datasource.setMaxActive(maxActive);
// datasource.setMaxWait(maxWait);
// datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
// datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
// datasource.setValidationQuery(validationQuery);
// datasource.setTestWhileIdle(testWhileIdle);
// datasource.setTestOnBorrow(testOnBorrow);
// datasource.setTestOnReturn(testOnReturn);
// datasource.setUseGlobalDataSourceStat(useGlobalDataSourceStat);
// datasource.setConnectProperties(connectProperties);
//
// try {
// datasource.setFilters(filters);
// } catch (SQLException e) {
// logger.error("========druid configuration initialization filter========", e);
// }
// return datasource;
// }
//
//
// public static void main(String[] args) throws Exception {
// String password = "xxxx";
// String[] arr = ConfigTools.genKeyPair(512);
// System.out.println("password:" + password);
// System.out.println("privateKey:" + arr[0]);
// System.out.println("publicKey:" + arr[1]);
// System.out.println("password:" + ConfigTools.encrypt(arr[0], password));
// }
//}
package com.mortals.xhx.config;
import lombok.Data;
import lombok.extern.apachecommons.CommonsLog;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
/**
* 流程引擎配置文件
*/
@Configuration
@ConfigurationProperties(prefix = "spring.datasource")
@Data
@CommonsLog
public class ProcessEngineConfig {
@Value("${spring.datasource.url}")
private String url;
@Value("${spring.datasource.driver-class-name}")
private String driverClassName;
@Value("${spring.datasource.username}")
private String username;
@Value("${spring.datasource.password}")
private String password;
/**
* 初始化流程引擎
* @return
*/
@Primary
@Bean(name = "processEngine")
public ProcessEngine initProcessEngine() {
log.info("=============================ProcessEngineBegin=============================");
// 流程引擎配置
ProcessEngineConfiguration cfg = null;
try {
cfg = new StandaloneProcessEngineConfiguration()
.setJdbcUrl(url)
.setJdbcUsername(username)
.setJdbcPassword(password)
.setJdbcDriver(driverClassName)
// 初始化基础表,不需要的可以改为 DB_SCHEMA_UPDATE_FALSE
//.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE)
.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
// 默认邮箱配置
// 发邮件的主机地址,先用 QQ 邮箱
.setMailServerHost("smtp.qq.com")
// POP3/SMTP服务的授权码
.setMailServerPassword("hergynqfusnsbbdf")
// 默认发件人
.setMailServerDefaultFrom("836369078@qq.com")
// 设置发件人用户名
.setMailServerUsername("管理员")
// 解决流程图乱码
.setActivityFontName("宋体")
.setLabelFontName("宋体")
.setAnnotationFontName("宋体");
} catch (Exception e) {
e.printStackTrace();
}
// 初始化流程引擎对象
ProcessEngine processEngine = cfg.buildProcessEngine();
log.info("=============================ProcessEngineEnd=============================");
return processEngine;
}
}
//package com.mortals.xhx.config;
//
//import com.fasterxml.jackson.annotation.JsonAutoDetect;
//import com.fasterxml.jackson.annotation.PropertyAccessor;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import lombok.Data;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cache.Cache;
//import org.springframework.cache.annotation.CachingConfigurerSupport;
//import org.springframework.cache.interceptor.CacheErrorHandler;
//import org.springframework.cache.interceptor.SimpleCacheErrorHandler;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.connection.RedisConnectionFactory;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
//
///**
// * @Author: linqj
// * @Date: 2019/3/6 10:36
// */
//@Data
//@Configuration
//public class RedisCacheConfig extends CachingConfigurerSupport {
//
// /**
// * 配置文件设置redis配置之后自动生成连接工厂类(使用lettuce)
// */
// @Autowired
// private RedisConnectionFactory redisConnectionFactory;
//
// /**
// * 生成RedisTemplate
// *
// * @return
// */
// @Bean("redisTemplate")
// public RedisTemplate redisTemplate() {
// Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
// ObjectMapper om = new ObjectMapper();
// om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
// jackson2JsonRedisSerializer.setObjectMapper(om);
// RedisTemplate redisTemplate = new RedisTemplate<>();
// redisTemplate.setConnectionFactory(redisConnectionFactory);
// redisTemplate.setKeySerializer(jackson2JsonRedisSerializer);
// redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
// redisTemplate.setHashKeySerializer(jackson2JsonRedisSerializer);
// redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
// redisTemplate.afterPropertiesSet();
// return redisTemplate;
// }
//
//// @Bean("redisCacheManager")
//// public RedisCacheManager redisCacheManager() {
//// RedisCacheWriter writer = RedisCacheWriter.lockingRedisCacheWriter(redisConnectionFactory);
//// RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig();
//// // 设置默认缓存过期时间
//// if (!StringUtils.isEmpty(expiresTime)) {
//// config.entryTtl(Duration.ofMinutes(Long.valueOf(expiresTime))).disableCachingNullValues();
//// } else {
//// config.entryTtl(Duration.ofMinutes(10)).disableCachingNullValues();
//// }
//// // 设置缓存空间
//// if (StringUtils.isEmpty(names)) {
//// names = "default-redis";
//// }
//// // 使用自定义配置初始化cacheManager
//// RedisCacheManager redisCacheManager = new RedisCacheManager(writer, config, names.split(","));
//// return redisCacheManager;
//// }
//
//
//
// /**
// * 如果cache出错, 我们会记录在日志里,方便排查,比如反序列化异常
// */
// @Override
// public CacheErrorHandler errorHandler() {
// return new LoggingCacheErrorHandler();
// }
//
// static class LoggingCacheErrorHandler extends SimpleCacheErrorHandler {
// private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
//
// @Override
// public void handleCacheGetError(RuntimeException exception, Cache cache, Object key) {
// LOGGER.error(String.format("cacheName:%s,cacheKey:%s",
// cache == null ? "unknown" : cache.getName(), key), exception);
// super.handleCacheGetError(exception, cache, key);
// }
//
// @Override
// public void handleCachePutError(RuntimeException exception, Cache cache, Object key,
// Object value) {
// LOGGER.error(String.format("cacheName:%s,cacheKey:%s",
// cache == null ? "unknown" : cache.getName(), key), exception);
// super.handleCachePutError(exception, cache, key, value);
// }
//
// @Override
// public void handleCacheEvictError(RuntimeException exception, Cache cache, Object key) {
// LOGGER.error(String.format("cacheName:%s,cacheKey:%s",
// cache == null ? "unknown" : cache.getName(), key), exception);
// super.handleCacheEvictError(exception, cache, key);
// }
//
// @Override
// public void handleCacheClearError(RuntimeException exception, Cache cache) {
// LOGGER.error(String.format("cacheName:%s", cache == null ? "unknown" : cache.getName()),
// exception);
// super.handleCacheClearError(exception, cache);
// }
// }
//
//}
package com.mortals.xhx.entity;
import lombok.Data;
/**
* 统一返回结果集实体类
* @param <T> 返回数据对象
*/
@Data
public class ErrorMsg<T> {
//错误码
private Integer errorCode;
//错误信息,一般为前端提示信息
private String errorMsg;
//返回值,一般为成功后返回的数据
private T data;
//错误详情,一般为失败后的详细原因,如空指针之类的
private String errorDetail;
public ErrorMsg() {}
public ErrorMsg(Integer errorCode, String errorMsg) {
this.errorCode = errorCode;
this.errorMsg = errorMsg;
}
public ErrorMsg(Integer errorCode, String errorMsg, T data) {
this.errorCode = errorCode;
this.errorMsg = errorMsg;
this.data = data;
}
/**
* 配合静态对象直接设置 data 参数
* @param data
* @return
*/
public ErrorMsg setNewData(T data) {
ErrorMsg error = new ErrorMsg();
error.setErrorCode(this.errorCode);
error.setErrorMsg(this.errorMsg);
error.setErrorDetail(this.errorDetail);
error.setData(data);
return error;
}
/**
* 配合静态对象直接设置 errorMsg 参数
* @param errorMsg
* @return
*/
public ErrorMsg setNewErrorMsg(String errorMsg) {
ErrorMsg error = new ErrorMsg();
error.setErrorCode(this.errorCode);
error.setErrorMsg(errorMsg);
error.setErrorDetail(this.errorDetail);
error.setData(this.data);
return error;
}
public static final ErrorMsg SUCCESS = new ErrorMsg(200, "成功");
public static final ErrorMsg INSERT_SUCCESS = new ErrorMsg(200, "新增成功");
public static final ErrorMsg UPDATE_SUCCESS = new ErrorMsg(200, "更新成功");
public static final ErrorMsg SAVE_SUCCESS = new ErrorMsg(200, "保存成功");
public static final ErrorMsg DELETE_SUCCESS = new ErrorMsg(200, "删除成功");
public static final ErrorMsg UPLOAD_SUCCESS = new ErrorMsg(200, "上传成功");
public static final ErrorMsg DOWNLOAD_SUCCESS = new ErrorMsg(200, "下载成功");
public static final ErrorMsg LOGIN_SUCCESS = new ErrorMsg(200, "登陆成功");
public static final ErrorMsg LOGOUT_SUCCESS = new ErrorMsg(200, "登出成功");
public static final ErrorMsg LOGIN_ERROR = new ErrorMsg(201, "登陆错误");
public static final ErrorMsg LOGIN_EXPIRE = new ErrorMsg(202, "登陆过期");
public static final ErrorMsg ACCESS_LIMITED = new ErrorMsg(301, "访问受限");
public static final ErrorMsg ARGS_ERROR = new ErrorMsg(501, "参数错误");
public static final ErrorMsg UNKOWN_ERROR = new ErrorMsg(502, "系统异常");
public static final ErrorMsg ERROR = new ErrorMsg(503, "失败");
public static final ErrorMsg SAVE_ERROR = new ErrorMsg(503, "保存错误");
public static final ErrorMsg SELECT_ERROR = new ErrorMsg(503, "查询错误");
public static final ErrorMsg INSERT_ERROR = new ErrorMsg(503, "新增错误");
public static final ErrorMsg UPDATE_ERROR = new ErrorMsg(503, "更新错误");
public static final ErrorMsg DELETE_ERROR = new ErrorMsg(503, "删除错误");
public static final ErrorMsg UPLOAD_ERROR = new ErrorMsg(503, "上传错误");
public static final ErrorMsg DOWNLOAD_ERROR = new ErrorMsg(503, "下载错误");
public static final ErrorMsg OTHER_SYSTEM_ERROR = new ErrorMsg(504, "调用系统异常");
}
package com.mortals.xhx.entity;
import lombok.Data;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 分页实体类,通过配置文件对 page, limit 进行默认值注入
*/
@Data
@Component
public class PageEntity<T> {
// 数据
private T data;
// 页码
private Integer page;
// 每页条数
private Integer limit;
// 数据总条数
private Long total;
// 总页数
private Integer totalPage;
public PageEntity() {}
public PageEntity(Integer page, Integer limit, Long total) {
this.page = page;
this.limit = limit;
this.total = total;
}
public PageEntity(Integer page, Integer limit, Integer total) {
this.page = page;
this.limit = limit;
this.total = total.longValue();
}
/**
* 计算分页起始索引
* @param page
* @param limit
* @return
*/
public static Integer startIndex(Integer page, Integer limit) {
return (page - 1) * limit;
}
/**
* 计算分页结束索引
* @param page
* @param limit
* @param total
* @return
*/
public static Integer endIndex(Integer page, Integer limit, Integer total) {
Integer endDataIndexAddOne;
if ((page - 1) * limit + limit > total) {
endDataIndexAddOne = total;
} else {
endDataIndexAddOne = (page - 1) * limit + limit;
}
return endDataIndexAddOne;
}
/**
* 计算总页数
*/
public Integer calculateTotalPage() {
if (this.limit != null && this.total != null) {
this.totalPage = (this.total.intValue() - 1) / this.limit + 1;
}
return this.totalPage;
}
/**
* 人工分页
* @param page 第几页
* @param limit 每页几条
* @param dataList 数据总列表
* @return
*/
public List<T> pageData(Integer page, Integer limit, Integer total, List<T> dataList) {
// 起始数据索引
Integer startDataIndex = startIndex(page, limit);
// 结束索引,最后一位不会被算进去
Integer endDataIndexAddOne = endIndex(page, limit, total);
return dataList.subList(startDataIndex, endDataIndexAddOne);
}
}
package com.mortals.xhx.exception;
import com.mortals.xhx.entity.ErrorMsg;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* 全局异常拦截器
* @author: linjinp
* @create: 2019-05-08 11:16
**/
@ControllerAdvice
@ResponseBody
@Configuration
public class GlobalExceptionHandler {
@ExceptionHandler(value = Exception.class)
public ErrorMsg exceptionHandler(Exception e){
e.printStackTrace();
ErrorMsg errorMsg = ErrorMsg.UNKOWN_ERROR;
errorMsg.setErrorDetail(e.toString());
return errorMsg;
}
}
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mortals.xhx.flowable.conf;
import org.flowable.ui.modeler.rest.app.EditorGroupsResource;
import org.flowable.ui.modeler.rest.app.EditorUsersResource;
import org.flowable.ui.modeler.rest.app.StencilSetResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
@Configuration
@ComponentScan(value = { "org.flowable.ui.modeler.rest.app",
// 不加载 rest,因为 getAccount 接口需要我们自己实现
// "org.flowable.ui.common.rest"
},excludeFilters = {
// 移除 EditorUsersResource 与 EditorGroupsResource,因为不使用 IDM 部分
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = EditorUsersResource.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = EditorGroupsResource.class),
// 配置文件用自己的
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = StencilSetResource.class),
}
)
@EnableAsync
public class AppDispatcherServletConfiguration implements WebMvcRegistrations {
private static final Logger LOGGER = LoggerFactory.getLogger(AppDispatcherServletConfiguration.class);
@Bean
public SessionLocaleResolver localeResolver() {
return new SessionLocaleResolver();
}
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
LOGGER.debug("Configuring localeChangeInterceptor");
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
return localeChangeInterceptor;
}
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
LOGGER.debug("Creating requestMappingHandlerMapping");
RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
requestMappingHandlerMapping.setRemoveSemicolonContent(false);
Object[] interceptors = { localeChangeInterceptor() };
requestMappingHandlerMapping.setInterceptors(interceptors);
return requestMappingHandlerMapping;
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mortals.xhx.flowable.conf;
import org.flowable.ui.common.service.idm.RemoteIdmService;
import org.flowable.ui.modeler.properties.FlowableModelerAppProperties;
import org.flowable.ui.modeler.servlet.ApiDispatcherServletConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
@Configuration
@EnableConfigurationProperties(FlowableModelerAppProperties.class)
@ComponentScan(basePackages = {
// "org.flowable.ui.modeler.conf",
"org.flowable.ui.modeler.repository",
"org.flowable.ui.modeler.service",
// "org.flowable.ui.modeler.security", //授权方面的都不需要
// "org.flowable.ui.common.conf", // flowable 开发环境内置的数据库连接
// "org.flowable.ui.common.filter", // IDM 方面的过滤器
"org.flowable.ui.common.service",
"org.flowable.ui.common.repository",
//
// "org.flowable.ui.common.security",//授权方面的都不需要
"org.flowable.ui.common.tenant" },excludeFilters = {
// 移除 RemoteIdmService
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = RemoteIdmService.class),
}
)
public class ApplicationConfiguration {
@Bean
public ServletRegistrationBean modelerApiServlet(ApplicationContext applicationContext) {
AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
dispatcherServletConfiguration.setParent(applicationContext);
dispatcherServletConfiguration.register(ApiDispatcherServletConfiguration.class);
DispatcherServlet servlet = new DispatcherServlet(dispatcherServletConfiguration);
ServletRegistrationBean registrationBean = new ServletRegistrationBean(servlet, "/api/*");
registrationBean.setName("Flowable Modeler App API Servlet");
registrationBean.setLoadOnStartup(1);
registrationBean.setAsyncSupported(true);
return registrationBean;
}
}
package com.mortals.xhx.flowable.conf;
import liquibase.Liquibase;
import liquibase.database.Database;
import liquibase.database.DatabaseConnection;
import liquibase.database.DatabaseFactory;
import liquibase.database.jvm.JdbcConnection;
import liquibase.exception.DatabaseException;
import liquibase.resource.ClassLoaderResourceAccessor;
import lombok.extern.apachecommons.CommonsLog;
import org.flowable.ui.common.service.exception.InternalServerErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
//@Configuration
@CommonsLog
public class DatabaseAutoConfiguration {
protected static final String LIQUIBASE_CHANGELOG_PREFIX = "ACT_DE_";
@Bean
public Liquibase liquibase(DataSource dataSource) {
log.info("Configuring Liquibase");
Liquibase liquibase = null;
try {
DatabaseConnection connection = new JdbcConnection(dataSource.getConnection());
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
database.setDatabaseChangeLogTableName(LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
database.setDatabaseChangeLogLockTableName(LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());
liquibase = new Liquibase("META-INF/liquibase/flowable-modeler-app-db-changelog.xml", new ClassLoaderResourceAccessor(), database);
liquibase.update("flowable");
return liquibase;
} catch (Exception e) {
log.error("liquibase error",e);
throw new InternalServerErrorException("Error creating liquibase database", e);
} finally {
closeDatabase(liquibase);
}
}
private void closeDatabase(Liquibase liquibase) {
if (liquibase != null) {
Database database = liquibase.getDatabase();
if (database != null) {
try {
database.close();
} catch (DatabaseException e) {
log.warn("Error closing database", e);
}
}
}
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mortals.xhx.flowable.conf;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.flowable.ui.common.service.exception.InternalServerErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/app")
public class FlowableStencilSetResource {
private static final Logger LOGGER = LoggerFactory.getLogger(FlowableStencilSetResource.class);
@Autowired
protected ObjectMapper objectMapper;
@RequestMapping(value = "/rest/stencil-sets/editor", method = RequestMethod.GET, produces = "application/json")
public JsonNode getStencilSetForEditor() {
try {
JsonNode stencilNode = objectMapper.readTree(this.getClass().getClassLoader().getResourceAsStream("stencilset/stencilset_bpmn.json"));
return stencilNode;
} catch (Exception e) {
LOGGER.error("Error reading bpmn stencil set json", e);
throw new InternalServerErrorException("Error reading bpmn stencil set json");
}
}
@RequestMapping(value = "/rest/stencil-sets/cmmneditor", method = RequestMethod.GET, produces = "application/json")
public JsonNode getCmmnStencilSetForEditor() {
try {
JsonNode stencilNode = objectMapper.readTree(this.getClass().getClassLoader().getResourceAsStream("stencilset/stencilset_cmmn.json"));
return stencilNode;
} catch (Exception e) {
LOGGER.error("Error reading bpmn stencil set json", e);
throw new InternalServerErrorException("Error reading bpmn stencil set json");
}
}
}
package com.mortals.xhx.flowable.controller;
import org.flowable.ui.common.model.UserRepresentation;
import org.flowable.ui.common.security.DefaultPrivileges;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* Flowable 相关接口
*/
@RestController
@RequestMapping("/login")
public class FlowableController {
/**
* 获取默认的管理员信息
* @return
*/
@RequestMapping(value = "/rest/account", method = RequestMethod.GET, produces = "application/json")
public UserRepresentation getAccount() {
UserRepresentation userRepresentation = new UserRepresentation();
userRepresentation.setId("admin");
userRepresentation.setEmail("admin@flowable.org");
userRepresentation.setFullName("Administrator");
// userRepresentation.setLastName("Administrator");
userRepresentation.setFirstName("Administrator");
List<String> privileges = new ArrayList<>();
privileges.add(DefaultPrivileges.ACCESS_MODELER);
privileges.add(DefaultPrivileges.ACCESS_IDM);
privileges.add(DefaultPrivileges.ACCESS_ADMIN);
privileges.add(DefaultPrivileges.ACCESS_TASK);
privileges.add(DefaultPrivileges.ACCESS_REST_API);
userRepresentation.setPrivileges(privileges);
return userRepresentation;
}
}
package com.mortals.xhx.flowable.dao;
public interface TestDao {
String test();
}
package com.mortals.xhx.flowable.listener;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.engine.impl.el.FixedValue;
import org.flowable.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* 会签监听器示例
*/
@Component
public class MyListener implements ExecutionListener {
// 页面配置参数注入
private FixedValue num;
@Autowired
private RuntimeService runtimeService;
private static MyListener myListener;
// 解决监听器中 Bean 获取不到问题
@PostConstruct
public void init() {
myListener = this;
myListener.runtimeService = this.runtimeService;
}
@Override
public void notify(DelegateExecution delegateExecution) {
// 调用 runtimeService 示例
ProcessInstance processInstance = myListener.runtimeService.createProcessInstanceQuery().processInstanceId(delegateExecution.getProcessInstanceId()).singleResult();
System.out.println(processInstance.getProcessDefinitionId());
// 获取页面配置参数的值
System.out.println(num.getExpressionText());
// 校验 okNum 是否已经存在
if (!delegateExecution.hasVariable("okNum")) {
delegateExecution.setVariable("okNum", 0);
}
// 已审核次数,审核一次 +1
int okNum = (int) delegateExecution.getVariable("okNum") + 1;
delegateExecution.setVariable("okNum", okNum);
}
}
package com.mortals.xhx.interceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @Author: linjinp
* @Date: 2019/1/2 12:35
*/
@Configuration
@Component
public class CorsInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
// 添加跨域CORS
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Headers", "Origin,X-Requested-With,Content-Type,Accept,Authorization,token, x-token");
response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
return true;
}
}
/**
* Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package com.mortals.xhx.util;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 日期工具类, 继承org.apache.commons.lang.time.DateUtils类
*
* @author jeeplus
* @version 2014-4-15
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
/**
* 得到当前日期字符串 格式(yyyy-MM-dd)
*/
public static String getDate() {
return getDate("yyyy-MM-dd");
}
/**
* 得到当前日期字符串 格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
*/
public static String getDate(String pattern) {
return DateFormatUtils.format(new Date(), pattern);
}
/**
* 得到日期字符串 默认格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
*/
public static String formatDate(Date date, Object... pattern) {
String formatDate = null;
if (pattern != null && pattern.length > 0) {
formatDate = DateFormatUtils.format(date, pattern[0].toString());
} else {
formatDate = DateFormatUtils.format(date, "yyyy-MM-dd");
}
return formatDate;
}
public static String formatDate1() {
String formatDate = DateFormatUtils.format(new Date(), "yyyyMMdd");
return formatDate;
}
/**
* 得到日期时间字符串,转换格式(yyyy-MM-dd HH:mm:ss)
*/
public static String formatDateTime(Date date) {
return formatDate(date, "yyyy-MM-dd HH:mm:ss");
}
/**
* 得到当前时间字符串 格式(HH:mm:ss)
*/
public static String getTime() {
return formatDate(new Date(), "HH:mm:ss");
}
/**
* 得到当前日期和时间字符串 格式(yyyy-MM-dd HH:mm:ss)
*/
public static String getDateTime() {
return formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
}
/**
* 得到当前年份字符串 格式(yyyy)
*/
public static String getYear() {
return formatDate(new Date(), "yyyy");
}
/**
* 得到当前月份字符串 格式(MM)
*/
public static String getMonth() {
return formatDate(new Date(), "MM");
}
/**
* 得到当天字符串 格式(dd)
*/
public static String getDay() {
return formatDate(new Date(), "dd");
}
/**
* 得到当前星期字符串 格式(E)星期几
*/
public static String getWeek() {
return formatDate(new Date(), "E");
}
/**
* 日期型字符串转化为日期 格式
* { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm",
* "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm",
* "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm" }
*/
public static Date parseDate(Object str) {
if (str == null) {
return null;
}
try {
return parseDate(str.toString(), parsePatterns);
} catch (ParseException e) {
return null;
}
}
/**
* 获取过去的天数
*
* @param date
* @return
*/
public static long pastDays(Date date) {
long t = new Date().getTime() - date.getTime();
return t / (24 * 60 * 60 * 1000);
}
/**
* 获取过去的小时
*
* @param date
* @return
*/
public static long pastHour(Date date) {
long t = new Date().getTime() - date.getTime();
return t / (60 * 60 * 1000);
}
/**
* 获取过去的分钟
*
* @param date
* @return
*/
public static long pastMinutes(Date date) {
long t = new Date().getTime() - date.getTime();
return t / (60 * 1000);
}
/**
* 转换为时间(天,时:分:秒.毫秒)
*
* @param timeMillis
* @return
*/
public static String formatDateTime(long timeMillis) {
long day = timeMillis / (24 * 60 * 60 * 1000);
long hour = (timeMillis / (60 * 60 * 1000) - day * 24);
long min = ((timeMillis / (60 * 1000)) - day * 24 * 60 - hour * 60);
long s = (timeMillis / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
long sss = (timeMillis - day * 24 * 60 * 60 * 1000 - hour * 60 * 60 * 1000 - min * 60 * 1000 - s * 1000);
return (day > 0 ? day + "," : "") + hour + ":" + min + ":" + s + "." + sss;
}
/**
* 获取两个日期之间的天数
*
* @param before
* @param after
* @return
*/
public static double getDistanceOfTwoDate(Date before, Date after) {
long beforeTime = before.getTime();
long afterTime = after.getTime();
return (afterTime - beforeTime) / (1000 * 60 * 60 * 24);
}
/**
* 根据指定的类型对时间进行转换
*
* @param date
* @param format
* @return
*/
public static String getDateFormat(Date date, String format) {
SimpleDateFormat df = new SimpleDateFormat(format);
return df.format(date);
}
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(formatDateTime(new Date()));
}
}
package com.mortals.xhx.util;
import java.util.UUID;
/**
* 生成 Guid 作为 Id
* @author: linjinp
* @create: 2019-04-22 10:47
* @throw
**/
public class GuidUtil {
/**
* UUID类来生成GUID
* @return
*/
public static String guid() {
return UUID.randomUUID().toString();
}
public static void main(String[] args) {
System.out.println(guid());
}
}
package com.mortals.xhx.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.SimpleDateFormatSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Json 工具类
*/
public class JsonUtil {
private final static Logger logger = LoggerFactory.getLogger(JsonUtil.class);
private static SerializeConfig config;
static {
config = new SerializeConfig();
config.put(Date.class, new SimpleDateFormatSerializer("yyyy-MM-dd HH:mm:ss"));
}
private static final SerializerFeature[] features = {
// 输出空置字段
SerializerFeature.WriteMapNullValue,
// list字段如果为null,输出为[],而不是null
SerializerFeature.WriteNullListAsEmpty,
// 数值字段如果为null,输出为0,而不是null
SerializerFeature.WriteNullNumberAsZero,
// Boolean字段如果为null,输出为false,而不是null
SerializerFeature.WriteNullBooleanAsFalse,
// 字符类型字段如果为null,输出为"",而不是null
SerializerFeature.WriteNullStringAsEmpty
};
/** Object TO Json String 字符串输出 */
public static String toJSON(Object object) {
try {
return JSON.toJSONString(object, config, features);
} catch (Exception e) {
logger.error("JsonUtil | method=toJSON() | 对象转为Json字符串 Error!" + e.getMessage(), e);
}
return null;
}
/** 转换为数组 Object */
public static Object[] toArray(String text) {
try {
return toArray(text, null);
} catch (Exception e) {
logger.error("JsonUtil | method=toArray() | 将json格式的数据转换为数组 Object Error!" + e.getMessage(), e);
}
return null;
}
/** 转换为数组 (可指定类型) */
public static <T> Object[] toArray(String text, Class<T> clazz) {
try {
return JSON.parseArray(text, clazz).toArray();
} catch (Exception e) {
logger.error("JsonUtil | method=toArray() | 将json格式的数据转换为数组 (可指定类型) Error!" + e.getMessage(), e);
}
return null;
}
/** Json 转为 Jave Bean */
public static <T> T toBean(String text, Class<T> clazz) {
try {
return JSON.parseObject(text, clazz);
} catch (Exception e) {
logger.error("JsonUtil | method=toBean() | Json 转为 Jave Bean Error!" + e.getMessage(), e);
}
return null;
}
/** Json 转为 Map */
public static Map<?, ?> toMap(String json) {
try {
return JSON.parseObject(json);
} catch (Exception e) {
logger.error("JsonUtil | method=toMap() | Json 转为 Map {},{}" + e.getMessage(), e);
}
return null;
}
/** Json 转 List,Class 集合中泛型的类型,非集合本身,可json-lib兼容的日期格式 */
public static <T> List<T> toList(String text, Class<T> clazz) {
try {
return JSON.parseArray(text, clazz);
} catch (Exception e) {
logger.error("JsonUtil | method=toList() | Json 转为 List {},{}" + e.getMessage(), e);
}
return null;
}
/** 从json字符串获取指定key的字符串 */
public static Object getValueFromJson(final String json, final String key) {
try {
if (json == null || key == null) {
return null;
}
return JSON.parseObject(json).getString(key);
} catch (Exception e) {
logger.error("JsonUtil | method=getStringFromJson() | 从json获取指定key的字符串 Error!" + e.getMessage(), e);
}
return null;
}
}
package com.mortals.xhx.util;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* @Author: linjinp
* @Date: 2018/11/7 16:34
*/
public class MD5Util {
// private final static String SALT = "0fdfa5e5a88bebae640L&d88e7c84708+==";
/**
* 密码加密,加盐双层加密
*
* @param source
* @return
*/
public static String encrypt(String source, String salt) {
try {
return encodeMd5((encodeMd5(source.getBytes(StandardCharsets.UTF_8)) + salt).getBytes(StandardCharsets.UTF_8));
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
/**
* 密码加密,直接单层加密
*
* @param source
* @return
*/
public static String encrypt(String source) {
try {
return encodeMd5(source.getBytes(StandardCharsets.UTF_8));
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
private static String encodeMd5(byte[] source) {
try {
return encodeHex(MessageDigest.getInstance("MD5").digest(source));
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
private static String encodeHex(byte[] bytes) {
StringBuffer buffer = new StringBuffer(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
if (((int) bytes[i] & 0xff) < 0x10)
buffer.append("0");
buffer.append(Long.toString((int) bytes[i] & 0xff, 16));
}
return buffer.toString();
}
/**
* 密码验证
*
* @return
*/
public static void main(String[] args) {
// 随机盐值
String salt = Salt.salt();
System.out.println(salt);
// 密码加密
String code = MD5Util.encrypt("123456", "");
System.out.println(code);
}
}
package com.mortals.xhx.util;
import java.util.Date;
import java.util.Random;
/**
* 自定义编号工具类
* @author: linjinp
* @create: 2019-05-06 11:27
* @throw
**/
public class NumberUtil {
/**
* 根据传入位数生成随机数
* @param length
* @return
*/
public static String random(int length) {
String val = "";
Random random = new Random();
for (int i = 0; i < length; i++) {
val += String.valueOf(random.nextInt(10));
}
return val;
}
/**
* 根据最大位数字加一,返回生成相同位数的字符串
* @param max
* @return
*/
public static String maxNumber(String max) {
try {
Integer len = max.length();
Integer number = Integer.valueOf(max) + 1;
max = number.toString();
len = len - max.length();
for (int i = 0; i < len; i ++) {
max = "0" + max;
}
} catch (Exception e) {
return null;
}
return max;
}
/**
* 生成申请单编号
* @return
*/
public static String formNumber() {
return "PGB" + DateUtils.getDateFormat(new Date(), "yyyyMMddHHmmss") + random(3);
}
}
package com.mortals.xhx.util;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
/**
* RestTemplate 工具类
* @author: linjinp
* @create: 2019-06-05 14:06
**/
public class RestTemplateUtil {
private static class SingletonRestTemplate {
static final RestTemplate INSTANCE = new RestTemplate();
}
private RestTemplateUtil() {
}
public static RestTemplate getInstance() {
return SingletonRestTemplate.INSTANCE;
}
/**
* post 请求
* @param url
* @param data
* @param token
* @return
* @throws Exception
*/
public static String post(String url, String data, String token) {
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", "application/json");
// headers.add("Accpet-Encoding", "gzip");
headers.add("Content-Encoding", "UTF-8");
headers.add("Content-Type", "application/json; charset=UTF-8");
if (token != null) {
headers.add("Authorization", token);
}
HttpEntity<String> requestEntity = new HttpEntity<>(data, headers);
return RestTemplateUtil.getInstance().postForObject(url, requestEntity, String.class);
}
/**
* get 请求
* @param url
* @param token
* @return
*/
public static String get(String url, String token) {
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", "application/json");
// headers.add("Accpet-Encoding", "gzip");
headers.add("Content-Encoding", "UTF-8");
headers.add("Content-Type", "application/json; charset=UTF-8");
if (token != null) {
headers.add("Authorization", token);
}
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
ResponseEntity<String> response = RestTemplateUtil.getInstance().exchange(url, HttpMethod.GET, requestEntity, String.class);
String responseBody = response.getBody();
return responseBody;
}
}
package com.mortals.xhx.util;
import java.util.Random;
/**
* 随机数生成盐值
* @author: linjinp
* @create: 2019-04-17 14:36
* @throw
**/
public class Salt {
// 设置盐值的位数
private final static int NUM = 20;
/**
* 生成随机数 数字+字母组合
* n : 需要的长度
* @return
*/
public static String salt() {
String val = "";
Random random = new Random();
for ( int i = 0; i < NUM; i++ )
{
String str = random.nextInt( 2 ) % 2 == 0 ? "num" : "char";
if ( "char".equalsIgnoreCase( str ) )
{ // 产生字母
int nextInt = random.nextInt( 2 ) % 2 == 0 ? 65 : 97;
// System.out.println(nextInt + "!!!!"); 1,0,1,1,1,0,0
val += (char) ( nextInt + random.nextInt( 26 ) );
}
else if ( "num".equalsIgnoreCase( str ) )
{ // 产生数字
val += String.valueOf( random.nextInt( 10 ) );
}
}
return val;
}
}
package com.mortals.xhx.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* 获取 Bean
* @author: linjinp
* @create: 2019-12-17 13:12
**/
@Component
public class SpringUtilConfig implements ApplicationContextAware {
/**
* 当前IOC
*
*/
private static ApplicationContext applicationContext;
/**
* * 设置当前上下文环境,此方法由spring自动装配
*
*/
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
/**
* 从当前IOC获取bean
*
* @return
*
*/
public static <T> T getBean(Class<T> c) {
return applicationContext.getBean(c);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.ui.common.security;
import org.flowable.idm.api.User;
import org.flowable.ui.common.model.RemoteUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.ArrayList;
import java.util.List;
/**
* Utility class for Spring Security.
*/
public class SecurityUtils {
private static User assumeUser;
private SecurityUtils() {
}
/**
* Get the login of the current user.
*/
public static String getCurrentUserId() {
User user = getCurrentUserObject();
if (user != null) {
return user.getId();
}
return null;
}
/**
* @return the {@link User} object associated with the current logged in user.
*/
public static User getCurrentUserObject() {
if (assumeUser != null) {
return assumeUser;
}
RemoteUser user = new RemoteUser();
user.setId("admin");
user.setDisplayName("Administrator");
user.setFirstName("Administrator");
user.setLastName("Administrator");
user.setEmail("admin@flowable.com");
user.setPassword("123456");
List<String> pris = new ArrayList<>();
pris.add(DefaultPrivileges.ACCESS_MODELER);
pris.add(DefaultPrivileges.ACCESS_IDM);
pris.add(DefaultPrivileges.ACCESS_ADMIN);
pris.add(DefaultPrivileges.ACCESS_TASK);
pris.add(DefaultPrivileges.ACCESS_REST_API);
user.setPrivileges(pris);
return user;
}
public static FlowableAppUser getCurrentFlowableAppUser() {
FlowableAppUser user = null;
SecurityContext securityContext = SecurityContextHolder.getContext();
if (securityContext != null && securityContext.getAuthentication() != null) {
Object principal = securityContext.getAuthentication().getPrincipal();
if (principal instanceof FlowableAppUser) {
user = (FlowableAppUser) principal;
}
}
return user;
}
public static boolean currentUserHasCapability(String capability) {
FlowableAppUser user = getCurrentFlowableAppUser();
for (GrantedAuthority grantedAuthority : user.getAuthorities()) {
if (capability.equals(grantedAuthority.getAuthority())) {
return true;
}
}
return false;
}
public static void assumeUser(User user) {
assumeUser = user;
}
public static void clearAssumeUser() {
assumeUser = null;
}
}
>>>>>>>>>>>>>>>>>>>
>> government-flowable <<
<<<<<<<<<<<<<<<<<<<
\ No newline at end of file
server:
tomcat:
uri-encoding: utf-8
spring:
application:
name: government-flowable
profiles:
active: develop
cloud:
nacos:
# Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类
discovery:
enabled: true
encode: UTF-8
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
group: DEFAULT_GROUP
namespace: 342d427e-a226-4ade-8963-b38353acecc7
config:
enabled: true
encode: UTF-8
server-addr: ${spring.cloud.nacos.discovery.server-addr} # Nacos 服务器地址
group: ${spring.cloud.nacos.discovery.group}
namespace: ${spring.cloud.nacos.discovery.namespace} # Nacos 命名空间 dev 的编号
file-extension: yaml
mybatis:
root-path: com.mortals
type-aliases-package: com.mortals.framework.model,com.mortals.xhx.common.**.model,com.mortals.xhx.**.model
mapper-locations: mapper/*/*.xml,classpath*:mapper/*.xml,classpath:/META-INF/modeler-mybatis-mappings/*.xml
config-location: classpath*:config/mybatis-sqlmap-config.xml
# 参数配置
configuration-properties:
# 配置流程引擎参数,详情可见 DatabaseConfiguration
blobType: BLOB
boolValue: TRUE
# 不要设置库名,否则会出现双库名 bug
prefix: ''
flowable:
# 关闭异步,不关闭历史数据的插入就是异步的,会在同一个事物里面,无法回滚
# 开发可开启会提高些效率,上线需要关闭
async-executor-activate: false
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="cacheEnabled" value="false" />
<setting name="lazyLoadingEnabled" value="flase" />
<setting name="multipleResultSetsEnabled" value="true" />
<setting name="useColumnLabel" value="true" />
<setting name="useGeneratedKeys" value="false" />
<setting name="defaultExecutorType" value="REUSE" />
<!-- 是否开始sql日志控制台打印 -->
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings>
<plugins>
<plugin interceptor="com.mortals.framework.thirty.mybatis.MortalsPagePlugin">
<property name="dialect" value="MySql" />
<property name="showSql" value="MySql" />
</plugin>
</plugins>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
default-lazy-init="false" default-autowire="byType">
<!-- 事务管理对象 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 拦截模式 -->
<aop:config proxy-target-class="false">
<aop:advisor pointcut="execution(* com.mortals..*Service.*(..))" advice-ref="txAdvice" />
</aop:config>
<!-- 事务传播方式 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!--tx:method name="get*" read-only="true"/ -->
<!--<tx:method name="*" read-only="false" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException,Exception" />-->
<tx:method name="remove*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="delete*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="change*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="create*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="update*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="modify*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="execute*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="excute*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="start*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="increment*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="do*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="audit*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="notify*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="send*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="save*" propagation="REQUIRED" rollback-for="com.mortals.framework.exception.AppException" />
<tx:method name="doForce*" propagation="REQUIRES_NEW" rollback-for="com.mortals.framework.exception.AppException" />
<!--<tx:method name="*" read-only="true" />-->
</tx:attributes>
</tx:advice>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
default-autowire="byType">
<import resource="spring-config-core.xml" />
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<springProperty scope="context" name="springApplicationName" source="spring.application.name"/>
<springProperty scope="context" name="serverPort" source="server.port"/>
<springProperty scope="context" name="logFilePath" source="application.log.path" defaultValue="/mortals/www.iot.com/logs" />
<springProperty scope="context" name="logLevel" source="application.log.level" defaultValue="INFO" />
<property name="logFilePath" value="${logFilePath:-/mortals/www.iot.com/logs}" />
<property name="logLevel" value="${logLevel:-INFO}" />
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] [%.50c\(%L\)] - %msg%n</pattern>
</encoder>
</appender>
<appender name="fileInfo" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] [%.50c\(%L\)] - %msg%n</pattern>
</encoder>
<file>${logFilePath}/${springApplicationName:-default}/${serverPort:-default}-info.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logFilePath}/${springApplicationName:-default}/${serverPort:-default}-info.log.%d{yyyyMMdd}</fileNamePattern>
</rollingPolicy>
</appender>
<appender name="fileError" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] [%.50c\(%L\)] - %msg%n</pattern>
</encoder>
<file>${logFilePath}/${springApplicationName:-default}/${serverPort:-default}-error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logFilePath}/${springApplicationName:-default}/${serverPort:-default}-error.log.%d{yyyyMMdd}</fileNamePattern>
</rollingPolicy>
</appender>
<root level="${logLevel}">
<appender-ref ref="console"/>
<appender-ref ref="fileInfo"/>
<appender-ref ref="fileError"/>
</root>
</configuration>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found :(</title>
<style>
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
html {
padding: 30px 10px;
font-size: 20px;
line-height: 1.4;
color: #737373;
background: #f0f0f0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html,
input {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body {
max-width: 500px;
_width: 500px;
padding: 30px 20px 50px;
border: 1px solid #b3b3b3;
border-radius: 4px;
margin: 0 auto;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
}
h1 {
margin: 0 10px;
font-size: 50px;
text-align: center;
}
h1 span {
color: #bbb;
}
h3 {
margin: 1.5em 0 0.5em;
}
p {
margin: 1em 0;
}
ul {
padding: 0 0 0 40px;
margin: 1em 0;
}
.container {
max-width: 380px;
_width: 380px;
margin: 0 auto;
}
/* google search */
#goog-fixurl ul {
list-style: none;
padding: 0;
margin: 0;
}
#goog-fixurl form {
margin: 0;
}
#goog-wm-qt,
#goog-wm-sb {
border: 1px solid #bbb;
font-size: 16px;
line-height: normal;
vertical-align: top;
color: #444;
border-radius: 2px;
}
#goog-wm-qt {
width: 220px;
height: 20px;
padding: 5px;
margin: 5px 10px 0 0;
box-shadow: inset 0 1px 1px #ccc;
}
#goog-wm-sb {
display: inline-block;
height: 32px;
padding: 0 10px;
margin: 5px 0 0;
white-space: nowrap;
cursor: pointer;
background-color: #f5f5f5;
background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
*overflow: visible;
*display: inline;
*zoom: 1;
}
#goog-wm-sb:hover,
#goog-wm-sb:focus {
border-color: #aaa;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
background-color: #f8f8f8;
}
#goog-wm-qt:hover,
#goog-wm-qt:focus {
border-color: #105cb6;
outline: 0;
color: #222;
}
input::-moz-focus-inner {
padding: 0;
border: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Not found <span>:(</span></h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
<ul>
<li>a mistyped address</li>
<li>an out-of-date link</li>
</ul>
<script>
var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
</script>
<script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</div>
</body>
</html>
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="images/mstile-150x150.png?v=Om5N75Y123"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function _drawHumanTaskIcon(paper, startX, startY)
{
var path1 = paper.path("m 1,17 16,0 0,-1.7778 -5.333332,-3.5555 0,-1.7778 c 1.244444,0 1.244444,-2.3111 1.244444,-2.3111 l 0,-3.0222 C 12.555557,0.8221 9.0000001,1.0001 9.0000001,1.0001 c 0,0 -3.5555556,-0.178 -3.9111111,3.5555 l 0,3.0222 c 0,0 0,2.3111 1.2444443,2.3111 l 0,1.7778 L 1,15.2222 1,17 17,17");
path1.attr({
"opacity": 1,
"stroke": "none",
"fill": "#d1b575"
});
var userTaskIcon = paper.set();
userTaskIcon.push(path1);
userTaskIcon.transform("T" + startX + "," + startY);
}
function _drawServiceTaskIcon(paper, startX, startY)
{
var path1 = paper.path("M 8,1 7.5,2.875 c 0,0 -0.02438,0.250763 -0.40625,0.4375 C 7.05724,3.330353 7.04387,3.358818 7,3.375 6.6676654,3.4929791 6.3336971,3.6092802 6.03125,3.78125 6.02349,3.78566 6.007733,3.77681 6,3.78125 5.8811373,3.761018 5.8125,3.71875 5.8125,3.71875 l -1.6875,-1 -1.40625,1.4375 0.96875,1.65625 c 0,0 0.065705,0.068637 0.09375,0.1875 0.002,0.00849 -0.00169,0.022138 0,0.03125 C 3.6092802,6.3336971 3.4929791,6.6676654 3.375,7 3.3629836,7.0338489 3.3239228,7.0596246 3.3125,7.09375 3.125763,7.4756184 2.875,7.5 2.875,7.5 L 1,8 l 0,2 1.875,0.5 c 0,0 0.250763,0.02438 0.4375,0.40625 0.017853,0.03651 0.046318,0.04988 0.0625,0.09375 0.1129372,0.318132 0.2124732,0.646641 0.375,0.9375 -0.00302,0.215512 -0.09375,0.34375 -0.09375,0.34375 L 2.6875,13.9375 4.09375,15.34375 5.78125,14.375 c 0,0 0.1229911,-0.09744 0.34375,-0.09375 0.2720511,0.147787 0.5795915,0.23888 0.875,0.34375 0.033849,0.01202 0.059625,0.05108 0.09375,0.0625 C 7.4756199,14.874237 7.5,15.125 7.5,15.125 L 8,17 l 2,0 0.5,-1.875 c 0,0 0.02438,-0.250763 0.40625,-0.4375 0.03651,-0.01785 0.04988,-0.04632 0.09375,-0.0625 0.332335,-0.117979 0.666303,-0.23428 0.96875,-0.40625 0.177303,0.0173 0.28125,0.09375 0.28125,0.09375 l 1.65625,0.96875 1.40625,-1.40625 -0.96875,-1.65625 c 0,0 -0.07645,-0.103947 -0.09375,-0.28125 0.162527,-0.290859 0.262063,-0.619368 0.375,-0.9375 0.01618,-0.04387 0.04465,-0.05724 0.0625,-0.09375 C 14.874237,10.52438 15.125,10.5 15.125,10.5 L 17,10 17,8 15.125,7.5 c 0,0 -0.250763,-0.024382 -0.4375,-0.40625 C 14.669647,7.0572406 14.641181,7.0438697 14.625,7 14.55912,6.8144282 14.520616,6.6141566 14.4375,6.4375 c -0.224363,-0.4866 0,-0.71875 0,-0.71875 L 15.40625,4.0625 14,2.625 l -1.65625,1 c 0,0 -0.253337,0.1695664 -0.71875,-0.03125 l -0.03125,0 C 11.405359,3.5035185 11.198648,3.4455201 11,3.375 10.95613,3.3588185 10.942759,3.3303534 10.90625,3.3125 10.524382,3.125763 10.5,2.875 10.5,2.875 L 10,1 8,1 z m 1,5 c 1.656854,0 3,1.3431458 3,3 0,1.656854 -1.343146,3 -3,3 C 7.3431458,12 6,10.656854 6,9 6,7.3431458 7.3431458,6 9,6 z");
path1.attr({
"opacity": 1,
"stroke": "none",
"fill": "#72a7d0"
});
var serviceTaskIcon = paper.set();
serviceTaskIcon.push(path1);
serviceTaskIcon.transform("T" + startX + "," + startY);
}
function _drawCaseTaskIcon(paper, startX, startY)
{
var path1 = paper.path("M5 8 L9 4 L18 4 L 21 7");
path1.attr({
"opacity": 1,
"stroke": "#000000",
"fill": "#000000"
});
var path2 = paper.path("M1 23 L1 4 L30 4 L30 23z");
path2.attr({
"opacity": 1,
"stroke": "#000000",
"fill": "#F4F6F7"
});
var caseTaskIcon = paper.set();
caseTaskIcon.push(path1);
caseTaskIcon.push(path2);
caseTaskIcon.translate(startX, startY);
caseTaskIcon.scale(0.7, 0.7);
}
function _drawProcessTaskIcon(paper, startX, startY)
{
var path1 = paper.path("M1 23 L7 11 L1 0 L30 0 L 35 11 L 30 23z");
path1.attr({
"opacity": 1,
"stroke": "#000000",
"fill": "#F4F6F7"
});
var processTaskIcon = paper.set();
processTaskIcon.push(path1);
processTaskIcon.translate(startX, startY);
processTaskIcon.scale(0.7, 0.7);
}
function _drawDecisionTaskIcon(paper, startX, startY)
{
var path1 = paper.path("m 1,2 0,14 16,0 0,-14 z m 1.9,2.4000386 3.7,0 0,2.7999224 -3.7,0 z m 4.36364,0 3.7,0 0,2.7999224 -3.7,0 z m 4.36364,0 3.7,0 0,2.7999224 -3.7,0 z m -8.67364,3.9 3.7,0 0,2.7999224 -3.7,0 z m 4.36364,0 3.7,0 0,2.7999224 -3.7,0 z m 4.36364,0 3.7,0 0,2.7999224 -3.7,0 z m -8.67364,3.9 3.7,0 0,2.7999224 -3.7,0 z m 4.36364,0 3.7,0 0,2.7999224 -3.7,0 z m 4.36364,0 3.7,0 0,2.7999224 -3.7,0 z");
path1.attr({
"opacity": 1,
"stroke": "#000000",
"fill": "#F4F6F7"
});
var decisionTaskIcon = paper.set();
decisionTaskIcon.push(path1);
decisionTaskIcon.translate(startX, startY);
decisionTaskIcon.scale(0.7, 0.7);
}
function _drawHttpTaskIcon(paper, startX, startY)
{
var path = paper.path("m 16.704699,5.9229055 q 0.358098,0 0.608767,0.2506681 0.250669,0.250668 0.250669,0.6087677 0,0.3580997 -0.250669,0.6087677 -0.250669,0.2506679 -0.608767,0.2506679 -0.358098,0 -0.608767,-0.2506679 -0.250669,-0.250668 -0.250669,-0.6087677 0,-0.3580997 0.250669,-0.6087677 0.250669,-0.2506681 0.608767,-0.2506681 z m 2.578308,-2.0053502 q -2.229162,0 -3.854034,0.6759125 -1.624871,0.6759067 -3.227361,2.2694472 -0.716197,0.725146 -1.575633,1.7457293 L 7.2329969,8.7876913 Q 7.0897576,8.8055849 7.000233,8.9309334 L 4.9948821,12.368677 q -0.035811,0.06267 -0.035811,0.143242 0,0.107426 0.080572,0.205905 l 0.5729577,0.572957 q 0.125334,0.116384 0.2864786,0.07162 l 2.4708789,-0.760963 2.5156417,2.515645 -0.76096,2.470876 q -0.009,0.02687 -0.009,0.08057 0,0.125338 0.08058,0.205905 l 0.572957,0.572958 q 0.170096,0.152194 0.349146,0.04476 l 3.437744,-2.005351 q 0.125335,-0.08953 0.143239,-0.232763 l 0.17905,-3.392986 q 1.02058,-0.859435 1.745729,-1.575629 1.67411,-1.6830612 2.309735,-3.2049805 0.635625,-1.5219191 0.635625,-3.8585111 0,-0.1253369 -0.08505,-0.2148575 -0.08505,-0.089526 -0.201431,-0.089526 z");
path.attr({
"opacity": 1,
"stroke": "none",
"fill": "#16964d"
});
startX += -2;
startY += -2;
path.transform("T" + startX + "," + startY);
}
function _drawBusinessRuleTaskIcon(paper, startX, startY) {
var path1 = paper.path("m 1,2 0,14 16,0 0,-14 z m 1.45458,5.6000386 2.90906,0 0,2.7999224 -2.90906,0 z m 4.36364,0 8.72718,0 0,2.7999224 -8.72718,0 z m -4.36364,4.1998844 2.90906,0 0,2.800116 -2.90906,0 z m 4.36364,0 8.72718,0 0,2.800116 -8.72718,0 z");
path1.attr({
"stroke": "none",
"fill": "#72a7d0"
});
var businessRuleTaskIcon = paper.set();
businessRuleTaskIcon.push(path1);
businessRuleTaskIcon.transform("T" + startX + "," + startY);
}
function _drawTimerEventListenerIcon(paper, element)
{
var x = element.x + (element.width / 2);
var y = element.y + (element.height / 2);
var circle = paper.circle(x, y, 10);
circle.attr({"stroke-width": 1,
"stroke": "black",
"fill": "none"
});
var path = paper.path("M 10 0 C 4.4771525 0 0 4.4771525 0 10 C 0 15.522847 4.4771525 20 10 20 C 15.522847 20 20 15.522847 20 10 C 20 4.4771525 15.522847 1.1842379e-15 10 0 z M 9.09375 1.03125 C 9.2292164 1.0174926 9.362825 1.0389311 9.5 1.03125 L 9.5 3.5 L 10.5 3.5 L 10.5 1.03125 C 15.063526 1.2867831 18.713217 4.9364738 18.96875 9.5 L 16.5 9.5 L 16.5 10.5 L 18.96875 10.5 C 18.713217 15.063526 15.063526 18.713217 10.5 18.96875 L 10.5 16.5 L 9.5 16.5 L 9.5 18.96875 C 4.9364738 18.713217 1.2867831 15.063526 1.03125 10.5 L 3.5 10.5 L 3.5 9.5 L 1.03125 9.5 C 1.279102 5.0736488 4.7225326 1.4751713 9.09375 1.03125 z M 9.5 5 L 9.5 8.0625 C 8.6373007 8.2844627 8 9.0680195 8 10 C 8 11.104569 8.8954305 12 10 12 C 10.931981 12 11.715537 11.362699 11.9375 10.5 L 14 10.5 L 14 9.5 L 11.9375 9.5 C 11.756642 8.7970599 11.20294 8.2433585 10.5 8.0625 L 10.5 5 L 9.5 5 z");
path.attr({
"stroke": "none",
"fill": "#585858"
});
path.transform("T" + (element.x + 5) + "," + (element.y + 5));
return path;
}
function _drawUserEventListenerIcon(paper, element) {
var userTaskIcon = paper.set();
var path1 = paper.path("M0.585,24.167h24.083v-7.833c0,0-2.333-3.917-7.083-5.167h-9.25 c-4.417,1.333-7.833,5.75-7.833,5.75L0.585,24.167z");
path1.attr({"opacity": 1, "stroke": "none", "fill": "#F4F6F7"});
userTaskIcon.push(path1);
var path2 = paper.path("M6,20L6,24");
path2.attr({"opacity": 1, "stroke": "white", "fill": "none"});
userTaskIcon.push(path2);
var path3 = paper.path("M20,20L20,24");
path3.attr({"opacity": 1, "stroke": "white", "fill": "none"});
userTaskIcon.push(path3);
var circle = paper.circle(13.002, 5.916, 5.417);
circle.attr({"stroke-width": 1, "stroke": "black", "fill": "#000000"});
userTaskIcon.push(circle);
var path4 = paper.path("M8.043,7.083c0,0,2.814-2.426,5.376-1.807s4.624-0.693,4.624-0.693 c0.25,1.688,0.042,3.75-1.458,5.584c0,0,1.083,0.75,1.083,1.5s0.125,1.875-1,3s-5.5,1.25-6.75,0S8.668,12.834,8.668,12 s0.583-1.25,1.25-1.917C8.835,9.5,7.419,7.708,8.043,7.083z");
path4.attr({"opacity": 1, "stroke": "none", "fill": "#F0EFF0"});
userTaskIcon.push(path4);
var x = (element.width / 2) - 2;
var y = (element.height / 2) - 2;
var circle2 = paper.circle(x, y, 17);
circle2.attr({"stroke-width": 1, "stroke": "#F0EFF0", "fill": "none"});
userTaskIcon.push(circle2);
userTaskIcon.transform("S0.7,0.7" + "T" + (element.x + 2) + "," + (element.y + 2));
return userTaskIcon;
}
div[class*='ui-tooltip-flowable-'] {
background-color: #ffffff;
border-color: #c5c5c5;
color: #4a4a4a;
font-family: Verdana;
font-size: 12px;
}
div[class*='ui-tooltip-flowable-'] .qtip-content {
color: #4a4a4a;
background-color: #ffffff;
font-family: Verdana;
font-size: 12px;
}
.ui-tooltip-flowable-cmmn .qtip-titlebar {
color: #FFFFFF;
font-size: 12px;
background: #2B414F;
}
.ui-tooltip-flowable-cmmn .qtip-tip {
background-color: #2B414F;
}
<html>
<head>
<link type="text/css" rel="stylesheet" href="display/jquery.qtip.min.css" />
<link type="text/css" rel="stylesheet" href="display-cmmn/displaymodel.css" />
<script type="text/javascript" src="display/jquery.qtip.min.js"></script>
<script type="text/javascript" src="display/raphael.min.js"></script>
<script type="text/javascript" src="display-cmmn/cmmn-draw.js"></script>
<script type="text/javascript" src="display-cmmn/cmmn-icons.js"></script>
<script type="text/javascript" src="display/Polyline.js"></script>
<script type="text/javascript" src="display-cmmn/displaymodel.js"></script>
</head>
</html>
\ No newline at end of file
/* qTip2 v2.2.0 basic css3 | qtip2.com | Licensed MIT, GPL | Wed Dec 18 2013 05:02:24 */
.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111} .qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1} .qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030} .qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0} .qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252} .qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0} .qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:0;top:0;width:100%;height:100%}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment