绩效考核数据修正
commit
bf6691a065
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/../../../../:\trkf-java\jxkh\.idea/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
@ -0,0 +1,23 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="jxkh:jar">
|
||||
<output-path>$PROJECT_DIR$/out/artifacts/jxkh_jar</output-path>
|
||||
<root id="archive" name="jxkh.jar">
|
||||
<element id="module-output" name="jxkh" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/dom4j-2.0.3.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/HikariCP-3.3.1.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/fastjson-1.2.78.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/httpcore-4.4.14.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/httpmime-4.5.13.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/ojdbc6-11.2.0.4.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/slf4j-api-1.7.25.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/httpclient-4.5.13.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/slf4j-simple-1.7.25.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/mssql-jdbc-7.4.1.jre8.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/spring-tx-5.2.16.RELEASE.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/spring-jcl-5.2.16.RELEASE.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/spring-core-5.2.16.RELEASE.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/spring-jdbc-5.2.16.RELEASE.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/src/lib/spring-beans-5.2.16.RELEASE.jar" path-in-jar="/" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
@ -0,0 +1,10 @@
|
||||
<component name="libraryTable">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/src/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/src/lib" recursive="false" />
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/jxkh.iml" filepath="$PROJECT_DIR$/jxkh.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="lib" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: jx.jxkhMain
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: jx.jxkhMain
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package jx;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
public class DBUtil {
|
||||
public DataSource Hikar_DataSource_NMGGS() throws Exception{
|
||||
HikariConfig config=new HikariConfig();
|
||||
try {
|
||||
config.setDriverClassName("oracle.jdbc.driver.OracleDriver");
|
||||
config.setJdbcUrl("jdbc:oracle:thin:@//10.15.0.11:1521/orcl");
|
||||
config.setUsername("nmggs");
|
||||
config.setPoolName("nmggs");
|
||||
config.setPassword("sysadmin");
|
||||
config.addDataSourceProperty("v$session.osuser","DL");
|
||||
config.addDataSourceProperty("v$session.machine","10.15.0.36");
|
||||
config.addDataSourceProperty("v$session.program","DIV_SEC");
|
||||
config.setMaximumPoolSize(6);
|
||||
config.setMinimumIdle(2);
|
||||
config.setConnectionTestQuery("select 1 from dual");
|
||||
config.setAutoCommit(true);
|
||||
}
|
||||
catch (Exception e){
|
||||
System.out.println("连接池错误:"+e.toString());
|
||||
}
|
||||
DataSource ds=new HikariDataSource(config);
|
||||
return ds;
|
||||
}
|
||||
|
||||
public DataSource Hikar_DataSource_NMGMPAY() throws Exception{
|
||||
HikariConfig config=new HikariConfig();
|
||||
try {
|
||||
config.setDriverClassName("oracle.jdbc.driver.OracleDriver");
|
||||
config.setJdbcUrl("jdbc:oracle:thin:@//10.15.100.5:1521/torcl");
|
||||
config.setUsername("nmgmpayadmin");
|
||||
config.setPoolName("100.5mpay");
|
||||
config.setPassword("nmgh90[]");
|
||||
config.addDataSourceProperty("v$session.osuser","DL");
|
||||
config.addDataSourceProperty("v$session.machine","10.15.99.66");
|
||||
config.addDataSourceProperty("v$session.program","gantry_pass_all");
|
||||
|
||||
config.setMaximumPoolSize(4);
|
||||
config.setMinimumIdle(2);
|
||||
config.setConnectionTestQuery("select 1 from dual");
|
||||
config.setAutoCommit(true);
|
||||
}
|
||||
catch (Exception e){
|
||||
System.out.println("连接池错误:"+e.toString());
|
||||
}
|
||||
DataSource ds=new HikariDataSource(config);
|
||||
return ds;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package jx;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.channels.FileLock;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
public class LogCommon {
|
||||
public static void WriteLogNormal(String logStr, String suffix)
|
||||
{
|
||||
// String s = String.format(" 消息:%s", logStr);
|
||||
|
||||
WriteLog(logStr, suffix );
|
||||
}
|
||||
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
String path = this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
|
||||
if(System.getProperty("os.name").contains("dows"))
|
||||
{
|
||||
path = path.substring(1,path.length());
|
||||
}
|
||||
if(path.contains("jar"))
|
||||
{
|
||||
path = path.substring(0,path.lastIndexOf("."));
|
||||
return path.substring(0,path.lastIndexOf("/"));
|
||||
}
|
||||
return path.replace("target/classes/", "");
|
||||
}
|
||||
private static void WriteLog(String content,String suffix) {
|
||||
|
||||
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
String str = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS")) + "---";
|
||||
|
||||
sb.append(str);
|
||||
sb.append(content);
|
||||
sb.append("\r\n");
|
||||
String logPath= new LogCommon().getPath()+"/LogFile/";
|
||||
|
||||
File logPathFile = new File(logPath);
|
||||
if (!logPathFile.isDirectory()) {
|
||||
Boolean f= logPathFile.mkdir();
|
||||
System.out.println(f);
|
||||
}
|
||||
|
||||
String fileDic = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
File filedir = new File(logPath + fileDic);
|
||||
if (!filedir.isDirectory()) {
|
||||
filedir.mkdir();
|
||||
File[] fs = logPathFile.listFiles();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int delFlag = Integer.parseInt(now.minus(10, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
|
||||
for (File f : fs) {
|
||||
int deldir = Integer.parseInt(f.getName());
|
||||
if (deldir < delFlag) {
|
||||
if (f.isDirectory()) {
|
||||
deleteDirectory(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String newFileName = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
String fullFilePath = logPath + fileDic + "/" + newFileName +"_"+ suffix+".txt";
|
||||
|
||||
try (RandomAccessFile reader = new RandomAccessFile(new File(fullFilePath), "rw");
|
||||
FileLock lock = reader.getChannel().lock()) {
|
||||
|
||||
reader.seek(reader.length());
|
||||
reader.write(sb.toString().getBytes("UTF-8"));
|
||||
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception exception) {
|
||||
System.out.println(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static void deleteDirectory(File file) {
|
||||
if (file.isFile()) {// 表示该文件不是文件夹
|
||||
file.delete();
|
||||
} else {
|
||||
// 首先得到当前的路径
|
||||
String[] childFilePaths = file.list();
|
||||
for (String childFilePath : childFilePaths) {
|
||||
File childFile = new File(file.getAbsolutePath() + "/" + childFilePath);
|
||||
deleteDirectory(childFile);
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue