Commit 09543827 authored by 华润's avatar 华润

代码提交内置机

parent b66bd3ed
......@@ -37,10 +37,10 @@ public class ProvidentFundServicesController {
@PostMapping("ProvidentFundServices")
public static String ProvidentFundServices() {
JSONObject jsonObject = new JSONObject();
// jsonObject.put("startTime", currenttime(0));
// jsonObject.put("endTime", currenttime(24));
jsonObject.put("startTime", "20210520 00:00:00");
jsonObject.put("endTime", "20210520 23:00:00");
jsonObject.put("startTime", currenttime(0));//正式环境
jsonObject.put("endTime", currenttime(24));//正式环境
// jsonObject.put("startTime", "20210520 00:00:00");//测试环境
// jsonObject.put("endTime", "20210520 23:00:00");//测试环境
jsonObject.put("app_id", "eb453ca78b354f2c9163a703530f5186");
jsonObject.put("app_secret", "9a31b84878654a72a999e38ef55aa186");
String str = jsonObject.toString();
......@@ -164,8 +164,9 @@ public class ProvidentFundServicesController {
//加载数据库驱动
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("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("jdbc:oracle:thin:@192.168.1.33:1596:zfgjj", "gjj80", "HG80_Y9E1C5");//正式环境
//得到预编译的Statement对象
CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWXX_IMP(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
//调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
......@@ -361,104 +362,108 @@ public class ProvidentFundServicesController {
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("调第二个接口了存储过程返回的list" + list);
JSONObject jsonObject = new JSONObject();
jsonObject.put("state", "1");
if (!list.isEmpty()) {
jsonObject.put("timestamp", list.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getTime());
} else {
jsonObject.put("timestamp", "");
}
if(!list.isEmpty()){//查到数据才请求第三方接口推送
System.out.println("调第二个接口了存储过程返回的list" + list);
JSONObject jsonObject = new JSONObject();
jsonObject.put("state", "1");
if (!list.isEmpty()) {
jsonObject.put("timestamp", list.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getTime());
} else {
jsonObject.put("timestamp", "");
}
if (!list.isEmpty()) {
jsonObject.put("busId", list.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getBusId());
} else {
jsonObject.put("busId", "");
}
jsonObject.put("departCode", "10");
jsonObject.put("nodeList", list);
String str = jsonObject.toString();
StringBuffer sb = new StringBuffer();
HttpURLConnection conn = null;
OutputStream out = null;
try {
// 创建url 资源
URL url = new URL("http://192.168.1.252:8888/FrontEndProcessor/FrontEndProcessor/BusinessProcessing");//调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// 创建http 连接
conn = (HttpURLConnection) url.openConnection();
// 设置允许输出
conn.setDoOutput(true);
// 设置允许输入
conn.setDoInput(true);
// 设置不使用缓存
conn.setUseCaches(false);
// 设置传递方式
conn.setRequestMethod("POST");
// 设置维持长连接
conn.setRequestProperty("Connection", "Keep-Alive");
// 设置文件类型:
conn.setRequestProperty("Content-Type", "application/json");
// 设置文件字符集:
conn.setRequestProperty("Charset", "UTF-8");
// 转换为字节数组
byte[] data = (str).getBytes("UTF-8");
// 设置文件长度
conn.setRequestProperty("Content-Length", String.valueOf(data.length));
// 开始连接请求
conn.connect();
//创建写入流,写入请求的字符串
out = new DataOutputStream(conn.getOutputStream());
out.write(data);
// 请求返回的状态
if (HttpURLConnection.HTTP_OK == conn.getResponseCode()) {
// 请求返回的数据
InputStream is = conn.getInputStream();
String readLine = new String();
BufferedReader responseReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
while ((readLine = responseReader.readLine()) != null) {
sb.append(readLine);
}
responseReader.close();
System.out.println("前置机返回第三方解压之后的进度推送结果" + sb.toString());
String uscc = "";
if (!list.isEmpty()) {
uscc = list.get(0).getUscc();
} else {
if (!list.isEmpty()) {
jsonObject.put("busId", list.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getBusId());
} else {
jsonObject.put("busId", "");
}
jsonObject.put("departCode", "10");
jsonObject.put("nodeList", list);
String str = jsonObject.toString();
StringBuffer sb = new StringBuffer();
HttpURLConnection conn = null;
OutputStream out = null;
try {
// 创建url 资源
URL url = new URL("http://192.168.1.252:8888/FrontEndProcessor/FrontEndProcessor/BusinessProcessing");//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// URL url = new URL("http://192.168.101.34:8080/FrontEndProcessor/FrontEndProcessor/BusinessProcessing");//(本地环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// 创建http 连接
conn = (HttpURLConnection) url.openConnection();
// 设置允许输出
conn.setDoOutput(true);
// 设置允许输入
conn.setDoInput(true);
// 设置不使用缓存
conn.setUseCaches(false);
// 设置传递方式
conn.setRequestMethod("POST");
// 设置维持长连接
conn.setRequestProperty("Connection", "Keep-Alive");
// 设置文件类型:
conn.setRequestProperty("Content-Type", "application/json");
// 设置文件字符集:
conn.setRequestProperty("Charset", "UTF-8");
// 转换为字节数组
byte[] data = (str).getBytes("UTF-8");
// 设置文件长度
conn.setRequestProperty("Content-Length", String.valueOf(data.length));
// 开始连接请求
conn.connect();
//创建写入流,写入请求的字符串
out = new DataOutputStream(conn.getOutputStream());
out.write(data);
// 请求返回的状态
if (HttpURLConnection.HTTP_OK == conn.getResponseCode()) {
// 请求返回的数据
InputStream is = conn.getInputStream();
String readLine = new String();
BufferedReader responseReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
while ((readLine = responseReader.readLine()) != null) {
sb.append(readLine);
}
responseReader.close();
System.out.println("前置机返回第三方解压之后的进度推送结果" + sb.toString());
String uscc = "";
if (!list.isEmpty()) {
uscc = list.get(0).getUscc();
} else {
}
System.out.println(uscc);
JSONObject jsonObj = JSONObject.parseObject(sb.toString());
String success = jsonObj.getString("success");
Integer value = 0;
if ("true".equals(success)) {
value = 1;
} else if ("false".equals(success)) {
value = 0;
}
try {
zjbmfhywtosjHX(uscc, value);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(value);
return sb.toString();
} else {
System.out.println("请求失败!!!");
}
System.out.println(uscc);
JSONObject jsonObj = JSONObject.parseObject(sb.toString());
String success = jsonObj.getString("success");
Integer value = 0;
if ("true".equals(success)) {
value = 1;
} else if ("false".equals(success)) {
value = 0;
}
try {
zjbmfhywtosjHX(uscc, value);
} catch (Exception e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.flush();
out.close();
} catch (IOException e) {
}
}
System.out.println(value);
return sb.toString();
} else {
System.out.println("请求失败!!!");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.flush();
out.close();
} catch (IOException e) {
if (conn != null) {
conn.disconnect();
}
}
if (conn != null) {
conn.disconnect();
}
}
return null;
}
......@@ -475,8 +480,9 @@ public class ProvidentFundServicesController {
//加载数据库驱动
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("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("jdbc:oracle:thin:@192.168.1.33:1596:zfgjj", "gjj80", "HG80_Y9E1C5");//正式环境
//得到预编译的Statement对象
CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_CX(?)}");
//给参数赋值
......@@ -543,8 +549,9 @@ public class ProvidentFundServicesController {
//加载数据库驱动
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("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("jdbc:oracle:thin:@192.168.1.33:1596:zfgjj", "gjj80", "HG80_Y9E1C5");//正式环境
//得到预编译的Statement对象
CallableStatement pstm = connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}");
//给参数赋值
......
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