Commit bdfacdfa authored by abc's avatar abc

初始化项目

parents
Pipeline #526 canceled with stages
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# 依赖于环境的 Maven 主目录路径
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="sgapp" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://nuget.tohi.cn/repository/maven-public/" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JsCompilerArguments">
<option name="sourceMapEmbedSources" />
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="aopalliance-1.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aopalliance-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-beanutils-1.8.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-collections-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-lang-2.5.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-logging-1.1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-core-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-frontend-jaxrs-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-rs-extension-providers-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-transports-http-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-transports-http-jetty-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/db2jcc.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/db2jcc_license_cu.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/ezmorph-1.0.6.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-annotations-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-core-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-databind-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-jaxrs-base-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-jaxrs-json-provider-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-module-jaxb-annotations-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.annotation-api-1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.servlet-api-3.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.ws.rs-api-2.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-continuation-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-http-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-io-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-security-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-server-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-util-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/json.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/json-lib-2.4-jdk15.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/log4j-1.2.17.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/ojdbc6.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/slf4j-api-1.7.12.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.7.12.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-aop-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-beans-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-context-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-core-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-expression-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-web-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/stax2-api-3.1.4.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/woodstox-core-asl-4.4.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/xmlschema-core-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="aopalliance-1.0 (2)">
<CLASSES>
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aopalliance-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-beanutils-1.8.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-collections-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-lang-2.5.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-logging-1.1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-core-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-frontend-jaxrs-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-rs-extension-providers-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-transports-http-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/cxf-rt-transports-http-jetty-3.1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/db2jcc.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/db2jcc_license_cu.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/ezmorph-1.0.6.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-annotations-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-core-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-databind-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-jaxrs-base-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-jaxrs-json-provider-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jackson-module-jaxb-annotations-2.6.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.annotation-api-1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.servlet-api-3.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.ws.rs-api-2.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-continuation-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-http-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-io-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-security-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-server-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jetty-util-9.2.10.v20150310.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/json.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/json-lib-2.4-jdk15.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/log4j-1.2.17.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/ojdbc6.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/slf4j-api-1.7.12.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.7.12.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-aop-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-beans-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-context-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-core-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-expression-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-web-4.2.0.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/stax2-api-3.1.4.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/woodstox-core-asl-4.4.1.jar!/" />
<root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/xmlschema-core-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib" recursive="false" />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<name>sgapp</name>
<groupId>sgapp</groupId>
<artifactId>sgapp</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<finalName>sgapp</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.7</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8888</port>
<maxIdleTime>30000</maxIdleTime>
</connector>
</connectors>
<webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</webAppSourceDirectory>
<contextPath>/</contextPath>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<cxf.version>3.1.2</cxf.version>
<jackson.version>2.6.0</jackson.version>
<spring.version>4.2.0.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>${cxf.version}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.fasterxml.jackson.jaxrs</groupId>-->
<!--<artifactId>jackson-jaxrs-json-provider</artifactId>-->
<!--<version>${jackson.version}</version>-->
<!--</dependency>-->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!--<dependency>-->
<!--<groupId>ibm.db2</groupId>-->
<!--<artifactId>db2jcc</artifactId>-->
<!--<version>10.5</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>ibm.db2</groupId>-->
<!--<artifactId>db2jcc_license_cu</artifactId>-->
<!--<version>10.5</version>-->
<!--</dependency>-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.auth0/java-jwt -->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.8.2</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package com.tohi.com.tohi.system.db;
import com.tohi.common.pwdutil.PropertiesConfigurerUtil;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Vector;
public final class DBConnectionPool extends Pool{
private int checkedOut;//正在使用的连接数
private Vector<Connection> freeConnections = new Vector<Connection>();
private String passWord = null;// 密码
private String url=null;//连接字符串
private String userName = null;// 用户名
private static int num = 0;//空闲连接数
private static int numActive =0;//当前可用的连接数
private static DBConnectionPool pool= null;//连接池实例变量
// 产生数据连接池
public static synchronized DBConnectionPool getInstance(){
if(pool==null)
pool = new DBConnectionPool();
return pool;
}
private DBConnectionPool(){
try{
//初始normalConn 个连接
init();
for (int i=0;i< normalConnect; i++){
Connection c = newConnection();
if (c!= null) {
freeConnections.addElement(c); //往容器中添加一个连接对象
num++;//记录总连接数
}
}
}catch (Exception e){
e.printStackTrace();
}
}
private void init() throws IOException {
this.userName = PropertiesConfigurerUtil.getProperty("userName");
this.passWord= PropertiesConfigurerUtil.getProperty("passWord");
this.url= PropertiesConfigurerUtil.getProperty("url");
this.driverName=PropertiesConfigurerUtil.getProperty("driverName");
this.maxConnect = Integer.parseInt(PropertiesConfigurerUtil.getProperty("maxConnect"));
this.normalConnect =Integer.parseInt(PropertiesConfigurerUtil.getProperty("normalConnect"));
}
// 如果不再使用某个连接对象,可调此方法将该对象释放到连接池
public synchronized void freeConnection(Connection con){
freeConnections.addElement(con);
num++;
checkedOut--;
numActive--;
notifyAll();//解锁
}
//创建一个新连接
private Connection newConnection(){
Connection con = null;
try{
// 用户、密码都为空
if(userName == null){
con = DriverManager.getConnection(url);
}else{
con = DriverManager.getConnection(url,userName,passWord);
}
String shcemaOwner = PropertiesConfigurerUtil.getProperty("shcema-owner-name");
this.changeSchemaOwnerOracle(con,shcemaOwner);
System.out.println("创建一个新连接");
}catch (Exception e){
e.printStackTrace();
return null;
}
return con;
}
private static void changeSchemaOwnerOracle(Connection connection, String schemaowner) throws Exception {
Statement st = connection.createStatement();
String sql = "alter session set current_schema = " + schemaowner;
st.execute(sql);
st.close();
}
//返回当前空闲连接数
public int getnum() {
return num;
}
// 返回当前连接数
public int getnumActive() {
return numActive;
}
// (单例模式)获取一个可用连接
public synchronized Connection getConnection(){
Connection con = null;
if(freeConnections.size() > 0 ){
num--;
con = (Connection) freeConnections.firstElement();
freeConnections.removeElementAt(0);
try{
if (con.isClosed()){
System.out.println("从连接池中删除一个无效连接");
con = getConnection();
}
}catch (Exception e){
System.out.println("从连接池中删除一个无效连接");
e.printStackTrace();
con = getConnection();
}
}else if(maxConnect == 0 || checkedOut < maxConnect){
con = newConnection();
}
if(con != null){
checkedOut++; //当前连接数+1
}
numActive++;
return con;
}
// 获取一个连接,并加上等待时间限制,单位为毫秒
public synchronized Connection getConnection(long timeout){
long startTime = new Date().getTime();
Connection con;
while ((con = getConnection())== null){
try{
wait(timeout);//线程等待
}catch (InterruptedException e){
}
if((new Date().getTime() - startTime) >= timeout){
return null;
}
}
return con;
}
//关闭所有连接
public synchronized void release(){
try{
//将当前连接赋值到枚举中
Enumeration allConnections = freeConnections.elements();
//使用循环关闭所用连接
while (allConnections.hasMoreElements()) {
//如果此枚举对象至少还有一个可提供的元素,则返回此枚举对象的下一个元素
Connection con = (Connection) allConnections.nextElement();
try {
con.close();
num--;
}catch (Exception e){
}
}
freeConnections.removeAllElements();
numActive = 0 ;
}catch (Exception e){
System.out.println("无法关闭连接池中的连接");
}finally {
super.release();
}
}
// 建立连接池
public void createPool(){
pool = new DBConnectionPool();
if (pool != null){
System.out.println("创建连接池成功");
}else {
System.out.println("创建连接池失败");
}
}
}
package com.tohi.com.tohi.system.db;
import com.tohi.common.pwdutil.PropertiesConfigurerUtil;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
public abstract class Pool {
public String propertiesName ="connection-INF.properties";
private static Pool instance= null;// 定义唯一实例
protected int maxConnect = 108;// 最大连接数
protected int normalConnect = 18;// 保持连接数
protected String driverName =null;// 驱动字符串
protected Driver driver = null;// 驱动变量
// 私有构造函数,不允许外界访问
protected Pool() {
try {
init();
loadDrivers(driverName);
} catch (Exception e) {
e.printStackTrace();
}
}
private void init() throws IOException {
this.driverName= PropertiesConfigurerUtil.getProperty("driverName");
this.maxConnect = Integer.parseInt(PropertiesConfigurerUtil.getProperty("maxConnect"));
this.normalConnect =Integer.parseInt(PropertiesConfigurerUtil.getProperty("normalConnect"));
}
protected void loadDrivers(String driverClassName) {
try{
driver = (Driver) Class.forName(driverClassName).newInstance();
DriverManager.registerDriver(driver);
System.out.println("成功注册JDBC驱动程序"+ driverClassName);
} catch (Exception e){
System.out.println("无法注册JDBC驱动程序:"+ driverClassName +",错误:"+e);
}
}
public abstract void createPool();
public static synchronized Pool getInstance() throws IOException,InstantiationException,
IllegalAccessException,
ClassNotFoundException {
if(instance == null){
instance.init();
instance = (Pool)Class.forName("com.luchang.system.common.db.Pool").newInstance();
}
return instance;
}
//获得一个可用的连接,如果没有则创建一个连接,且小于最大连接限制
public abstract Connection getConnection();
// 获得一个连接,有时间限制
public abstract Connection getConnection(long time);
// 将连接对象返回给连接池
public abstract void freeConnection(Connection con);
// 返回当前空闲连接数
public abstract int getnum();
//返回当前工作的连接数
public abstract int getnumActive();
protected synchronized void release() {
// 撤销驱动
try{
DriverManager.deregisterDriver(driver);
System.out.println("撤销JDBC驱动程序"+ driver.getClass().getName());
}catch (SQLException e){
System.out.println("无法撤销JDBC驱动程序的注册:"+ driver.getClass().getName());
}
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class PA_DATA_TempModel extends TempModel {
public String DateTime;
public String Value;
public String EQ_NAME;
public String UNIT;
public PA_DATA_TempModel() {
}
public String getDateTime() {
return this.DateTime;
}
public void setDateTime(String dateTime) {
this.DateTime = dateTime;
}
public String getValue() {
return this.Value;
}
public void setValue(String value) {
this.Value = value;
}
public String getEQ_NAME() {
return this.EQ_NAME;
}
public void setEQ_NAME(String eQ_NAME) {
this.EQ_NAME = eQ_NAME;
}
public String getUNIT() {
return this.UNIT;
}
public void setUNIT(String uNIT) {
this.UNIT = uNIT;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class PA_GG {
String UDAPPID;
String KSDATE;
String JSDATE;
String PI_POST_NO;
String CREATEBY;
String CREATEDATE;
String DESCRIPTION;
public PA_GG() {
}
public String getUDAPPID() {
return UDAPPID;
}
public void setUDAPPID(String UDAPPID) {
this.UDAPPID = UDAPPID;
}
public String getKSDATE() {
return KSDATE;
}
public void setKSDATE(String KSDATE) {
this.KSDATE = KSDATE;
}
public String getJSDATE() {
return JSDATE;
}
public void setJSDATE(String JSDATE) {
this.JSDATE = JSDATE;
}
public String getPI_POST_NO() {
return PI_POST_NO;
}
public void setPI_POST_NO(String PI_POST_NO) {
this.PI_POST_NO = PI_POST_NO;
}
public String getCREATEBY() {
return CREATEBY;
}
public void setCREATEBY(String CREATEBY) {
this.CREATEBY = CREATEBY;
}
public String getCREATEDATE() {
return CREATEDATE;
}
public void setCREATEDATE(String CREATEDATE) {
this.CREATEDATE = CREATEDATE;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String DESCRIPTION) {
this.DESCRIPTION = DESCRIPTION;
}
@Override
public String toString() {
return "PA_GG{" +
"UDAPPID='" + UDAPPID + '\'' +
", KSDATE='" + KSDATE + '\'' +
", JSDATE='" + JSDATE + '\'' +
", PI_POST_NO='" + PI_POST_NO + '\'' +
", CREATEBY='" + CREATEBY + '\'' +
", CREATEDATE='" + CREATEDATE + '\'' +
", DESCRIPTION='" + DESCRIPTION + '\'' +
'}';
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class PA_Group_TempModel extends TempModel {
public PA_Group_TempModel() {
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class PA_XJ_DEFECTS {
public String CODEID;
public String XJ_CONTENT;
public String GROUP_ID;
public String PAPOINTID;
public String EQUIP;
public String USERID;
public String COMPANYID;
public String CREATEDATE;
public PA_XJ_DEFECTS() {
}
public String getCODEID() {
return this.CODEID;
}
public void setCODEID(String cODEID) {
this.CODEID = cODEID;
}
public String getXJ_CONTENT() {
return this.XJ_CONTENT;
}
public void setXJ_CONTENT(String xJ_CONTENT) {
this.XJ_CONTENT = xJ_CONTENT;
}
public String getGROUP_ID() {
return this.GROUP_ID;
}
public void setGROUP_ID(String gROUP_ID) {
this.GROUP_ID = gROUP_ID;
}
public String getPAPOINTID() {
return this.PAPOINTID;
}
public void setPAPOINTID(String pAPOINTID) {
this.PAPOINTID = pAPOINTID;
}
public String getEQUIP() {
return this.EQUIP;
}
public void setEQUIP(String eQUIP) {
this.EQUIP = eQUIP;
}
public String getUSERID() {
return this.USERID;
}
public void setUSERID(String uSERID) {
this.USERID = uSERID;
}
public String getCOMPANYID() {
return this.COMPANYID;
}
public void setCOMPANYID(String cOMPANYID) {
this.COMPANYID = cOMPANYID;
}
public String getCREATEDATE() {
return this.CREATEDATE;
}
public void setCREATEDATE(String cREATEDATE) {
this.CREATEDATE = cREATEDATE;
}
}
package com.tohi.common.dto;
public class PI_TASK {
String NUM;//编号
String TASK_NAME;//任务名称
String PI_TASKCFG_NO;//巡检任务配置
String TASK_TYPE;//任务类型
String PROFESSIONAL;//专业
String PI_POST_NO; //巡检岗位
String STATUS; //任务状态
String BEGIN_TIME;//开始时间
String END_TIME;//结束时间
String NORM_AREA;//应到区域
String REAL_AREA;//实到区域
public PI_TASK() {
}
public String getNUM() {
return NUM;
}
public void setNUM(String NUM) {
this.NUM = NUM;
}
public String getTASK_NAME() {
return TASK_NAME;
}
public void setTASK_NAME(String TASK_NAME) {
this.TASK_NAME = TASK_NAME;
}
public String getPI_TASKCFG_NO() {
return PI_TASKCFG_NO;
}
public void setPI_TASKCFG_NO(String PI_TASKCFG_NO) {
this.PI_TASKCFG_NO = PI_TASKCFG_NO;
}
public String getTASK_TYPE() {
return TASK_TYPE;
}
public void setTASK_TYPE(String TASK_TYPE) {
this.TASK_TYPE = TASK_TYPE;
}
public String getPROFESSIONAL() {
return PROFESSIONAL;
}
public void setPROFESSIONAL(String PROFESSIONAL) {
this.PROFESSIONAL = PROFESSIONAL;
}
public String getPI_POST_NO() {
return PI_POST_NO;
}
public void setPI_POST_NO(String PI_POST_NO) {
this.PI_POST_NO = PI_POST_NO;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String STATUS) {
this.STATUS = STATUS;
}
public String getBEGIN_TIME() {
return BEGIN_TIME;
}
public void setBEGIN_TIME(String BEGIN_TIME) {
this.BEGIN_TIME = BEGIN_TIME;
}
public String getEND_TIME() {
return END_TIME;
}
public void setEND_TIME(String END_TIME) {
this.END_TIME = END_TIME;
}
public String getNORM_AREA() {
return NORM_AREA;
}
public void setNORM_AREA(String NORM_AREA) {
this.NORM_AREA = NORM_AREA;
}
public String getREAL_AREA() {
return REAL_AREA;
}
public void setREAL_AREA(String REAL_AREA) {
this.REAL_AREA = REAL_AREA;
}
}
package com.tohi.common.dto;
public class PI_TASK_AREA {
String PI_TASK_NO;//任务编号
String LC_XP_ID;//标识牌编号
String NUM;//区域编号
String TASK_AREA_NAME;//任务区域名称
String PROFESSIONAL;//专业
String UDSFSM;//是否扫码巡检
String SCPERSON;//巡检上传人员
String SCANTIME;//上传时间
String URLNAME;//文件路径
String STATUS;//状态
String NFCID;//NFCID
public PI_TASK_AREA(){
}
public String getPI_TASK_NO() {
return PI_TASK_NO;
}
public void setPI_TASK_NO(String PI_TASK_NO) {
this.PI_TASK_NO = PI_TASK_NO;
}
public String getLC_XP_ID() {
return LC_XP_ID;
}
public void setLC_XP_ID(String LC_XP_ID) {
this.LC_XP_ID = LC_XP_ID;
}
public String getNUM() {
return NUM;
}
public void setNUM(String NUM) {
this.NUM = NUM;
}
public String getTASK_AREA_NAME() {
return TASK_AREA_NAME;
}
public void setTASK_AREA_NAME(String TASK_AREA_NAME) {
this.TASK_AREA_NAME = TASK_AREA_NAME;
}
public String getPROFESSIONAL() {
return PROFESSIONAL;
}
public void setPROFESSIONAL(String PROFESSIONAL) {
this.PROFESSIONAL = PROFESSIONAL;
}
public String getUDSFSM() {
return UDSFSM;
}
public void setUDSFSM(String UDSFSM) {
this.UDSFSM = UDSFSM;
}
public String getSCPERSON() {
return SCPERSON;
}
public void setSCPERSON(String SCPERSON) {
this.SCPERSON = SCPERSON;
}
public String getSCANTIME() {
return SCANTIME;
}
public void setSCANTIME(String SCANTIME) {
this.SCANTIME = SCANTIME;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String STATUS) {
this.STATUS = STATUS;
}
public String getURLNAME() {
return URLNAME;
}
public void setURLNAME(String URLNAME) {
this.URLNAME = URLNAME;
}
public String getNFCID() {
return NFCID;
}
public void setNFCID(String NFCID) {
this.NFCID = NFCID;
}
@Override
public String toString() {
return "PI_TASK_AREA{" +
"PI_TASK_NO='" + PI_TASK_NO + '\'' +
", LC_XP_ID='" + LC_XP_ID + '\'' +
", NUM='" + NUM + '\'' +
", TASK_AREA_NAME='" + TASK_AREA_NAME + '\'' +
", PROFESSIONAL='" + PROFESSIONAL + '\'' +
", UDSFSM='" + UDSFSM + '\'' +
", SCPERSON='" + SCPERSON + '\'' +
", SCANTIME='" + SCANTIME + '\'' +
", URLNAME='" + URLNAME + '\'' +
", STATUS='" + STATUS + '\'' +
", NFCID='" + NFCID + '\'' +
'}';
}
}
package com.tohi.common.dto;
public class PI_TASK_DEVICE {
String NUM;//设备编号
String ON_OFF_POTIN;//设备工况
String SCANTIME;//巡检时间
String TASK_DEVICE_NAME;//位置名称
String LOCATION;//位置
String STATUS;//巡检设备状态
String ASSETNUM;//设备编号
String ASSETNAME;//设备名称
public PI_TASK_DEVICE(){
}
public String getNUM() {
return NUM;
}
public void setNUM(String NUM) {
this.NUM = NUM;
}
public String getON_OFF_POTIN() {
return ON_OFF_POTIN;
}
public void setON_OFF_POTIN(String ON_OFF_POTIN) {
this.ON_OFF_POTIN = ON_OFF_POTIN;
}
public String getSCANTIME() {
return SCANTIME;
}
public void setSCANTIME(String SCANTIME) {
this.SCANTIME = SCANTIME;
}
public String getTASK_DEVICE_NAME() {
return TASK_DEVICE_NAME;
}
public void setTASK_DEVICE_NAME(String TASK_DEVICE_NAME) {
this.TASK_DEVICE_NAME = TASK_DEVICE_NAME;
}
public String getLOCATION() {
return LOCATION;
}
public void setLOCATION(String LOCATION) {
this.LOCATION = LOCATION;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String STATUS) {
this.STATUS = STATUS;
}
public String getASSETNUM() {
return ASSETNUM;
}
public void setASSETNUM(String ASSETNUM) {
this.ASSETNUM = ASSETNUM;
}
public String getASSETNAME() {
return ASSETNAME;
}
public void setASSETNAME(String ASSETNAME) {
this.ASSETNAME = ASSETNAME;
}
@Override
public String toString() {
return "PI_TASK_DEVICE{" +
"NUM='" + NUM + '\'' +
", ON_OFF_POTIN='" + ON_OFF_POTIN + '\'' +
", SCANTIME='" + SCANTIME + '\'' +
", TASK_DEVICE_NAME='" + TASK_DEVICE_NAME + '\'' +
", LOCATION='" + LOCATION + '\'' +
", STATUS='" + STATUS + '\'' +
", ASSETNUM='" + ASSETNUM + '\'' +
", ASSETNAME='" + ASSETNAME + '\'' +
'}';
}
}
package com.tohi.common.dto;
public class PI_TASK_ITEM {
String NUM;//巡检项编号
String DEVICE_PART_NAME;//部件名称
String PI_ITEM_DESCRIPTION;//巡检内容
String POINT_NORM;//巡检标准
String CHECK_METHOD;//检查方法
String POINT_TYPE;//测点类型
String PI_TASK_ITEM_RESULT;//结果
String DOUBLERET;//数值结果
String XJPERSONID;//巡检人
String PI_TASK_TIME;//巡检时间
String PI_TASK_NO;//巡检任务编号
String STATUS;//状态
String LOWER_LIMIT;//下限值
String HIGHER_LIMIT;//上限值
String REMARK;//备注
String TASK_NAME;//任务名称
String ASSETNAME;//设备名称
public PI_TASK_ITEM(){
}
public String getNUM() {
return NUM;
}
public void setNUM(String NUM) {
this.NUM = NUM;
}
public String getDEVICE_PART_NAME() {
return DEVICE_PART_NAME;
}
public void setDEVICE_PART_NAME(String DEVICE_PART_NAME) {
this.DEVICE_PART_NAME = DEVICE_PART_NAME;
}
public String getPI_ITEM_DESCRIPTION() {
return PI_ITEM_DESCRIPTION;
}
public void setPI_ITEM_DESCRIPTION(String PI_ITEM_DESCRIPTION) {
this.PI_ITEM_DESCRIPTION = PI_ITEM_DESCRIPTION;
}
public String getPOINT_NORM() {
return POINT_NORM;
}
public void setPOINT_NORM(String POINT_NORM) {
this.POINT_NORM = POINT_NORM;
}
public String getCHECK_METHOD() {
return CHECK_METHOD;
}
public void setCHECK_METHOD(String CHECK_METHOD) {
this.CHECK_METHOD = CHECK_METHOD;
}
public String getPOINT_TYPE() {
return POINT_TYPE;
}
public void setPOINT_TYPE(String POINT_TYPE) {
this.POINT_TYPE = POINT_TYPE;
}
public String getPI_TASK_ITEM_RESULT() {
return PI_TASK_ITEM_RESULT;
}
public void setPI_TASK_ITEM_RESULT(String PI_TASK_ITEM_RESULT) {
this.PI_TASK_ITEM_RESULT = PI_TASK_ITEM_RESULT;
}
public String getXJPERSONID() {
return XJPERSONID;
}
public void setXJPERSONID(String XJPERSONID) {
this.XJPERSONID = XJPERSONID;
}
public String getPI_TASK_TIME() {
return PI_TASK_TIME;
}
public void setPI_TASK_TIME(String PI_TASK_TIME) {
this.PI_TASK_TIME = PI_TASK_TIME;
}
public String getPI_TASK_NO() {
return PI_TASK_NO;
}
public void setPI_TASK_NO(String PI_TASK_NO) {
this.PI_TASK_NO = PI_TASK_NO;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String STATUS) {
this.STATUS = STATUS;
}
public String getDOUBLERET() {
return DOUBLERET;
}
public void setDOUBLERET(String DOUBLERET) {
this.DOUBLERET = DOUBLERET;
}
public String getLOWER_LIMIT() {
return LOWER_LIMIT;
}
public void setLOWER_LIMIT(String LOWER_LIMIT) {
this.LOWER_LIMIT = LOWER_LIMIT;
}
public String getHIGHER_LIMIT() {
return HIGHER_LIMIT;
}
public void setHIGHER_LIMIT(String HIGHER_LIMIT) {
this.HIGHER_LIMIT = HIGHER_LIMIT;
}
public String getREMARK() {
return REMARK;
}
public void setREMARK(String REMARK) {
this.REMARK = REMARK;
}
public String getTASK_NAME() {
return TASK_NAME;
}
public void setTASK_NAME(String TASK_NAME) {
this.TASK_NAME = TASK_NAME;
}
public String getASSETNAME() {
return ASSETNAME;
}
public void setASSETNAME(String ASSETNAME) {
this.ASSETNAME = ASSETNAME;
}
@Override
public String toString() {
return "PI_TASK_ITEM{" +
"NUM='" + NUM + '\'' +
", DEVICE_PART_NAME='" + DEVICE_PART_NAME + '\'' +
", PI_ITEM_DESCRIPTION='" + PI_ITEM_DESCRIPTION + '\'' +
", POINT_NORM='" + POINT_NORM + '\'' +
", CHECK_METHOD='" + CHECK_METHOD + '\'' +
", POINT_TYPE='" + POINT_TYPE + '\'' +
", PI_TASK_ITEM_RESULT='" + PI_TASK_ITEM_RESULT + '\'' +
", DOUBLERET='" + DOUBLERET + '\'' +
", XJPERSONID='" + XJPERSONID + '\'' +
", PI_TASK_TIME='" + PI_TASK_TIME + '\'' +
", PI_TASK_NO='" + PI_TASK_NO + '\'' +
", STATUS='" + STATUS + '\'' +
", LOWER_LIMIT='" + LOWER_LIMIT + '\'' +
", HIGHER_LIMIT='" + HIGHER_LIMIT + '\'' +
", REMARK='" + REMARK + '\'' +
", TASK_NAME='" + TASK_NAME + '\'' +
", ASSETNAME='" + ASSETNAME + '\'' +
'}';
}
}
package com.tohi.common.dto;
public class Page {
Object data;
int total;
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class Phone_C_USER {
public String US_CODE;
public String Account_Alias;
public String US_PWD;
public String US_NAME;
public String US_PHONE_NUMBER;
public String US_COMPANY_ID;
public String ROLEID;
public Phone_C_USER() {
}
public String getUS_CODE() {
return this.US_CODE;
}
public void setUS_CODE(String uS_CODE) {
this.US_CODE = uS_CODE;
}
public String getAccount_Alias() {
return this.Account_Alias;
}
public void setAccount_Alias(String account_Alias) {
this.Account_Alias = account_Alias;
}
public String getUS_PWD() {
return this.US_PWD;
}
public void setUS_PWD(String uS_PWD) {
this.US_PWD = uS_PWD;
}
public String getUS_NAME() {
return this.US_NAME;
}
public void setUS_NAME(String uS_NAME) {
this.US_NAME = uS_NAME;
}
public String getUS_PHONE_NUMBER() {
return this.US_PHONE_NUMBER;
}
public void setUS_PHONE_NUMBER(String uS_PHONE_NUMBER) {
this.US_PHONE_NUMBER = uS_PHONE_NUMBER;
}
public String getUS_COMPANY_ID() {
return this.US_COMPANY_ID;
}
public void setUS_COMPANY_ID(String uS_COMPANY_ID) {
this.US_COMPANY_ID = uS_COMPANY_ID;
}
public String getROLEID() {
return this.ROLEID;
}
public void setROLEID(String rOLEID) {
this.ROLEID = rOLEID;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class Phone_PA_ITEM_STATU {
public String ITEMID;
public String FALUTID;
public String FALUTID_NAME;
public Phone_PA_ITEM_STATU() {
}
public String getITEMID() {
return this.ITEMID;
}
public void setITEMID(String iTEMID) {
this.ITEMID = iTEMID;
}
public String getFALUTID() {
return this.FALUTID;
}
public void setFALUTID(String fALUTID) {
this.FALUTID = fALUTID;
}
public String getFALUTID_NAME() {
return this.FALUTID_NAME;
}
public void setFALUTID_NAME(String fALUTID_NAME) {
this.FALUTID_NAME = fALUTID_NAME;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class Phone_PA_MOBILEMAP {
public String CODE;
public float LATITUDE;
public float LONGITUDE;
public String USERID;
public String REDATE;
public Phone_PA_MOBILEMAP() {
}
public String getCODE() {
return this.CODE;
}
public void setCODE(String cODE) {
this.CODE = cODE;
}
public float getLATITUDE() {
return this.LATITUDE;
}
public void setLATITUDE(float lATITUDE) {
this.LATITUDE = lATITUDE;
}
public float getLONGITUDE() {
return this.LONGITUDE;
}
public void setLONGITUDE(float lONGITUDE) {
this.LONGITUDE = lONGITUDE;
}
public String getUSERID() {
return this.USERID;
}
public void setUSERID(String uSERID) {
this.USERID = uSERID;
}
public String getREDATE() {
return this.REDATE;
}
public void setREDATE(String rEDATE) {
this.REDATE = rEDATE;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class Phone_PA_ROUTINE {
public String ITEMSEQ;
public String PAPOINTID;
public String PAPOINTNAME;
public String GROUP_ID;
public String GROUP_NAME;
public String NFCID;
public String EQUIPID;
public String QTD_NUMBER;
public String UPPERLIMIT;
public String LOWERLIMIT;
public String MAXINPUT;
public String MININPUT;
public String UNIT;
public String PROMPT;
public String EQUIPNAME;
public String ITEM_ID;
public String ITEM_NAME;
public String TIMES;
public String ITEM_CHECK;
public String CYCLE_TYPE;
public String ITEMTYPE;
public String ITEMGUIDE;
public String ITEMDESC;
public String LASTTIME;
public String NEXTTIME;
public String EQSTATU;
public String EQSEQ;
public String EFFECTIVE_BEGINDATE;
public String EFFECTIVE_ENDDATE;
public String MANDATORY;
public String FLAG;
public String QRCODE;
public String zhouqi;
public String cishu;
public String leixi;
public String sbsl;
public Phone_PA_ROUTINE() {
}
public String getSbsl() {
return this.sbsl;
}
public void setSbsl(String sbsl) {
this.sbsl = sbsl;
}
public String getLeixi() {
return this.leixi;
}
public void setLeixi(String leixi) {
this.leixi = leixi;
}
public String getZhouqi() {
return this.zhouqi;
}
public void setZhouqi(String zhouqi) {
this.zhouqi = zhouqi;
}
public String getCishu() {
return this.cishu;
}
public void setCishu(String cishu) {
this.cishu = cishu;
}
public String getITEMSEQ() {
return this.ITEMSEQ;
}
public void setITEMSEQ(String iTEMSEQ) {
this.ITEMSEQ = iTEMSEQ;
}
public String getPAPOINTID() {
return this.PAPOINTID;
}
public void setPAPOINTID(String pAPOINTID) {
this.PAPOINTID = pAPOINTID;
}
public String getPAPOINTNAME() {
return this.PAPOINTNAME;
}
public void setPAPOINTNAME(String pAPOINTNAME) {
this.PAPOINTNAME = pAPOINTNAME;
}
public String getGROUP_ID() {
return this.GROUP_ID;
}
public void setGROUP_ID(String gROUP_ID) {
this.GROUP_ID = gROUP_ID;
}
public String getGROUP_NAME() {
return this.GROUP_NAME;
}
public void setGROUP_NAME(String gROUP_NAME) {
this.GROUP_NAME = gROUP_NAME;
}
public String getNFCID() {
return this.NFCID;
}
public void setNFCID(String nFCID) {
this.NFCID = nFCID;
}
public String getEQUIPID() {
return this.EQUIPID;
}
public void setEQUIPID(String eQUIPID) {
this.EQUIPID = eQUIPID;
}
public String getQTD_NUMBER() {
return this.QTD_NUMBER;
}
public void setQTD_NUMBER(String qTD_NUMBER) {
this.QTD_NUMBER = qTD_NUMBER;
}
public String getUPPERLIMIT() {
return this.UPPERLIMIT;
}
public void setUPPERLIMIT(String uPPERLIMIT) {
this.UPPERLIMIT = uPPERLIMIT;
}
public String getLOWERLIMIT() {
return this.LOWERLIMIT;
}
public void setLOWERLIMIT(String lOWERLIMIT) {
this.LOWERLIMIT = lOWERLIMIT;
}
public String getMAXINPUT() {
return this.MAXINPUT;
}
public void setMAXINPUT(String mAXINPUT) {
this.MAXINPUT = mAXINPUT;
}
public String getMININPUT() {
return this.MININPUT;
}
public void setMININPUT(String mININPUT) {
this.MININPUT = mININPUT;
}
public String getUNIT() {
return this.UNIT;
}
public void setUNIT(String uNIT) {
this.UNIT = uNIT;
}
public String getPROMPT() {
return this.PROMPT;
}
public void setPROMPT(String pROMPT) {
this.PROMPT = pROMPT;
}
public String getEQUIPNAME() {
return this.EQUIPNAME;
}
public void setEQUIPNAME(String eQUIPNAME) {
this.EQUIPNAME = eQUIPNAME;
}
public String getITEM_ID() {
return this.ITEM_ID;
}
public void setITEM_ID(String iTEM_ID) {
this.ITEM_ID = iTEM_ID;
}
public String getITEM_NAME() {
return this.ITEM_NAME;
}
public void setITEM_NAME(String iTEM_NAME) {
this.ITEM_NAME = iTEM_NAME;
}
public String getTIMES() {
return this.TIMES;
}
public void setTIMES(String tIMES) {
this.TIMES = tIMES;
}
public String getITEM_CHECK() {
return this.ITEM_CHECK;
}
public void setITEM_CHECK(String iTEM_CHECK) {
this.ITEM_CHECK = iTEM_CHECK;
}
public String getCYCLE_TYPE() {
return this.CYCLE_TYPE;
}
public void setCYCLE_TYPE(String cYCLE_TYPE) {
this.CYCLE_TYPE = cYCLE_TYPE;
}
public String getITEMTYPE() {
return this.ITEMTYPE;
}
public void setITEMTYPE(String iTEMTYPE) {
this.ITEMTYPE = iTEMTYPE;
}
public String getITEMGUIDE() {
return this.ITEMGUIDE;
}
public void setITEMGUIDE(String iTEMGUIDE) {
this.ITEMGUIDE = iTEMGUIDE;
}
public String getITEMDESC() {
return this.ITEMDESC;
}
public void setITEMDESC(String iTEMDESC) {
this.ITEMDESC = iTEMDESC;
}
public String getLASTTIME() {
return this.LASTTIME;
}
public void setLASTTIME(String lASTTIME) {
this.LASTTIME = lASTTIME;
}
public String getNEXTTIME() {
return this.NEXTTIME;
}
public void setNEXTTIME(String nEXTTIME) {
this.NEXTTIME = nEXTTIME;
}
public String getEQSTATU() {
return this.EQSTATU;
}
public void setEQSTATU(String eQSTATU) {
this.EQSTATU = eQSTATU;
}
public String getEQSEQ() {
return this.EQSEQ;
}
public void setEQSEQ(String eQSEQ) {
this.EQSEQ = eQSEQ;
}
public String getEFFECTIVE_BEGINDATE() {
return this.EFFECTIVE_BEGINDATE;
}
public void setEFFECTIVE_BEGINDATE(String eFFECTIVE_BEGINDATE) {
this.EFFECTIVE_BEGINDATE = eFFECTIVE_BEGINDATE;
}
public String getEFFECTIVE_ENDDATE() {
return this.EFFECTIVE_ENDDATE;
}
public void setEFFECTIVE_ENDDATE(String eFFECTIVE_ENDDATE) {
this.EFFECTIVE_ENDDATE = eFFECTIVE_ENDDATE;
}
public String getMANDATORY() {
return this.MANDATORY;
}
public void setMANDATORY(String mANDATORY) {
this.MANDATORY = mANDATORY;
}
public String getFLAG() {
return this.FLAG;
}
public void setFLAG(String fLAG) {
this.FLAG = fLAG;
}
public String getQRCODE() {
return this.QRCODE;
}
public void setQRCODE(String qRCODE) {
this.QRCODE = qRCODE;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class Phone_PA_ROUTINE_GROUP {
public String GROUP_ID;
public String GROUP_NAME;
public String PAPOINTID;
public String PAPOINTNAME;
public String GROUP_SEQ;
public String NFCID;
public String TWOCODE;
public String BARCODE;
public String QRCODE;
public String zs;
public Phone_PA_ROUTINE_GROUP() {
}
public String getZs() {
return this.zs;
}
public void setZs(String zs) {
this.zs = zs;
}
public String getGROUP_ID() {
return this.GROUP_ID;
}
public void setGROUP_ID(String gROUP_ID) {
this.GROUP_ID = gROUP_ID;
}
public String getGROUP_NAME() {
return this.GROUP_NAME;
}
public void setGROUP_NAME(String gROUP_NAME) {
this.GROUP_NAME = gROUP_NAME;
}
public String getPAPOINTID() {
return this.PAPOINTID;
}
public void setPAPOINTID(String pAPOINTID) {
this.PAPOINTID = pAPOINTID;
}
public String getPAPOINTNAME() {
return this.PAPOINTNAME;
}
public void setPAPOINTNAME(String pAPOINTNAME) {
this.PAPOINTNAME = pAPOINTNAME;
}
public String getGROUP_SEQ() {
return this.GROUP_SEQ;
}
public void setGROUP_SEQ(String gROUP_SEQ) {
this.GROUP_SEQ = gROUP_SEQ;
}
public String getNFCID() {
return this.NFCID;
}
public void setNFCID(String nFCID) {
this.NFCID = nFCID;
}
public String getTWOCODE() {
return this.TWOCODE;
}
public void setTWOCODE(String tWOCODE) {
this.TWOCODE = tWOCODE;
}
public String getBARCODE() {
return this.BARCODE;
}
public void setBARCODE(String bARCODE) {
this.BARCODE = bARCODE;
}
public String getQRCODE() {
return this.QRCODE;
}
public void setQRCODE(String qRCODE) {
this.QRCODE = qRCODE;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class Results {
public String result;
public String PhoneResult;
public Results() {
}
public String getResult() {
return this.result;
}
public void setResult(String result) {
this.result = result;
}
public String getPhoneResult() {
return this.PhoneResult;
}
public void setPhoneResult(String phoneResult) {
this.PhoneResult = phoneResult;
}
}
package com.tohi.common.dto;
import java.util.*;
public class Singleton {
//缓存accessToken 的Map ,map中包含 一个accessToken 和 缓存的时间戳
//当然也可以分开成两个属性咯
private Map<String, String> map = new HashMap();
private Singleton() {
}
private static Singleton single = null;
// 静态工厂方法
public static Singleton getInstance() {
if (single == null) {
single = new Singleton();
}
return single;
}
public Map<String, String> getMap() {
return map;
}
public void setMap(Map<String, String> map) {
this.map = map;
}
public static Singleton getSingle() {
return single;
}
public static void setSingle(Singleton single) {
Singleton.single = single;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TempModel {
public String ID;
@JsonProperty
public String Name;
@JsonProperty
public String Type;
public TempModel() {
}
public String getID() {
return this.ID;
}
public void setID(String iD) {
this.ID = iD;
}
@JsonIgnore
public String getName() {
return this.Name;
}
@JsonIgnore
public void setName(String Name) {
this.Name = Name;
}
@JsonIgnore
public String getType() {
return this.Type;
}
@JsonIgnore
public void setType(String type) {
this.Type = type;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.dto;
public class UdGeneral {
public String areaNum;
public String NFCID;
public String areaName;
public UdGeneral() {
}
public String getAreaNum() {
return areaNum;
}
public void setAreaNum(String areaNum) {
this.areaNum = areaNum;
}
public String getNFCID() {
return NFCID;
}
public void setNFCID(String NFCID) {
this.NFCID = NFCID;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.pwdutil;
public class ArgsUtil {
public ArgsUtil() {
}
public static void main(String[] args1) {
}
public String getvalue(String str) {
if (str == null) {
return "";
} else {
int pos = str.indexOf(61);
if (pos > 0) {
int pos1 = str.indexOf(32, pos);
if (pos1 < pos) {
pos1 = str.length();
}
if (pos1 > pos + 1) {
return str.substring(pos + 1, pos1).trim();
}
}
return "";
}
}
public String getValue(String[] args, String name) {
if (name != null && !"".equals(name) && args != null) {
int len = args.length;
for(int i = 0; i < len; ++i) {
String temp = args[i].toLowerCase();
if (temp.startsWith(name.toLowerCase())) {
return this.getvalue(temp);
}
}
return null;
} else {
return null;
}
}
}
package com.tohi.common.pwdutil;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.core.Response;
import java.io.IOException;
public class CheckRequestFilter implements ContainerRequestFilter {
private static final String TARGET_URL ="/pitask/getToken";
public void filter(ContainerRequestContext requestContext) throws IOException {
String url=requestContext.getUriInfo().getRequestUri().toString();
if(!url.contains("pitask")){
requestContext.abortWith(Response
.status(Response.Status.UNAUTHORIZED)
.entity("用户名或密码错误")
.build());
}else {
if(!url.endsWith(TARGET_URL)){
String token = requestContext.getHeaderString("token");
if(token!=null&&!"".equals(token)){
if (!TokenUtils.verify(token)) {
requestContext.abortWith(Response
.status(Response.Status.UNAUTHORIZED)
.entity("用户名或密码错误")
.build());
}
}else {
requestContext.abortWith(Response
.status(Response.Status.UNAUTHORIZED)
.entity("用户名或密码错误")
.build());
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.pwdutil;
public class EncodeUtil {
public EncodeUtil() {
}
public static void printHexString(String hint, byte[] b) {
System.out.print(hint);
for(int i = 0; i < b.length; ++i) {
String hex = Integer.toHexString(b[i] & 255);
if (hex.length() == 1) {
hex = '0' + hex;
}
System.out.print(hex.toUpperCase() + " ");
}
System.out.println("");
}
public static String Bytes2HexString(byte[] b) {
if (b == null) {
return null;
} else {
String ret = "";
for(int i = 0; i < b.length; ++i) {
String hex = Integer.toHexString(b[i] & 255);
if (hex.length() == 1) {
hex = '0' + hex;
}
ret = ret + hex.toUpperCase();
}
return ret;
}
}
public static byte uniteBytes(byte src0, byte src1) {
byte _b0 = Byte.decode("0x" + new String(new byte[]{src0}));
_b0 = (byte)(_b0 << 4);
byte _b1 = Byte.decode("0x" + new String(new byte[]{src1}));
byte ret = (byte)(_b0 ^ _b1);
return ret;
}
public static byte[] HexString2Bytes(String src) {
byte[] tmp = src.getBytes();
byte[] ret = new byte[tmp.length / 2];
for(int i = 0; i < ret.length; ++i) {
ret[i] = uniteBytes(tmp[i * 2], tmp[i * 2 + 1]);
}
return ret;
}
public static byte[] Encode(byte[] b) {
String s = Bytes2HexString(b);
return s.getBytes();
}
public static byte[] Decode(byte[] b) {
String src = new String(b);
return HexString2Bytes(src);
}
}
package com.tohi.common.pwdutil;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.io.*;
/**
* 文件工具
*/
public class FileUtils {
/**
* 把字节转换成文件
* @param fileData
* @param fileName
* @throws IOException
*/
private static void byteDataConvertToFile(byte[] fileData, String fileName) throws IOException{
ByteArrayInputStream is = new ByteArrayInputStream(fileData);
writeToFile(is,fileName);
}
/**
* 把字节转换成文件
* @param fileBase64Data
* @param fileName
* @throws IOException
*/
private static void base64DataConvertToFile(String fileBase64Data, String fileName) throws IOException{
byte[] bytes = Base64.decode(fileBase64Data);
byteDataConvertToFile(bytes,fileName);
}
/**
* 把二进制流转换成文件
* @param inStream
* @param fileName
* @throws IOException
*/
private static void writeToFile(InputStream inStream, String fileName) throws IOException{
FileOutputStream outStream = new FileOutputStream(fileName);
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, bytesRead);
}
outStream.close();
inStream.close();
}
/**
* 把文件转换成字节
* @param file
* @return
*/
private static byte[] fileConvertToByteData(File file){
FileInputStream fileInputStream = null;
byte[] fileData = null;
try {
fileData = new byte[(int) file.length()];
fileInputStream = new FileInputStream(file);
fileInputStream.read(fileData);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return fileData;
}
public String fileConvertToStringData(File file,String endoce){
String result = null;
if(endoce==null||"".equals(endoce)){
endoce = "UTF-8";
}
byte[] bytes = fileConvertToByteData(file);
if(bytes!=null){
try{
result = new String(bytes, "UTF-8");
}catch (Exception e){
e.printStackTrace();
}
return result;
}
return result;
}
private static String fileConvertToBase64Data(File file) throws IOException{
InputStream in = new FileInputStream(file);
// 取得文件大小
long length = file.length();
// 根据大小创建字节数组
byte[] bytes = new byte[(int) length];
// 读取文件内容到字节数组
int offset = 0;
int numRead = 0;
while (offset < bytes.length
&& (numRead = in.read(bytes, offset, bytes.length - offset)) >= 0) {
offset += numRead;
}
// 读取完毕的校验
if (offset < bytes.length) {
throw new IOException("不能读取文件:"+ file.getName());
}
in.close();
String encodedFileString = Base64.encode(bytes);
//String encodedFileString = java.util.Base64.getEncoder().encode(bytes).toString();
return encodedFileString;
}
public void addFile(String ownerId,String ownerTable,String fileData){
}
public static void main(String[] args) throws IOException{
File file = new File("E:\\file.rar");
byte[] bytes = FileUtils.fileConvertToByteData(file);
//bytes转成文件
//FileUtils.byteDataConvertToFile(bytes,"E:\\file2.rar");
System.out.println("字节流:"+bytes);
System.out.println("转换字符串:"+new String(bytes,"UTF-8"));
String[] str ={new String(bytes,"UTF-8")};
System.out.println("封装String数组"+str);
String fileData = FileUtils.fileConvertToBase64Data(file);
System.out.println("Base64加密:"+fileData);
// byte[] bytes = Base64.decode(s);
//byteDataConvertToFile(bytes,"D:\\mmo2.txt");
base64DataConvertToFile(fileData,"D:\\mmo2.txt");
// String[] str = {bytes.toString()};
// System.out.println(bytes+"=="+str[0]);
}
}
\ No newline at end of file
This diff is collapsed.
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.pwdutil;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Map.Entry;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.util.PropertyPlaceholderHelper;
public class PropertiesConfigurerUtil extends PropertyPlaceholderConfigurer {
private static Map<String, String> properties = new HashMap();
public PropertiesConfigurerUtil() {
}
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException {
PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper("${", "}", ":", false);
Iterator var5 = props.entrySet().iterator();
while(var5.hasNext()) {
Entry<Object, Object> entry = (Entry)var5.next();
String stringKey = String.valueOf(entry.getKey()).trim();
String stringValue = String.valueOf(entry.getValue()).trim();
stringValue = helper.replacePlaceholders(stringValue, props);
properties.put(stringKey, stringValue);
}
super.processProperties(beanFactoryToProcess, props);
}
public static Map<String, String> getProperties() {
return properties;
}
public static String getProperty(String proName) {
return (String)properties.get(proName);
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.pwdutil;
public class PropertiesUtil {
public static String CRYPTOX_MODE = "CBC";
public static String CRYPTOX_PADDING = "PKCS5Padding";
public static String CRYPTOX_KEY = "Sa#qk5usfmMI-@2dbZP9`jL3";
public static String CRYPTOX_SPEC = "beLd7$lB";
public static String CRYPTOX_ALGORITHM = "DESede";
public static String CRYPTOX_MODULUS = "";
public static String CRYPTOX_PROVIDER = null;
private String algorithm;
private String mode;
private String padding;
private String key;
private String spec;
private String modulus;
private String provider;
public PropertiesUtil() {
try {
this.algorithm = PropertiesConfigurerUtil.getProperty("mxe.security.cryptox.algorithm");
this.mode = PropertiesConfigurerUtil.getProperty("mxe.security.cryptox.mode");
this.padding = PropertiesConfigurerUtil.getProperty("mxe.security.cryptox.padding");
this.key = PropertiesConfigurerUtil.getProperty("mxe.security.cryptox.key");
this.spec = PropertiesConfigurerUtil.getProperty("mxe.security.cryptox.spec");
this.modulus = "";
this.provider = null;
} catch (Exception var2) {
var2.printStackTrace();
}
}
public void setAlgorithm(String algorithm) {
this.algorithm = algorithm;
}
public void setMode(String mode) {
this.mode = mode;
}
public void setPadding(String padding) {
this.padding = padding;
}
public void setKey(String key) {
this.key = key;
}
public void setSpec(String spec) {
this.spec = spec;
}
public void setModulus(String modulus) {
this.modulus = modulus;
}
public void setProvider(String provider) {
this.provider = provider;
}
public String getAlgorithm() {
return this.algorithm;
}
public String getMode() {
return this.mode;
}
public String getPadding() {
return this.padding;
}
public String getKey() {
return this.key;
}
public String getSpec() {
return this.spec;
}
public String getModulus() {
return this.modulus;
}
public String getProvider() {
return this.provider;
}
}
package com.tohi.common.pwdutil;
/*
* 微信公众平台(JAVA) SDK
*
* Copyright (c) 2016, Ansitech Network Technology Co.,Ltd All rights reserved.
* http://www.ansitech.com/weixin/sdk/
*
* 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.
*/
import java.security.MessageDigest;
/**
* <p>Title: SHA1算法</p>
*
* @author levi
*/
public final class SHA1 {
private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
/**
* Takes the raw bytes from the digest and formats them correct.
*
* @param bytes the raw bytes from the digest.
* @return the formatted bytes.
*/
private static String getFormattedText(byte[] bytes) {
int len = bytes.length;
StringBuilder buf = new StringBuilder(len * 2);
// 把密文转换成十六进制的字符串形式
for (int j = 0; j < len; j++) {
buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
}
return buf.toString();
}
public static String encode(String str) {
if (str == null) {
return null;
}
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
messageDigest.update(str.getBytes());
return getFormattedText(messageDigest.digest());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
\ No newline at end of file
package com.tohi.common.pwdutil;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import net.sf.json.JSONObject;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @desc 使用token验证用户是否登录
* @author zm
**/
public class TokenUtils {
//设置过期时间
private static final long EXPIRE_DATE=90*60*100000;
//token秘钥
private static final String TOKEN_SECRET = "ZCfasfhuaUUHufguGuwu2020BQWE";
public static String token (String username,String password){
String token = "";
try {
dbhelpers helper = new dbhelpers();
String sql = "select personid,password from maxuser where loginid = '" + username + "'";
String jsonObj = helper.executeQuery(sql);
JSONObject o = JSONObject.fromObject(jsonObj);
JSONObject o1 = (JSONObject)o.get("0");
if (o1 == null) {
return "";
} else {
String o2 = (String)o1.get("PASSWORD");
PropertiesUtil pu = new PropertiesUtil();
MXCipherX mx = new MXCipherX(true, pu);
String spwd = mx.encData(password);
if (!spwd.equalsIgnoreCase(o2)) {
return "";
}
}
//过期时间
Date date = new Date(System.currentTimeMillis()+EXPIRE_DATE);
//秘钥及加密算法
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET);
//设置头部信息
Map<String,Object> header = new HashMap();
header.put("typ","JWT");
header.put("alg","HS256");
//携带username,password信息,生成签名
token = JWT.create()
.withHeader(header)
.withClaim("username",username)
.withClaim("password",password).withExpiresAt(date)
.sign(algorithm);
}catch (Exception e){
e.printStackTrace();
return "";
}
return token;
}
public static boolean verify(String token){
/**
* @desc 验证token,通过返回true
* @params [token]需要校验的串
**/
try {
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET);
JWTVerifier verifier = JWT.require(algorithm).build();
DecodedJWT jwt = verifier.verify(token);
return true;
}catch (Exception e){
e.printStackTrace();
return false;
}
}
public static void main(String[] args) {
String username ="zhangsan";
String password = "123";
String token = token(username,password);
System.out.println(token);
boolean b = verify("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd22yZCI6IjEyMyIsImV4cCI6MTU3ODE5NzQxMywidXNlcm5hbWUiOiJ6aGFuZ3NhbiJ9.IyTZT0tISQQZhGhsNuaqHGV8LD7idjUYjn3MGbulmJg");
System.out.println(b);
}
}
\ No newline at end of file
package com.tohi.common.pwdutil;
import cn.hutool.http.HttpUtil;
import com.tohi.common.dto.Singleton;
import org.apache.commons.lang.StringUtils;
import net.sf.json.JSONObject;
import java.util.*;
public class WxUtils {
public static String appId = "wwe4f3e6def9ee9538";
public static String appSecret = "Yzu6F95cbbxfDN4kg6pubY_BuCIEJL4BFFvJIg-Ye2U";
//获取access_token的url
public final static String js_api_ticket_url = "https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=ACCESS_TOKEN";
/**https://qyapi.weixin.qq.com/cgi-bin/ticket/get
* 获取access_token
*
* @return
*/
private static String getAccessToken() {
String rel = "";
Singleton singleton = Singleton.getInstance();
Map<String, String> map = singleton.getMap();
String time = map.get("access_token_time");
String accessToken = map.get("access_token");
Long nowDate = new Date().getTime();
//这里设置过期时间 3000*1000就好了
if (accessToken != null && time != null && nowDate - Long.parseLong(time) < 7200 * 1000) {
rel = accessToken;
} else {
String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s", appId, appSecret);
String result = HttpUtil.get(url);
if (StringUtils.isBlank(result)) {
return null;
}
JSONObject responseJsonObject = JSONObject.fromObject(result);
map.put("access_token_time", nowDate + "");
map.put("access_token", responseJsonObject.getString("access_token"));
rel = responseJsonObject.getString("access_token");
System.out.println("access_token====="+rel);
}
return rel;
}
private static String getJsapiTicket(String accessToken) {
String rel = "";
Singleton singleton = Singleton.getInstance();
Map<String, String> map = singleton.getMap();
String js_api_ticketn_time = map.get("js_api_ticketn_time");
String ticket = map.get("ticket");
Long nowDate = new Date().getTime();
if (ticket != null && js_api_ticketn_time != null && nowDate - Long.parseLong(js_api_ticketn_time) < 7200 * 1000) {
rel = ticket;
} else {
String url = js_api_ticket_url.replace("ACCESS_TOKEN", accessToken);
System.out.println(url);
String result = HttpUtil.get(url);
if (StringUtils.isBlank(result)) {
return null;
}
JSONObject responseJsonObject = JSONObject.fromObject(result);
map.put("js_api_ticketn_time", nowDate + "");
map.put("ticket", responseJsonObject.getString("ticket"));
rel = responseJsonObject.getString("ticket");
System.out.println("ticket==="+rel);
}
return rel;
}
public static Map getConfig(String url) {
String accessToken = getAccessToken();
String ticket = getJsapiTicket(accessToken);
String nonceStr = create_nonce_str();
String timestamp = create_timestamp();
String string1 = "jsapi_ticket=" + ticket +
"&noncestr=" + nonceStr +
"&timestamp=" + timestamp +
"&url=" + url;
Map<String, Object> map = new HashMap();
map.put("appId", appId);
map.put("timestamp", timestamp);
map.put("nonceStr", nonceStr);
map.put("signature", SHA1.encode(string1));
return map;
}
private static String create_nonce_str() {
return UUID.randomUUID().toString();
}
private static String create_timestamp() {
return Long.toString(System.currentTimeMillis() / 1000);
}
}
This diff is collapsed.
#----------------------------------------------------------------------------
#maximo7.5 ,7.6
#----------------------------------------------------------------------------
mxe.security.cryptox.mode=CBC
mxe.security.cryptox.padding=PKCS5Padding
mxe.security.cryptox.key=Sa#qk5usfmMI-@2dbZP9`jL3
mxe.security.cryptox.spec=beLd7$lB
mxe.security.cryptox.algorithm= DESede
#----------------------------------------------------------------------------
#maximo DB
#----------------------------------------------------------------------------
#url = jdbc:oracle:thin:@172.20.1.33:1521:orclsg
#userName =sgmaximo
#passWord =sgmaximo
#url = jdbc:oracle:thin:@10.21.100.227:1521:maxprod7
#userName =maxgdsg
#passWord =maximo
url = jdbc:oracle:thin:@10.192.23.224:1521:maxprod7
userName =maxgdsg
passWord =maximo
shcema-owner-name = maxgdsg
driverName = oracle.jdbc.driver.OracleDriver
maxConnect = 20
normalConnect = 5
# 阳西
#url = jdbc:oracle:thin:@172.20.0.46:1521:orcl
#userName =yxhbmro
#passWord =maximo
#url = jdbc:oracle:thin:@10.10.13.202:1521:orcl
#userName =yxhbmro
#passWord =yxhbmro
#doc = \\home\\phadmin\\maximo\\docker-compose-maximo\\doclinks\\attachments\\
#docdata =\\docker-compose-maximo\\doclinks\\attachments\\
#doc 附件上传地址 docdata 巡检数据上传地址 docu 附件引用地址
doc =C:\\SGAPP\\doclinks
docdata =//MisInterface//pi//xjdata//
docu =/doclinks//
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="http://www.springframework.org/schema/beans
classpath:/org/springframework/beans/factory/xml/spring-beans-4.2.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<!--&lt;!&ndash;扫描service下的包&ndash;&gt;-->
<!--<context:component-scan base-package="com.tohi.app.rest"/>-->
<jaxrs:server id="pitaskSerice" address="/">
<jaxrs:serviceBeans>
<ref bean="pitaskSericeImpl" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
<bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpPreStreamInterceptor" />
<bean class="com.tohi.common.pwdutil.CheckRequestFilter" />
</jaxrs:providers>
<jaxrs:inInterceptors>
<!-- <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpInInterceptor" /> -->
<bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpInInterceptor">
<property name="callbackParam" value="callback"/>
</bean>
</jaxrs:inInterceptors>
<jaxrs:outInterceptors>
<bean
class="org.apache.cxf.jaxrs.provider.jsonp.JsonpPostStreamInterceptor" />
</jaxrs:outInterceptors>
</jaxrs:server>
</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" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
classpath:/org/springframework/beans/factory/xml/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
classpath:/org/springframework/context/config/spring-context-4.2.xsd">
<context:component-scan base-package="com.tohi.app.rest" />
<import resource="spring-cxf.xml" />
<bean id="propertiesConfigurer" class="com.tohi.common.pwdutil.PropertiesConfigurerUtil">
<property name="locations">
<list>
<value>classpath:prop.properties</value>
</list>
</property>
</bean>
<bean id="checkRequestFilter" class="com.tohi.common.pwdutil.CheckRequestFilter"></bean>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @version $Id: applicationContext.xml 561608 2007-08-01 00:33:12Z vgritsenko $ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:configurator="http://cocoon.apache.org/schema/configurator"
xmlns:avalon="http://cocoon.apache.org/schema/avalon"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
http://cocoon.apache.org/schema/avalon http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd">
<!-- Activate Cocoon Spring Configurator -->
<configurator:settings/>
<!-- Configure Log4j -->
<bean name="org.apache.cocoon.spring.configurator.log4j"
class="org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator"
scope="singleton">
<property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
<property name="resource" value="/WEB-INF/log4j.xml"/>
</bean>
<!-- Activate Avalon Bridge -->
<avalon:bridge/>
</beans>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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