Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InternalLogic
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CrossProvincialPlatform
InternalLogic
Commits
b66bd3ed
Commit
b66bd3ed
authored
May 31, 2021
by
华润
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码提交内置机
parent
e59526b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
253 additions
and
179 deletions
+253
-179
src/main/java/net/cdkj/gjj/adapter/controller/ProvidentFundServicesController.java
...j/adapter/controller/ProvidentFundServicesController.java
+192
-179
src/main/java/net/cdkj/gjj/adapter/domain/Json.java
src/main/java/net/cdkj/gjj/adapter/domain/Json.java
+61
-0
No files found.
src/main/java/net/cdkj/gjj/adapter/controller/ProvidentFundServicesController.java
View file @
b66bd3ed
package
net.cdkj.gjj.adapter.controller
;
package
net.cdkj.gjj.adapter.controller
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.UnitAccountOpeningInformation
;
import
net.cdkj.gjj.adapter.domain.UnitAccountOpeningInformation
;
import
oracle.jdbc.OracleTypes
;
import
oracle.jdbc.OracleTypes
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -14,7 +15,6 @@ import java.io.*;
...
@@ -14,7 +15,6 @@ import java.io.*;
import
java.net.HttpURLConnection
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.net.URL
;
import
java.sql.*
;
import
java.sql.*
;
import
java.text.Format
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -49,7 +49,8 @@ public class ProvidentFundServicesController {
...
@@ -49,7 +49,8 @@ public class ProvidentFundServicesController {
OutputStream
out
=
null
;
OutputStream
out
=
null
;
try
{
try
{
// 创建url 资源
// 创建url 资源
URL
url
=
new
URL
(
"http://192.168.1.252:8888/FrontEndProcessor/FrontEndProcessor/ProvidentFundServices"
);
//调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
URL
url
=
new
URL
(
"http://192.168.1.252:8888/FrontEndProcessor/FrontEndProcessor/ProvidentFundServices"
);
//(测试环境地址)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// URL url = new URL("http://192.168.101.34:8080/FrontEndProcessor/FrontEndProcessor/ProvidentFundServices");//(本地测试地址)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// 创建http 连接
// 创建http 连接
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
// 设置允许输出
// 设置允许输出
...
@@ -85,7 +86,7 @@ public class ProvidentFundServicesController {
...
@@ -85,7 +86,7 @@ public class ProvidentFundServicesController {
sb
.
append
(
readLine
);
sb
.
append
(
readLine
);
}
}
responseReader
.
close
();
responseReader
.
close
();
System
.
out
.
println
(
"前置机返回第三方解压之后的公积金服务数据:"
+
sb
.
toString
());
//
System.out.println("前置机返回第三方解压之后的公积金服务数据:"+sb.toString());
return
sb
.
toString
();
return
sb
.
toString
();
}
else
{
}
else
{
System
.
out
.
println
(
"请求失败!!!"
);
System
.
out
.
println
(
"请求失败!!!"
);
...
@@ -144,158 +145,153 @@ public class ProvidentFundServicesController {
...
@@ -144,158 +145,153 @@ public class ProvidentFundServicesController {
/**
/**
* (第一个定时的)
* (第一个定时的)
* 调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,
* 调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,
*拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
* 拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
*
* @return
* @return
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"gjjxtfwjk"
)
@PostMapping
(
"gjjxtfwjk"
)
public
static
void
gjjxtfwjk
()
throws
Exception
{
public
static
void
gjjxtfwjk
()
throws
Exception
{
//1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
//1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String
jsoninfom
=
ProvidentFundServices
();
String
jsoninfom
=
ProvidentFundServices
();
System
.
out
.
println
(
"拿到第一个接口返回的第三方数据,准备调第一个存储过程"
+
jsoninfom
);
System
.
out
.
println
(
"拿到第一个接口返回的第三方数据,准备调第一个存储过程"
+
jsoninfom
);
//2.内置机处理返回的业务数据,调用oracle存储过程
Json
jsonentity
=
JSONObject
.
parseObject
(
jsoninfom
,
Json
.
class
);
JSONObject
a
=
JSONObject
.
parseObject
(
jsoninfom
);
List
<
UnitAccountOpeningInformation
>
bills
=
new
ArrayList
<>();
JSONArray
jsonArray
=
(
JSONArray
)
a
.
get
(
"data"
);
if
(!
isNullOrEmpty
(
jsonentity
))
{
List
<
UnitAccountOpeningInformation
>
bills
=
new
ArrayList
<>();
bills
=
jsonentity
.
getData
();
if
(
jsonArray
.
size
()<
1
){
//data为空
}
else
{
bills
=
(
List
<
UnitAccountOpeningInformation
>)
JSONArray
.
parseArray
(
jsonArray
.
toString
(),
UnitAccountOpeningInformation
.
class
);
}
}
//2.内置机处理返回的业务数据,调用oracle存储过程
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"
);
//测试环境
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存储过程
CallableStatement
pstm2
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWKH.DWKH_SAVE()}"
);
CallableStatement
pstm2
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWKH.DWKH_SAVE()}"
);
System
.
out
.
println
(
""
+
bills
);
//
System.out.println(""+bills);
//给参数赋值
//给参数赋值
// pstm.getString(1);
// pstm.getString(1);
if
(!
bills
.
isEmpty
())
{
if
(!
bills
.
isEmpty
())
{
for
(
UnitAccountOpeningInformation
uniInfom:
bills
)
{
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
if
(!
""
.
equals
(
uniInfom
.
getBusId
())&&
uniInfom
.
getBusId
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getBusId
())
&&
uniInfom
.
getBusId
()
!=
null
)
{
pstm
.
setString
(
1
,
uniInfom
.
getBusId
());
pstm
.
setString
(
1
,
uniInfom
.
getBusId
());
}
else
{
}
else
{
pstm
.
setString
(
1
,
""
);
pstm
.
setString
(
1
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getUscc
())&&
uniInfom
.
getUscc
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getUscc
())
&&
uniInfom
.
getUscc
()
!=
null
)
{
pstm
.
setString
(
2
,
uniInfom
.
getUscc
());
pstm
.
setString
(
2
,
uniInfom
.
getUscc
());
}
else
{
}
else
{
pstm
.
setString
(
2
,
""
);
pstm
.
setString
(
2
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getEntName
())&&
uniInfom
.
getEntName
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getEntName
())
&&
uniInfom
.
getEntName
()
!=
null
)
{
pstm
.
setString
(
3
,
uniInfom
.
getEntName
());
pstm
.
setString
(
3
,
uniInfom
.
getEntName
());
}
else
{
}
else
{
pstm
.
setString
(
3
,
""
);
pstm
.
setString
(
3
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getDom
())&&
uniInfom
.
getDom
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getDom
())
&&
uniInfom
.
getDom
()
!=
null
)
{
pstm
.
setString
(
4
,
uniInfom
.
getDom
());
pstm
.
setString
(
4
,
uniInfom
.
getDom
());
}
else
{
}
else
{
pstm
.
setString
(
4
,
""
);
pstm
.
setString
(
4
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getEstDate
())&&
uniInfom
.
getEstDate
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getEstDate
())
&&
uniInfom
.
getEstDate
()
!=
null
)
{
pstm
.
setDate
(
5
,
new
java
.
sql
.
Date
(
uniInfom
.
getEstDate
().
getTime
()));
pstm
.
setDate
(
5
,
new
java
.
sql
.
Date
(
uniInfom
.
getEstDate
().
getTime
()));
}
else
{
}
else
{
pstm
.
setString
(
5
,
""
);
pstm
.
setString
(
5
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getLerep
())&&
uniInfom
.
getLerep
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getLerep
())
&&
uniInfom
.
getLerep
()
!=
null
)
{
pstm
.
setString
(
6
,
uniInfom
.
getLerep
());
pstm
.
setString
(
6
,
uniInfom
.
getLerep
());
}
else
{
}
else
{
pstm
.
setString
(
6
,
""
);
pstm
.
setString
(
6
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getCerType
())&&
uniInfom
.
getCerType
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getCerType
())
&&
uniInfom
.
getCerType
()
!=
null
)
{
pstm
.
setString
(
7
,
uniInfom
.
getCerType
());
pstm
.
setString
(
7
,
uniInfom
.
getCerType
());
}
else
{
}
else
{
pstm
.
setString
(
7
,
""
);
pstm
.
setString
(
7
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getCerNo
())&&
uniInfom
.
getCerNo
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getCerNo
())
&&
uniInfom
.
getCerNo
()
!=
null
)
{
pstm
.
setString
(
8
,
uniInfom
.
getCerNo
());
pstm
.
setString
(
8
,
uniInfom
.
getCerNo
());
}
else
{
}
else
{
pstm
.
setString
(
8
,
""
);
pstm
.
setString
(
8
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getOperatorName
())&&
uniInfom
.
getOperatorName
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getOperatorName
())
&&
uniInfom
.
getOperatorName
()
!=
null
)
{
pstm
.
setString
(
9
,
uniInfom
.
getOperatorName
());
pstm
.
setString
(
9
,
uniInfom
.
getOperatorName
());
}
else
{
}
else
{
pstm
.
setString
(
9
,
""
);
pstm
.
setString
(
9
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getOperatorCerNo
())&&
uniInfom
.
getOperatorCerNo
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getOperatorCerNo
())
&&
uniInfom
.
getOperatorCerNo
()
!=
null
)
{
pstm
.
setString
(
10
,
uniInfom
.
getOperatorCerNo
());
pstm
.
setString
(
10
,
uniInfom
.
getOperatorCerNo
());
}
else
{
}
else
{
pstm
.
setString
(
10
,
""
);
pstm
.
setString
(
10
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getOperatorPhone
())&&
uniInfom
.
getOperatorPhone
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getOperatorPhone
())
&&
uniInfom
.
getOperatorPhone
()
!=
null
)
{
pstm
.
setString
(
11
,
uniInfom
.
getOperatorPhone
());
pstm
.
setString
(
11
,
uniInfom
.
getOperatorPhone
());
}
else
{
}
else
{
pstm
.
setString
(
11
,
""
);
pstm
.
setString
(
11
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getOplocdistrict
())&&
uniInfom
.
getOplocdistrict
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getOplocdistrict
())
&&
uniInfom
.
getOplocdistrict
()
!=
null
)
{
pstm
.
setString
(
12
,
uniInfom
.
getOplocdistrict
());
pstm
.
setString
(
12
,
uniInfom
.
getOplocdistrict
());
}
else
{
}
else
{
pstm
.
setString
(
12
,
""
);
pstm
.
setString
(
12
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getUnitNature
())&&
uniInfom
.
getUnitNature
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getUnitNature
())
&&
uniInfom
.
getUnitNature
()
!=
null
)
{
pstm
.
setString
(
13
,
uniInfom
.
getUnitNature
());
pstm
.
setString
(
13
,
uniInfom
.
getUnitNature
());
}
else
{
}
else
{
pstm
.
setString
(
13
,
""
);
pstm
.
setString
(
13
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getEconomicType
())&&
uniInfom
.
getEconomicType
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getEconomicType
())
&&
uniInfom
.
getEconomicType
()
!=
null
)
{
pstm
.
setString
(
14
,
uniInfom
.
getEconomicType
());
pstm
.
setString
(
14
,
uniInfom
.
getEconomicType
());
}
else
{
}
else
{
pstm
.
setString
(
14
,
""
);
pstm
.
setString
(
14
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getIndustryphy
())&&
uniInfom
.
getIndustryphy
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getIndustryphy
())
&&
uniInfom
.
getIndustryphy
()
!=
null
)
{
pstm
.
setString
(
15
,
uniInfom
.
getIndustryphy
());
pstm
.
setString
(
15
,
uniInfom
.
getIndustryphy
());
}
else
{
}
else
{
pstm
.
setString
(
15
,
""
);
pstm
.
setString
(
15
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getUnitPayDay
())&&
uniInfom
.
getUnitPayDay
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getUnitPayDay
())
&&
uniInfom
.
getUnitPayDay
()
!=
null
)
{
pstm
.
setString
(
16
,
uniInfom
.
getUnitPayDay
());
pstm
.
setString
(
16
,
uniInfom
.
getUnitPayDay
());
}
else
{
}
else
{
pstm
.
setString
(
16
,
""
);
pstm
.
setString
(
16
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getUnitDepPro
())&&
uniInfom
.
getUnitDepPro
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getUnitDepPro
())
&&
uniInfom
.
getUnitDepPro
()
!=
null
)
{
pstm
.
setString
(
17
,
uniInfom
.
getUnitDepPro
());
pstm
.
setString
(
17
,
uniInfom
.
getUnitDepPro
());
}
else
{
}
else
{
pstm
.
setString
(
17
,
""
);
pstm
.
setString
(
17
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getPersonalDepPro
())&&
uniInfom
.
getPersonalDepPro
()!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getPersonalDepPro
())
&&
uniInfom
.
getPersonalDepPro
()
!=
null
)
{
pstm
.
setString
(
18
,
uniInfom
.
getPersonalDepPro
());
pstm
.
setString
(
18
,
uniInfom
.
getPersonalDepPro
());
}
else
{
}
else
{
pstm
.
setString
(
18
,
""
);
pstm
.
setString
(
18
,
""
);
}
}
pstm
.
registerOutParameter
(
19
,
oracle
.
jdbc
.
OracleTypes
.
VARCHAR
);
pstm
.
registerOutParameter
(
19
,
oracle
.
jdbc
.
OracleTypes
.
VARCHAR
);
pstm
.
registerOutParameter
(
20
,
oracle
.
jdbc
.
OracleTypes
.
VARCHAR
);
pstm
.
registerOutParameter
(
20
,
oracle
.
jdbc
.
OracleTypes
.
VARCHAR
);
//执行数据库查询操作
//执行数据库查询操作
pstm
.
execute
();
pstm
.
execute
();
//输出结果[第二个参数]
//输出结果[第二个参数]
System
.
out
.
println
(
pstm
.
getString
(
19
));
System
.
out
.
println
(
pstm
.
getString
(
19
));
System
.
out
.
println
(
pstm
.
getString
(
20
));
System
.
out
.
println
(
pstm
.
getString
(
20
));
if
(
""
.
equals
(
pstm
.
getString
(
19
))||
pstm
.
getString
(
19
)==
null
)
{
if
(
""
.
equals
(
pstm
.
getString
(
19
))
||
pstm
.
getString
(
19
)
==
null
)
{
break
;
break
;
}
else
{
}
else
{
try
{
try
{
// 避免批量插入高并发,此处设置每次停顿5秒
// 避免批量插入高并发,此处设置每次停顿5秒
Thread
.
currentThread
().
sleep
(
2000
);
Thread
.
currentThread
().
sleep
(
2000
);
...
@@ -306,6 +302,8 @@ public class ProvidentFundServicesController {
...
@@ -306,6 +302,8 @@ public class ProvidentFundServicesController {
}
}
}
}
pstm2
.
execute
();
pstm2
.
execute
();
}
else
{
System
.
out
.
println
(
"第三方返回的报文中data数据为空!"
);
}
}
//释放资源
//释放资源
pstm
.
close
();
pstm
.
close
();
...
@@ -313,9 +311,42 @@ public class ProvidentFundServicesController {
...
@@ -313,9 +311,42 @@ public class ProvidentFundServicesController {
connection
.
close
();
connection
.
close
();
}
}
/**
* 判断一个实体对象是否为空
*
* @param obj
* @return
*/
public
static
boolean
isNullOrEmpty
(
Object
obj
)
{
if
(
obj
==
null
)
return
true
;
if
(
obj
instanceof
CharSequence
)
return
((
CharSequence
)
obj
).
length
()
==
0
;
if
(
obj
instanceof
Collection
)
return
((
Collection
)
obj
).
isEmpty
();
if
(
obj
instanceof
Map
)
return
((
Map
)
obj
).
isEmpty
();
if
(
obj
instanceof
Object
[])
{
Object
[]
object
=
(
Object
[])
obj
;
if
(
object
.
length
==
0
)
{
return
true
;
}
boolean
empty
=
true
;
for
(
int
i
=
0
;
i
<
object
.
length
;
i
++)
{
if
(!
isNullOrEmpty
(
object
[
i
]))
{
empty
=
false
;
break
;
}
}
return
empty
;
}
return
false
;
}
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
*(第二个定时)
* (第二个定时)
*
* @param
* @param
* @param
* @param
*/
*/
...
@@ -324,28 +355,28 @@ public class ProvidentFundServicesController {
...
@@ -324,28 +355,28 @@ public class ProvidentFundServicesController {
public
static
String
BusinessProcessing
()
{
public
static
String
BusinessProcessing
()
{
System
.
out
.
println
(
"调第二个接口了"
);
System
.
out
.
println
(
"调第二个接口了"
);
//调oracle存储过程拿到进度推进的数据集合
//调oracle存储过程拿到进度推进的数据集合
List
<
BusinessProcessing
>
list
=
null
;
List
<
BusinessProcessing
>
list
=
null
;
try
{
try
{
list
=
zjbmfhywtosj
();
list
=
zjbmfhywtosj
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
System
.
out
.
println
(
"调第二个接口了存储过程返回的list"
+
list
);
System
.
out
.
println
(
"调第二个接口了存储过程返回的list"
+
list
);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"state"
,
"1"
);
jsonObject
.
put
(
"state"
,
"1"
);
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
jsonObject
.
put
(
"timestamp"
,
list
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getTime
());
jsonObject
.
put
(
"timestamp"
,
list
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getTime
());
}
else
{
}
else
{
jsonObject
.
put
(
"timestamp"
,
""
);
jsonObject
.
put
(
"timestamp"
,
""
);
}
}
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
jsonObject
.
put
(
"busId"
,
list
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getBusId
());
jsonObject
.
put
(
"busId"
,
list
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getBusId
());
}
else
{
}
else
{
jsonObject
.
put
(
"busId"
,
""
);
jsonObject
.
put
(
"busId"
,
""
);
}
}
jsonObject
.
put
(
"departCode"
,
"10"
);
jsonObject
.
put
(
"departCode"
,
"10"
);
jsonObject
.
put
(
"nodeList"
,
list
);
jsonObject
.
put
(
"nodeList"
,
list
);
String
str
=
jsonObject
.
toString
();
String
str
=
jsonObject
.
toString
();
StringBuffer
sb
=
new
StringBuffer
();
StringBuffer
sb
=
new
StringBuffer
();
HttpURLConnection
conn
=
null
;
HttpURLConnection
conn
=
null
;
...
@@ -388,25 +419,24 @@ public class ProvidentFundServicesController {
...
@@ -388,25 +419,24 @@ public class ProvidentFundServicesController {
sb
.
append
(
readLine
);
sb
.
append
(
readLine
);
}
}
responseReader
.
close
();
responseReader
.
close
();
System
.
out
.
println
(
"前置机返回第三方解压之后的进度推送结果"
+
sb
.
toString
());
System
.
out
.
println
(
"前置机返回第三方解压之后的进度推送结果"
+
sb
.
toString
());
String
uscc
=
""
;
String
uscc
=
""
;
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
uscc
=
list
.
get
(
0
).
getUscc
();
uscc
=
list
.
get
(
0
).
getUscc
();
}
else
{
}
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"
);
Integer
value
=
0
;
Integer
value
=
0
;
if
(
"true"
.
equals
(
success
))
{
if
(
"true"
.
equals
(
success
))
{
value
=
1
;
value
=
1
;
}
else
if
(
"false"
.
equals
(
success
))
{
}
else
if
(
"false"
.
equals
(
success
))
{
value
=
0
;
value
=
0
;
}
}
try
{
try
{
zjbmfhywtosjHX
(
uscc
,
value
);
zjbmfhywtosjHX
(
uscc
,
value
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -429,7 +459,6 @@ public class ProvidentFundServicesController {
...
@@ -429,7 +459,6 @@ public class ProvidentFundServicesController {
conn
.
disconnect
();
conn
.
disconnect
();
}
}
}
}
return
null
;
return
null
;
}
}
...
@@ -441,72 +470,62 @@ public class ProvidentFundServicesController {
...
@@ -441,72 +470,62 @@ public class ProvidentFundServicesController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"zjbmfhywtosj"
)
@PostMapping
(
"zjbmfhywtosj"
)
public
static
List
<
BusinessProcessing
>
zjbmfhywtosj
()
throws
Exception
{
public
static
List
<
BusinessProcessing
>
zjbmfhywtosj
()
throws
Exception
{
//1.调用oracle存储过程,拿到业务办理进度数据
//1.调用oracle存储过程,拿到业务办理进度数据
//加载数据库驱动
//加载数据库驱动
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"
);
//测试环境
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(?)}"
);
//给参数赋值
//给参数赋值
// pstm.setString(1,"914205007146986289");
// pstm.setString(1,"914205007146986289");
pstm
.
registerOutParameter
(
1
,
OracleTypes
.
CURSOR
);
pstm
.
registerOutParameter
(
1
,
OracleTypes
.
CURSOR
);
//执行数据库查询操作
//执行数据库查询操作
pstm
.
execute
();
pstm
.
execute
();
//输出结果[第二个参数]
//输出结果[第二个参数]
ResultSet
rs
=
(
ResultSet
)
pstm
.
getObject
(
1
);
//此处的2要与存储过程中cursor的问题对应
ResultSet
rs
=
(
ResultSet
)
pstm
.
getObject
(
1
);
//此处的2要与存储过程中cursor的问题对应
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
BusinessProcessing
b
=
new
BusinessProcessing
();
BusinessProcessing
b
=
new
BusinessProcessing
();
System
.
out
.
println
(
rs
.
getString
(
1
));
//获取具体的值
//
System.out.println(rs.getString(1));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
1
))&&
rs
.
getString
(
1
)!=
null
)
{
if
(!
""
.
equals
(
rs
.
getString
(
1
))
&&
rs
.
getString
(
1
)
!=
null
)
{
b
.
setBusiLink
(
rs
.
getString
(
1
));
b
.
setBusiLink
(
rs
.
getString
(
1
));
}
}
System
.
out
.
println
(
rs
.
getString
(
2
));
//获取具体的值
//
System.out.println(rs.getString(2));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
2
))&&
rs
.
getString
(
2
)!=
null
)
{
if
(!
""
.
equals
(
rs
.
getString
(
2
))
&&
rs
.
getString
(
2
)
!=
null
)
{
b
.
setBusiType
(
rs
.
getString
(
2
));
b
.
setBusiType
(
rs
.
getString
(
2
));
}
}
System
.
out
.
println
(
rs
.
getString
(
3
));
//获取具体的值
//
System.out.println(rs.getString(3));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
3
))&&
rs
.
getString
(
3
)!=
null
)
{
if
(!
""
.
equals
(
rs
.
getString
(
3
))
&&
rs
.
getString
(
3
)
!=
null
)
{
b
.
setOpeartor
(
rs
.
getString
(
3
));
b
.
setOpeartor
(
rs
.
getString
(
3
));
}
}
System
.
out
.
println
(
rs
.
getString
(
4
));
//获取具体的值
//
System.out.println(rs.getString(4));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
4
))&&
rs
.
getString
(
4
)!=
null
)
{
if
(!
""
.
equals
(
rs
.
getString
(
4
))
&&
rs
.
getString
(
4
)
!=
null
)
{
b
.
setTel
(
rs
.
getString
(
4
));
b
.
setTel
(
rs
.
getString
(
4
));
}
}
System
.
out
.
println
(
rs
.
getString
(
5
));
//获取具体的值
//
System.out.println(rs.getString(5));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
5
))&&
rs
.
getString
(
5
)!=
null
)
{
if
(!
""
.
equals
(
rs
.
getString
(
5
))
&&
rs
.
getString
(
5
)
!=
null
)
{
b
.
setOpinion
(
rs
.
getString
(
5
));
b
.
setOpinion
(
rs
.
getString
(
5
));
}
}
System
.
out
.
println
(
rs
.
getString
(
6
));
//获取具体的值
//
System.out.println(rs.getString(6));//获取具体的值
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("1111"+rs.getDate(7));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
7
))
&&
rs
.
getString
(
7
)
!=
null
)
{
System
.
out
.
println
(
"sssss:"
+
Timestamp
.
valueOf
(
rs
.
getString
(
7
).
substring
(
0
,
19
)));
b
.
setTime
(
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
){
// 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
)
{
b
.
setUscc
(
rs
.
getString
(
8
));
b
.
setUscc
(
rs
.
getString
(
8
));
}
}
System
.
out
.
println
(
rs
.
getString
(
9
));
//获取具体的值
//
System.out.println(rs.getString(9));//获取具体的值
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
));
//获取具体的值
//
System.out.println(rs.getString(10));//获取具体的值
if
(!
""
.
equals
(
rs
.
getString
(
10
))&&
rs
.
getString
(
10
)!=
null
)
{
if
(!
""
.
equals
(
rs
.
getString
(
10
))
&&
rs
.
getString
(
10
)
!=
null
)
{
b
.
setBusId
(
rs
.
getString
(
10
));
b
.
setBusId
(
rs
.
getString
(
10
));
}
}
list
.
add
(
b
);
list
.
add
(
b
);
...
@@ -515,28 +534,22 @@ public class ProvidentFundServicesController {
...
@@ -515,28 +534,22 @@ public class ProvidentFundServicesController {
//释放资源
//释放资源
pstm
.
close
();
pstm
.
close
();
connection
.
close
();
connection
.
close
();
// for(BusinessProcessing b:list){
return
list
;
// if(b.getTime()!=null){
// Format format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// b.setTime(format.format(b.getTime()));
// }
// }
return
list
;
}
}
public
static
void
zjbmfhywtosjHX
(
String
uscc
,
Integer
value
)
throws
Exception
{
public
static
void
zjbmfhywtosjHX
(
String
uscc
,
Integer
value
)
throws
Exception
{
//1.调用oracle存储过程,拿到业务办理进度数据
//1.调用oracle存储过程,拿到业务办理进度数据
//加载数据库驱动
//加载数据库驱动
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"
);
//测试环境
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(?,?)}"
);
//给参数赋值
//给参数赋值
pstm
.
setString
(
1
,
uscc
);
pstm
.
setString
(
1
,
uscc
);
pstm
.
setInt
(
2
,
value
);
pstm
.
setInt
(
2
,
value
);
// pstm.registerOutParameter(1, OracleTypes.CURSOR);
// pstm.registerOutParameter(1, OracleTypes.CURSOR);
//执行数据库查询操作
//执行数据库查询操作
pstm
.
execute
();
pstm
.
execute
();
...
...
src/main/java/net/cdkj/gjj/adapter/domain/Json.java
0 → 100644
View file @
b66bd3ed
package
net.cdkj.gjj.adapter.domain
;
import
java.util.List
;
/**
* Json对象
*/
public
class
Json
{
private
Integer
code
;
private
String
message
;
private
String
fields
;
private
List
<
UnitAccountOpeningInformation
>
data
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
String
getFields
()
{
return
fields
;
}
public
void
setFields
(
String
fields
)
{
this
.
fields
=
fields
;
}
public
List
<
UnitAccountOpeningInformation
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
UnitAccountOpeningInformation
>
data
)
{
this
.
data
=
data
;
}
@Override
public
String
toString
()
{
return
"Json{"
+
"code="
+
code
+
", message='"
+
message
+
'\''
+
", fields='"
+
fields
+
'\''
+
", data="
+
data
+
'}'
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment