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
d6db3561
Commit
d6db3561
authored
Jan 31, 2024
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位开户、单位变更、单位销户协议修改
parent
7a2a3da1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
818 additions
and
217 deletions
+818
-217
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
+11
-22
src/main/java/net/cdkj/gjj/adapter/controller/TestController.java
.../java/net/cdkj/gjj/adapter/controller/TestController.java
+0
-15
src/main/java/net/cdkj/gjj/adapter/domain/Json.java
src/main/java/net/cdkj/gjj/adapter/domain/Json.java
+0
-10
src/main/java/net/cdkj/gjj/adapter/domain/PropertyqUtil.java
src/main/java/net/cdkj/gjj/adapter/domain/PropertyqUtil.java
+1
-2
src/main/java/net/cdkj/gjj/adapter/domain/UnitAccountOpeningInformation.java
...dkj/gjj/adapter/domain/UnitAccountOpeningInformation.java
+10
-30
src/main/java/net/cdkj/gjj/adapter/service/DeptInfoUpdateService.java
...a/net/cdkj/gjj/adapter/service/DeptInfoUpdateService.java
+281
-0
src/main/java/net/cdkj/gjj/adapter/service/DeptLogoutService.java
.../java/net/cdkj/gjj/adapter/service/DeptLogoutService.java
+47
-123
src/main/java/net/cdkj/gjj/adapter/service/OpenAccountService.java
...java/net/cdkj/gjj/adapter/service/OpenAccountService.java
+464
-0
src/main/resources/application.properties
src/main/resources/application.properties
+4
-15
No files found.
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
View file @
d6db3561
package
net.cdkj.gjj.adapter.controller
;
package
net.cdkj.gjj.adapter.controller
;
import
net.cdkj.gjj.adapter.service.DeptInfoUpdateService
;
import
net.cdkj.gjj.adapter.service.DeptLogoutService
;
import
net.cdkj.gjj.adapter.service.OpenAccountService
;
import
net.cdkj.gjj.adapter.utils.InternalUtils
;
import
net.cdkj.gjj.adapter.utils.InternalUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -21,14 +24,14 @@ import javax.annotation.Resource;
...
@@ -21,14 +24,14 @@ import javax.annotation.Resource;
//@Async
//@Async
public
class
AlarmTask
{
public
class
AlarmTask
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateController
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AlarmTask
.
class
);
@Resource
@Resource
private
DeptInfoUpdateController
deptInfoUpdateController
;
private
OpenAccountService
openAccountService
;
@Resource
@Resource
private
Dept
LogoutController
deptLogoutController
;
private
Dept
InfoUpdateService
deptInfoUpdateService
;
@Resource
@Resource
private
ProvidentFundServicesController
providentFundServicesController
;
private
DeptLogoutService
deptLogoutService
;
/**
/**
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
...
@@ -37,7 +40,7 @@ public class AlarmTask {
...
@@ -37,7 +40,7 @@ public class AlarmTask {
public
void
dwkhPullTask
()
{
public
void
dwkhPullTask
()
{
log
.
debug
(
"第一个接口开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
log
.
debug
(
"第一个接口开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
try
{
try
{
providentFundServicesController
.
gjjxtfwjk
();
openAccountService
.
syncDeptInfo
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"{}"
,
e
);
log
.
error
(
"{}"
,
e
);
}
}
...
@@ -51,34 +54,20 @@ public class AlarmTask {
...
@@ -51,34 +54,20 @@ public class AlarmTask {
@Scheduled
(
initialDelay
=
20
*
1000
,
fixedDelayString
=
"${dwkhPushTaskDelay}"
)
@Scheduled
(
initialDelay
=
20
*
1000
,
fixedDelayString
=
"${dwkhPushTaskDelay}"
)
public
void
dwkhPushTask
()
{
public
void
dwkhPushTask
()
{
log
.
debug
(
"第二个接口开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
log
.
debug
(
"第二个接口开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
providentFundServicesController
.
BusinessProcessing
();
openAccountService
.
dwkhPush
();
}
}
@Scheduled
(
initialDelay
=
40
*
1000
,
fixedDelayString
=
"${dwxxbgPushTaskDelay}"
)
@Scheduled
(
initialDelay
=
40
*
1000
,
fixedDelayString
=
"${dwxxbgPushTaskDelay}"
)
public
void
dwxxbgPushTask
()
{
public
void
dwxxbgPushTask
()
{
log
.
debug
(
"dwxxbgPushTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
log
.
debug
(
"dwxxbgPushTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
deptInfoUpdateController
.
dwxxbgPush
();
deptInfoUpdateService
.
deptInfoUpdatePush
();
}
@Scheduled
(
initialDelay
=
60
*
1000
,
fixedDelayString
=
"${dwxxbgPullTaskDelay}"
)
public
void
dwxxbgPullTask
()
{
log
.
debug
(
"dwxxbgPullTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
deptInfoUpdateController
.
dwxxbgPull
();
}
}
@Scheduled
(
initialDelay
=
80
*
1000
,
fixedDelayString
=
"${dwxhPushTaskDelay}"
)
@Scheduled
(
initialDelay
=
80
*
1000
,
fixedDelayString
=
"${dwxhPushTaskDelay}"
)
public
void
dwxhPushTask
()
{
public
void
dwxhPushTask
()
{
log
.
debug
(
"dwxhPushTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
log
.
debug
(
"dwxhPushTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
deptLogout
Controller
.
dwxhPush
();
deptLogout
Service
.
dwxhPush
();
}
}
@Scheduled
(
initialDelay
=
100
*
1000
,
fixedDelayString
=
"${dwxhPullTaskDelay}"
)
public
void
dwxhPullTask
()
{
log
.
debug
(
"dwxhPullTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
deptLogoutController
.
dwxhPull
();
}
}
}
src/main/java/net/cdkj/gjj/adapter/controller/TestController.java
deleted
100644 → 0
View file @
7a2a3da1
package
net.cdkj.gjj.adapter.controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"demo"
)
public
class
TestController
{
@RequestMapping
(
"test"
)
public
String
test
(
String
name
)
{
System
.
out
.
println
(
"内部业务机"
);
return
"hello,hello"
+
name
;
}
}
src/main/java/net/cdkj/gjj/adapter/domain/Json.java
View file @
d6db3561
...
@@ -47,15 +47,5 @@ public class Json {
...
@@ -47,15 +47,5 @@ public class Json {
this
.
data
=
data
;
this
.
data
=
data
;
}
}
@Override
public
String
toString
()
{
return
"Json{"
+
"code="
+
code
+
", message='"
+
message
+
'\''
+
", fields='"
+
fields
+
'\''
+
", data="
+
data
+
'}'
;
}
}
}
src/main/java/net/cdkj/gjj/adapter/domain/PropertyqUtil.java
View file @
d6db3561
package
net.cdkj.gjj.adapter.domain
;
package
net.cdkj.gjj.adapter.domain
;
import
net.cdkj.gjj.adapter.controller.DeptInfoUpdateController
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -14,7 +13,7 @@ import java.util.Properties;
...
@@ -14,7 +13,7 @@ import java.util.Properties;
*/
*/
public
class
PropertyqUtil
{
public
class
PropertyqUtil
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateController
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
PropertyqUtil
.
class
);
/**
/**
* 读取 classpath 下 指定的properties配置文件,加载到Properties并返回Properties
* 读取 classpath 下 指定的properties配置文件,加载到Properties并返回Properties
...
...
src/main/java/net/cdkj/gjj/adapter/domain/UnitAccountOpeningInformation.java
View file @
d6db3561
...
@@ -58,6 +58,16 @@ public class UnitAccountOpeningInformation {
...
@@ -58,6 +58,16 @@ public class UnitAccountOpeningInformation {
private
String
errmsg
;
private
String
errmsg
;
private
String
dataStatus
;
public
String
getDataStatus
()
{
return
dataStatus
;
}
public
void
setDataStatus
(
String
dataStatus
)
{
this
.
dataStatus
=
dataStatus
;
}
public
String
getBusId
()
{
public
String
getBusId
()
{
return
busId
;
return
busId
;
...
@@ -250,34 +260,4 @@ public class UnitAccountOpeningInformation {
...
@@ -250,34 +260,4 @@ public class UnitAccountOpeningInformation {
public
void
setErrmsg
(
String
errmsg
)
{
public
void
setErrmsg
(
String
errmsg
)
{
this
.
errmsg
=
errmsg
;
this
.
errmsg
=
errmsg
;
}
}
@Override
public
String
toString
()
{
return
"UnitAccountOpeningInformation{"
+
"ywbh='"
+
ywbh
+
'\''
+
", busId='"
+
busId
+
'\''
+
", uscc='"
+
uscc
+
'\''
+
", entName='"
+
entName
+
'\''
+
", dom='"
+
dom
+
'\''
+
", estDate="
+
estDate
+
", lerep='"
+
lerep
+
'\''
+
", cerType='"
+
cerType
+
'\''
+
", cerNo='"
+
cerNo
+
'\''
+
", operatorName='"
+
operatorName
+
'\''
+
", operatorCerNo='"
+
operatorCerNo
+
'\''
+
", operatorPhone='"
+
operatorPhone
+
'\''
+
", oplocdistrict='"
+
oplocdistrict
+
'\''
+
", unitNature='"
+
unitNature
+
'\''
+
", economicType='"
+
economicType
+
'\''
+
", industryphy='"
+
industryphy
+
'\''
+
", unitPayDay='"
+
unitPayDay
+
'\''
+
", unitDepPro='"
+
unitDepPro
+
'\''
+
", personalDepPro='"
+
personalDepPro
+
'\''
+
", zxdqbm='"
+
zxdqbm
+
'\''
+
", lcls='"
+
lcls
+
'\''
+
", dwzh='"
+
dwzh
+
'\''
+
", errcode='"
+
errcode
+
'\''
+
", errmsg='"
+
errmsg
+
'\''
+
'}'
;
}
}
}
src/main/java/net/cdkj/gjj/adapter/
controller/DeptInfoUpdateController
.java
→
src/main/java/net/cdkj/gjj/adapter/
service/DeptInfoUpdateService
.java
View file @
d6db3561
package
net.cdkj.gjj.adapter.
controller
;
package
net.cdkj.gjj.adapter.
service
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
net.cdkj.gjj.adapter.domain.AjaxResult
;
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
net.cdkj.gjj.adapter.utils.InternalUtils
;
import
oracle.jdbc.OracleTypes
;
import
oracle.jdbc.OracleTypes
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -34,80 +28,18 @@ import java.util.List;
...
@@ -34,80 +28,18 @@ import java.util.List;
/**
/**
* 公积金系统服务类
* 公积金系统服务类
*/
*/
@RestController
@Service
@RequestMapping
(
value
=
"/InternalLogic"
)
public
class
DeptInfoUpdateService
{
public
class
DeptInfoUpdateController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateService
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateController
.
class
);
@Resource
@Resource
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Resource
@Resource
private
DruidDataSource
druidDataSource
;
private
DruidDataSource
druidDataSource
;
@Value
(
"${dwxxbgPullUrl}"
)
@Value
(
"${businessProcessing}"
)
private
String
dwxxbgPullUrl
;
private
String
businessProcessing
;
@Value
(
"${dwxxbgPushUrl}"
)
private
String
dwxxbgPushUrl
;
@Value
(
"${timetype}"
)
private
String
timetype
;
@Value
(
"${startTime}"
)
private
String
startTime
;
@Value
(
"${endTime}"
)
private
String
endTime
;
/**
* 模拟数据
*
* @return
*/
private
static
String
mockDwxxbgHttp
()
{
List
<
UnitAccountOpeningInformation
>
informationList
=
new
ArrayList
<>();
UnitAccountOpeningInformation
information
=
new
UnitAccountOpeningInformation
();
information
.
setBusId
(
"2"
);
information
.
setUscc
(
"91421122MAC7ANQB8C"
);
information
.
setEntName
(
"红安县永利土石方工程有限公司"
);
information
.
setDom
(
"湖北省黄冈市红安县高桥镇长扬路东端北侧119号"
);
information
.
setLerep
(
"吴永利"
);
information
.
setCerType
(
"10"
);
information
.
setCerNo
(
"422123197810295851"
);
information
.
setOperatorName
(
"吴永利"
);
information
.
setOperatorCerNo
(
"422123197810295851"
);
information
.
setOperatorPhone
(
"13872001037"
);
information
.
setOplocdistrict
(
"421122"
);
information
.
setUnitNature
(
"A313"
);
information
.
setEconomicType
(
"1"
);
information
.
setIndustryphy
(
"E"
);
information
.
setUnitPayDay
(
"1"
);
informationList
.
add
(
information
);
Json
json
=
new
Json
();
json
.
setData
(
informationList
);
String
dwxxbgHttp
=
JSONObject
.
toJSONString
(
json
);
return
dwxxbgHttp
;
}
/**
* 公积金系统服务接口内置机调前置机中间接口
*
* @param
* @param
*/
@ResponseBody
@PostMapping
(
"/getDwxxbgHttp"
)
public
String
getDwxxbgHttp
()
{
JSONObject
jsonObject
=
new
JSONObject
();
if
(
"1"
.
equals
(
timetype
))
{
// 表示正式环境
jsonObject
.
put
(
"startTime"
,
InternalUtils
.
currentTime
(
0
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
InternalUtils
.
currentTime
(
24
));
// 正式环境
}
else
if
(
"2"
.
equals
(
timetype
))
{
// 表示测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
startTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
endTime
);
// 测试环境或本地环境
}
jsonObject
.
put
(
"app_id"
,
"eb453ca78b354f2c9163a703530f5186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
String
str
=
jsonObject
.
toString
();
//(测试环境地址)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String
forObject
=
restTemplate
.
postForObject
(
dwxxbgPullUrl
,
str
,
String
.
class
);
return
forObject
;
}
/**
/**
* (第一个定时的)
* (第一个定时的)
...
@@ -116,23 +48,10 @@ public class DeptInfoUpdateController {
...
@@ -116,23 +48,10 @@ public class DeptInfoUpdateController {
*
*
* @return
* @return
*/
*/
@ResponseBody
public
void
deptInfoUpdatePull
(
List
<
UnitAccountOpeningInformation
>
bills
)
{
@PostMapping
(
"/dwxxbgPull"
)
public
AjaxResult
dwxxbgPull
()
{
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String
dwxxbgHttp
=
getDwxxbgHttp
();
// String dwxxbgHttp = mockDwxxbgHttp();
log
.
info
(
"拿到第一个接口返回的第三方数据:{}"
,
dwxxbgHttp
);
Json
jsonentity
=
JSONObject
.
parseObject
(
dwxxbgHttp
,
Json
.
class
);
List
<
UnitAccountOpeningInformation
>
bills
=
null
;
if
(!
InternalUtils
.
isNullOrEmpty
(
jsonentity
))
{
bills
=
jsonentity
.
getData
();
}
if
(
CollectionUtils
.
isEmpty
(
bills
))
{
if
(
CollectionUtils
.
isEmpty
(
bills
))
{
log
.
info
(
"第三方返回的报文中data数据为空!"
);
return
;
return
AjaxResult
.
success
(
"第三方返回的报文中data数据为空"
,
null
);
}
}
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 2.内置机处理返回的业务数据,调用oracle存储过程
Connection
connection
=
null
;
Connection
connection
=
null
;
CallableStatement
dwxxbgImp
=
null
;
CallableStatement
dwxxbgImp
=
null
;
...
@@ -143,7 +62,9 @@ public class DeptInfoUpdateController {
...
@@ -143,7 +62,9 @@ public class DeptInfoUpdateController {
dwxxbgImp
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_IMP(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}"
);
dwxxbgImp
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_IMP(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}"
);
// 循环插入
// 循环插入
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
if
(!
StringUtils
.
isEmpty
(
uniInfom
.
getOplocdistrict
()))
{
if
(
StringUtils
.
isEmpty
(
uniInfom
.
getOplocdistrict
()))
{
continue
;
}
// 业务标识
// 业务标识
String
busId
=
StringUtils
.
hasText
(
uniInfom
.
getBusId
())
?
uniInfom
.
getBusId
()
:
""
;
String
busId
=
StringUtils
.
hasText
(
uniInfom
.
getBusId
())
?
uniInfom
.
getBusId
()
:
""
;
dwxxbgImp
.
setString
(
1
,
busId
);
dwxxbgImp
.
setString
(
1
,
busId
);
...
@@ -206,7 +127,6 @@ public class DeptInfoUpdateController {
...
@@ -206,7 +127,6 @@ public class DeptInfoUpdateController {
Thread
.
currentThread
().
sleep
(
2000
);
Thread
.
currentThread
().
sleep
(
2000
);
}
}
}
}
}
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
dwxxbgSave
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_SAVE()}"
);
dwxxbgSave
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_SAVE()}"
);
dwxxbgSave
.
execute
();
dwxxbgSave
.
execute
();
...
@@ -223,21 +143,15 @@ public class DeptInfoUpdateController {
...
@@ -223,21 +143,15 @@ public class DeptInfoUpdateController {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
}
}
return
AjaxResult
.
success
(
"请求成功"
,
null
);
}
}
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
* (第二个定时)
* (第二个定时)
*
* @param
* @param
*/
*/
@ResponseBody
public
String
deptInfoUpdatePush
()
{
@PostMapping
(
"/dwxxbgPush"
)
public
String
dwxxbgPush
()
{
// 调oracle存储过程拿到进度推进的数据集合
// 调oracle存储过程拿到进度推进的数据集合
List
<
BusinessProcessing
>
collDwxxbgList
=
collD
wxxbg
();
List
<
BusinessProcessing
>
collDwxxbgList
=
collD
eptInfoUpdate
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"state"
,
"1"
);
jsonObject
.
put
(
"state"
,
"1"
);
if
(!
CollectionUtils
.
isEmpty
(
collDwxxbgList
))
{
if
(!
CollectionUtils
.
isEmpty
(
collDwxxbgList
))
{
...
@@ -252,25 +166,22 @@ public class DeptInfoUpdateController {
...
@@ -252,25 +166,22 @@ public class DeptInfoUpdateController {
String
str
=
jsonObject
.
toString
();
String
str
=
jsonObject
.
toString
();
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String
forObject
=
restTemplate
.
postForObject
(
dwxxbgPushUrl
,
str
,
String
.
class
);
String
forObject
=
restTemplate
.
postForObject
(
businessProcessing
,
str
,
String
.
class
);
log
.
info
(
"前置机返回第三方解压之后的进度推送结果:{}"
,
forObject
);
log
.
info
(
"前置机返回第三方解压之后的进度推送结果:{}"
,
forObject
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
forObject
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
forObject
);
Integer
value
=
"true"
.
equals
(
jsonObj
.
getString
(
"success"
))
?
1
:
0
;
Integer
value
=
"true"
.
equals
(
jsonObj
.
getString
(
"success"
))
?
1
:
0
;
String
uscc
=
!
CollectionUtils
.
isEmpty
(
collDwxxbgList
)
?
collDwxxbgList
.
get
(
0
).
getUscc
()
:
""
;
String
uscc
=
!
CollectionUtils
.
isEmpty
(
collDwxxbgList
)
?
collDwxxbgList
.
get
(
0
).
getUscc
()
:
""
;
log
.
info
(
"入参 uscc:{} value:{}"
,
uscc
,
value
);
log
.
info
(
"入参 uscc:{} value:{}"
,
uscc
,
value
);
collDwxxbgHx
(
uscc
,
value
);
// 回写
collDeptInfoUpdateRewrite
(
uscc
,
value
);
return
forObject
;
return
forObject
;
}
}
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
* 调用oracle存储过程拿到进度数据,然后请求前置机,让前置机请求市监接口,将办理的进度数据推送给市监
* 调用oracle存储过程拿到进度数据,然后请求前置机,让前置机请求市监接口,将办理的进度数据推送给市监
*
* @return
*/
*/
@ResponseBody
public
List
<
BusinessProcessing
>
collDeptInfoUpdate
()
{
@PostMapping
(
"/collDwxxbg"
)
public
List
<
BusinessProcessing
>
collDwxxbg
()
{
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
Connection
connection
=
null
;
Connection
connection
=
null
;
CallableStatement
dwxxbgCx
=
null
;
CallableStatement
dwxxbgCx
=
null
;
...
@@ -338,7 +249,10 @@ public class DeptInfoUpdateController {
...
@@ -338,7 +249,10 @@ public class DeptInfoUpdateController {
}
}
public
void
collDwxxbgHx
(
String
uscc
,
Integer
value
)
{
/**
* 单位变更回写
*/
public
void
collDeptInfoUpdateRewrite
(
String
uscc
,
Integer
value
)
{
Connection
connection
=
null
;
Connection
connection
=
null
;
CallableStatement
pstm
=
null
;
CallableStatement
pstm
=
null
;
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
...
@@ -363,4 +277,5 @@ public class DeptInfoUpdateController {
...
@@ -363,4 +277,5 @@ public class DeptInfoUpdateController {
}
}
}
}
}
}
src/main/java/net/cdkj/gjj/adapter/
controller/DeptLogoutController
.java
→
src/main/java/net/cdkj/gjj/adapter/
service/DeptLogoutService
.java
View file @
d6db3561
package
net.cdkj.gjj.adapter.
controller
;
package
net.cdkj.gjj.adapter.
service
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
net.cdkj.gjj.adapter.domain.AjaxResult
;
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
net.cdkj.gjj.adapter.utils.InternalUtils
;
import
oracle.jdbc.OracleTypes
;
import
oracle.jdbc.OracleTypes
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -34,70 +28,17 @@ import java.util.List;
...
@@ -34,70 +28,17 @@ import java.util.List;
/**
/**
* 公积金系统服务类
* 公积金系统服务类
*/
*/
@RestController
@Service
@RequestMapping
(
value
=
"/InternalLogic"
)
public
class
DeptLogoutService
{
public
class
DeptLogoutController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptLogout
Controller
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptLogout
Service
.
class
);
@Resource
@Resource
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Resource
@Resource
private
DruidDataSource
druidDataSource
;
private
DruidDataSource
druidDataSource
;
@Value
(
"${dwxhPullUrl}"
)
@Value
(
"${businessProcessing}"
)
private
String
dwxhPullUrl
;
private
String
businessProcessing
;
@Value
(
"${dwxhPushUrl}"
)
private
String
dwxhPushUrl
;
@Value
(
"${timetype}"
)
private
String
timetype
;
@Value
(
"${startTime}"
)
private
String
startTime
;
@Value
(
"${endTime}"
)
private
String
endTime
;
/**
* 模拟数据
*
* @return
*/
private
static
String
mockDwxhHttp
()
{
List
<
UnitAccountOpeningInformation
>
informationList
=
new
ArrayList
<>();
UnitAccountOpeningInformation
information
=
new
UnitAccountOpeningInformation
();
information
.
setBusId
(
"2"
);
information
.
setUscc
(
"91421122MAC7ANQB8C"
);
information
.
setEntName
(
"红安县永利土石方工程有限公司"
);
information
.
setDom
(
"湖北省黄冈市红安县高桥镇长扬路东端北侧119号"
);
information
.
setOplocdistrict
(
"421122"
);
informationList
.
add
(
information
);
Json
json
=
new
Json
();
json
.
setData
(
informationList
);
String
dwxhHttp
=
JSONObject
.
toJSONString
(
json
);
return
dwxhHttp
;
}
/**
* 公积金系统服务接口内置机调前置机中间接口
*
* @param
* @param
*/
@ResponseBody
@PostMapping
(
"/getDwxhHttp"
)
public
String
getDwxhHttp
()
{
JSONObject
jsonObject
=
new
JSONObject
();
if
(
"1"
.
equals
(
timetype
))
{
// 表示正式环境
jsonObject
.
put
(
"startTime"
,
InternalUtils
.
currentTime
(
0
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
InternalUtils
.
currentTime
(
24
));
// 正式环境
}
else
if
(
"2"
.
equals
(
timetype
))
{
// 表示测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
startTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
endTime
);
// 测试环境或本地环境
}
jsonObject
.
put
(
"app_id"
,
"eb453ca78b354f2c9163a703530f5186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
String
str
=
jsonObject
.
toString
();
//(测试环境地址)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String
forObject
=
restTemplate
.
postForObject
(
dwxhPullUrl
,
str
,
String
.
class
);
return
forObject
;
}
/**
/**
* (第一个定时的)
* (第一个定时的)
...
@@ -106,22 +47,10 @@ public class DeptLogoutController {
...
@@ -106,22 +47,10 @@ public class DeptLogoutController {
*
*
* @return
* @return
*/
*/
@ResponseBody
public
void
deptLogoutPull
(
List
<
UnitAccountOpeningInformation
>
bills
)
{
@PostMapping
(
"/dwxhPull"
)
public
AjaxResult
dwxhPull
()
{
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String
dwxhHttp
=
getDwxhHttp
();
log
.
info
(
"拿到第一个接口返回的第三方数据:{}"
,
dwxhHttp
);
Json
jsonentity
=
JSONObject
.
parseObject
(
dwxhHttp
,
Json
.
class
);
List
<
UnitAccountOpeningInformation
>
bills
=
null
;
if
(!
InternalUtils
.
isNullOrEmpty
(
jsonentity
))
{
bills
=
jsonentity
.
getData
();
}
if
(
CollectionUtils
.
isEmpty
(
bills
))
{
if
(
CollectionUtils
.
isEmpty
(
bills
))
{
log
.
info
(
"第三方返回的报文中data数据为空!"
);
return
;
return
AjaxResult
.
success
(
"第三方返回的报文中data数据为空"
,
null
);
}
}
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 2.内置机处理返回的业务数据,调用oracle存储过程
Connection
connection
=
null
;
Connection
connection
=
null
;
CallableStatement
dwxhImp
=
null
;
CallableStatement
dwxhImp
=
null
;
...
@@ -132,7 +61,9 @@ public class DeptLogoutController {
...
@@ -132,7 +61,9 @@ public class DeptLogoutController {
dwxhImp
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXH.DWXH_IMP(?, ?, ?, ?, ?, ?, ?)}"
);
dwxhImp
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXH.DWXH_IMP(?, ?, ?, ?, ?, ?, ?)}"
);
// 循环插入
// 循环插入
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
if
(!
StringUtils
.
isEmpty
(
uniInfom
.
getOplocdistrict
()))
{
if
(
StringUtils
.
isEmpty
(
uniInfom
.
getOplocdistrict
()))
{
continue
;
}
// 业务标识
// 业务标识
String
busId
=
StringUtils
.
hasText
(
uniInfom
.
getBusId
())
?
uniInfom
.
getBusId
()
:
""
;
String
busId
=
StringUtils
.
hasText
(
uniInfom
.
getBusId
())
?
uniInfom
.
getBusId
()
:
""
;
dwxhImp
.
setString
(
1
,
busId
);
dwxhImp
.
setString
(
1
,
busId
);
...
@@ -165,7 +96,6 @@ public class DeptLogoutController {
...
@@ -165,7 +96,6 @@ public class DeptLogoutController {
Thread
.
currentThread
().
sleep
(
2000
);
Thread
.
currentThread
().
sleep
(
2000
);
}
}
}
}
}
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
dwxhSave
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXH.DWXH_SAVE()}"
);
dwxhSave
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXH.DWXH_SAVE()}"
);
dwxhSave
.
execute
();
dwxhSave
.
execute
();
...
@@ -182,18 +112,12 @@ public class DeptLogoutController {
...
@@ -182,18 +112,12 @@ public class DeptLogoutController {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
}
}
return
AjaxResult
.
success
(
"请求成功"
,
null
);
}
}
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
* (第二个定时)
* (第二个定时)
*
* @param
* @param
*/
*/
@ResponseBody
@PostMapping
(
"/dwxhPush"
)
public
String
dwxhPush
()
{
public
String
dwxhPush
()
{
// 调oracle存储过程拿到进度推进的数据集合
// 调oracle存储过程拿到进度推进的数据集合
List
<
BusinessProcessing
>
collDwxhList
=
collDwxh
();
List
<
BusinessProcessing
>
collDwxhList
=
collDwxh
();
...
@@ -211,12 +135,13 @@ public class DeptLogoutController {
...
@@ -211,12 +135,13 @@ public class DeptLogoutController {
String
str
=
jsonObject
.
toString
();
String
str
=
jsonObject
.
toString
();
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String
forObject
=
restTemplate
.
postForObject
(
dwxhPushUrl
,
str
,
String
.
class
);
String
forObject
=
restTemplate
.
postForObject
(
businessProcessing
,
str
,
String
.
class
);
log
.
info
(
"前置机返回第三方解压之后的进度推送结果:{}"
,
forObject
);
log
.
info
(
"前置机返回第三方解压之后的进度推送结果:{}"
,
forObject
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
forObject
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
forObject
);
Integer
value
=
"true"
.
equals
(
jsonObj
.
getString
(
"success"
))
?
1
:
0
;
Integer
value
=
"true"
.
equals
(
jsonObj
.
getString
(
"success"
))
?
1
:
0
;
String
uscc
=
!
CollectionUtils
.
isEmpty
(
collDwxhList
)
?
collDwxhList
.
get
(
0
).
getUscc
()
:
""
;
String
uscc
=
!
CollectionUtils
.
isEmpty
(
collDwxhList
)
?
collDwxhList
.
get
(
0
).
getUscc
()
:
""
;
log
.
info
(
"入参 uscc:{} value:{}"
,
uscc
,
value
);
log
.
info
(
"入参 uscc:{} value:{}"
,
uscc
,
value
);
// 回写
collDwxhHx
(
uscc
,
value
);
collDwxhHx
(
uscc
,
value
);
return
forObject
;
return
forObject
;
}
}
...
@@ -224,11 +149,7 @@ public class DeptLogoutController {
...
@@ -224,11 +149,7 @@ public class DeptLogoutController {
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
* 调用oracle存储过程拿到进度数据,然后请求前置机,让前置机请求市监接口,将办理的进度数据推送给市监
* 调用oracle存储过程拿到进度数据,然后请求前置机,让前置机请求市监接口,将办理的进度数据推送给市监
*
* @return
*/
*/
@ResponseBody
@PostMapping
(
"/collDwxh"
)
public
List
<
BusinessProcessing
>
collDwxh
()
{
public
List
<
BusinessProcessing
>
collDwxh
()
{
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
Connection
connection
=
null
;
Connection
connection
=
null
;
...
@@ -297,6 +218,9 @@ public class DeptLogoutController {
...
@@ -297,6 +218,9 @@ public class DeptLogoutController {
}
}
/**
* 回写
*/
public
void
collDwxhHx
(
String
uscc
,
Integer
value
)
{
public
void
collDwxhHx
(
String
uscc
,
Integer
value
)
{
Connection
connection
=
null
;
Connection
connection
=
null
;
CallableStatement
pstm
=
null
;
CallableStatement
pstm
=
null
;
...
...
src/main/java/net/cdkj/gjj/adapter/
controller/ProvidentFundServicesController
.java
→
src/main/java/net/cdkj/gjj/adapter/
service/OpenAccountService
.java
View file @
d6db3561
package
net.cdkj.gjj.adapter.
controller
;
package
net.cdkj.gjj.adapter.
service
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
...
@@ -12,39 +12,43 @@ import oracle.jdbc.OracleTypes;
...
@@ -12,39 +12,43 @@ import oracle.jdbc.OracleTypes;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.sql.CallableStatement
;
import
java.sql.CallableStatement
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* 公积金系统服务类
* 公积金系统服务类
*/
*/
@RestController
@Service
@RequestMapping
(
value
=
"InternalLogic"
)
public
class
OpenAccountService
{
public
class
ProvidentFundServicesController
{
// sl4j
// sl4j
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProvidentFundServicesController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
OpenAccountService
.
class
);
@Resource
@Resource
private
DruidDataSource
dataSource
;
private
DruidDataSource
dataSource
;
@Resource
private
DeptLogoutService
deptLogoutService
;
@Resource
private
DeptInfoUpdateService
deptInfoUpdateService
;
@Value
(
"${providentFundServices}"
)
private
String
providentFundServices
;
@Value
(
"${dwkhPullUrl}"
)
@Value
(
"${businessProcessing}"
)
private
String
dwkhPullUrl
;
private
String
businessProcessing
;
@Value
(
"${dwkhPushUrl}"
)
private
String
dwkhPushUrl
;
@Value
(
"${timetype}"
)
@Value
(
"${timetype}"
)
private
String
timetype
;
private
String
timetype
;
...
@@ -55,62 +59,14 @@ public class ProvidentFundServicesController {
...
@@ -55,62 +59,14 @@ public class ProvidentFundServicesController {
@Value
(
"${endTime}"
)
@Value
(
"${endTime}"
)
private
String
endTime
;
private
String
endTime
;
/**
* 获取当天零点零分零秒的时间戳和当天24点的时间戳
*
* @return
*/
@ResponseBody
@PostMapping
(
"currentime"
)
public
static
String
currenttime
(
int
type
)
{
return
InternalUtils
.
currentTime
(
type
);
}
/**
* 判断一个实体对象是否为空
*
* @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
*/
*/
@ResponseBody
public
void
syncDeptInfo
()
throws
Exception
{
@PostMapping
(
"ProvidentFundServices"
)
public
String
ProvidentFundServices
()
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
if
(
"1"
.
equals
(
timetype
))
{
// 表示正式环境
if
(
"1"
.
equals
(
timetype
))
{
// 表示正式环境
jsonObject
.
put
(
"startTime"
,
currentt
ime
(
0
));
// 正式环境
jsonObject
.
put
(
"startTime"
,
InternalUtils
.
currentT
ime
(
0
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
currentt
ime
(
24
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
InternalUtils
.
currentT
ime
(
24
));
// 正式环境
}
else
if
(
"2"
.
equals
(
timetype
))
{
// 表示测试环境或本地环境
}
else
if
(
"2"
.
equals
(
timetype
))
{
// 表示测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
startTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
startTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
endTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
endTime
);
// 测试环境或本地环境
...
@@ -119,26 +75,44 @@ public class ProvidentFundServicesController {
...
@@ -119,26 +75,44 @@ public class ProvidentFundServicesController {
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
String
str
=
jsonObject
.
toString
();
String
str
=
jsonObject
.
toString
();
// 发起 post 请求
// 发起 post 请求
return
HttpUtil
.
sendPost
(
dwkhPullUrl
,
str
);
String
result
=
HttpUtil
.
sendPost
(
providentFundServices
,
str
);
// String result = mockDwxxHttp();
logger
.
info
(
"拿到第一个接口返回的第三方数据,准备调第一个存储过程"
+
result
);
Json
jsonentity
=
JSONObject
.
parseObject
(
result
,
Json
.
class
);
List
<
UnitAccountOpeningInformation
>
bills
=
new
ArrayList
<>();
if
(!
InternalUtils
.
isNullOrEmpty
(
jsonentity
))
{
bills
=
jsonentity
.
getData
();
}
List
<
UnitAccountOpeningInformation
>
openAccountList
=
new
ArrayList
<>();
List
<
UnitAccountOpeningInformation
>
deptInfoUpdateList
=
new
ArrayList
<>();
List
<
UnitAccountOpeningInformation
>
deptLogoutList
=
new
ArrayList
<>();
for
(
UnitAccountOpeningInformation
bill
:
bills
)
{
String
dataStatus
=
bill
.
getDataStatus
();
// 开户
if
(
StringUtils
.
isEmpty
(
dataStatus
)
||
dataStatus
.
equals
(
"0"
))
{
openAccountList
.
add
(
bill
);
// 变更
}
else
if
(
dataStatus
.
equals
(
"1"
))
{
deptInfoUpdateList
.
add
(
bill
);
// 注销
}
else
if
(
dataStatus
.
equals
(
"2"
))
{
deptLogoutList
.
add
(
bill
);
}
}
openAccountPull
(
openAccountList
);
deptInfoUpdateService
.
deptInfoUpdatePull
(
deptInfoUpdateList
);
deptLogoutService
.
deptLogoutPull
(
deptLogoutList
);
}
}
/**
/**
* (第一个定时的)
* (第一个定时的)
* 调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,
* 调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,
* 拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
* 拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
*
* @return
*/
*/
@ResponseBody
public
void
openAccountPull
(
List
<
UnitAccountOpeningInformation
>
bills
)
throws
Exception
{
@PostMapping
(
"gjjxtfwjk"
)
if
(
CollectionUtils
.
isEmpty
(
bills
))
{
public
void
gjjxtfwjk
()
throws
Exception
{
return
;
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String
jsoninfom
=
ProvidentFundServices
();
logger
.
info
(
"拿到第一个接口返回的第三方数据,准备调第一个存储过程"
+
jsoninfom
);
Json
jsonentity
=
JSONObject
.
parseObject
(
jsoninfom
,
Json
.
class
);
List
<
UnitAccountOpeningInformation
>
bills
=
new
ArrayList
<>();
if
(!
isNullOrEmpty
(
jsonentity
))
{
bills
=
jsonentity
.
getData
();
}
}
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 加载数据库驱动
// 加载数据库驱动
...
@@ -147,9 +121,11 @@ public class ProvidentFundServicesController {
...
@@ -147,9 +121,11 @@ public class ProvidentFundServicesController {
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()}"
);
if
(!
bills
.
isEmpty
())
{
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
for
(
UnitAccountOpeningInformation
uniInfom
:
bills
)
{
if
(!
""
.
equals
(
uniInfom
.
getOplocdistrict
())
&&
uniInfom
.
getOplocdistrict
()
!=
null
)
{
String
oplocdistrict
=
uniInfom
.
getOplocdistrict
();
if
(
StringUtils
.
isEmpty
(
oplocdistrict
))
{
continue
;
}
logger
.
info
(
"oplocdistrict"
+
"在规定的值里面,调imp过程"
);
logger
.
info
(
"oplocdistrict"
+
"在规定的值里面,调imp过程"
);
if
(!
""
.
equals
(
uniInfom
.
getBusId
())
&&
uniInfom
.
getBusId
()
!=
null
)
{
if
(!
""
.
equals
(
uniInfom
.
getBusId
())
&&
uniInfom
.
getBusId
()
!=
null
)
{
pstm
.
setString
(
1
,
uniInfom
.
getBusId
());
pstm
.
setString
(
1
,
uniInfom
.
getBusId
());
...
@@ -217,8 +193,8 @@ public class ProvidentFundServicesController {
...
@@ -217,8 +193,8 @@ public class ProvidentFundServicesController {
pstm
.
setString
(
11
,
""
);
pstm
.
setString
(
11
,
""
);
}
}
if
(!
""
.
equals
(
uniInfom
.
getOplocdistrict
())
&&
uniInfom
.
getOplocdistrict
()
!=
null
)
{
if
(!
""
.
equals
(
oplocdistrict
)
&&
oplocdistrict
!=
null
)
{
pstm
.
setString
(
12
,
uniInfom
.
getOplocdistrict
()
);
pstm
.
setString
(
12
,
oplocdistrict
);
}
else
{
}
else
{
pstm
.
setString
(
12
,
""
);
pstm
.
setString
(
12
,
""
);
}
}
...
@@ -258,8 +234,8 @@ public class ProvidentFundServicesController {
...
@@ -258,8 +234,8 @@ public class ProvidentFundServicesController {
}
else
{
}
else
{
pstm
.
setString
(
18
,
""
);
pstm
.
setString
(
18
,
""
);
}
}
pstm
.
registerOutParameter
(
19
,
oracle
.
jdbc
.
OracleTypes
.
VARCHAR
);
pstm
.
registerOutParameter
(
19
,
OracleTypes
.
VARCHAR
);
pstm
.
registerOutParameter
(
20
,
oracle
.
jdbc
.
OracleTypes
.
VARCHAR
);
pstm
.
registerOutParameter
(
20
,
OracleTypes
.
VARCHAR
);
// 执行数据库查询操作
// 执行数据库查询操作
pstm
.
execute
();
pstm
.
execute
();
// 输出结果[第二个参数]
// 输出结果[第二个参数]
...
@@ -278,11 +254,7 @@ public class ProvidentFundServicesController {
...
@@ -278,11 +254,7 @@ public class ProvidentFundServicesController {
}
}
}
}
}
pstm2
.
execute
();
pstm2
.
execute
();
}
else
{
logger
.
info
(
"第三方返回的报文中data数据为空!"
);
}
// 释放资源
// 释放资源
pstm
.
close
();
pstm
.
close
();
pstm2
.
close
();
pstm2
.
close
();
...
@@ -292,18 +264,13 @@ public class ProvidentFundServicesController {
...
@@ -292,18 +264,13 @@ public class ProvidentFundServicesController {
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
* (第二个定时)
* (第二个定时)
*
* @param
* @param
*/
*/
@ResponseBody
public
String
dwkhPush
()
{
@PostMapping
(
"BusinessProcessing"
)
public
String
BusinessProcessing
()
{
logger
.
info
(
"调第二个接口了"
);
logger
.
info
(
"调第二个接口了"
);
// 调oracle存储过程拿到进度推进的数据集合
// 调oracle存储过程拿到进度推进的数据集合
List
<
BusinessProcessing
>
list
=
null
;
List
<
BusinessProcessing
>
list
=
null
;
try
{
try
{
list
=
zjbmfhywtosj
();
list
=
collOpenAccount
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"{}"
,
e
);
logger
.
error
(
"{}"
,
e
);
}
}
...
@@ -325,7 +292,7 @@ public class ProvidentFundServicesController {
...
@@ -325,7 +292,7 @@ public class ProvidentFundServicesController {
jsonObject
.
put
(
"nodeList"
,
list
);
jsonObject
.
put
(
"nodeList"
,
list
);
String
str
=
jsonObject
.
toString
();
String
str
=
jsonObject
.
toString
();
// 发起 post 请求
// 发起 post 请求
String
result
=
HttpUtil
.
sendPost
(
dwkhPushUrl
,
str
);
String
result
=
HttpUtil
.
sendPost
(
businessProcessing
,
str
);
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
String
uscc
=
""
;
String
uscc
=
""
;
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
...
@@ -341,7 +308,7 @@ public class ProvidentFundServicesController {
...
@@ -341,7 +308,7 @@ public class ProvidentFundServicesController {
value
=
0
;
value
=
0
;
}
}
try
{
try
{
zjbmfhywtosjHX
(
uscc
,
value
);
collOpenAccountRewrite
(
uscc
,
value
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"{}"
,
e
);
logger
.
error
(
"{}"
,
e
);
}
}
...
@@ -353,18 +320,14 @@ public class ProvidentFundServicesController {
...
@@ -353,18 +320,14 @@ public class ProvidentFundServicesController {
/**
/**
* 住建部门返回公积金办理进度数据接口方法
* 住建部门返回公积金办理进度数据接口方法
* 调用oracle存储过程拿到进度数据,然后请求前置机,让前置机请求市监接口,将办理的进度数据推送给市监
* 调用oracle存储过程拿到进度数据,然后请求前置机,让前置机请求市监接口,将办理的进度数据推送给市监
*
* @return
*/
*/
@ResponseBody
public
List
<
BusinessProcessing
>
collOpenAccount
()
throws
Exception
{
@PostMapping
(
"zjbmfhywtosj"
)
public
List
<
BusinessProcessing
>
zjbmfhywtosj
()
throws
Exception
{
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
Connection
connection
=
dataSource
.
getConnection
();
Connection
connection
=
dataSource
.
getConnection
();
// 得到预编译的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
();
...
@@ -413,7 +376,10 @@ public class ProvidentFundServicesController {
...
@@ -413,7 +376,10 @@ public class ProvidentFundServicesController {
}
}
public
void
zjbmfhywtosjHX
(
String
uscc
,
Integer
value
)
throws
Exception
{
/**
* 回写
*/
public
void
collOpenAccountRewrite
(
String
uscc
,
Integer
value
)
throws
Exception
{
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
// 加载数据库驱动
// 加载数据库驱动
Connection
connection
=
dataSource
.
getConnection
();
Connection
connection
=
dataSource
.
getConnection
();
...
@@ -431,4 +397,68 @@ public class ProvidentFundServicesController {
...
@@ -431,4 +397,68 @@ public class ProvidentFundServicesController {
connection
.
close
();
connection
.
close
();
}
}
/**
* 模拟数据
*
* @return
*/
private
static
String
mockDwxxHttp
()
{
List
<
UnitAccountOpeningInformation
>
informationList
=
new
ArrayList
<>();
// 单位变更
UnitAccountOpeningInformation
dwkh
=
new
UnitAccountOpeningInformation
();
dwkh
.
setBusId
(
"2"
);
dwkh
.
setUscc
(
"91421122MAC7ANQB8C"
);
dwkh
.
setEntName
(
"红安县永利土石方工程有限公司"
);
dwkh
.
setDom
(
"湖北省黄冈市红安县高桥镇长扬路东端北侧119号"
);
dwkh
.
setEstDate
(
new
Date
());
dwkh
.
setLerep
(
"吴永利"
);
dwkh
.
setCerType
(
"10"
);
dwkh
.
setCerNo
(
"422123197810295851"
);
dwkh
.
setOperatorName
(
"吴永利"
);
dwkh
.
setOperatorCerNo
(
"422123197810295851"
);
dwkh
.
setOperatorPhone
(
"13872001037"
);
dwkh
.
setOplocdistrict
(
"421122"
);
dwkh
.
setUnitNature
(
"A313"
);
dwkh
.
setEconomicType
(
"1"
);
dwkh
.
setIndustryphy
(
"E"
);
dwkh
.
setUnitPayDay
(
"1"
);
dwkh
.
setUnitDepPro
(
"12"
);
dwkh
.
setPersonalDepPro
(
"12"
);
informationList
.
add
(
dwkh
);
// 单位变更
UnitAccountOpeningInformation
dwxxBg
=
new
UnitAccountOpeningInformation
();
dwxxBg
.
setBusId
(
"2"
);
dwxxBg
.
setUscc
(
"91421122MAC7ANQB8C"
);
dwxxBg
.
setEntName
(
"红安县永利土石方工程有限公司"
);
dwxxBg
.
setDom
(
"湖北省黄冈市红安县高桥镇长扬路东端北侧119号"
);
dwxxBg
.
setLerep
(
"吴永利"
);
dwxxBg
.
setCerType
(
"10"
);
dwxxBg
.
setCerNo
(
"422123197810295851"
);
dwxxBg
.
setOperatorName
(
"吴永利"
);
dwxxBg
.
setOperatorCerNo
(
"422123197810295851"
);
dwxxBg
.
setOperatorPhone
(
"13872001037"
);
dwxxBg
.
setOplocdistrict
(
"421122"
);
dwxxBg
.
setUnitNature
(
"A313"
);
dwxxBg
.
setEconomicType
(
"1"
);
dwxxBg
.
setIndustryphy
(
"E"
);
dwxxBg
.
setUnitPayDay
(
"1"
);
dwxxBg
.
setDataStatus
(
"1"
);
informationList
.
add
(
dwxxBg
);
// 单位销户
UnitAccountOpeningInformation
dwXh
=
new
UnitAccountOpeningInformation
();
dwXh
.
setBusId
(
"2"
);
dwXh
.
setUscc
(
"91421122MAC7ANQB8C"
);
dwXh
.
setEntName
(
"红安县永利土石方工程有限公司"
);
dwXh
.
setDom
(
"湖北省黄冈市红安县高桥镇长扬路东端北侧119号"
);
dwXh
.
setOplocdistrict
(
"421122"
);
dwXh
.
setDataStatus
(
"2"
);
informationList
.
add
(
dwXh
);
Json
json
=
new
Json
();
json
.
setData
(
informationList
);
String
dwxxbgHttp
=
JSONObject
.
toJSONString
(
json
);
return
dwxxbgHttp
;
}
}
}
src/main/resources/application.properties
View file @
d6db3561
...
@@ -24,20 +24,11 @@ password:ENC(PI2/xdOsEObL0YZlfGfQnyiJeYUw/90FePU+sO4EDjU=)
...
@@ -24,20 +24,11 @@ password:ENC(PI2/xdOsEObL0YZlfGfQnyiJeYUw/90FePU+sO4EDjU=)
# 前置服务URL
# 前置服务URL
#单位
开户
拉取url
#单位
信息
拉取url
dwkhPullUrl
:
http://127.0.0.1:8081/FrontEndProcessor/ProvidentFundServices
providentFundServices
:
http://127.0.0.1:8081/FrontEndProcessor/ProvidentFundServices
#
单位开户
推送url
#
办理进度
推送url
dwkhPushUrl
:
http://127.0.0.1:8081/FrontEndProcessor/BusinessProcessing
businessProcessing
:
http://127.0.0.1:8081/FrontEndProcessor/BusinessProcessing
#单位信息变跟拉取url
dwxxbgPullUrl
:
http://127.0.0.1:8081/FrontEndProcessor/dwxxbgPull
#单位信息变跟推送url
dwxxbgPushUrl
:
http://127.0.0.1:8081/FrontEndProcessor/dwxxbgPush
#单位销户拉取url
dwxhPullUrl
:
http://127.0.0.1:8081/FrontEndProcessor/dwxhPull
#单位销户推送url
dwxhPushUrl
:
http://127.0.0.1:8081/FrontEndProcessor/dwxhPush
...
@@ -45,9 +36,7 @@ dwxhPushUrl:http://127.0.0.1:8081/FrontEndProcessor/dwxhPush
...
@@ -45,9 +36,7 @@ dwxhPushUrl:http://127.0.0.1:8081/FrontEndProcessor/dwxhPush
dwkhPullTaskDelay
:
60000
dwkhPullTaskDelay
:
60000
dwkhPushTaskDelay
:
60000
dwkhPushTaskDelay
:
60000
dwxxbgPushTaskDelay
:
60000
dwxxbgPushTaskDelay
:
60000
dwxxbgPullTaskDelay
:
60000
dwxhPushTaskDelay
:
60000
dwxhPushTaskDelay
:
60000
dwxhPullTaskDelay
:
60000
# 日志配置
# 日志配置
logging.config
:
classpath:logback.xml
logging.config
:
classpath:logback.xml
...
...
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