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
ad7f1adf
Commit
ad7f1adf
authored
May 28, 2021
by
华润
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码提交内置机
parent
70f38a14
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
7 deletions
+64
-7
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
+52
-0
src/main/java/net/cdkj/gjj/adapter/controller/ProvidentFundServicesController.java
...j/adapter/controller/ProvidentFundServicesController.java
+12
-7
No files found.
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
0 → 100644
View file @
ad7f1adf
package
net.cdkj.gjj.adapter.controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* 定时任务类
* @author huarun
*
*/
@Component
@EnableScheduling
//@Async
public
class
AlarmTask
{
//系统服务定时器
/**第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次*/
@Scheduled
(
initialDelay
=
5
*
1000
,
fixedDelay
=
60
*
1000
)
public
void
run3
(){
String
dqsj
=
""
;
Date
dt
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-mm-dd HH:mm:ss"
);
dqsj
=
sdf
.
format
(
dt
);
System
.
out
.
println
(
"开始时间"
+
dqsj
);
try
{
ProvidentFundServicesController
.
gjjxtfwjk
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
//进度数据定时器
/**第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次*/
@Scheduled
(
initialDelay
=
10
*
1000
,
fixedDelay
=
60
*
1000
)
public
void
run4
(){
String
dqsj
=
""
;
Date
dt
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-mm-dd HH:mm:ss"
);
dqsj
=
sdf
.
format
(
dt
);
System
.
out
.
println
(
"开始时间"
+
dqsj
);
ProvidentFundServicesController
.
BusinessProcessing
();
}
}
src/main/java/net/cdkj/gjj/adapter/controller/ProvidentFundServicesController.java
View file @
ad7f1adf
...
@@ -48,7 +48,7 @@ public class ProvidentFundServicesController {
...
@@ -48,7 +48,7 @@ public class ProvidentFundServicesController {
OutputStream
out
=
null
;
OutputStream
out
=
null
;
try
{
try
{
// 创建url 资源
// 创建url 资源
URL
url
=
new
URL
(
"http://192.168.1
01.34:8080
/FrontEndProcessor/FrontEndProcessor/ProvidentFundServices"
);
//调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
URL
url
=
new
URL
(
"http://192.168.1
.252:8888
/FrontEndProcessor/FrontEndProcessor/ProvidentFundServices"
);
//调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// 创建http 连接
// 创建http 连接
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
// 设置允许输出
// 设置允许输出
...
@@ -84,7 +84,7 @@ public class ProvidentFundServicesController {
...
@@ -84,7 +84,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
(
"请求失败!!!"
);
...
@@ -341,7 +341,7 @@ public class ProvidentFundServicesController {
...
@@ -341,7 +341,7 @@ public class ProvidentFundServicesController {
OutputStream
out
=
null
;
OutputStream
out
=
null
;
try
{
try
{
// 创建url 资源
// 创建url 资源
URL
url
=
new
URL
(
"http://192.168.1
01.34:8080
/FrontEndProcessor/FrontEndProcessor/BusinessProcessing"
);
//调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
URL
url
=
new
URL
(
"http://192.168.1
.252:8888
/FrontEndProcessor/FrontEndProcessor/BusinessProcessing"
);
//调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
// 创建http 连接
// 创建http 连接
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
// 设置允许输出
// 设置允许输出
...
@@ -377,12 +377,17 @@ public class ProvidentFundServicesController {
...
@@ -377,12 +377,17 @@ 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
=
list
.
get
(
0
).
getUscc
();
String
uscc
=
list
.
get
(
0
).
getUscc
();
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"
);
Boolean
value
=
Boolean
.
getBoolean
(
success
);
Integer
value
=
0
;
if
(
"true"
.
equals
(
success
)){
value
=
1
;
}
else
if
(
"false"
.
equals
(
success
)){
value
=
0
;
}
try
{
try
{
zjbmfhywtosjHX
(
uscc
,
value
);
zjbmfhywtosjHX
(
uscc
,
value
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -483,7 +488,7 @@ public class ProvidentFundServicesController {
...
@@ -483,7 +488,7 @@ public class ProvidentFundServicesController {
}
}
public
static
void
zjbmfhywtosjHX
(
String
uscc
,
Boolean
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"
);
...
@@ -493,7 +498,7 @@ public class ProvidentFundServicesController {
...
@@ -493,7 +498,7 @@ public class ProvidentFundServicesController {
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
.
set
Boolean
(
2
,
value
);
pstm
.
set
Int
(
2
,
value
);
// pstm.registerOutParameter(1, OracleTypes.CURSOR);
// pstm.registerOutParameter(1, OracleTypes.CURSOR);
//执行数据库查询操作
//执行数据库查询操作
pstm
.
execute
();
pstm
.
execute
();
...
...
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