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
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.app.rest;
import com.tohi.com.tohi.system.db.DBConnectionPool;
import com.tohi.common.pwdutil.PropertiesConfigurerUtil;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.util.StringUtils;
public class JdbcUtil {
private static String url = PropertiesConfigurerUtil.getProperty("url");
private static String username = PropertiesConfigurerUtil.getProperty("userName");
private static String password = PropertiesConfigurerUtil.getProperty("passWord");
private static SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static String shcemaOwner = PropertiesConfigurerUtil.getProperty("shcema-owner-name");
public static String doc = PropertiesConfigurerUtil.getProperty("doc");
private JdbcUtil() {
}
public static Connection getConn() throws SQLException {
// return DBConnectionPool.getInstance().getConnection();
Connection conn = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(url, username, password);
changeSchemaOwnerOracle(conn,shcemaOwner);
} catch (Exception var1) {
var1.printStackTrace();
}
return conn;
}
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 static void close(Connection conn) {
if (conn != null) {
try {
conn.close();
} catch (SQLException var2) {
var2.printStackTrace();
}
}
}
public static List<Map<String, String>> findNullToEmpty(Object sql, String[] columns) throws Exception {
if (sql != null && columns != null && columns.length != 0) {
String executeSql = null;
if (sql instanceof String) {
executeSql = (String)sql;
} else {
if (!(sql instanceof StringBuffer)) {
return null;
}
executeSql = ((StringBuffer)sql).toString();
}
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
ArrayList rows = new ArrayList();
try {
con = getConn();
stmt = con.createStatement();
stmt.setQueryTimeout(10);
rs = stmt.executeQuery(executeSql);
while(rs.next()) {
Map<String, String> row = new HashMap();
String[] var11 = columns;
int var10 = columns.length;
for(int var9 = 0; var9 < var10; ++var9) {
String col = var11[var9];
row.put(col, rs.getString(col)!=null ? rs.getString(col) : "");
}
rows.add(row);
}
} catch (Exception var20) {
var20.printStackTrace();
} finally {
try {
close(stmt, con, rs);
} catch (SQLException var19) {
var19.printStackTrace();
}
}
return rows;
} else {
return null;
}
}
public static Map<String, String> findOne(Object sql, String[] columns) throws Exception {
if (sql != null && columns != null && columns.length != 0) {
String executeSql = null;
if (sql instanceof String) {
executeSql = (String)sql;
} else {
if (!(sql instanceof StringBuffer)) {
return null;
}
executeSql = ((StringBuffer)sql).toString();
}
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
HashMap data = new HashMap();
try {
con = getConn();
stmt = con.createStatement();
stmt.setQueryTimeout(10);
rs = stmt.executeQuery(executeSql);
while(rs.next()) {
String[] var10 = columns;
int var9 = columns.length;
for(int var8 = 0; var8 < var9; ++var8) {
String col = var10[var8];
data.put(col, rs.getString(col));
}
}
} catch (Exception var19) {
var19.printStackTrace();
} finally {
try {
close(stmt, con, rs);
} catch (SQLException var18) {
var18.printStackTrace();
}
}
return data.isEmpty() ? null : data;
} else {
return null;
}
}
public static boolean execute(Object sql) throws Exception {
if (sql == null) {
return false;
} else {
String executeSql = null;
if (sql instanceof String) {
executeSql = (String)sql;
} else {
if (!(sql instanceof StringBuffer)) {
return false;
}
executeSql = ((StringBuffer)sql).toString();
}
Connection con = null;
Statement stmt = null;
boolean result = true;
try {
con = getConn();
stmt = con.createStatement();
stmt.setQueryTimeout(10);
result = stmt.execute(executeSql);
} catch (Exception var14) {
var14.printStackTrace();
} finally {
try {
close(stmt, con, (ResultSet)null);
} catch (SQLException var13) {
var13.printStackTrace();
}
}
return result;
}
}
public static List<Map<String, String>> find(Object sql, String[] columns) throws Exception {
if (sql != null && columns != null && columns.length != 0) {
String executeSql = null;
if (sql instanceof String) {
executeSql = (String)sql;
} else {
if (!(sql instanceof StringBuffer)) {
return null;
}
executeSql = ((StringBuffer)sql).toString();
}
Statement stmt = null;
Connection con = null;
ResultSet rs = null;
ArrayList rows = new ArrayList();
try {
con = getConn();
stmt = con.createStatement();
stmt.setQueryTimeout(10);
rs = stmt.executeQuery(executeSql);
while(rs.next()) {
Map<String, String> row = new HashMap();
String[] var11 = columns;
int var10 = columns.length;
for(int var9 = 0; var9 < var10; ++var9) {
String col = var11[var9];
row.put(col, rs.getString(col));
}
rows.add(row);
}
} catch (Exception var20) {
var20.printStackTrace();
} finally {
try {
close(stmt, con, rs);
} catch (SQLException var19) {
var19.printStackTrace();
}
}
return rows.isEmpty() ? null : rows;
} else {
return null;
}
}
public static String insertSentence(Map<String, String> obj, String tableName) {
if (obj == null) {
return null;
} else {
Set<String> keys = obj.keySet();
StringBuffer buffer = new StringBuffer(" insert into " + tableName);
int count = 0;
String key;
Iterator var6;
for(var6 = keys.iterator(); var6.hasNext(); ++count) {
key = (String)var6.next();
if (count == 0) {
buffer.append(" (" + key);
} else {
buffer.append("," + key);
}
}
buffer.append(") values ");
count = 0;
for(var6 = keys.iterator(); var6.hasNext(); ++count) {
key = (String)var6.next();
if (count == 0) {
buffer.append("(" + getParam(obj.get(key)));
} else {
buffer.append("," + getParam(obj.get(key)));
}
}
buffer.append(")");
count = 0;
return buffer.toString();
}
}
public static void executeBatch(List<String> sqls) throws RemoteException, SQLException {
Connection con = getConn();
Statement stmt = null;
try {
if (sqls == null || sqls.isEmpty()) {
throw new Exception("JDBCHelpException: SQL集合 不能为空! DateTime: " + datetime.format(new Date()));
}
con.setAutoCommit(false);
stmt = con.createStatement();
stmt.setQueryTimeout(10);
Iterator var4 = sqls.iterator();
while(var4.hasNext()) {
String sql = (String)var4.next();
stmt.executeUpdate(sql);
}
con.commit();
con.setAutoCommit(true);
} catch (Exception var10) {
try {
con.rollback();
} catch (SQLException var9) {
var9.printStackTrace();
}
} finally {
close(stmt, con, (ResultSet)null);
}
}
public static String updateSentence(Map<String, String> obj, String tableName, String where) {
if (obj == null) {
return null;
} else {
Set<String> keys = obj.keySet();
StringBuffer buffer = new StringBuffer(" update " + tableName + " set ");
int count = 0;
for(Iterator var7 = keys.iterator(); var7.hasNext(); ++count) {
String key = (String)var7.next();
if (count == 0) {
buffer.append(key + " = " + getParam(obj.get(key)) + " ");
} else {
buffer.append("," + key + " = " + getParam(obj.get(key)) + " ");
}
}
count = 0;
if (StringUtils.hasText(where)) {
buffer.append(where);
}
return buffer.toString();
}
}
private static String getParam(Object params) {
if (params == null) {
return "null";
} else if (params instanceof Integer) {
return params.toString();
} else if (params instanceof String) {
String str = params.toString();
if ("null".equalsIgnoreCase(str)) {
return "null";
} else if (str.indexOf("isSentence:") >= 0) {
return params.toString().substring(str.indexOf(":") + 1);
} else {
return str.toUpperCase().indexOf(".NEXTVAL") >= 0 ? params.toString() : "'" + params.toString() + "'";
}
} else {
return params instanceof Double ? params.toString() : null;
}
}
private static void close(Statement stmt, Connection con, ResultSet rs) throws SQLException {
if (stmt != null) {
stmt.close();
stmt = null;
}
if (con != null) {
con.close();
con = null;
}
if (rs != null) {
rs.close();
rs = null;
}
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.app.rest;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
@Provider
@Path("/pitask")
public interface pitaskSerice {
@GET
@Path("/GetPhoneManage")
@Produces({"application/json"})
Response GetPhoneManage(@QueryParam("PHONEID") String var1, @QueryParam("RoleID") String var2, @QueryParam("CompanyID") String var3);
@GET
@Path("/GetPhoneAPP")
@Produces({"application/json"})
Response GetPhoneAPP(@QueryParam("BB_ID") String var1, @QueryParam("CompanyID") String var2);
@GET
@Path("/downloadPA_ROLE")
@Produces({"application/json"})
Response downloadPA_ROLE(@QueryParam("CompanyID") String var1,@Context HttpServletResponse response);
@GET
@Path("/downloadPA_User")
@Produces({"application/json"})
Response downloadPA_User(@QueryParam("CompanyID") String var1, @QueryParam("RoleID") String var2,
@Context HttpServletResponse response);
@GET
@Path("/GetNotice/{postId}")
@Produces({"application/json"})
Response GetNotice(@PathParam("postId") String var1,@Context HttpServletResponse response);
@GET
@Path("/GetPItask")
@Produces({"application/json"})
String GetPItask(@QueryParam("POST_ID") String var1);
@GET
@Path("/DateTimeNow")
@Produces({"application/json"})
String DateTimeNow();
@GET
@Path("/downloadPA_ROUTINE_GROUP")
@Produces({"application/json"})
Response downloadPA_ROUTINE_GROUP(@QueryParam("US_CODE") String var1, @QueryParam("COMPANY_ID") String var2,
@QueryParam("IfRole") String var3);
@GET
@Path("/downloadPA_ROUTINE")
@Produces({"application/json"})
Response downloadPA_ROUTINE(@QueryParam("US_CODE") String var1, @QueryParam("COMPANY_ID") String var2,
@QueryParam("IfRole") String var3);
@POST
@Path("/UploadingPA_DATA/{strContent}")
@Produces({"application/json"})
Response UploadingPA(@PathParam("strContent") String var1);
@POST
@Path("/UploadingPA_LSXJ")
@Produces({"application/json"})
Response UploadingPALS(@ModelAttribute("strContent") String var1);
@GET
@Path("/queryPiTask/{US_CODE}/{COMPANY_ID}")
@Produces({"application/json"})
Response queryPiTask(@PathParam("US_CODE") String var1, @PathParam("COMPANY_ID") String var2);
@GET
@Path("/checkUser/{loginid}/{password}")
@Produces({"application/json"})
Response checkUser(@PathParam("loginid") String var1, @PathParam("password") String var2,
@Context HttpServletResponse response);
@GET
@Path("/executeUpdate")
@Produces({"application/json"})
Response executeUpdate();
@GET
@Path("/downloadPA_ITEM_STATU/{US_CODE}")
@Produces({"application/json"})
Response queryPi_Item_Status(@PathParam("US_CODE") String var1);
@POST
@Path("/login")
@Produces({"application/json"})
@Consumes(MediaType.APPLICATION_JSON)
Response Login(@RequestBody Map<String,String> userMap,@Context HttpServletResponse response);
@GET
@Path("/executeUpdate/{Listsql}")
@Produces({"application/json"})
Response executeUpdate(@PathParam("Listsql") List<String> var1);
@GET
@Path("/getNFCList/{areaName}")
@Produces({"application/json"})
Response getNFCList(@PathParam("areaName") String areaName,@Context HttpServletResponse response);
@GET
@Path("/getNFCDetail/{areaNum}")
@Produces({"application/json"})
Response getNFCDetail(@PathParam("areaNum") String areaNum,@Context HttpServletResponse response);
@GET
@Path("/getNFCList/")
@Produces({"application/json"})
Response getNFCList(@Context HttpServletResponse response);
@POST
@Path("/bindNFC")
@Produces({"application/json"})
@Consumes(MediaType.APPLICATION_JSON)
Response bindNFC(@RequestBody Map<String,String> nfcMap,@Context HttpServletResponse response);
@POST
@Path("/springUpload")
@Consumes({"multipart/form-data"})
Response uploadFileList(List<Attachment> var1, @Context HttpServletRequest var2);
@GET
@Path("/downloadPA_Createpitask")
@Produces({"application/json"})
Response downloadPA_Createpitask(@QueryParam("US_CODE") String var1, @QueryParam("CompanyID") String var2,
@QueryParam("personid") String var3);
@POST
@Path("/UploadHD")
@Consumes({"multipart/form-data"})
Response CreaUdbug(List<Attachment> var1, @Context HttpServletRequest var2);
@GET
@Path("/getTaskByPostId/{postId}/{status}")
@Produces({"application/json"})
Response getTaskByPostId(@PathParam("postId") String postId,@PathParam("status") String status,
@Context HttpServletResponse response);
@GET
@Path("/getRouteTaskByPostId/{postId}/{status}")
@Produces({"application/json"})
Response getRouteTaskByPostId(@PathParam("postId") String postId,@PathParam("status") String status,
@Context HttpServletResponse response);
@POST
@Path("/getTaskByRouteNum")
@Produces({"application/json"})
@Consumes(MediaType.APPLICATION_JSON)
Response getTaskByRouteNum(@RequestBody Map<String,String> routeMap,@Context HttpServletResponse response);
@GET
@Path("/getAreaByTaskNum/{taskNum}/{status}/{page}")
@Produces({"application/json"})
Response getAreaByTaskNum(@PathParam("taskNum") String taskNum,@PathParam(value = "status") String status,
@PathParam(value = "page") String page,@Context HttpServletResponse response);
@GET
@Path("/getAreaByTaskNum/{taskNum}/{page}")
@Produces({"application/json"})
Response getAreaByTaskNum(@PathParam("taskNum") String taskNum,@PathParam(value = "page") String page,@Context HttpServletResponse response);
@GET
@Path("/getDeviceByAreaNum/{taskNum}/{areaNum}/{page}")
@Produces({"application/json"})
Response getDeviceByAreaNum(@PathParam("taskNum") String taskNum,@PathParam("areaNum") String areaNum,
@PathParam(value = "page") String page,@Context HttpServletResponse response);
@GET
@Path("/selectItemDetail/{taskNum}/{itemNum}")
@Produces({"application/json"})
Response selectItemDetail(@PathParam("taskNum") String taskNum,@PathParam("itemNum") String itemNum,
@Context HttpServletResponse response);
@GET
@Path("/getItemByDeviceNum/{taskNum}/{areaNum}/{deviceNum}/{page}")
@Produces({"application/json"})
Response getItemByDeviceNum(@PathParam("taskNum") String taskNum,@PathParam("areaNum") String areaNum,
@PathParam("deviceNum") String deviceNum,@PathParam(value = "page") String page,@Context HttpServletResponse response);
@POST
@Path("/punchCard")
@Consumes(MediaType.APPLICATION_JSON)
Response punchCard(@RequestBody Map<String,String> itemMap,@Context HttpServletResponse response);
@GET
@Path("/saveRecord/{taskNum}")
@Produces({"application/json"})
Response saveRecord(@PathParam("taskNum") String taskNum,@Context HttpServletResponse response);
@GET
@Path("/exemptFromInspection/{taskNum}/{areaNum}/{deviceNum}")
@Produces({"application/json"})
Response exemptFromInspection(@PathParam("taskNum") String taskNum,@PathParam("areaNum") String areaNum,
@PathParam("deviceNum") String deviceNum,@Context HttpServletResponse response);
@GET
@Path("/getExemptFromInspectionItem/{taskNum}")
@Produces({"application/json"})
Response getExemptFromInspection(@PathParam("taskNum") String taskNum,
@Context HttpServletResponse response);
@GET
@Path("/getConfig")
@Produces({"application/json"})
Response getConfig(@Context HttpServletResponse response);
@GET
@Path("/selectItemPicture/{taskNum}/{itemNum}")
@Produces({"application/json"})
Response selectItemPicture(@PathParam("taskNum") String taskNum,@PathParam("itemNum") String itemNum,
@Context HttpServletResponse response);
@GET
@Path("/selectNotFinishItemList/{taskNum}")
@Produces({"application/json"})
Response selectNotFinishItemList(@PathParam("taskNum") String taskNum,@Context HttpServletResponse response);
@GET
@Path("/selectExpItemList/{taskNum}")
@Produces({"application/json"})
Response selectExpItemList(@PathParam("taskNum") String taskNum,@Context HttpServletResponse response);
@POST
@Path("/updateItem")
@Consumes(MediaType.APPLICATION_JSON)
Response updateItem(@RequestBody Map<String,String> itemMap,@Context HttpServletResponse response);
@POST
@Path("/uploadPunchCardImg")
@Consumes({"multipart/form-data"})
Response uploadPunchCardImg(@FormParam("useCode") String useCode,@FormParam("taskNum") String taskNum,@FormParam("cardId") String cardId,
@FormParam("IsiOS") String IsiOS,@Multipart(value = "files") Attachment files,@Context HttpServletResponse response);
@POST
@Path("/uploadItemImg")
@Consumes({"multipart/form-data"})
Response uploadItemImg(@FormParam("useCode") String useCode,@FormParam("taskNum") String taskNum,@FormParam("itemNum") String itemNum,
@Multipart(value = "files") Attachment files,@Context HttpServletResponse response);
@GET
@Path("/previewImg/{imgUrl}")
Response previewImg(@PathParam("imgUrl") String imgUrl,@Context HttpServletResponse response) throws IOException;
@POST
@Path("/getToken")
@Produces({"application/json"})
@Consumes(MediaType.APPLICATION_JSON)
Response getToken(@RequestBody Map<String,String> userMap,@Context HttpServletResponse response);
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.app.rest;
import com.tohi.common.dto.*;
import com.tohi.common.pwdutil.*;
import java.io.*;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.activation.DataHandler;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.InputStreamDataSource;
import org.springframework.stereotype.Component;
@Component
public class pitaskSericeImpl implements pitaskSerice {
public pitaskSericeImpl() {
System.out.println("start rest ----" + new Date());
}
public Response GetPhoneManage(String paramString1, String paramString2, String paramString3) {
String result = "[{'result':'true'}]";
return Response.ok().entity(result).build();
}
public Response downloadPA_ROLE(String paramString1,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
System.out.println("========downloadPA_ROLE========,参数:" + paramString1);
List<PA_Group_TempModel> list = helper.downloadPA_ROLE(paramString1);
JSONArray o = JSONArray.fromObject(list);
String s = o.toString();
System.out.println(s.replaceAll("name", "Name") + "-----s");
return Response.ok().entity(s.replaceAll("name", "Name")).build();
}
public Response getNFCList(String areaName,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
List<UdGeneral> list = helper.downloadPA_BSP(areaName,"");
JSONArray o = JSONArray.fromObject(list);
return Response.ok().entity(o).build();
}
public Response getNFCDetail(String areaNum,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
List<UdGeneral> list = helper.downloadPA_BSP("",areaNum);
JSONArray o = JSONArray.fromObject(list);
return Response.ok().entity(o).build();
}
public Response getNFCList(HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
List<UdGeneral> list = helper.downloadPA_BSP("","");
JSONArray o = JSONArray.fromObject(list);
return Response.ok().entity(o).build();
}
public Response bindNFC(Map<String,String> nfcMap,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
String r = helper.bindNFC(nfcMap.get("NFCID"), nfcMap.get("areaNum"));
return Response.ok().entity(r).build();
}
public Response downloadPA_User(String paramString1, String paramString2,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
System.out.println("========downloadPA_User");
System.out.println("paramString1:" + paramString1);
System.out.println("paramString2:" + paramString2);
List<Phone_C_USER> list = helper.downloadPA_User(paramString1, paramString2);
JSONArray o = JSONArray.fromObject(list);
System.out.println("downloadPA_User:(" + o + ")");
return Response.ok().entity(o).build();
}
public Response GetPhoneAPP(String paramString, String paramString1) {
dbhelpers helper = new dbhelpers();
String m = helper.GetPhoneAPP(paramString, paramString1);
System.out.println(m + "---------242");
return Response.ok().entity(m).build();
}
public Response GetNotice(String postId,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
List<PA_GG> list = helper.GetNotice(postId);
JSONArray o = JSONArray.fromObject(list);
return Response.ok().entity(o).build();
}
public String GetPItask(String paramString1) {
String result = "无";
dbhelpers helper = new dbhelpers();
result = helper.GetPItask(paramString1);
return result;
}
public String DateTimeNow(){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String str = sdf.format(new Date());
System.out.println(str + "--str");
return str;
}
public Response downloadPA_ROUTINE_GROUP(String paramString1, String paramString2, String paramString3) {
dbhelpers helper = new dbhelpers();
System.out.println(paramString1 + "=" + paramString2 + "==" + paramString3 + "======downloadPA_ROUTINE_GROUP");
List<Phone_PA_ROUTINE_GROUP> list = helper.downloadPA_ROUTINE_GROUP(paramString1, paramString2);
JSONArray o = JSONArray.fromObject(list);
System.out.println("Phone_PA_ROUTINE_GROUP" + o);
return Response.ok().entity(o).build();
}
public Response downloadPA_ROUTINE(String paramString1, String paramString2, String paramString3) {
System.out.println(paramString1 + "=" + paramString2 + "==" + paramString3 + "====downloadPA_ROUTINE");
dbhelpers helper = new dbhelpers();
List<Phone_PA_ROUTINE> list = helper.downloadPA_ROUTINE(paramString1, paramString2);
JSONArray o = JSONArray.fromObject(list);
System.out.println("Phone_PA_ROUTINE" + o);
return Response.ok().entity(o).build();
}
public Response UploadingPALS(String strContent) {
dbhelpers helper = new dbhelpers();
try {
strContent = URLDecoder.decode(strContent, "UTF-8");
} catch (UnsupportedEncodingException var9) {
var9.printStackTrace();
}
Integer upload = helper.methodBls(strContent);
List<Results> runtime = new ArrayList();
Results obj = new Results();
String m = null;
if (upload == 1) {
obj.setResult("true");
obj.setPhoneResult("true");
m = "{\"PhoneResult\":\"true\",\"result\":\"true\",\"UpdateNow\":\"true\"}";
} else {
obj.setResult("false");
obj.setPhoneResult("false");
// obj.setUpdateNow("false");
}
runtime.add(obj);
JSONArray o = JSONArray.fromObject(runtime);
System.out.println("UploadingPA:" + o);
String s = o.toString();
s = s.replaceAll("phoneResult", "PhoneResult");
return Response.ok().entity(m).build();
}
public Response UploadingPA(String strContent) {
System.out.println("========"+strContent);
dbhelpers helper = new dbhelpers();
try {
strContent = URLDecoder.decode(strContent, "UTF-8");
} catch (UnsupportedEncodingException var9) {
var9.printStackTrace();
}
System.out.println("--------------------------143");
Integer upload = helper.methodB(strContent);
System.out.println(upload + "===upload");
List<Results> runtime = new ArrayList();
Results obj = new Results();
String m = null;
if (upload == 1) {
obj.setResult("true");
obj.setPhoneResult("true");
m = "{\"PhoneResult\":\"true\",\"result\":\"true\",\"UpdateNow\":\"true\"}";
} else {
obj.setResult("false");
obj.setPhoneResult("false");
// obj.setUpdateNow("false");
}
System.out.println(obj.getResult() + "--------------------133");
runtime.add(obj);
JSONArray o = JSONArray.fromObject(runtime);
System.out.println("UploadingPA:" + o);
String s = o.toString();
s = s.replaceAll("phoneResult", "PhoneResult");
System.out.println(m + "--------141");
return Response.ok().entity(m).build();
}
public Response queryPiTask(String personid, String orgid) {
dbhelpers helper = new dbhelpers();
List<Phone_PA_ROUTINE> list = helper.downloadPA_ROUTINE(personid, orgid);
JSONArray o = JSONArray.fromObject(list);
System.out.println("queryPiTask" + o);
return Response.ok().entity(o).build();
}
public Response checkUser(String loginid, String password,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
String result = "";
try {
dbhelpers helper = new dbhelpers();
String sql = "select personid,password from maxuser where loginid = '" + loginid + "'";
System.out.println(sql);
String jsonObj = helper.executeQuery(sql);
JSONObject o = JSONObject.fromObject(jsonObj);
JSONObject o1 = (JSONObject)o.get("0");
if (o1 != null) {
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)) {
result = o1.toString();
} else {
result = "用户名或密码错误";
}
} else {
result = "用户名或密码错误";
}
} catch (Exception var13) {
result = var13.getMessage();
}
System.out.println(result);
return Response.ok().entity(result).build();
}
public Response executeUpdate() {
dbhelpers db = new dbhelpers();
String sql = " update pi_task set END_TIME = to_date(char(current date)||' '||char(current time),'yyyy/mm/dd hh24:mi:ss')";
Integer i = db.executeUpdate(sql);
System.out.println("executeUpdate===" +sql);
return Response.ok().entity(i).build();
}
public Response queryPi_Item_Status(String personid) {
System.out.println("====downloadPA_ITEM_STATU");
dbhelpers helper = new dbhelpers();
List<Phone_PA_ITEM_STATU> list = helper.downloadPA_ITEM_STATU(personid);
JSONArray o = JSONArray.fromObject(list);
System.out.println("Phone_PA_ITEM_STATU" + o);
return Response.ok().entity(o).build();
}
public Response Login(Map<String,String> User,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers helper = new dbhelpers();
Phone_C_USER user = new Phone_C_USER();
String result = helper.login(User.get("loginid"), User.get("password"));
if (result == "") {
dbhelpers helper1 = new dbhelpers();
user = helper1.getUserinfo(User.get("loginid"), User.get("password"));
JSONObject o = JSONObject.fromObject(user);
return Response.ok().entity(o).build();
}
return Response.ok().entity(result).build();
}
public Response executeUpdate(List<String> Listsql) {
dbhelpers db = new dbhelpers();
Integer i = db.executeUpdate(Listsql);
System.out.println("executeUpdate===" + i);
return Response.ok().entity(i).build();
}
public Response uploadFileList(List<Attachment> attachments, HttpServletRequest request) {
System.out.println("235-----------------------图片");
dbhelpers helper = new dbhelpers();
String result = helper.uploadFileList(attachments, request);
return Response.ok().entity(result).build();
}
public Response downloadPA_Createpitask(String paramString1, String paramString2, String paramString3) {
System.out.println(paramString1 + "==========" + paramString2 + "=====" + paramString3);
String result = "[{'result':'true'}]";
dbhelpers helper = new dbhelpers();
String jsonObj = helper.downloadPerson(paramString3);
System.out.println("=========266===" + jsonObj);
if (!"0".equalsIgnoreCase(jsonObj)) {
System.out.println("=======================275");
helper.downloadPA_Createpitask(paramString1, paramString2);
} else {
result = "[{'result':'false'}]";
}
return Response.ok().entity(result).build();
}
public Response CreaUdbug(List<Attachment> attachments, HttpServletRequest request) {
System.out.println("253----------CreaUdbug-------------图片");
dbhelpers helper = new dbhelpers();
String result = helper.CreaUdbug(attachments, request);
System.out.println(result + "=========256");
return Response.ok().entity(result).build();
}
public Response getTaskByPostId(String postId, String status,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
Map<String,String> routeMap = new HashMap();
routeMap.put("postId",postId);
routeMap.put("status",status);
List<PI_TASK> taskList = dbhelpers.getTaskList(routeMap);
JSONArray o = JSONArray.fromObject(taskList);
return Response.ok().entity(o).build();
}
public Response getRouteTaskByPostId(String postId, String status,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK> taskList = dbhelpers.getTaskList(postId,status);
JSONArray o = JSONArray.fromObject(taskList);
return Response.ok().entity(o).build();
}
public Response getTaskByRouteNum(Map<String,String> routMap,HttpServletResponse response){
response.setHeader("Access-Control-Allow-Origin","*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK> taskList = dbhelpers.getTaskList(routMap);
JSONArray o = JSONArray.fromObject(taskList);
return Response.ok().entity(o).build();
}
public Response getAreaByTaskNum(String taskNum,String status,String page,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_AREA> areaList = dbhelpers.getAreaList(taskNum,status,page);
dbhelpers dbhelpers1 = new dbhelpers();
Page page1 = new Page();
page1.setData(areaList);
page1.setTotal(dbhelpers1.getAreaListTotal(taskNum,status));
JSONObject data = JSONObject.fromObject(page1);
return Response.ok().entity(data).build();
}
public Response getAreaByTaskNum(String taskNum,String page,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_AREA> areaList = dbhelpers.getAreaList(taskNum,null,page);
dbhelpers dbhelpers1 = new dbhelpers();
Page page1 = new Page();
page1.setData(areaList);
page1.setTotal(dbhelpers1.getAreaListTotal(taskNum,null));
JSONObject data = JSONObject.fromObject(page1);
return Response.ok().entity(data).build();
}
public Response getItemByDeviceNum(String taskNum,String areaNum,String deviceNum,String page,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_ITEM> areaList = dbhelpers.getItemList(taskNum,areaNum,deviceNum,page);
JSONArray o = JSONArray.fromObject(areaList);
return Response.ok().entity(o).build();
}
public Response getDeviceByAreaNum(String taskNum,String areaNum,String page,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_DEVICE> deviceList = dbhelpers.getDeviceList(taskNum,areaNum,page);
JSONArray o = JSONArray.fromObject(deviceList);
return Response.ok().entity(o).build();
}
public Response selectItemDetail(String taskNum, String itemNum,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
PI_TASK_ITEM pi_task_item = dbhelpers.selectItemDetail(taskNum, itemNum);
JSONObject o = JSONObject.fromObject(pi_task_item);
return Response.ok().entity(o).build();
}
public Response punchCard(Map<String,String> areaMap,
HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
String result = "成功";
dbhelpers dbhelpers = new dbhelpers();
result = dbhelpers.punchCard(areaMap.get("useCode"),areaMap.get("taskNum"),areaMap.get("cardId"),areaMap.get("IsiOS"));
return Response.ok().entity(result).build();
}
public Response saveRecord(String taskNum,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_ITEM> areaList = dbhelpers.saveRecord(taskNum);
if(areaList.size()!=0){
return Response.ok().entity("有未检项").build();
}
return Response.ok().entity("成功").build();
}
public Response exemptFromInspection(String taskNum, String areaNum,String deviceNum, HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
String r = dbhelpers.exemptFromInspection(taskNum,areaNum,deviceNum);
return Response.ok().entity(r).build();
}
public Response getExemptFromInspection(String taskNum, HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_ITEM> areaList = dbhelpers.selectExpItemList(taskNum,"免检");
if(areaList.size()==0){
return Response.status(Response.Status.NOT_FOUND).build();
}
JSONArray o = JSONArray.fromObject(areaList);
return Response.ok().entity(o).build();
}
public Response selectNotFinishItemList(String taskNum,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_ITEM> areaList = dbhelpers.selectNotFinishItemList(taskNum,"草稿");
if(areaList.size()==0){
return Response.status(Response.Status.NOT_FOUND).build();
}
JSONArray o = JSONArray.fromObject(areaList);
return Response.ok().entity(o).build();
}
public Response selectExpItemList(String taskNum, HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<PI_TASK_ITEM> areaList = dbhelpers.selectExpItemList(taskNum,"异常");
if(areaList.size()==0){
return Response.status(Response.Status.NOT_FOUND).build();
}
JSONArray o = JSONArray.fromObject(areaList);
return Response.ok().entity(o).build();
}
public Response updateItem(Map<String,String> itemMap,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
String r = dbhelpers.updateItem(itemMap.get("useCode"),itemMap.get("taskNum"),itemMap.get("itemNum"),itemMap.get("result"),
itemMap.get("valueResult"),itemMap.get("remark"));
return Response.ok().entity(r).build();
}
public Response uploadPunchCardImg(String useCode,String taskNum,String cardId,String IsiOS,Attachment files,
HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
String r = dbhelpers.uploadPunchCardImg(useCode,taskNum,cardId,IsiOS,files);
return Response.ok().entity(r).build();
}
public Response uploadItemImg(String useCode, String taskNum, String itemNum,Attachment files,
HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
String r = dbhelpers.uploadItemImg(useCode,taskNum,itemNum,files);
return Response.ok().entity(r).build();
}
public Response previewImg(String imgUrl, HttpServletResponse response) throws IOException {
response.setHeader("Access-Control-Allow-Origin", "*");
imgUrl = JdbcUtil.doc+"\\"+imgUrl;
File file = new File(imgUrl);
if(!file.exists()){
return Response.status(Response.Status.NOT_FOUND).build();
}
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
//获取url的后缀名
String fileExtName = imgUrl.substring(imgUrl.lastIndexOf(".") + 1);
if(fileExtName==null||"".equals(fileExtName)){
return Response.status(Response.Status.NOT_FOUND).build();
}
response.setHeader("Content-Type", "image/"+fileExtName);
byte b[] = new byte[1024];
int read;
try {
while ((read = bis.read(b)) != -1) {
bos.write(b, 0, read);
}
//request.getRequestDispatcher("/components/hazard/yscchird.html").forward(request, response);
} catch (Exception e) {
// TODO: handle exception
} finally {
if (bos != null) {
bos.close();
}
if (bis != null) {
bis.close();
}
}
return Response.ok().entity("完成").build();
}
public Response getToken(Map<String,String> User,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
Map<String,String> map = new HashMap();
map.put("token", TokenUtils.token(User.get("loginid"), User.get("password")));
JSONObject jsonObject = JSONObject.fromObject(map);
return Response.ok().entity(jsonObject).build();
}
public Response getConfig(HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
Map config = WxUtils.getConfig("http://mmapp.b2bsun.com/SGXJ/index.html");
if(config.size() == 0){
return Response.status(Response.Status.NOT_FOUND).build();
}
JSONObject jsonObject = JSONObject.fromObject(config);
return Response.ok().entity(jsonObject).build();
}
public Response selectItemPicture(String taskNum,String itemNum,HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
dbhelpers dbhelpers = new dbhelpers();
List<Map<String,String>> config = dbhelpers.selectItemPicture(taskNum,itemNum);
if(config.size() == 0){
return Response.status(Response.Status.NOT_FOUND).build();
}
JSONArray jsonArray= JSONArray.fromObject(config);
return Response.ok().entity(jsonArray).build();
}
}
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
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.pwdutil;
import com.tohi.app.rest.JdbcUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public class CustThread extends Thread {
private Connection con;
private String strContent;
public static Connection getDB2Conn() {
Connection conn = null;
try {
conn = JdbcUtil.getConn();
} catch (Exception var2) {
var2.printStackTrace();
}
return conn;
}
public CustThread(String strContent) {
this.strContent = strContent;
this.con = getDB2Conn();
}
public void run() {
ResultSet rst = null;
PreparedStatement pst = null;
ResultSet rst1 = null;
PreparedStatement pst1 = null;
ResultSet rst2 = null;
PreparedStatement pst2 = null;
ResultSet rst3 = null;
PreparedStatement pst3 = null;
ResultSet rst4 = null;
PreparedStatement pst4 = null;
try {
System.out.println("========================44");
int beg = this.strContent.indexOf("&US_CODE");
// int end = this.strContent.indexOf("&UpdateDate");
int end = this.strContent.indexOf("&callback");
String userid = this.strContent.substring(beg, end);
List<String[]> list = new ArrayList();
Integer result = 0;
int endIndex = 0;
endIndex = this.strContent.lastIndexOf("&Company_ID");
this.strContent = this.strContent.substring(0, endIndex);
String[] strs = this.strContent.split(";");
if (strs != null) {
String[] var21 = strs;
int var20 = strs.length;
for(int var19 = 0; var19 < var20; ++var19) {
String str = var21[var19];
String[] test = str.split("\\^");
list.add(test);
}
List<String> listsql = new ArrayList();
List<String> upqy = new ArrayList();
int d = 0;
int i = 1;
int m = 0;
String id = "";
String US_CODE = userid.substring(9, userid.length());
List<String> listqy = new ArrayList();
String qyid = null;
new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(5, -1);
Date datej = calendar.getTime();
String imid = null;
String imsql = null;
String zt = null;
String itemsql = null;
String qfsql = null;
String qfsql1 = null;
String sql;
String sqlx;
for(Iterator var37 = list.iterator(); var37.hasNext(); ++i) {
String[] str = (String[])var37.next();
if (i == 1) {
id = str[0].replaceAll("strContent=", "");
str[0] = id;
}
if ("9008081".equalsIgnoreCase(str[0])) {
d = 0;
result = 1;
}
System.out.println("str[6]================" + str[6]);
if ("点检".equalsIgnoreCase(str[6])) {
qfsql = " PI_TASK_ITEMID='" + str[0] + "'";
qfsql1 = " b.PI_TASK_ITEMID='" + str[0] + "'";
} else {
qfsql = " NUM='" + str[0] + "' and BEGIN_TIME<=to_date('" + str[3] + "','yyyy-mm-dd hh24:mi:ss')" + " and END_TIME >=to_date('" + str[3] + "','yyyy-mm-dd hh24:mi:ss')";
qfsql1 = " b.NUM='" + str[0] + "' and b.BEGIN_TIME<=to_date('" + str[3] + "','yyyy-mm-dd hh24:mi:ss')" + " and b.END_TIME >=to_date('" + str[3] + "','yyyy-mm-dd hh24:mi:ss')";
}
sql = "update PI_TASK_ITEM set XJPERSONID='" + str[8] + "', PI_TASK_ITEM_RESULT='" + str[2] + "', PI_TASK_TIME=to_date('" + str[3] + "','yyyy-mm-dd hh24:mi:ss'), REMARK='" + str[4] + "' where " + " " + qfsql;
if (!"".equalsIgnoreCase(str[0]) && str[0] != null) {
itemsql = "select PI_TASK_ITEM_RESULT,PI_TASK_ITEMID ,pi_task_no,(select PI_TASK_AREAid from PI_TASK_AREA where num in(select PI_TASK_area_no from PI_TASK_DEVICE where pi_task_no=PI_TASK_ITEM.pi_task_no and num=PI_TASK_ITEM.PI_TASK_device_no and pi_task_area_no=PI_TASK_ITEM.pi_task_area_no) and pi_task_no=PI_TASK_ITEM.pi_task_no ) qyid from PI_TASK_ITEM where " + qfsql;
System.out.println("139:" + itemsql);
pst4 = this.con.prepareStatement(itemsql);
rst4 = pst4.executeQuery();
if (rst4.next()) {
if (!"正常".equalsIgnoreCase(str[2])) {
if (imid == null) {
imid = "'" + rst4.getString("PI_TASK_ITEMID") + "'";
} else {
imid = imid + ",'" + rst4.getString("PI_TASK_ITEMID") + "'";
}
}
listqy.add(rst4.getString("qyid"));
}
if (rst4 != null) {
rst4.close();
}
if (pst4 != null) {
pst4.close();
}
}
System.out.println("sql556:" + sql);
if (str[0] != null && str[0] != "") {
m = 0;
}
System.out.println(str[4] + "============581============" + str[7]);
sqlx = " update PI_TASK_AREA a set UDSFSM=" + str[7] + " where exists (select 1 from PI_TASK_ITEM b where a.pi_task_no=b.pi_task_no " + " and a.num=b.PI_TASK_AREA_no and " + qfsql1 + " )";
System.out.println("584:" + sqlx);
listsql.add(sql);
if ("1".equals(str[5])) {
zt = "运行";
} else if ("2".equals(str[5])) {
zt = "检修";
} else if ("3".equals(str[5])) {
zt = "备用(巡检)";
} else if ("4".equals(str[5])) {
zt = "备用";
} else if ("5".equals(str[5])) {
zt = "停运";
}
sql = " update PI_TASK_DEVICE a set ON_OFF_POTIN='" + zt + "' where exists (select 1 from PI_TASK_ITEM b where a.pi_task_no=b.pi_task_no " + " and a.num=b.PI_TASK_device_no and a.PI_area_no=b.PI_TASK_area_no and " + qfsql1 + " ) ";
listsql.add(sql);
listsql.add(sqlx);
}
String ctj;
if (i > 1 && d==0) {
HashSet<String> h = new HashSet(listqy);
listqy.clear();
listqy.addAll(h);
for(int j = 0; j < listqy.size(); ++j) {
if (j == 0) {
qyid = "'" + (String)listqy.get(j) + "'";
} else {
qyid = qyid + ",'" + (String)listqy.get(j) + "'";
}
}
ctj = "update PI_TASK_AREA set IS_UPLOAD=1,SCPERSON='" + US_CODE + "',SCDATE= CURRENT_DATE," + " SCANTIME=(select to_date(to_char(min(PI_TASK_TIME),'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') sj from PI_TASK_ITEM where " + " PI_TASK_TIME is not null and pi_task_no=PI_TASK_AREA.pi_task_no and PI_TASK_DEVICE_no in(" + " select NUM from PI_TASK_DEVICE where ON_OFF_POTIN in('运行','检修','备用(巡检)') and pi_task_no=PI_TASK_AREA.pi_task_no ))" + " where PI_TASK_AREAID in(" + qyid + ")";
listsql.add(ctj);
}
if (d==0) {
System.out.println("207---" + listsql.size());
this.executeUpdateqy(listsql);
}
if (i > 1 && d==0) {
try {
sql = " select PI_TASK_NO,(select IGNORE_POINT from PI_TASK where num=PI_TASK_AREA.PI_TASK_NO) xjs from PI_TASK_AREA where IS_UPLOAD=1 and PI_TASK_AREAID in(" + qyid + ") group by PI_TASK_NO";
System.out.println("561sql:----" + sql);
pst1 = this.con.prepareStatement(sql);
rst1 = pst1.executeQuery();
ctj = "";
label773:
while(true) {
do {
do {
if (!rst1.next()) {
break label773;
}
} while(rst1.getString("PI_TASK_NO") == null);
} while("".equalsIgnoreCase(rst1.getString("PI_TASK_NO")));
sql = " select a.qyz,b.yjd,c.kjd,(select count(*) tj from PI_TASK_DEVICE where pi_task_no = a.PI_TASK_NO and ON_OFF_POTIN in('备用','停运')) tj, (select count(*) from PI_TASK_ITEM where PI_TASK_DEVICE_no in( select num from PI_TASK_DEVICE where pi_task_no = a.PI_TASK_NO and ON_OFF_POTIN in('备用','停运')) and pi_task_no =a.PI_TASK_NO ) tjx, (select count(t.pi_task_no) lj from PI_TASK_ITEM t where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "' and " + " PI_TASK_DEVICE_no in(select NUM from PI_TASK_DEVICE t where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "'" + " and ON_OFF_POTIN in('运行','检修','备用(巡检)')) and PI_TASK_ITEM_RESULT is null) lj," + " (select count(*) yj from ( select t.PI_TASK_ITEMid from PI_TASK_ITEM t " + " where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "' " + " and PI_TASK_DEVICE_no in(select NUM from PI_TASK_DEVICE t where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "' and ON_OFF_POTIN in('运行','检修','备用(巡检)')) " + " and (PI_TASK_ITEM_RESULT like '%异常%' or PI_TASK_ITEM_RESULT like '%轻微%' or PI_TASK_ITEM_RESULT like '%严重%' )" + " union all" + " select t.PI_TASK_ITEMid from PI_TASK_ITEM t " + " where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "' and POINT_TYPE='JS' and PI_TASK_ITEM_RESULT is not null " + " and PI_TASK_ITEM_RESULT!='正常' and PI_TASK_DEVICE_no in(select NUM from PI_TASK_DEVICE t where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "' and ON_OFF_POTIN in('运行','检修','备用(巡检)')) " + " and (nvl(PI_TASK_ITEM_RESULT,0)>nvl(HIGHER_LIMIT,0) or nvl(PI_TASK_ITEM_RESULT,0)<nvl(LOWER_LIMIT,0))) a) yc" + " from (select count(*) qyz,max(PI_TASK_NO) PI_TASK_NO from PI_TASK_AREA " + " where PI_TASK_NO='" + rst1.getString("PI_TASK_NO") + "' and IS_UPLOAD=1) a left join " + " (select count(*) yjd ,max(PI_TASK_NO) PI_TASK_NO from PI_TASK_DEVICE where NUM in(" + " select pi_AREA_DEVICE_NO from PI_TASK_ITEM where pi_task_no = '" + rst1.getString("PI_TASK_NO") + "' " + " and PI_TASK_ITEM_RESULT is not null group by pi_AREA_DEVICE_NO) and PI_TASK_NO='" + rst1.getString("PI_TASK_NO") + "'" + " and NUM in(select NUM from PI_TASK_DEVICE t where t.pi_task_no='" + rst1.getString("PI_TASK_NO") + "' and ON_OFF_POTIN in('运行','检修','备用(巡检)')) " + ") b on a.PI_TASK_NO=b.PI_TASK_NO" + " left join (select count(*) kjd,max(PI_TASK_NO) pi_task_no from PI_TASK_DEVICE where PI_TASK_NO='" + rst1.getString("PI_TASK_NO") + "'" + " and NUM not in(select pi_AREA_DEVICE_NO from PI_TASK_ITEM where pi_task_no = '" + rst1.getString("PI_TASK_NO") + "' " + " group by pi_AREA_DEVICE_NO)) c on a.PI_TASK_NO=c.PI_TASK_NO";
System.out.println("233====" + sql);
pst2 = this.con.prepareStatement(sql);
rst2 = pst2.executeQuery();
while(rst2.next()) {
ctj = ",MISSED_RATE=trunc(to_number(cast(" + rst2.getInt("lj") + " as float)/(IGNORE_POINT-" + rst2.getInt("tjx") + ")*100),0) " + " ,PI_RATE =trunc(to_number(cast(" + (rst2.getInt("yjd") + rst2.getInt("kjd")) + " as float)/(NORM_POINT-" + rst2.getInt("tj") + ")*100),0)";
if (rst1.getInt("xjs") == rst2.getInt("tjx")) {
ctj = " ,MISSED_RATE=0,PI_RATE =100 ";
}
sqlx = "update PI_TASK set status='已上传结果' ,REAL_AREA=" + rst2.getInt("qyz") + ",IN_PLACE_RATE =trunc(to_number(cast(" + rst2.getInt("qyz") + " as float)/NORM_AREA*100),0),CHANGEBY='" + US_CODE + "' " + " ,REAL_POINT=" + (rst2.getInt("yjd") + rst2.getInt("kjd")) + " ,TJ_POINT='" + rst2.getInt("tj") + "'," + " TJX='" + rst2.getInt("tjx") + "'," + " YCD='" + rst2.getString("yc") + "',MISSED_POINT='" + rst2.getString("lj") + "' " + " " + ctj + " where num='" + rst1.getString("PI_TASK_NO") + "'";
System.out.println("632===" + sqlx);
upqy.add(sqlx);
sqlx = " update PI_TASK_DEVICE set SCANTIME=(select to_date(to_char(min(PI_TASK_TIME),'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') sj from PI_TASK_ITEM where PI_TASK_TIME is not null and pi_task_no=PI_TASK_DEVICE.pi_task_no and PI_TASK_DEVICE_no=PI_TASK_DEVICE.num) where ON_OFF_POTIN in('运行','检修','备用(巡检)') and pi_task_no='" + rst1.getString("PI_TASK_NO") + "'" + " and num in(select pi_task_device_no from PI_TASK_ITEM where PI_TASK_TIME is not null and pi_task_no='" + rst1.getString("PI_TASK_NO") + "')";
upqy.add(sqlx);
System.out.println("664===" + sqlx);
this.executeUpdate(upqy);
upqy.clear();
}
if (rst2 != null) {
rst2.close();
}
if (pst2 != null) {
pst2.close();
}
}
} catch (Exception var62) {
this.closeAll(this.con, (PreparedStatement)pst, (ResultSet)rst);
this.closeAll((Connection)null, pst1, rst1);
this.closeAll((Connection)null, pst2, rst2);
this.closeAll((Connection)null, pst4, rst4);
var62.printStackTrace();
} finally {
this.closeAll(this.con, (PreparedStatement)pst, (ResultSet)rst);
this.closeAll((Connection)null, pst1, rst1);
this.closeAll((Connection)null, pst2, rst2);
this.closeAll((Connection)null, pst4, rst4);
}
imsql = " select t.PI_TASK_ITEMid,t.PI_TASK_no,'部件名称:'||t.DEVICE_PART_NAME ||',巡检描述:'||t.PI_ITEM_DESCRIPTION||',巡检结果:'||t.PI_TASK_ITEM_RESULT as ms, t.PI_TASK_DEVICE_no,(select LOCATION from PI_TASK_DEVICE where NUM=t.PI_TASK_DEVICE_no and rownum=1) location from PI_TASK_ITEM t where t.PI_TASK_ITEMID in(" + imid + ") " + " and PI_TASK_DEVICE_no in(select NUM from PI_TASK_DEVICE t where t.pi_task_no in(select pi_task_no from PI_TASK_ITEM where PI_TASK_ITEMID in(" + imid + ")) and ON_OFF_POTIN in('运行','检修','备用(巡检)'))" + " and (PI_TASK_ITEM_RESULT like '%异常%' or PI_TASK_ITEM_RESULT like '%轻微%' " + " or PI_TASK_ITEM_RESULT like '%严重%' ) " + " union all" + " select t.PI_TASK_ITEMid,t.PI_TASK_no,'部件名称:'||t.DEVICE_PART_NAME ||',巡检描述:'||t.PI_ITEM_DESCRIPTION||',上限值:'||t.HIGHER_LIMIT||',下限值:'||t.LOWER_LIMIT||',巡检结果:'||t.PI_TASK_ITEM_RESULT as ms," + " t.PI_TASK_DEVICE_no,(select LOCATION from PI_TASK_DEVICE where NUM=t.PI_TASK_DEVICE_no and rownum=1) location from PI_TASK_ITEM t " + " where t.PI_TASK_ITEMID in(" + imid + ") and POINT_TYPE='JS' and PI_TASK_ITEM_RESULT!='正常' and PI_TASK_ITEM_RESULT is not null and " + " PI_TASK_DEVICE_no in(select NUM from PI_TASK_DEVICE t where t.pi_task_no in(select pi_task_no from PI_TASK_ITEM where PI_TASK_ITEMID in(" + imid + ")) and ON_OFF_POTIN in('运行','检修','备用(巡检)'))" + " and HIGHER_LIMIT is not null and LOWER_LIMIT is not null and (nvl(PI_TASK_ITEM_RESULT,0)>nvl(HIGHER_LIMIT,0) or nvl(PI_TASK_ITEM_RESULT,0)<nvl(LOWER_LIMIT,0))";
System.out.println("634====" + imsql);
try {
this.con = JdbcUtil.getConn();
pst3 = this.con.prepareStatement(imsql);
rst3 = pst3.executeQuery();
int mm = 0;
for(ctj = ""; rst3.next(); mm = 1) {
ctj = " insert into udbug (UDBUGID, DESCRIPTION, ORGID, SITEID, HASLD, APPTYPE, ASSETNUM, BUGLEVEL, BUGMEMO, BUGNUM, BUGTYPE, CHANGEBY, CHANGEDATE, COMPDATE, FINBZ, FINDBY, FINDDEPT, FINDTIME, HISTORYFLAG, LEAD, LOCATION, LONGDESC, PLANYSTIME, PROCESSMEMO, PROCESSMODE, REPORTBY, REPORTDEPT, REPORTTIME, STATUS, STATUSDATE, STATUSDESC, UDBUGNUM, WONUM, UDTASKNUM) values (UDBUGIDSEQ.NEXTVAL, null, 'YXHBDC', 'YXDC', 0, 'SBUG', null, null, null, null, null, '" + US_CODE + "'," + " sysdate, null, null, null, null, null, 0, null, '" + rst3.getString("location") + "', '" + rst3.getString("ms") + "'," + " null, null, null, '" + US_CODE + "', (select DEPARTMENT from PERSON where PERSONID='" + US_CODE + "'), sysdate," + " 'DRAFT',sysdate, '草稿', (select seed+1 sd from AUTOKEY where AUTOKEYNAME='UDBUGNUMS' and orgid='YXHBDC'), null, '" + rst3.getString("PI_TASK_ITEMid") + "')";
System.out.println("==============648==" + ctj);
upqy.add(ctj);
ctj = " update AUTOKEY set seed=seed+1 where AUTOKEYNAME='UDBUGNUMS' and orgid='YXHBDC'";
System.out.println("==============648==" + ctj);
upqy.add(ctj);
}
if (mm > 0) {
this.executeUpdate(upqy);
}
} catch (SQLException var60) {
this.closeAll(this.con, pst3, rst3);
var60.printStackTrace();
} finally {
this.closeAll(this.con, pst3, rst3);
}
}
System.out.println(result + "===============result==========291Thread=======");
}
} catch (Exception var64) {
this.closeAll(this.con, (PreparedStatement)null, (ResultSet)null);
this.closeAll((Connection)null, pst1, rst1);
this.closeAll((Connection)null, pst2, rst2);
this.closeAll((Connection)null, pst3, rst3);
this.closeAll((Connection)null, pst4, rst4);
var64.printStackTrace();
} finally {
this.closeAll(this.con, (PreparedStatement)null, (ResultSet)null);
this.closeAll((Connection)null, pst1, rst1);
this.closeAll((Connection)null, pst2, rst2);
this.closeAll((Connection)null, pst3, rst3);
this.closeAll((Connection)null, pst4, rst4);
}
}
public Integer executeUpdate(List<String> Listsql) {
Integer result = -1;
Statement pst = null;
try {
pst = this.con.createStatement();
String sql;
for(Iterator var5 = Listsql.iterator(); var5.hasNext(); result = pst.executeUpdate(sql)) {
sql = (String)var5.next();
}
} catch (SQLException var16) {
result = -1;
try {
if (pst != null) {
pst.close();
}
if (this.con != null) {
this.con.close();
}
} catch (SQLException var15) {
var15.printStackTrace();
}
var16.printStackTrace();
} finally {
try {
if (pst != null) {
pst.close();
}
} catch (SQLException var14) {
var14.printStackTrace();
}
}
return result;
}
public Integer executeUpdateqy(List<String> Listsql) {
Integer result = -1;
Statement pst = null;
try {
pst = this.con.createStatement();
String sql;
for(Iterator var5 = Listsql.iterator(); var5.hasNext(); result = pst.executeUpdate(sql)) {
sql = (String)var5.next();
}
} catch (SQLException var16) {
result = -1;
var16.printStackTrace();
try {
if (pst != null) {
pst.close();
}
if (this.con != null) {
this.con.close();
}
} catch (SQLException var15) {
var15.printStackTrace();
}
} finally {
try {
if (pst != null) {
pst.close();
}
} catch (SQLException var14) {
var14.printStackTrace();
}
}
return result;
}
private void closeAll(Connection con, PreparedStatement pst, ResultSet rst) {
try {
if (rst != null) {
rst.close();
}
if (pst != null) {
pst.close();
}
if (con != null) {
con.close();
}
} catch (SQLException var5) {
var5.printStackTrace();
}
}
}
//
// 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
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.common.pwdutil;
import java.lang.reflect.Constructor;
import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.Provider;
import java.security.PublicKey;
import java.security.Security;
import java.security.spec.RSAPrivateKeySpec;
import java.security.spec.RSAPublicKeySpec;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class MXCipherX {
String algorithm;
String mode;
String padding;
String key;
String spec;
String modulus;
private Cipher cipherEncrypt;
String transformation;
SecretKey secretKey;
IvParameterSpec ivSpec;
PBEParameterSpec pbeParamSpec;
SecretKeySpec secretkeySpec;
PublicKey publicKey;
PrivateKey privateKey;
boolean nonSunProviders;
Provider providerClass;
int padLen;
protected MXCipherX() {
this.algorithm = PropertiesUtil.CRYPTOX_ALGORITHM;
this.mode = PropertiesUtil.CRYPTOX_MODE;
this.padding = PropertiesUtil.CRYPTOX_PADDING;
this.key = PropertiesUtil.CRYPTOX_KEY;
this.spec = PropertiesUtil.CRYPTOX_SPEC;
this.modulus = PropertiesUtil.CRYPTOX_MODULUS;
this.cipherEncrypt = null;
this.transformation = null;
this.secretKey = null;
this.ivSpec = null;
this.pbeParamSpec = null;
this.secretkeySpec = null;
this.publicKey = null;
this.privateKey = null;
this.nonSunProviders = false;
this.providerClass = null;
this.padLen = 8;
}
public MXCipherX(boolean isEncrypt, PropertiesUtil pu) {
this.algorithm = PropertiesUtil.CRYPTOX_ALGORITHM;
this.mode = PropertiesUtil.CRYPTOX_MODE;
this.padding = PropertiesUtil.CRYPTOX_PADDING;
this.key = PropertiesUtil.CRYPTOX_KEY;
this.spec = PropertiesUtil.CRYPTOX_SPEC;
this.modulus = PropertiesUtil.CRYPTOX_MODULUS;
this.cipherEncrypt = null;
this.transformation = null;
this.secretKey = null;
this.ivSpec = null;
this.pbeParamSpec = null;
this.secretkeySpec = null;
this.publicKey = null;
this.privateKey = null;
this.nonSunProviders = false;
this.providerClass = null;
this.padLen = 8;
String algTest = pu.getAlgorithm();
String modeTest = pu.getMode();
String paddingTest = pu.getPadding();
String keyTest = pu.getKey();
String specTest = pu.getSpec();
String modTest = pu.getModulus();
String providerTest = pu.getProvider();
this.init(isEncrypt, algTest, modeTest, paddingTest, keyTest, specTest, modTest, providerTest);
}
public MXCipherX(boolean isEncrypt, String algTest, String modeTest, String paddingTest, String keyTest, String specTest) {
this.algorithm = PropertiesUtil.CRYPTOX_ALGORITHM;
this.mode = PropertiesUtil.CRYPTOX_MODE;
this.padding = PropertiesUtil.CRYPTOX_PADDING;
this.key = PropertiesUtil.CRYPTOX_KEY;
this.spec = PropertiesUtil.CRYPTOX_SPEC;
this.modulus = PropertiesUtil.CRYPTOX_MODULUS;
this.cipherEncrypt = null;
this.transformation = null;
this.secretKey = null;
this.ivSpec = null;
this.pbeParamSpec = null;
this.secretkeySpec = null;
this.publicKey = null;
this.privateKey = null;
this.nonSunProviders = false;
this.providerClass = null;
this.padLen = 8;
this.init(isEncrypt, algTest, modeTest, paddingTest, keyTest, specTest, (String)null, (String)null);
}
public MXCipherX(boolean isEncrypt, String algTest, String modeTest, String paddingTest, String keyTest, String specTest, String modTest, String providerTest) {
this.algorithm = PropertiesUtil.CRYPTOX_ALGORITHM;
this.mode = PropertiesUtil.CRYPTOX_MODE;
this.padding = PropertiesUtil.CRYPTOX_PADDING;
this.key = PropertiesUtil.CRYPTOX_KEY;
this.spec = PropertiesUtil.CRYPTOX_SPEC;
this.modulus = PropertiesUtil.CRYPTOX_MODULUS;
this.cipherEncrypt = null;
this.transformation = null;
this.secretKey = null;
this.ivSpec = null;
this.pbeParamSpec = null;
this.secretkeySpec = null;
this.publicKey = null;
this.privateKey = null;
this.nonSunProviders = false;
this.providerClass = null;
this.padLen = 8;
this.init(isEncrypt, algTest, modeTest, paddingTest, keyTest, specTest, modTest, providerTest);
}
protected void init(boolean isEncrypt, String algTest, String modeTest, String paddingTest, String keyTest, String specTest, String modTest, String providerTest) {
try {
if (providerTest != null && !providerTest.equals("")) {
Class<?> c = Class.forName(providerTest);
Class[] paramTypes = new Class[0];
Constructor<?> ctor = c.getConstructor(paramTypes);
Object[] params = new Object[0];
this.providerClass = (Provider)ctor.newInstance(params);
Security.addProvider(this.providerClass);
}
} catch (Exception var14) {
var14.printStackTrace();
return;
}
Provider[] provs = Security.getProviders();
for(int xx = 0; xx < provs.length; ++xx) {
if (!provs[xx].getName().toUpperCase().startsWith("SUN")) {
}
this.nonSunProviders = true;
}
this.validateParams(algTest, modeTest, paddingTest, keyTest, specTest, modTest);
this.transformation = this.algorithm;
if (this.mode != null && !this.mode.equals("") && this.padding != null && !this.padding.equals("")) {
this.transformation = this.transformation + "/" + this.mode + "/" + this.padding;
}
try {
this.cipherEncrypt = this.buildCipher(isEncrypt);
} catch (Exception var13) {
var13.printStackTrace();
}
}
Cipher buildCipher(boolean encrypt) throws Exception {
Cipher cipher = null;
int cryptMode = 1;
if (!encrypt) {
cryptMode = 2;
}
SecretKeyFactory keyFac;
if (!this.algorithm.equals("DESede") && !this.algorithm.equals("TripleDES")) {
if (this.algorithm.equals("DES")) {
if (this.secretKey == null || this.ivSpec == null) {
DESKeySpec keyspec = new DESKeySpec(this.key.getBytes());
keyFac = SecretKeyFactory.getInstance(this.algorithm);
this.secretKey = keyFac.generateSecret(keyspec);
this.ivSpec = new IvParameterSpec(this.spec.getBytes());
}
if (this.providerClass == null) {
cipher = Cipher.getInstance(this.transformation);
} else {
cipher = Cipher.getInstance(this.transformation, this.providerClass);
}
if (this.transformation.indexOf("ECB") < 0) {
cipher.init(cryptMode, this.secretKey, this.ivSpec);
} else {
cipher.init(cryptMode, this.secretKey);
}
} else if (this.algorithm.startsWith("PBEWith")) {
if (this.secretKey == null || this.pbeParamSpec == null) {
this.pbeParamSpec = new PBEParameterSpec(this.spec.getBytes(), 20);
PBEKeySpec pbeKeySpec = new PBEKeySpec(this.spec.toCharArray());
keyFac = SecretKeyFactory.getInstance(this.algorithm);
this.secretKey = keyFac.generateSecret(pbeKeySpec);
}
if (this.providerClass == null) {
cipher = Cipher.getInstance(this.transformation);
} else {
cipher = Cipher.getInstance(this.transformation, this.providerClass);
}
cipher.init(cryptMode, this.secretKey, this.pbeParamSpec);
} else if (this.algorithm.equals("RSA")) {
if (this.publicKey == null || this.privateKey == null) {
KeyFactory fac = KeyFactory.getInstance("RSA", this.providerClass);
this.publicKey = fac.generatePublic(new RSAPublicKeySpec(new BigInteger(this.modulus), new BigInteger(this.key)));
this.privateKey = fac.generatePrivate(new RSAPrivateKeySpec(new BigInteger(this.modulus), new BigInteger(this.spec)));
}
if (this.providerClass == null) {
cipher = Cipher.getInstance(this.transformation);
} else {
cipher = Cipher.getInstance(this.transformation, this.providerClass);
}
if (encrypt) {
cipher.init(cryptMode, this.publicKey);
} else {
cipher.init(cryptMode, this.privateKey);
}
} else {
if (this.secretkeySpec == null) {
int padLen = this.algorithm.equals("SKIPJACK") ? 10 : 16;
byte[] byteArray = this.spec.getBytes();
byteArray = this.pad(byteArray, padLen);
this.secretkeySpec = new SecretKeySpec(byteArray, this.algorithm);
}
if (this.providerClass == null) {
cipher = Cipher.getInstance(this.transformation);
} else {
cipher = Cipher.getInstance(this.transformation, this.providerClass);
}
cipher.init(cryptMode, this.secretkeySpec);
}
} else {
if (this.secretKey == null || this.ivSpec == null) {
DESedeKeySpec keyspec = new DESedeKeySpec(this.key.getBytes());
keyFac = SecretKeyFactory.getInstance(this.algorithm);
this.secretKey = keyFac.generateSecret(keyspec);
this.ivSpec = new IvParameterSpec(this.spec.getBytes());
}
if (this.providerClass == null) {
cipher = Cipher.getInstance(this.transformation);
} else {
cipher = Cipher.getInstance(this.transformation, this.providerClass);
}
if (this.transformation.indexOf("ECB") < 0) {
cipher.init(cryptMode, this.secretKey, this.ivSpec);
} else {
cipher.init(cryptMode, this.secretKey);
}
}
return cipher;
}
private boolean validateParams(String algTest, String modeTest, String paddingTest, String keyTest, String specTest, String modTest) {
if (algTest != null && !algTest.equals("")) {
this.algorithm = algTest;
}
if (modeTest != null && !modeTest.equals("")) {
this.mode = modeTest;
}
if (paddingTest != null && !paddingTest.equals("")) {
this.padding = paddingTest;
}
if (keyTest != null && !keyTest.equals("")) {
this.key = keyTest;
}
if (specTest != null && !specTest.equals("")) {
this.spec = specTest;
}
if (modTest != null && !modTest.equals("")) {
this.modulus = modTest;
}
if (this.algorithm == null) {
return false;
} else {
if (!this.algorithm.equals("AES") && !this.algorithm.equals("Serpent") && !this.algorithm.equals("MARS") && !this.algorithm.equals("RC6") && !this.algorithm.equals("Rijndael") && !this.algorithm.equals("Square") && !this.algorithm.equals("Twofish")) {
if (this.algorithm.equals("RSA")) {
this.padLen = 0;
}
} else {
this.padLen = 16;
}
if (!this.algorithm.equals("DES") && !this.algorithm.equals("DESede") && !this.algorithm.equals("AES")) {
if (modeTest == null || modeTest.equals("")) {
this.mode = "";
}
if (paddingTest == null || paddingTest.equals("")) {
this.padding = "";
}
}
if (this.nonSunProviders) {
return true;
} else if (!this.algorithm.equals("DESede") && !this.algorithm.equals("DES") && !this.algorithm.equals("AES") && !this.algorithm.equals("PBEWithMD5AndDES")) {
return false;
} else if (!this.algorithm.equals("AES") || this.mode != null && this.mode.equals("ECB")) {
if (this.algorithm.equals("PBEWithMD5AndDES")) {
if (this.mode == null || !this.mode.equals("CBC")) {
return false;
}
if (this.padding == null || !this.padding.equals("PKCS5Padding")) {
return false;
}
if (this.key.getBytes().length != 8) {
return false;
}
}
if (this.mode != null && !this.mode.equals("") && !this.mode.equals("CBC") && !this.mode.equals("CFB") && !this.mode.equals("ECB") && !this.mode.equals("OFB") && !this.mode.equals("PCBC")) {
return false;
} else if (this.padding != null && !this.padding.equals("") && !this.padding.equals("NoPadding") && !this.padding.equals("PKCS5Padding")) {
return false;
} else if (this.key != null && !this.key.equals("") && !this.algorithm.equals("RSA") && this.key.length() % 24 != 0) {
return false;
} else if (this.spec != null && !this.spec.equals("") && !this.algorithm.equals("RSA") && this.spec.length() % 8 != 0) {
return false;
} else if (this.mode == null || !this.mode.equals("OFB") || this.padding == null || this.padding.equals("NoPadding") || this.algorithm != null && this.algorithm.equals("DES")) {
return true;
} else {
return false;
}
} else {
return false;
}
}
}
public synchronized String encData(String in) {
byte[] temp = in.getBytes();
temp = this.pad(temp);
byte[] encryptVal = (byte[])null;
try {
encryptVal = this.cipherEncrypt.doFinal(temp);
} catch (Exception var5) {
var5.printStackTrace();
return null;
}
return EncodeUtil.Bytes2HexString(encryptVal);
}
public synchronized String decData(String in) {
byte[] temp = EncodeUtil.HexString2Bytes(in);
temp = this.pad(temp);
byte[] decryptVal = (byte[])null;
try {
decryptVal = this.cipherEncrypt.doFinal(temp);
} catch (IllegalBlockSizeException var6) {
var6.printStackTrace();
} catch (BadPaddingException var7) {
var7.printStackTrace();
}
String value = new String(decryptVal);
return value.trim();
}
protected byte[] pad(byte[] in) {
return this.pad(in, this.padLen);
}
protected byte[] pad(byte[] in, int padLen) {
if (padLen == 0) {
return in;
} else {
int inlen = in.length;
int outlen = inlen;
int rem = inlen % padLen;
if (rem > 0) {
outlen = inlen + (padLen - rem);
}
byte[] out = new byte[outlen];
for(int xx = 0; xx < inlen; ++xx) {
out[xx] = in[xx];
}
return out;
}
}
}
//
// 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 source diff could not be displayed because it is too large. You can view the blob instead.
#----------------------------------------------------------------------------
#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>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!--
- This is a sample configuration for log4j.
- It simply just logs everything into a single log file.
- Note, that you can use properties for value substitution.
-->
<appender name="CORE" class="org.apache.log4j.FileAppender">
<param name="File" value="${org.apache.cocoon.work.directory}/cocoon-logs/log4j.log" />
<param name="Append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %t %c - %m%n"/>
</layout>
</appender>
<root>
<priority value="${org.apache.cocoon.log4j.loglevel}"/>
<appender-ref ref="CORE"/>
</root>
</log4j:configuration>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
\ No newline at end of file
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
<link href="http://cdn.bootcss.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Product</h1>
</div>
<div class="panel panel-default">
<div class="panel-heading">Product List</div>
<div class="panel-body">
<div id="product"></div>
</div>
</div>
<div id="checkuser"></div>
<div id="checkuser1"></div>
<div id="queryPiGroup"></div>
</div>
<script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="http://cdn.bootcss.com/handlebars.js/1.3.0/handlebars.min.js"></script>
<script type="text/x-handlebars-template" id="product_table_template">
{{#if data}}
<table class="table table-hover" id="product_table">
<thead>
<tr>
<th>ID</th>
<th>Product Name</th>
<th>Product Desc</th>
</tr>
</thead>
<tbody>
{{#data}}
<tr data-id="{EQUIPID}}" data-name="{{EQUIPNAME}}">
<td>{{EQRUNSTATU}}</td>
<td>{{EQUIPID}}</td>
<td>{{EQUIPNAME}}</td>
</tr>
{{/data}}
</tbody>
</table>
{{else}}
<div class="alert alert-warning">Can not find any data!</div>
{{/if}}
</script>
<script>
// $(function(){
// $.getJSON('http://localhost:8080/sgapp/rest/pitask/UploadingPA_DATA?strContent=65^1510005^1510006^1^^2015-11-04 17:58:19^1^电气点检设备DQDJ_SB001^电气点检设备DQDJ_SB001^电气点检区域DQDJ_AREA001^廖东东^150003^JL^设备正常^^null^点检^111001^1;&Company_ID=YUDEAN&strGroup=2307001_2023_8_15_17_50&US_CODE=2307001&callback=?', {}, function(data){
// $('#Uploading').html("UploadingPA_EQUIP_STATUS++++++++=test444s");
//
// });
// });
<%-- $(function() {
$.ajax({
type : 'get',
url : '<%=basePath %>/rest/pitask/queryPiTask/7',
dataType : 'jsonp',
jsonp : '_jsonp',
jsonpcallback : 'callback',
success : function(data) {
alert(data);
var template = $("#product_table_template").html();
var render = Handlebars.compile(template);
var html = render({
data : data
});
$('#product').html(html);
}
});
}); --%>
<%-- $(function() {
$.ajax({
type : 'get',
url : '<%=basePath %>/rest/pitask/checkUser/maxadmin/000000',
dataType : 'jsonp',
jsonp : '_jsonp',
jsonpcallback : 'callback',
success : function(data) {
alert(data.PASSWORD);
$('#checkuser1').html(data.PASSWORD);
},
error : function(e) {
alert("error");
}
});
}); --%>
<%-- $(function() {
$.ajax({
type : 'get',
url : '<%=basePath %>/rest/pitask/enterFunction',
data:{
US_CODE:"maxadmin",
US_PWD:"000000"
},
dataType : 'jsonp',
jsonp : '_jsonp',
jsonpcallback : 'callback',
success : function(data) {
$('#checkuser1').html(data.US_NAME+"++++++++=test1");
}
});
}); --%>
// $(function(){
// $.getJSON('http://localhost:8080/sgapp/rest/pitask/UploadingPA_EQUIP_STATUS?strContent=73^1510005^1510006^1^^2015-11-04 17:58:19^1^电气点检设备DQDJ_SB001^电气点检设备DQDJ_SB001^电气点检区域DQDJ_AREA001^^150003^JL^^null^null^点检^undefined^1&Company_ID=YUDEAN&strGroup=150003_2015_11_4_17_50&US_CODE=1035&callback=?',{}, function(data){
// $('#checkuser').html("ss++++++++=test444s");
// });
//
// });
/* $(function(){
$.getJSON('http://172.20.2.25:8080/cxfservice/rest/pitask/queryPiTask/7', function(data){
var template = $("#product_table_template").html();
var render = Handlebars.compile(template);
var html = render({
data: data
});
$('#product').html(html);
});
});
$(function(){
$.getJSON('http://172.20.2.25:8080/cxfservice/rest/pitask/queryPiGroup/MAXADMIN?callback=?', function(data){
$('#queryPiGroup').html(data[0].papointid);
});
});
$(function(){
$.getJSON('http://172.20.2.25:8080/cxfservice/rest/pitask/executeUpdate/1?callback=?', function(data){
alert(data);
});
}); */
</script>
</body>
</html>
\ No newline at end of file
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\ArgsUtil.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PI_TASK.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Phone_PA_ITEM_STATU.java
D:\project\sgapp\src\main\java\com\tohi\com\tohi\system\db\Pool.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\TempModel.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PI_TASK_ITEM.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Singleton.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\PropertiesUtil.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Phone_C_USER.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Phone_PA_MOBILEMAP.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\UdGeneral.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Phone_PA_ROUTINE.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\WxUtils.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\CheckRequestFilter.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Results.java
D:\project\sgapp\src\main\java\com\tohi\app\rest\pitaskSericeImpl.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\CustThread.java
D:\project\sgapp\src\main\java\com\tohi\app\rest\JdbcUtil.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Phone_PA_ROUTINE_GROUP.java
D:\project\sgapp\src\main\java\com\tohi\com\tohi\system\db\DBConnectionPool.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\MXCipherX.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\Page.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\FileUtils.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\PropertiesConfigurerUtil.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PA_GG.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PI_TASK_AREA.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PA_Group_TempModel.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\EncodeUtil.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PA_XJ_DEFECTS.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\SHA1.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\TokenUtils.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PI_TASK_DEVICE.java
D:\project\sgapp\src\main\java\com\tohi\app\rest\pitaskSerice.java
D:\project\sgapp\src\main\java\com\tohi\common\dto\PA_DATA_TempModel.java
D:\project\sgapp\src\main\java\com\tohi\common\pwdutil\dbhelpers.java
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