Commit e59526b1 authored by 华润's avatar 华润

代码提交内置机

parent 4848eb89
...@@ -13,12 +13,11 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,12 +13,11 @@ import org.springframework.web.bind.annotation.RestController;
import java.io.*; import java.io.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.sql.CallableStatement; import java.sql.*;
import java.sql.Connection; import java.text.Format;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.Date;
/** /**
...@@ -38,8 +37,10 @@ public class ProvidentFundServicesController { ...@@ -38,8 +37,10 @@ public class ProvidentFundServicesController {
@PostMapping("ProvidentFundServices") @PostMapping("ProvidentFundServices")
public static String ProvidentFundServices() { public static String ProvidentFundServices() {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("startTime", currenttime(0)); // jsonObject.put("startTime", currenttime(0));
jsonObject.put("endTime", currenttime(24)); // 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_id", "eb453ca78b354f2c9163a703530f5186");
jsonObject.put("app_secret", "9a31b84878654a72a999e38ef55aa186"); jsonObject.put("app_secret", "9a31b84878654a72a999e38ef55aa186");
String str = jsonObject.toString(); String str = jsonObject.toString();
...@@ -155,12 +156,19 @@ public class ProvidentFundServicesController { ...@@ -155,12 +156,19 @@ public class ProvidentFundServicesController {
//2.内置机处理返回的业务数据,调用oracle存储过程 //2.内置机处理返回的业务数据,调用oracle存储过程
JSONObject a = JSONObject.parseObject(jsoninfom); JSONObject a = JSONObject.parseObject(jsoninfom);
JSONArray jsonArray = (JSONArray)a.get("data"); JSONArray jsonArray = (JSONArray)a.get("data");
List<UnitAccountOpeningInformation> bills = (List<UnitAccountOpeningInformation>)JSONArray.parseArray(jsonArray.toString(), UnitAccountOpeningInformation.class); List<UnitAccountOpeningInformation> bills=new ArrayList<>();
if(jsonArray.size()<1){//data为空
}else{
bills = (List<UnitAccountOpeningInformation>)JSONArray.parseArray(jsonArray.toString(), UnitAccountOpeningInformation.class);
}
System.out.println(bills); System.out.println(bills);
//加载数据库驱动 //加载数据库驱动
Class.forName("oracle.jdbc.driver.OracleDriver"); Class.forName("oracle.jdbc.driver.OracleDriver");
//得到Connection连接 //得到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.101.194:1521:zfgjj", "HG2020", "HG2020");//本地环境
Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1521:zfgjj", "GJJ80", "GJJ80");//测试环境
//得到预编译的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存储过程
...@@ -381,7 +389,13 @@ public class ProvidentFundServicesController { ...@@ -381,7 +389,13 @@ public class ProvidentFundServicesController {
} }
responseReader.close(); responseReader.close();
System.out.println("前置机返回第三方解压之后的进度推送结果"+sb.toString()); System.out.println("前置机返回第三方解压之后的进度推送结果"+sb.toString());
String uscc=list.get(0).getUscc(); String uscc="";
if(!list.isEmpty()){
uscc=list.get(0).getUscc();
}else {
}
System.out.println(uscc); System.out.println(uscc);
JSONObject jsonObj= JSONObject.parseObject(sb.toString()); JSONObject jsonObj= JSONObject.parseObject(sb.toString());
String success= jsonObj.getString("success"); String success= jsonObj.getString("success");
...@@ -433,7 +447,7 @@ public class ProvidentFundServicesController { ...@@ -433,7 +447,7 @@ public class ProvidentFundServicesController {
Class.forName("oracle.jdbc.driver.OracleDriver"); Class.forName("oracle.jdbc.driver.OracleDriver");
//得到Connection连接 //得到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.101.194:1521:zfgjj", "HG2020", "HG2020");//本地环境
Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1566:zfgjj", "HG2020", "HG2020");//测试环境 Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1521:zfgjj", "GJJ80", "GJJ80");//测试环境
//得到预编译的Statement对象 //得到预编译的Statement对象
CallableStatement pstm=connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_CX(?)}"); CallableStatement pstm=connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_CX(?)}");
//给参数赋值 //给参数赋值
...@@ -470,9 +484,18 @@ public class ProvidentFundServicesController { ...@@ -470,9 +484,18 @@ public class ProvidentFundServicesController {
if(!"".equals(rs.getString(6))&&rs.getString(6)!=null){ if(!"".equals(rs.getString(6))&&rs.getString(6)!=null){
b.setResult(rs.getString(6)); b.setResult(rs.getString(6));
} }
System.out.println(rs.getString(7));//获取具体的值 // System.out.println("1111"+rs.getDate(7));//获取具体的值
System.out.println("sssss:"+Timestamp.valueOf(rs.getString(7).substring(0,19)));
System.out.println("ddddd:"+rs.getString(7).substring(0,19));
if(!"".equals(rs.getString(7))&&rs.getString(7)!=null){ if(!"".equals(rs.getString(7))&&rs.getString(7)!=null){
b.setTime(rs.getDate(7)); // b.setTime(rs.getDate(7),);
// System.out.println("222"+rs.getDate(7));
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//注意月份是MM
// Date date = simpleDateFormat.parse(rs.getString(7).substring(0,19));
// b.setTime(Timestamp.valueOf(rs.getString(7).substring(0,19)));
b.setTime(rs.getString(7).substring(0,19));
// Date ccc=date;
// System.out.println("日期转换"+ccc);
} }
System.out.println(rs.getString(8));//获取具体的值 System.out.println(rs.getString(8));//获取具体的值
if(!"".equals(rs.getString(8))&&rs.getString(8)!=null){ if(!"".equals(rs.getString(8))&&rs.getString(8)!=null){
...@@ -482,12 +505,22 @@ public class ProvidentFundServicesController { ...@@ -482,12 +505,22 @@ public class ProvidentFundServicesController {
if(!"".equals(rs.getString(9))&&rs.getString(9)!=null){ if(!"".equals(rs.getString(9))&&rs.getString(9)!=null){
b.setEntName(rs.getString(9)); b.setEntName(rs.getString(9));
} }
System.out.println(rs.getString(10));//获取具体的值
if(!"".equals(rs.getString(10))&&rs.getString(10)!=null){
b.setBusId(rs.getString(10));
}
list.add(b); list.add(b);
} }
System.out.println(list); System.out.println(list);
//释放资源 //释放资源
pstm.close(); pstm.close();
connection.close(); connection.close();
// for(BusinessProcessing b:list){
// if(b.getTime()!=null){
// Format format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// b.setTime(format.format(b.getTime()));
// }
// }
return list; return list;
} }
...@@ -498,7 +531,7 @@ public class ProvidentFundServicesController { ...@@ -498,7 +531,7 @@ public class ProvidentFundServicesController {
Class.forName("oracle.jdbc.driver.OracleDriver"); Class.forName("oracle.jdbc.driver.OracleDriver");
//得到Connection连接 //得到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.101.194:1521:zfgjj", "HG2020", "HG2020");//本地环境
Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1566:zfgjj", "HG2020", "HG2020");//测试环境 Connection connection= DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.36:1521:zfgjj", "GJJ80", "GJJ80");//测试环境
//得到预编译的Statement对象 //得到预编译的Statement对象
CallableStatement pstm=connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}"); CallableStatement pstm=connection.prepareCall("{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}");
//给参数赋值 //给参数赋值
......
...@@ -22,7 +22,7 @@ public class BusinessProcessing { ...@@ -22,7 +22,7 @@ public class BusinessProcessing {
private String result; private String result;
private Date time; private String time;
private String uscc; private String uscc;
...@@ -78,11 +78,11 @@ public class BusinessProcessing { ...@@ -78,11 +78,11 @@ public class BusinessProcessing {
this.result = result; this.result = result;
} }
public Date getTime() { public String getTime() {
return time; return time;
} }
public void setTime(Date time) { public void setTime(String time) {
this.time = time; this.time = time;
} }
......
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