Commit 5e707c49 authored by 张俊's avatar 张俊

单位变更开发,框架优化处理

parent d7abe822
/*
* Copyright 2007-present the original author or authors.
*
* 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
*
* https://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.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<groupId>net.cdkj.gjj</groupId> <groupId>net.cdkj.gjj</groupId>
<artifactId>InternalLogic</artifactId> <artifactId>InternalLogic</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging> <packaging>jar</packaging>
<name>InternalLogic</name> <name>InternalLogic</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
...@@ -21,35 +21,22 @@ ...@@ -21,35 +21,22 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<!-- <dependency>-->
<dependency> <!-- <groupId>net.sf.json-lib</groupId>-->
<groupId>org.springframework.boot</groupId> <!-- <artifactId>json-lib</artifactId>-->
<artifactId>spring-boot-starter-tomcat</artifactId> <!-- <version>2.4</version>-->
<scope>provided</scope> <!-- <classifier>jdk15</classifier>-->
</dependency> <!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>net.sf.json-lib</groupId>-->
<!-- <artifactId>json-lib</artifactId>-->
<!-- <version>2.4</version>-->
<!-- <classifier>jdk15</classifier>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.83</version> <version>1.2.83</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.17</version>
</dependency>
<dependency> <dependency>
<groupId>com.oracle</groupId> <groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId> <artifactId>ojdbc7</artifactId>
...@@ -60,6 +47,7 @@ ...@@ -60,6 +47,7 @@
<artifactId>jasypt-spring-boot-starter</artifactId> <artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.2</version> <version>3.0.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories> <repositories>
......
...@@ -2,6 +2,8 @@ package net.cdkj.gjj.adapter; ...@@ -2,6 +2,8 @@ package net.cdkj.gjj.adapter;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@SpringBootApplication @SpringBootApplication
public class InternalLogicApplication { public class InternalLogicApplication {
......
package net.cdkj.gjj.adapter;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(InternalLogicApplication.class);
}
}
package net.cdkj.gjj.adapter.config;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;
import java.util.Properties;
/**
* druid 配置多数据源
*
* @author ruoyi
*/
@Configuration
public class DruidConfig {
@Value("${driverClassName:oracle.jdbc.driver.OracleDriver}")
private String driverClassName;
@Value("${url}")
private String url;
@Value("${user}")
private String username;
@Value("${password}")
private String password;
@Bean
public DruidDataSource druidDataSource() {
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setDriverClassName(driverClassName);
druidDataSource.setUrl(url);
druidDataSource.setUsername(username);
druidDataSource.setPassword(password);
return druidDataSource;
}
}
package net.cdkj.gjj.adapter.encryptor; package net.cdkj.gjj.adapter.config;
import org.jasypt.encryption.StringEncryptor; import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor; import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
...@@ -35,10 +35,5 @@ public class JasyptConfig { ...@@ -35,10 +35,5 @@ public class JasyptConfig {
return encryptor; return encryptor;
} }
public static String encryptStr(String decryptStr) {
StringEncryptor encryptor = new JasyptConfig().stringEncryptor();
return encryptor.decrypt(decryptStr);
}
} }
package net.cdkj.gjj.adapter.config; package net.cdkj.gjj.adapter.config;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -9,6 +10,8 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert ...@@ -9,6 +10,8 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.sql.DataSource;
/** /**
* 把RestTemplate注入Spring IOC容器 * 把RestTemplate注入Spring IOC容器
* *
...@@ -36,4 +39,7 @@ public class RestTemplateConfig { ...@@ -36,4 +39,7 @@ public class RestTemplateConfig {
}); });
return restTemplate; return restTemplate;
} }
} }
\ No newline at end of file
package net.cdkj.gjj.adapter.controller; package net.cdkj.gjj.adapter.controller;
import net.cdkj.gjj.adapter.utils.InternalUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
...@@ -20,39 +24,49 @@ import java.util.Date; ...@@ -20,39 +24,49 @@ import java.util.Date;
//@Async //@Async
public class AlarmTask { public class AlarmTask {
private static final Logger log = LoggerFactory.getLogger(DeptInfoUpdateController.class);
//系统服务定时器 @Resource
private DeptInfoUpdateController deptInfoUpdateController;
@Resource
private ProvidentFundServicesController providentFundServicesController;
/** /**
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次 * 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
*/ */
@Scheduled(initialDelay = 5 * 1000, fixedDelay = 60 * 1000) // @Scheduled(initialDelay = 5 * 1000, fixedDelay = 60 * 1000)
public void run3() { public void run3() {
String dqsj = ""; log.debug("第一个接口开始时间:{}", InternalUtils.getCurrentTime());
Date dt = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
dqsj = sdf.format(dt);
System.out.println("第一个接口开始时间" + dqsj);
try { try {
ProvidentFundServicesController.gjjxtfwjk(); providentFundServicesController.gjjxtfwjk();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
//进度数据定时器 // 进度数据定时器
/** /**
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次 * 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
*/ */
@Scheduled(initialDelay = 20 * 1000, fixedDelay = 60 * 1000) // @Scheduled(initialDelay = 20 * 1000, fixedDelay = 60 * 1000)
public void run4() { public void run4() {
String dqsj = ""; log.debug("第二个接口开始时间:{}", InternalUtils.getCurrentTime());
Date dt = new Date(); providentFundServicesController.BusinessProcessing();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss"); }
dqsj = sdf.format(dt);
System.out.println("第二个接口开始时间" + dqsj);
ProvidentFundServicesController.BusinessProcessing(); @Scheduled(initialDelay = 40 * 1000, fixedDelay = 60 * 1000)
public void dwxxbgPushTask() {
log.debug("dwxxbgPushTask 开始时间:{}", InternalUtils.getCurrentTime());
deptInfoUpdateController.dwxxbgPush();
}
@Scheduled(initialDelay = 60 * 1000, fixedDelay = 60 * 1000)
public void dwxxbgPullTask() {
log.debug("dwxxbgPullTask 开始时间:{}", InternalUtils.getCurrentTime());
deptInfoUpdateController.dwxxbgPull();
} }
} }
package net.cdkj.gjj.adapter.encryptor; package net.cdkj.gjj.adapter.controller;
import net.cdkj.gjj.adapter.config.JasyptConfig;
import org.jasypt.encryption.StringEncryptor; import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController @RestController
@RequestMapping("/encrypt") @RequestMapping("/encrypt")
@CrossOrigin(origins = "*", maxAge = 3600) @CrossOrigin(origins = "*", maxAge = 3600)
public class EncryptController { public class EncryptController {
@Resource
private StringEncryptor jasyptStringEncryptor;
@PostMapping("/jasyptEnc") @PostMapping("/jasyptEnc")
public String encrypt(@RequestParam String encStr) throws Exception { public String encrypt(@RequestParam String encStr) {
StringEncryptor encryptor = new JasyptConfig().stringEncryptor(); return jasyptStringEncryptor.encrypt(encStr);
return encryptor.encrypt(encStr);
} }
@PostMapping("/jasyptDec") @PostMapping("/jasyptDec")
public String decrypt(@RequestParam String decStr) throws Exception { public String decrypt(@RequestParam String decStr) {
StringEncryptor encryptor = new JasyptConfig().stringEncryptor(); return jasyptStringEncryptor.decrypt(decStr);
return encryptor.decrypt(decStr);
} }
} }
package net.cdkj.gjj.adapter.controller; package net.cdkj.gjj.adapter.controller;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import net.cdkj.gjj.adapter.encryptor.JasyptConfig; import net.cdkj.gjj.adapter.config.JasyptConfig;
import net.cdkj.gjj.adapter.domain.BusinessProcessing; import net.cdkj.gjj.adapter.domain.BusinessProcessing;
import net.cdkj.gjj.adapter.domain.Json; import net.cdkj.gjj.adapter.domain.Json;
import net.cdkj.gjj.adapter.domain.PropertyqUtil; import net.cdkj.gjj.adapter.domain.PropertyqUtil;
import net.cdkj.gjj.adapter.domain.UnitAccountOpeningInformation; import net.cdkj.gjj.adapter.domain.UnitAccountOpeningInformation;
import oracle.jdbc.OracleTypes; import oracle.jdbc.OracleTypes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.*; import java.io.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
...@@ -31,19 +35,22 @@ import java.util.*; ...@@ -31,19 +35,22 @@ import java.util.*;
@RequestMapping(value = "InternalLogic") @RequestMapping(value = "InternalLogic")
public class ProvidentFundServicesController { public class ProvidentFundServicesController {
private static String url;
private static String user;
private static String password;
private static String frontEndProcessorServer; @Resource
private DruidDataSource dataSource;
@Value("${frontEndProcessorServer}")
private String frontEndProcessorServer;
@Value("${timetype}")
private String timetype;
@Value("${startTime}")
private String startTime;
@Value("${endTime}")
private String endTime;
static {
Properties prop = PropertyqUtil.getConfig("application.properties");
url = JasyptConfig.encryptStr(PropertyqUtil.getPropValue(prop, "url"));
user = JasyptConfig.encryptStr(PropertyqUtil.getPropValue(prop, "user"));
password = JasyptConfig.encryptStr(PropertyqUtil.getPropValue(prop, "password"));
frontEndProcessorServer = PropertyqUtil.getPropValue(prop, "frontEndProcessorServer");
}
/** /**
* 公积金系统服务接口内置机调前置机中间接口 * 公积金系统服务接口内置机调前置机中间接口
...@@ -53,16 +60,15 @@ public class ProvidentFundServicesController { ...@@ -53,16 +60,15 @@ public class ProvidentFundServicesController {
*/ */
@ResponseBody @ResponseBody
@PostMapping("ProvidentFundServices") @PostMapping("ProvidentFundServices")
public static String ProvidentFundServices() { public String ProvidentFundServices() {
Properties prop = PropertyqUtil.getConfig("application.properties"); Properties prop = PropertyqUtil.getConfig("application.properties");
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String type = PropertyqUtil.getPropValue(prop, "timetype"); if ("1".equals(timetype)) {// 表示正式环境
if ("1".equals(type)) {// 表示正式环境
jsonObject.put("startTime", currenttime(0));// 正式环境 jsonObject.put("startTime", currenttime(0));// 正式环境
jsonObject.put("endTime", currenttime(24));// 正式环境 jsonObject.put("endTime", currenttime(24));// 正式环境
} else if ("2".equals(type)) {// 表示测试环境或本地环境 } else if ("2".equals(timetype)) {// 表示测试环境或本地环境
jsonObject.put("startTime", PropertyqUtil.getPropValue(prop, "startTime"));// 测试环境或本地环境 jsonObject.put("startTime", startTime);// 测试环境或本地环境
jsonObject.put("endTime", PropertyqUtil.getPropValue(prop, "endTime"));// 测试环境或本地环境 jsonObject.put("endTime", endTime);// 测试环境或本地环境
} }
jsonObject.put("app_id", "eb453ca78b354f2c9163a703530f5186"); jsonObject.put("app_id", "eb453ca78b354f2c9163a703530f5186");
jsonObject.put("app_secret", "9a31b84878654a72a999e38ef55aa186"); jsonObject.put("app_secret", "9a31b84878654a72a999e38ef55aa186");
...@@ -174,7 +180,7 @@ public class ProvidentFundServicesController { ...@@ -174,7 +180,7 @@ public class ProvidentFundServicesController {
*/ */
@ResponseBody @ResponseBody
@PostMapping("gjjxtfwjk") @PostMapping("gjjxtfwjk")
public static void gjjxtfwjk() throws Exception { public void gjjxtfwjk() throws Exception {
Properties prop = PropertyqUtil.getConfig("application.properties"); Properties prop = PropertyqUtil.getConfig("application.properties");
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理 // 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String jsoninfom = ProvidentFundServices(); String jsoninfom = ProvidentFundServices();
...@@ -186,11 +192,7 @@ public class ProvidentFundServicesController { ...@@ -186,11 +192,7 @@ public class ProvidentFundServicesController {
} }
// 2.内置机处理返回的业务数据,调用oracle存储过程 // 2.内置机处理返回的业务数据,调用oracle存储过程
// 加载数据库驱动 // 加载数据库驱动
Class.forName("oracle.jdbc.driver.OracleDriver"); Connection connection = dataSource.getConnection();
// 得到Connection连接
// Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.101.194:1521:zfgjj", "HG2020", "HG2020");//本地环境
// Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1521:zfgjj", "GJJ80", "GJJ80");//测试环境
Connection connection = DriverManager.getConnection(url, user, password);// 正式环境
// 得到预编译的Statement对象 // 得到预编译的Statement对象
CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWXX_IMP(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}"); CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWXX_IMP(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程 // 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
...@@ -393,7 +395,7 @@ public class ProvidentFundServicesController { ...@@ -393,7 +395,7 @@ public class ProvidentFundServicesController {
*/ */
@ResponseBody @ResponseBody
@PostMapping("BusinessProcessing") @PostMapping("BusinessProcessing")
public static String BusinessProcessing() { public String BusinessProcessing() {
System.out.println("调第二个接口了"); System.out.println("调第二个接口了");
// 调oracle存储过程拿到进度推进的数据集合 // 调oracle存储过程拿到进度推进的数据集合
List<BusinessProcessing> list = null; List<BusinessProcessing> list = null;
...@@ -515,15 +517,10 @@ public class ProvidentFundServicesController { ...@@ -515,15 +517,10 @@ public class ProvidentFundServicesController {
*/ */
@ResponseBody @ResponseBody
@PostMapping("zjbmfhywtosj") @PostMapping("zjbmfhywtosj")
public static List<BusinessProcessing> zjbmfhywtosj() throws Exception { public List<BusinessProcessing> zjbmfhywtosj() throws Exception {
Properties prop = PropertyqUtil.getConfig("application.properties"); Properties prop = PropertyqUtil.getConfig("application.properties");
// 1.调用oracle存储过程,拿到业务办理进度数据 // 1.调用oracle存储过程,拿到业务办理进度数据
// 加载数据库驱动 Connection connection = dataSource.getConnection();
Class.forName("oracle.jdbc.driver.OracleDriver");
// 得到Connection连接
// Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.101.194:1521:zfgjj", "HG2020", "HG2020");//本地环境
// Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1521:zfgjj", "GJJ80", "GJJ80");//测试环境
Connection connection = DriverManager.getConnection(url, user, password);// 正式环境
// 得到预编译的Statement对象 // 得到预编译的Statement对象
CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_CX(?)}"); CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_CX(?)}");
// 给参数赋值 // 给参数赋值
...@@ -585,15 +582,11 @@ public class ProvidentFundServicesController { ...@@ -585,15 +582,11 @@ public class ProvidentFundServicesController {
} }
public static void zjbmfhywtosjHX(String uscc, Integer value) throws Exception { public void zjbmfhywtosjHX(String uscc, Integer value) throws Exception {
Properties prop = PropertyqUtil.getConfig("application.properties"); Properties prop = PropertyqUtil.getConfig("application.properties");
// 1.调用oracle存储过程,拿到业务办理进度数据 // 1.调用oracle存储过程,拿到业务办理进度数据
// 加载数据库驱动 // 加载数据库驱动
Class.forName("oracle.jdbc.driver.OracleDriver"); Connection connection = dataSource.getConnection();
// 得到Connection连接
// Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.101.194:1521:zfgjj", "HG2020", "HG2020");//本地环境
// Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1521:zfgjj", "GJJ80", "GJJ80");//测试环境
Connection connection = DriverManager.getConnection(url, user, password);// 正式环境
// 得到预编译的Statement对象 // 得到预编译的Statement对象
CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}"); CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}");
// 给参数赋值 // 给参数赋值
......
package net.cdkj.gjj.adapter.domain;
import org.springframework.http.HttpStatus;
import java.util.HashMap;
/**
* 操作消息提醒
*
* @author ruoyi
*/
public class AjaxResult extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
/**
* 状态码
*/
public static final String CODE_TAG = "code";
/**
* 返回内容
*/
public static final String MSG_TAG = "msg";
/**
* 数据对象
*/
public static final String DATA_TAG = "data";
/**
* 总数
*/
public static final String TOTAL_TAG = "total";
/**
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
*/
public AjaxResult() {
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
*/
public AjaxResult(int code, String msg) {
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
* @param data 数据对象
*/
public AjaxResult(int code, String msg, Object data) {
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
super.put(DATA_TAG, data);
}
/**
* 返回成功消息
*
* @return 成功消息
*/
public static AjaxResult success() {
return AjaxResult.success("操作成功");
}
/**
* 返回成功数据
*
* @return 成功消息
*/
public static AjaxResult success(Object data) {
AjaxResult ajaxResult = AjaxResult.success("操作成功", data);
/*if (data instanceof Page) {
ajaxResult.put(TOTAL_TAG, ((Page<?>) data).getTotal());
}*/
return ajaxResult;
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 成功消息
*/
public static AjaxResult success(String msg, Object data) {
return new AjaxResult(HttpStatus.OK.value(), msg, data);
}
/**
* 返回错误消息
*
* @return
*/
public static AjaxResult error() {
return AjaxResult.error("操作失败");
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult error(String msg) {
return AjaxResult.error(msg, null);
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public static AjaxResult error(String msg, Object data) {
return new AjaxResult(HttpStatus.INTERNAL_SERVER_ERROR.value(), msg, data);
}
/**
* 返回错误消息
*
* @param code 状态码
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult error(int code, String msg) {
return new AjaxResult(code, msg, null);
}
}
...@@ -71,4 +71,10 @@ public class InternalUtils { ...@@ -71,4 +71,10 @@ public class InternalUtils {
} }
return time; return time;
} }
public static String getCurrentTime() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
return sdf.format(new Date());
}
} }
#??????(1???????2??????????????) #??????(1???????2??????????????)
#???????????????????? #????????????????????
timetype:1 timetype:1
#?????????????????? #??????????????????
#timetype:2 #timetype:2
#?????????? #??????????
...@@ -9,12 +8,24 @@ startTime:20230201 00:00:00 ...@@ -9,12 +8,24 @@ startTime:20230201 00:00:00
#?????????? #??????????
endTime:20230208 23:00:00 endTime:20230208 23:00:00
#????????? #正式环境
url:2NiJQAsT5i5vcdRA4+QoL0OxDje63w09kf/upD6cZocEy3IvgPXj3BdymdZCw0I0vnYI/K8K+PTYJrRjv6xbqA== #url:2NiJQAsT5i5vcdRA4+QoL0OxDje63w09kf/upD6cZocEy3IvgPXj3BdymdZCw0I0vnYI/K8K+PTYJrRjv6xbqA==
user:7MSN/YEwcQpKaVmXkrQtI5zBlPm6ThDA #user:7MSN/YEwcQpKaVmXkrQtI5zBlPm6ThDA
password:b6/rlcEodaunlW9hS3Uuigr6oiNIXV7ezgbK2ZAuuIo= #password:b6/rlcEodaunlW9hS3Uuigr6oiNIXV7ezgbK2ZAuuIo=
#公司环境
driverClassName:oracle.jdbc.driver.OracleDriver
url:ENC(Et305ScSPFkdAEmh0PpvV6vTeZXprJV57rQ1eL5MOkJZyMnSTt5jttYCJJbnQbPyYyOpPTFhW58z/P5PA9vJbw==)
user:ENC(Dt42e5Z4WWim9j0Ls2G2YjmzwuQ2pjBx)
password:ENC(PI2/xdOsEObL0YZlfGfQnyiJeYUw/90FePU+sO4EDjU=)
#url:jdbc:oracle:thin:@192.168.101.194:1521:zfgjj
#user:GJJ80
#password:GJJ80_Hg41RG
# 前置服务URL
#frontEndProcessorServer:http://192.168.1.252:8888
frontEndProcessorServer:http://127.0.0.1:8081
frontEndProcessorServer: http://192.168.1.252:8888
dwxxbgPushTaskDelay:60000
dwxxbgPullTaskDelay:60000
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="logs"/>
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-debug.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-debug.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.cdkj" level="debug"/>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file_debug"/>
<appender-ref ref="file_error"/>
</root>
</configuration>
<?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.
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
package net.cdkj.gjj.adapter;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class AdapterApplicationTests {
@Test
void contextLoads() {
}
}
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