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
5e707c49
Commit
5e707c49
authored
Sep 14, 2023
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位变更开发,框架优化处理
parent
d7abe822
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
604 additions
and
449 deletions
+604
-449
.mvn/wrapper/MavenWrapperDownloader.java
.mvn/wrapper/MavenWrapperDownloader.java
+0
-118
.mvn/wrapper/maven-wrapper.jar
.mvn/wrapper/maven-wrapper.jar
+0
-0
.mvn/wrapper/maven-wrapper.properties
.mvn/wrapper/maven-wrapper.properties
+0
-2
pom.xml
pom.xml
+13
-25
src/main/java/net/cdkj/gjj/adapter/InternalLogicApplication.java
...n/java/net/cdkj/gjj/adapter/InternalLogicApplication.java
+2
-0
src/main/java/net/cdkj/gjj/adapter/ServletInitializer.java
src/main/java/net/cdkj/gjj/adapter/ServletInitializer.java
+0
-13
src/main/java/net/cdkj/gjj/adapter/config/DruidConfig.java
src/main/java/net/cdkj/gjj/adapter/config/DruidConfig.java
+44
-0
src/main/java/net/cdkj/gjj/adapter/config/JasyptConfig.java
src/main/java/net/cdkj/gjj/adapter/config/JasyptConfig.java
+1
-6
src/main/java/net/cdkj/gjj/adapter/config/RestTemplateConfig.java
.../java/net/cdkj/gjj/adapter/config/RestTemplateConfig.java
+6
-0
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
+30
-16
src/main/java/net/cdkj/gjj/adapter/controller/DeptInfoUpdateController.java
...cdkj/gjj/adapter/controller/DeptInfoUpdateController.java
+225
-184
src/main/java/net/cdkj/gjj/adapter/controller/EncryptController.java
...va/net/cdkj/gjj/adapter/controller/EncryptController.java
+27
-0
src/main/java/net/cdkj/gjj/adapter/controller/ProvidentFundServicesController.java
...j/adapter/controller/ProvidentFundServicesController.java
+31
-38
src/main/java/net/cdkj/gjj/adapter/domain/AjaxResult.java
src/main/java/net/cdkj/gjj/adapter/domain/AjaxResult.java
+140
-0
src/main/java/net/cdkj/gjj/adapter/utils/InternalUtils.java
src/main/java/net/cdkj/gjj/adapter/utils/InternalUtils.java
+6
-0
src/main/resources/application.properties
src/main/resources/application.properties
+17
-6
src/main/resources/logback-spring.xml
src/main/resources/logback-spring.xml
+62
-0
src/main/webapp/WEB-INF/web.xml
src/main/webapp/WEB-INF/web.xml
+0
-28
src/test/java/net/cdkj/gjj/adapter/AdapterApplicationTests.java
...st/java/net/cdkj/gjj/adapter/AdapterApplicationTests.java
+0
-13
No files found.
.mvn/wrapper/MavenWrapperDownloader.java
deleted
100644 → 0
View file @
d7abe822
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
java.net.*
;
import
java.io.*
;
import
java.nio.channels.*
;
import
java.util.Properties
;
public
class
MavenWrapperDownloader
{
private
static
final
String
WRAPPER_VERSION
=
"0.5.6"
;
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private
static
final
String
DEFAULT_DOWNLOAD_URL
=
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+
WRAPPER_VERSION
+
"/maven-wrapper-"
+
WRAPPER_VERSION
+
".jar"
;
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private
static
final
String
MAVEN_WRAPPER_PROPERTIES_PATH
=
".mvn/wrapper/maven-wrapper.properties"
;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private
static
final
String
MAVEN_WRAPPER_JAR_PATH
=
".mvn/wrapper/maven-wrapper.jar"
;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private
static
final
String
PROPERTY_NAME_WRAPPER_URL
=
"wrapperUrl"
;
public
static
void
main
(
String
args
[])
{
System
.
out
.
println
(
"- Downloader started"
);
File
baseDirectory
=
new
File
(
args
[
0
]);
System
.
out
.
println
(
"- Using base directory: "
+
baseDirectory
.
getAbsolutePath
());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File
mavenWrapperPropertyFile
=
new
File
(
baseDirectory
,
MAVEN_WRAPPER_PROPERTIES_PATH
);
String
url
=
DEFAULT_DOWNLOAD_URL
;
if
(
mavenWrapperPropertyFile
.
exists
())
{
FileInputStream
mavenWrapperPropertyFileInputStream
=
null
;
try
{
mavenWrapperPropertyFileInputStream
=
new
FileInputStream
(
mavenWrapperPropertyFile
);
Properties
mavenWrapperProperties
=
new
Properties
();
mavenWrapperProperties
.
load
(
mavenWrapperPropertyFileInputStream
);
url
=
mavenWrapperProperties
.
getProperty
(
PROPERTY_NAME_WRAPPER_URL
,
url
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"- ERROR loading '"
+
MAVEN_WRAPPER_PROPERTIES_PATH
+
"'"
);
}
finally
{
try
{
if
(
mavenWrapperPropertyFileInputStream
!=
null
)
{
mavenWrapperPropertyFileInputStream
.
close
();
}
}
catch
(
IOException
e
)
{
// Ignore ...
}
}
}
System
.
out
.
println
(
"- Downloading from: "
+
url
);
File
outputFile
=
new
File
(
baseDirectory
.
getAbsolutePath
(),
MAVEN_WRAPPER_JAR_PATH
);
if
(!
outputFile
.
getParentFile
().
exists
())
{
if
(!
outputFile
.
getParentFile
().
mkdirs
())
{
System
.
out
.
println
(
"- ERROR creating output directory '"
+
outputFile
.
getParentFile
().
getAbsolutePath
()
+
"'"
);
}
}
System
.
out
.
println
(
"- Downloading to: "
+
outputFile
.
getAbsolutePath
());
try
{
downloadFileFromURL
(
url
,
outputFile
);
System
.
out
.
println
(
"Done"
);
System
.
exit
(
0
);
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
"- Error downloading"
);
e
.
printStackTrace
();
System
.
exit
(
1
);
}
}
private
static
void
downloadFileFromURL
(
String
urlString
,
File
destination
)
throws
Exception
{
if
(
System
.
getenv
(
"MVNW_USERNAME"
)
!=
null
&&
System
.
getenv
(
"MVNW_PASSWORD"
)
!=
null
)
{
String
username
=
System
.
getenv
(
"MVNW_USERNAME"
);
char
[]
password
=
System
.
getenv
(
"MVNW_PASSWORD"
).
toCharArray
();
Authenticator
.
setDefault
(
new
Authenticator
()
{
@Override
protected
PasswordAuthentication
getPasswordAuthentication
()
{
return
new
PasswordAuthentication
(
username
,
password
);
}
});
}
URL
website
=
new
URL
(
urlString
);
ReadableByteChannel
rbc
;
rbc
=
Channels
.
newChannel
(
website
.
openStream
());
FileOutputStream
fos
=
new
FileOutputStream
(
destination
);
fos
.
getChannel
().
transferFrom
(
rbc
,
0
,
Long
.
MAX_VALUE
);
fos
.
close
();
rbc
.
close
();
}
}
.mvn/wrapper/maven-wrapper.jar
deleted
100644 → 0
View file @
d7abe822
File deleted
.mvn/wrapper/maven-wrapper.properties
deleted
100644 → 0
View file @
d7abe822
distributionUrl
=
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl
=
https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
pom.xml
View file @
5e707c49
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<groupId>
net.cdkj.gjj
</groupId>
<groupId>
net.cdkj.gjj
</groupId>
<artifactId>
InternalLogic
</artifactId>
<artifactId>
InternalLogic
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
w
ar
</packaging>
<packaging>
j
ar
</packaging>
<name>
InternalLogic
</name>
<name>
InternalLogic
</name>
<description>
Demo project for Spring Boot
</description>
<description>
Demo project for Spring Boot
</description>
...
@@ -21,35 +21,22 @@
...
@@ -21,35 +21,22 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependency>
<!-- <dependency>-->
<dependency>
<!-- <groupId>net.sf.json-lib</groupId>-->
<groupId>
org.springframework.boot
</groupId>
<!-- <artifactId>json-lib</artifactId>-->
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<!-- <version>2.4</version>-->
<scope>
provided
</scope>
<!-- <classifier>jdk15</classifier>-->
</dependency>
<!-- </dependency>-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<exclusions>
<exclusion>
<groupId>
org.junit.vintage
</groupId>
<artifactId>
junit-vintage-engine
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>net.sf.json-lib</groupId>-->
<!-- <artifactId>json-lib</artifactId>-->
<!-- <version>2.4</version>-->
<!-- <classifier>jdk15</classifier>-->
<!-- </dependency>-->
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.83
</version>
<version>
1.2.83
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.2.17
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.oracle
</groupId>
<groupId>
com.oracle
</groupId>
<artifactId>
ojdbc7
</artifactId>
<artifactId>
ojdbc7
</artifactId>
...
@@ -60,6 +47,7 @@
...
@@ -60,6 +47,7 @@
<artifactId>
jasypt-spring-boot-starter
</artifactId>
<artifactId>
jasypt-spring-boot-starter
</artifactId>
<version>
3.0.2
</version>
<version>
3.0.2
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
<repositories>
<repositories>
...
...
src/main/java/net/cdkj/gjj/adapter/InternalLogicApplication.java
View file @
5e707c49
...
@@ -2,6 +2,8 @@ package net.cdkj.gjj.adapter;
...
@@ -2,6 +2,8 @@ package net.cdkj.gjj.adapter;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
@SpringBootApplication
@SpringBootApplication
public
class
InternalLogicApplication
{
public
class
InternalLogicApplication
{
...
...
src/main/java/net/cdkj/gjj/adapter/ServletInitializer.java
deleted
100644 → 0
View file @
d7abe822
package
net.cdkj.gjj.adapter
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
public
class
ServletInitializer
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
InternalLogicApplication
.
class
);
}
}
src/main/java/net/cdkj/gjj/adapter/config/DruidConfig.java
0 → 100644
View file @
5e707c49
package
net.cdkj.gjj.adapter.config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.stereotype.Component
;
import
javax.sql.DataSource
;
import
java.util.Properties
;
/**
* druid 配置多数据源
*
* @author ruoyi
*/
@Configuration
public
class
DruidConfig
{
@Value
(
"${driverClassName:oracle.jdbc.driver.OracleDriver}"
)
private
String
driverClassName
;
@Value
(
"${url}"
)
private
String
url
;
@Value
(
"${user}"
)
private
String
username
;
@Value
(
"${password}"
)
private
String
password
;
@Bean
public
DruidDataSource
druidDataSource
()
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
druidDataSource
.
setDriverClassName
(
driverClassName
);
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUsername
(
username
);
druidDataSource
.
setPassword
(
password
);
return
druidDataSource
;
}
}
src/main/java/net/cdkj/gjj/adapter/
encryptor
/JasyptConfig.java
→
src/main/java/net/cdkj/gjj/adapter/
config
/JasyptConfig.java
View file @
5e707c49
package
net.cdkj.gjj.adapter.
encryptor
;
package
net.cdkj.gjj.adapter.
config
;
import
org.jasypt.encryption.StringEncryptor
;
import
org.jasypt.encryption.StringEncryptor
;
import
org.jasypt.encryption.pbe.PooledPBEStringEncryptor
;
import
org.jasypt.encryption.pbe.PooledPBEStringEncryptor
;
...
@@ -35,10 +35,5 @@ public class JasyptConfig {
...
@@ -35,10 +35,5 @@ public class JasyptConfig {
return
encryptor
;
return
encryptor
;
}
}
public
static
String
encryptStr
(
String
decryptStr
)
{
StringEncryptor
encryptor
=
new
JasyptConfig
().
stringEncryptor
();
return
encryptor
.
decrypt
(
decryptStr
);
}
}
}
src/main/java/net/cdkj/gjj/adapter/config/RestTemplateConfig.java
View file @
5e707c49
package
net.cdkj.gjj.adapter.config
;
package
net.cdkj.gjj.adapter.config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
org.springframework.boot.web.client.RestTemplateBuilder
;
import
org.springframework.boot.web.client.RestTemplateBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -9,6 +10,8 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
...
@@ -9,6 +10,8 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
import
org.springframework.web.client.DefaultResponseErrorHandler
;
import
org.springframework.web.client.DefaultResponseErrorHandler
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
javax.sql.DataSource
;
/**
/**
* 把RestTemplate注入Spring IOC容器
* 把RestTemplate注入Spring IOC容器
*
*
...
@@ -36,4 +39,7 @@ public class RestTemplateConfig {
...
@@ -36,4 +39,7 @@ public class RestTemplateConfig {
});
});
return
restTemplate
;
return
restTemplate
;
}
}
}
}
\ No newline at end of file
src/main/java/net/cdkj/gjj/adapter/controller/AlarmTask.java
View file @
5e707c49
package
net.cdkj.gjj.adapter.controller
;
package
net.cdkj.gjj.adapter.controller
;
import
net.cdkj.gjj.adapter.utils.InternalUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -20,39 +24,49 @@ import java.util.Date;
...
@@ -20,39 +24,49 @@ import java.util.Date;
//@Async
//@Async
public
class
AlarmTask
{
public
class
AlarmTask
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateController
.
class
);
//系统服务定时器
@Resource
private
DeptInfoUpdateController
deptInfoUpdateController
;
@Resource
private
ProvidentFundServicesController
providentFundServicesController
;
/**
/**
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
*/
*/
@Scheduled
(
initialDelay
=
5
*
1000
,
fixedDelay
=
60
*
1000
)
//
@Scheduled(initialDelay = 5 * 1000, fixedDelay = 60 * 1000)
public
void
run3
()
{
public
void
run3
()
{
String
dqsj
=
""
;
log
.
debug
(
"第一个接口开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
Date
dt
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-mm-dd HH:mm:ss"
);
dqsj
=
sdf
.
format
(
dt
);
System
.
out
.
println
(
"第一个接口开始时间"
+
dqsj
);
try
{
try
{
P
rovidentFundServicesController
.
gjjxtfwjk
();
p
rovidentFundServicesController
.
gjjxtfwjk
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
//进度数据定时器
//
进度数据定时器
/**
/**
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
* 第一次延迟(initialDelay)?秒后执行,之后按fixedDelay的规则每?秒执行一次
*/
*/
@Scheduled
(
initialDelay
=
20
*
1000
,
fixedDelay
=
60
*
1000
)
//
@Scheduled(initialDelay = 20 * 1000, fixedDelay = 60 * 1000)
public
void
run4
()
{
public
void
run4
()
{
String
dqsj
=
""
;
log
.
debug
(
"第二个接口开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
Date
dt
=
new
Date
();
providentFundServicesController
.
BusinessProcessing
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-mm-dd HH:mm:ss"
);
}
dqsj
=
sdf
.
format
(
dt
);
System
.
out
.
println
(
"第二个接口开始时间"
+
dqsj
);
ProvidentFundServicesController
.
BusinessProcessing
();
@Scheduled
(
initialDelay
=
40
*
1000
,
fixedDelay
=
60
*
1000
)
public
void
dwxxbgPushTask
()
{
log
.
debug
(
"dwxxbgPushTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
deptInfoUpdateController
.
dwxxbgPush
();
}
@Scheduled
(
initialDelay
=
60
*
1000
,
fixedDelay
=
60
*
1000
)
public
void
dwxxbgPullTask
()
{
log
.
debug
(
"dwxxbgPullTask 开始时间:{}"
,
InternalUtils
.
getCurrentTime
());
deptInfoUpdateController
.
dwxxbgPull
();
}
}
}
}
src/main/java/net/cdkj/gjj/adapter/controller/DeptInfoUpdateController.java
View file @
5e707c49
package
net.cdkj.gjj.adapter.controller
;
package
net.cdkj.gjj.adapter.controller
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
net.cdkj.gjj.adapter.domain.BusinessProcessing
;
import
net.cdkj.gjj.adapter.domain.*
;
import
net.cdkj.gjj.adapter.domain.Json
;
import
net.cdkj.gjj.adapter.domain.PropertyqUtil
;
import
net.cdkj.gjj.adapter.domain.UnitAccountOpeningInformation
;
import
net.cdkj.gjj.adapter.encryptor.JasyptConfig
;
import
net.cdkj.gjj.adapter.utils.InternalUtils
;
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.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.PostMapping
;
...
@@ -22,9 +21,12 @@ import org.springframework.web.client.RestTemplate;
...
@@ -22,9 +21,12 @@ import org.springframework.web.client.RestTemplate;
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.DriverManager
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.util.*
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Properties
;
/**
/**
...
@@ -37,22 +39,20 @@ public class DeptInfoUpdateController {
...
@@ -37,22 +39,20 @@ public class DeptInfoUpdateController {
@Resource
@Resource
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Resource
private
DruidDataSource
druidDataSource
;
private
static
String
url
;
@Value
(
"${frontEndProcessorServer}"
)
private
static
String
user
;
private
String
frontEndProcessorServer
;
private
static
String
password
;
private
static
String
frontEndProcessorServer
;
@Value
(
"${timetype}"
)
private
String
timetype
;
static
{
@Value
(
"${startTime}"
)
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
private
String
startTime
;
url
=
JasyptConfig
.
encryptStr
(
PropertyqUtil
.
getPropValue
(
prop
,
"url"
));
user
=
JasyptConfig
.
encryptStr
(
PropertyqUtil
.
getPropValue
(
prop
,
"user"
));
password
=
JasyptConfig
.
encryptStr
(
PropertyqUtil
.
getPropValue
(
prop
,
"password"
));
frontEndProcessorServer
=
PropertyqUtil
.
getPropValue
(
prop
,
"frontEndProcessorServer"
);
}
@Value
(
"${endTime}"
)
private
String
endTime
;
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateController
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DeptInfoUpdateController
.
class
);
...
@@ -65,15 +65,13 @@ public class DeptInfoUpdateController {
...
@@ -65,15 +65,13 @@ public class DeptInfoUpdateController {
@ResponseBody
@ResponseBody
@PostMapping
(
"/getDwxxbgHttp"
)
@PostMapping
(
"/getDwxxbgHttp"
)
public
String
getDwxxbgHttp
()
{
public
String
getDwxxbgHttp
()
{
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
String
type
=
PropertyqUtil
.
getPropValue
(
prop
,
"timetype"
);
if
(
"1"
.
equals
(
timetype
))
{
// 表示正式环境
if
(
"1"
.
equals
(
type
))
{
// 表示正式环境
jsonObject
.
put
(
"startTime"
,
InternalUtils
.
currentTime
(
0
));
// 正式环境
jsonObject
.
put
(
"startTime"
,
InternalUtils
.
currentTime
(
0
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
InternalUtils
.
currentTime
(
24
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
InternalUtils
.
currentTime
(
24
));
// 正式环境
}
else
if
(
"2"
.
equals
(
type
))
{
// 表示测试环境或本地环境
}
else
if
(
"2"
.
equals
(
t
imet
ype
))
{
// 表示测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
PropertyqUtil
.
getPropValue
(
prop
,
"startTime"
)
);
// 测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
startTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
PropertyqUtil
.
getPropValue
(
prop
,
"endTime"
)
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
endTime
);
// 测试环境或本地环境
}
}
jsonObject
.
put
(
"app_id"
,
"eb453ca78b354f2c9163a703530f5186"
);
jsonObject
.
put
(
"app_id"
,
"eb453ca78b354f2c9163a703530f5186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
...
@@ -85,7 +83,6 @@ public class DeptInfoUpdateController {
...
@@ -85,7 +83,6 @@ public class DeptInfoUpdateController {
}
}
/**
/**
* (第一个定时的)
* (第一个定时的)
* 调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,
* 调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,
...
@@ -95,29 +92,32 @@ public class DeptInfoUpdateController {
...
@@ -95,29 +92,32 @@ public class DeptInfoUpdateController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"/dwxxbgPull"
)
@PostMapping
(
"/dwxxbgPull"
)
public
void
dwxxbgPull
()
throws
Exception
{
public
AjaxResult
dwxxbgPull
()
{
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String
dwxxbgHttp
=
getDwxxbgHttp
();
String
dwxxbgHttp
=
getDwxxbgHttp
();
// String dwxxbgHttp = mockDwxxbgHttp();
log
.
info
(
"拿到第一个接口返回的第三方数据:{}"
,
dwxxbgHttp
);
log
.
info
(
"拿到第一个接口返回的第三方数据:{}"
,
dwxxbgHttp
);
Json
jsonentity
=
JSONObject
.
parseObject
(
dwxxbgHttp
,
Json
.
class
);
Json
jsonentity
=
JSONObject
.
parseObject
(
dwxxbgHttp
,
Json
.
class
);
List
<
UnitAccountOpeningInformation
>
bills
=
null
;
List
<
UnitAccountOpeningInformation
>
bills
=
null
;
if
(!
InternalUtils
.
isNullOrEmpty
(
jsonentity
))
{
if
(!
InternalUtils
.
isNullOrEmpty
(
jsonentity
))
{
bills
=
jsonentity
.
getData
();
bills
=
jsonentity
.
getData
();
}
}
if
(
!
CollectionUtils
.
isEmpty
(
bills
))
{
if
(
CollectionUtils
.
isEmpty
(
bills
))
{
log
.
info
(
"第三方返回的报文中data数据为空!"
);
log
.
info
(
"第三方返回的报文中data数据为空!"
);
return
AjaxResult
.
success
(
"第三方返回的报文中data数据为空"
,
null
);
}
}
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 2.内置机处理返回的业务数据,调用oracle存储过程
Class
.
forName
(
"oracle.jdbc.driver.OracleDriver"
);
Connection
connection
=
null
;
Connection
connection
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
CallableStatement
dwxxbgImp
=
null
;
CallableStatement
dwxxbgSave
=
null
;
try
{
connection
=
druidDataSource
.
getConnection
();
// 得到预编译的Statement对象
// 得到预编译的Statement对象
CallableStatement
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
()))
{
System
.
out
.
println
(
"oplocdistrict"
+
"在规定的值里面,调imp过程"
);
// 业务标识
// 业务标识
String
busId
=
StringUtils
.
hasText
(
uniInfom
.
getBusId
())
?
uniInfom
.
getBusId
()
:
""
;
String
busId
=
StringUtils
.
hasText
(
uniInfom
.
getBusId
())
?
uniInfom
.
getBusId
()
:
""
;
dwxxbgImp
.
setString
(
1
,
busId
);
dwxxbgImp
.
setString
(
1
,
busId
);
...
@@ -168,29 +168,66 @@ public class DeptInfoUpdateController {
...
@@ -168,29 +168,66 @@ public class DeptInfoUpdateController {
dwxxbgImp
.
registerOutParameter
(
17
,
OracleTypes
.
VARCHAR
);
dwxxbgImp
.
registerOutParameter
(
17
,
OracleTypes
.
VARCHAR
);
// 执行数据库查询操作
// 执行数据库查询操作
dwxxbgImp
.
execute
();
dwxxbgImp
.
execute
();
//
获取出参
//
获取出参
String
errcode
=
dwxxbgImp
.
getString
(
16
);
String
errcode
=
dwxxbgImp
.
getString
(
16
);
//String errmsg = dwxxbgImp.getString(17);
String
errmsg
=
dwxxbgImp
.
getString
(
17
);
log
.
info
(
"DWXXBG_IMP 执行结果 errcode:{},errmsg :{}"
,
errcode
,
errmsg
);
if
(
StringUtils
.
isEmpty
(
errcode
))
{
if
(
StringUtils
.
isEmpty
(
errcode
))
{
break
;
log
.
error
(
"DWXXBG_IMP 执行结果 errcode:{},errmsg :{},对应数据为:{}"
,
errcode
,
errmsg
,
JSON
.
toJSONString
(
uniInfom
));
continue
;
}
else
{
}
else
{
try
{
// 避免批量插入高并发,此处设置每次停顿5秒
// 避免批量插入高并发,此处设置每次停顿5秒
Thread
.
currentThread
().
sleep
(
2000
);
Thread
.
currentThread
().
sleep
(
2000
);
System
.
out
.
println
(
"间隔2秒传一条数据调一次存储过程"
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
}
}
}
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
// 调完第一个存储过程DWXX_IMP之后再调DWKH_SAVE存储过程
CallableStatement
dwxxbgSave
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_SAVE()}"
);
dwxxbgSave
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_SAVE()}"
);
dwxxbgSave
.
execute
();
dwxxbgSave
.
execute
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
// 释放资源
// 释放资源
try
{
dwxxbgImp
.
close
();
dwxxbgImp
.
close
();
dwxxbgSave
.
close
();
dwxxbgSave
.
close
();
connection
.
close
();
connection
.
close
();
}
catch
(
SQLException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
e
);
}
}
return
AjaxResult
.
success
(
"请求成功"
,
null
);
}
/**
* 模拟数据
*
* @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
;
}
}
...
@@ -204,17 +241,11 @@ public class DeptInfoUpdateController {
...
@@ -204,17 +241,11 @@ public class DeptInfoUpdateController {
@ResponseBody
@ResponseBody
@PostMapping
(
"/dwxxbgPush"
)
@PostMapping
(
"/dwxxbgPush"
)
public
String
dwxxbgPush
()
{
public
String
dwxxbgPush
()
{
System
.
out
.
println
(
"调第二个接口了"
);
// 调oracle存储过程拿到进度推进的数据集合
// 调oracle存储过程拿到进度推进的数据集合
List
<
BusinessProcessing
>
collDwxxbgList
=
null
;
List
<
BusinessProcessing
>
collDwxxbgList
=
collDwxxbg
();
try
{
collDwxxbgList
=
collDwxxbg
();
}
catch
(
Exception
e
)
{
log
.
info
(
"调用 DWXXBG_CX 异常:{}"
,
e
);
}
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"state"
,
"1"
);
jsonObject
.
put
(
"state"
,
"1"
);
if
(!
collDwxxbgList
.
isEmpty
(
))
{
if
(!
CollectionUtils
.
isEmpty
(
collDwxxbgList
))
{
jsonObject
.
put
(
"timestamp"
,
collDwxxbgList
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getTime
());
jsonObject
.
put
(
"timestamp"
,
collDwxxbgList
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getTime
());
jsonObject
.
put
(
"busId"
,
collDwxxbgList
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getBusId
());
jsonObject
.
put
(
"busId"
,
collDwxxbgList
.
stream
().
min
(
Comparator
.
comparing
(
BusinessProcessing:
:
getTime
)).
get
().
getBusId
());
}
else
{
}
else
{
...
@@ -228,22 +259,13 @@ public class DeptInfoUpdateController {
...
@@ -228,22 +259,13 @@ public class DeptInfoUpdateController {
String
businessprocessingUrl
=
frontEndProcessorServer
+
"/FrontEndProcessor/FrontEndProcessor/BusinessProcessing"
;
String
businessprocessingUrl
=
frontEndProcessorServer
+
"/FrontEndProcessor/FrontEndProcessor/BusinessProcessing"
;
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String
forObject
=
restTemplate
.
postForObject
(
businessprocessingUrl
,
str
,
String
.
class
);
String
forObject
=
restTemplate
.
postForObject
(
businessprocessingUrl
,
str
,
String
.
class
);
// 请求返回的数据
log
.
info
(
"前置机返回第三方解压之后的进度推送结果:{}"
,
forObject
);
log
.
info
(
"前置机返回第三方解压之后的进度推送结果:{}"
,
forObject
);
String
uscc
=
""
;
if
(!
collDwxxbgList
.
isEmpty
())
{
uscc
=
collDwxxbgList
.
get
(
0
).
getUscc
();
}
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
;
try
{
String
uscc
=
!
CollectionUtils
.
isEmpty
(
collDwxxbgList
)
?
collDwxxbgList
.
get
(
0
).
getUscc
()
:
""
;
log
.
info
(
"入参 uscc:{} value:{}"
,
uscc
,
value
);
log
.
info
(
"入参 uscc:{} value:{}"
,
uscc
,
value
);
collDwxxbgHx
(
uscc
,
value
);
collDwxxbgHx
(
uscc
,
value
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用 DWXXBG_HX 过程异常:{}"
,
e
);
}
return
forObject
;
return
forObject
;
}
}
/**
/**
...
@@ -254,19 +276,20 @@ public class DeptInfoUpdateController {
...
@@ -254,19 +276,20 @@ public class DeptInfoUpdateController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"/collDwxxbg"
)
@PostMapping
(
"/collDwxxbg"
)
public
static
List
<
BusinessProcessing
>
collDwxxbg
()
throws
Exception
{
public
List
<
BusinessProcessing
>
collDwxxbg
()
{
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
Connection
connection
=
null
;
CallableStatement
dwxxbgCx
=
null
;
ResultSet
rs
=
null
;
try
{
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
Class
.
forName
(
"oracle.jdbc.driver.OracleDriver"
);
connection
=
druidDataSource
.
getConnection
();
Connection
connection
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
// 调用过程,返回企业注册的审核信息
// 调用过程,返回企业注册的审核信息
CallableStatement
dwxxbgCx
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_CX(?)}"
);
dwxxbgCx
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_CX(?)}"
);
// 给参数赋值
dwxxbgCx
.
registerOutParameter
(
1
,
OracleTypes
.
CURSOR
);
dwxxbgCx
.
registerOutParameter
(
1
,
OracleTypes
.
CURSOR
);
// 执行数据库查询操作
dwxxbgCx
.
execute
();
dwxxbgCx
.
execute
();
// 输出结果[第二个参数]
// 输出结果[第二个参数]
ResultSet
rs
=
(
ResultSet
)
dwxxbgCx
.
getObject
(
1
);
// 此处的2要与存储过程中cursor的问题对应
rs
=
(
ResultSet
)
dwxxbgCx
.
getObject
(
1
);
// 此处的2要与存储过程中cursor的问题对应
List
<
BusinessProcessing
>
list
=
new
ArrayList
<>();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
BusinessProcessing
bp
=
new
BusinessProcessing
();
BusinessProcessing
bp
=
new
BusinessProcessing
();
if
(
StringUtils
.
hasText
(
rs
.
getString
(
1
)))
{
if
(
StringUtils
.
hasText
(
rs
.
getString
(
1
)))
{
...
@@ -302,27 +325,45 @@ public class DeptInfoUpdateController {
...
@@ -302,27 +325,45 @@ public class DeptInfoUpdateController {
list
.
add
(
bp
);
list
.
add
(
bp
);
}
}
log
.
info
(
"调用 DWXXBG_CX 返回数据:{}"
,
JSONObject
.
toJSONString
(
list
));
log
.
info
(
"调用 DWXXBG_CX 返回数据:{}"
,
JSONObject
.
toJSONString
(
list
));
}
catch
(
Exception
e
)
{
log
.
error
(
"调用 DWXXBG_CX 异常:{}"
,
e
);
}
finally
{
// 释放资源
// 释放资源
try
{
rs
.
close
();
dwxxbgCx
.
close
();
dwxxbgCx
.
close
();
connection
.
close
();
connection
.
close
();
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
return
list
;
return
list
;
}
}
public
static
void
collDwxxbgHx
(
String
uscc
,
Integer
value
)
throws
Exception
{
public
void
collDwxxbgHx
(
String
uscc
,
Integer
value
)
{
Connection
connection
=
null
;
CallableStatement
pstm
=
null
;
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
try
{
// 加载数据库驱动
// 加载数据库驱动
Class
.
forName
(
"oracle.jdbc.driver.OracleDriver"
);
connection
=
druidDataSource
.
getConnection
();
Connection
connection
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
// 正式环境
// 得到预编译的Statement对象
// 得到预编译的Statement对象
CallableStatement
pstm
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_HX(?,?)}"
);
pstm
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWXXBG.DWXXBG_HX(?,?)}"
);
// 给参数赋值
pstm
.
setString
(
1
,
uscc
);
pstm
.
setString
(
1
,
uscc
);
pstm
.
setInt
(
2
,
value
);
pstm
.
setInt
(
2
,
value
);
pstm
.
execute
();
pstm
.
execute
();
}
catch
(
Exception
e
)
{
log
.
error
(
"调用 DWXXBG_HX 过程异常:{}"
,
e
);
}
finally
{
// 释放资源
// 释放资源
try
{
pstm
.
close
();
pstm
.
close
();
connection
.
close
();
connection
.
close
();
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
}
}
src/main/java/net/cdkj/gjj/adapter/
encrypto
r/EncryptController.java
→
src/main/java/net/cdkj/gjj/adapter/
controlle
r/EncryptController.java
View file @
5e707c49
package
net.cdkj.gjj.adapter.
encrypto
r
;
package
net.cdkj.gjj.adapter.
controlle
r
;
import
net.cdkj.gjj.adapter.config.JasyptConfig
;
import
org.jasypt.encryption.StringEncryptor
;
import
org.jasypt.encryption.StringEncryptor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
@RestController
@RestController
@RequestMapping
(
"/encrypt"
)
@RequestMapping
(
"/encrypt"
)
@CrossOrigin
(
origins
=
"*"
,
maxAge
=
3600
)
@CrossOrigin
(
origins
=
"*"
,
maxAge
=
3600
)
public
class
EncryptController
{
public
class
EncryptController
{
@Resource
private
StringEncryptor
jasyptStringEncryptor
;
@PostMapping
(
"/jasyptEnc"
)
@PostMapping
(
"/jasyptEnc"
)
public
String
encrypt
(
@RequestParam
String
encStr
)
throws
Exception
{
public
String
encrypt
(
@RequestParam
String
encStr
)
{
StringEncryptor
encryptor
=
new
JasyptConfig
().
stringEncryptor
();
return
jasyptStringEncryptor
.
encrypt
(
encStr
);
return
encryptor
.
encrypt
(
encStr
);
}
}
@PostMapping
(
"/jasyptDec"
)
@PostMapping
(
"/jasyptDec"
)
public
String
decrypt
(
@RequestParam
String
decStr
)
throws
Exception
{
public
String
decrypt
(
@RequestParam
String
decStr
)
{
StringEncryptor
encryptor
=
new
JasyptConfig
().
stringEncryptor
();
return
jasyptStringEncryptor
.
decrypt
(
decStr
);
return
encryptor
.
decrypt
(
decStr
);
}
}
}
}
src/main/java/net/cdkj/gjj/adapter/controller/ProvidentFundServicesController.java
View file @
5e707c49
package
net.cdkj.gjj.adapter.controller
;
package
net.cdkj.gjj.adapter.controller
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
net.cdkj.gjj.adapter.
encryptor
.JasyptConfig
;
import
net.cdkj.gjj.adapter.
config
.JasyptConfig
;
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.Json
;
import
net.cdkj.gjj.adapter.domain.PropertyqUtil
;
import
net.cdkj.gjj.adapter.domain.PropertyqUtil
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.io.*
;
import
java.io.*
;
import
java.net.HttpURLConnection
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.net.URL
;
...
@@ -31,19 +35,22 @@ import java.util.*;
...
@@ -31,19 +35,22 @@ import java.util.*;
@RequestMapping
(
value
=
"InternalLogic"
)
@RequestMapping
(
value
=
"InternalLogic"
)
public
class
ProvidentFundServicesController
{
public
class
ProvidentFundServicesController
{
private
static
String
url
;
private
static
String
user
;
private
static
String
password
;
private
static
String
frontEndProcessorServer
;
@Resource
private
DruidDataSource
dataSource
;
@Value
(
"${frontEndProcessorServer}"
)
private
String
frontEndProcessorServer
;
@Value
(
"${timetype}"
)
private
String
timetype
;
@Value
(
"${startTime}"
)
private
String
startTime
;
@Value
(
"${endTime}"
)
private
String
endTime
;
static
{
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
url
=
JasyptConfig
.
encryptStr
(
PropertyqUtil
.
getPropValue
(
prop
,
"url"
));
user
=
JasyptConfig
.
encryptStr
(
PropertyqUtil
.
getPropValue
(
prop
,
"user"
));
password
=
JasyptConfig
.
encryptStr
(
PropertyqUtil
.
getPropValue
(
prop
,
"password"
));
frontEndProcessorServer
=
PropertyqUtil
.
getPropValue
(
prop
,
"frontEndProcessorServer"
);
}
/**
/**
* 公积金系统服务接口内置机调前置机中间接口
* 公积金系统服务接口内置机调前置机中间接口
...
@@ -53,16 +60,15 @@ public class ProvidentFundServicesController {
...
@@ -53,16 +60,15 @@ public class ProvidentFundServicesController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"ProvidentFundServices"
)
@PostMapping
(
"ProvidentFundServices"
)
public
static
String
ProvidentFundServices
()
{
public
String
ProvidentFundServices
()
{
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
String
type
=
PropertyqUtil
.
getPropValue
(
prop
,
"timetype"
);
if
(
"1"
.
equals
(
timetype
))
{
// 表示正式环境
if
(
"1"
.
equals
(
type
))
{
// 表示正式环境
jsonObject
.
put
(
"startTime"
,
currenttime
(
0
));
// 正式环境
jsonObject
.
put
(
"startTime"
,
currenttime
(
0
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
currenttime
(
24
));
// 正式环境
jsonObject
.
put
(
"endTime"
,
currenttime
(
24
));
// 正式环境
}
else
if
(
"2"
.
equals
(
type
))
{
// 表示测试环境或本地环境
}
else
if
(
"2"
.
equals
(
t
imet
ype
))
{
// 表示测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
PropertyqUtil
.
getPropValue
(
prop
,
"startTime"
)
);
// 测试环境或本地环境
jsonObject
.
put
(
"startTime"
,
startTime
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
PropertyqUtil
.
getPropValue
(
prop
,
"endTime"
)
);
// 测试环境或本地环境
jsonObject
.
put
(
"endTime"
,
endTime
);
// 测试环境或本地环境
}
}
jsonObject
.
put
(
"app_id"
,
"eb453ca78b354f2c9163a703530f5186"
);
jsonObject
.
put
(
"app_id"
,
"eb453ca78b354f2c9163a703530f5186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
jsonObject
.
put
(
"app_secret"
,
"9a31b84878654a72a999e38ef55aa186"
);
...
@@ -174,7 +180,7 @@ public class ProvidentFundServicesController {
...
@@ -174,7 +180,7 @@ public class ProvidentFundServicesController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"gjjxtfwjk"
)
@PostMapping
(
"gjjxtfwjk"
)
public
static
void
gjjxtfwjk
()
throws
Exception
{
public
void
gjjxtfwjk
()
throws
Exception
{
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
// 1.调用公积金系统服务接口方法,请求前置机,让前置机请求市监接口,拿到市监返回的开户信息json数据,经过前置机zip解压返回给本内置机处理
String
jsoninfom
=
ProvidentFundServices
();
String
jsoninfom
=
ProvidentFundServices
();
...
@@ -186,11 +192,7 @@ public class ProvidentFundServicesController {
...
@@ -186,11 +192,7 @@ public class ProvidentFundServicesController {
}
}
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 2.内置机处理返回的业务数据,调用oracle存储过程
// 加载数据库驱动
// 加载数据库驱动
Class
.
forName
(
"oracle.jdbc.driver.OracleDriver"
);
Connection
connection
=
dataSource
.
getConnection
();
// 得到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
(
url
,
user
,
password
);
// 正式环境
// 得到预编译的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存储过程
...
@@ -393,7 +395,7 @@ public class ProvidentFundServicesController {
...
@@ -393,7 +395,7 @@ public class ProvidentFundServicesController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"BusinessProcessing"
)
@PostMapping
(
"BusinessProcessing"
)
public
static
String
BusinessProcessing
()
{
public
String
BusinessProcessing
()
{
System
.
out
.
println
(
"调第二个接口了"
);
System
.
out
.
println
(
"调第二个接口了"
);
// 调oracle存储过程拿到进度推进的数据集合
// 调oracle存储过程拿到进度推进的数据集合
List
<
BusinessProcessing
>
list
=
null
;
List
<
BusinessProcessing
>
list
=
null
;
...
@@ -515,15 +517,10 @@ public class ProvidentFundServicesController {
...
@@ -515,15 +517,10 @@ public class ProvidentFundServicesController {
*/
*/
@ResponseBody
@ResponseBody
@PostMapping
(
"zjbmfhywtosj"
)
@PostMapping
(
"zjbmfhywtosj"
)
public
static
List
<
BusinessProcessing
>
zjbmfhywtosj
()
throws
Exception
{
public
List
<
BusinessProcessing
>
zjbmfhywtosj
()
throws
Exception
{
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
// 加载数据库驱动
Connection
connection
=
dataSource
.
getConnection
();
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
(
url
,
user
,
password
);
// 正式环境
// 得到预编译的Statement对象
// 得到预编译的Statement对象
CallableStatement
pstm
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWKH.DWKH_CX(?)}"
);
CallableStatement
pstm
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWKH.DWKH_CX(?)}"
);
// 给参数赋值
// 给参数赋值
...
@@ -585,15 +582,11 @@ public class ProvidentFundServicesController {
...
@@ -585,15 +582,11 @@ public class ProvidentFundServicesController {
}
}
public
static
void
zjbmfhywtosjHX
(
String
uscc
,
Integer
value
)
throws
Exception
{
public
void
zjbmfhywtosjHX
(
String
uscc
,
Integer
value
)
throws
Exception
{
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
Properties
prop
=
PropertyqUtil
.
getConfig
(
"application.properties"
);
// 1.调用oracle存储过程,拿到业务办理进度数据
// 1.调用oracle存储过程,拿到业务办理进度数据
// 加载数据库驱动
// 加载数据库驱动
Class
.
forName
(
"oracle.jdbc.driver.OracleDriver"
);
Connection
connection
=
dataSource
.
getConnection
();
// 得到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
(
url
,
user
,
password
);
// 正式环境
// 得到预编译的Statement对象
// 得到预编译的Statement对象
CallableStatement
pstm
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}"
);
CallableStatement
pstm
=
connection
.
prepareCall
(
"{call JGJ_KSYW_DWKH.DWKH_HX(?,?)}"
);
// 给参数赋值
// 给参数赋值
...
...
src/main/java/net/cdkj/gjj/adapter/domain/AjaxResult.java
0 → 100644
View file @
5e707c49
package
net.cdkj.gjj.adapter.domain
;
import
org.springframework.http.HttpStatus
;
import
java.util.HashMap
;
/**
* 操作消息提醒
*
* @author ruoyi
*/
public
class
AjaxResult
extends
HashMap
<
String
,
Object
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 状态码
*/
public
static
final
String
CODE_TAG
=
"code"
;
/**
* 返回内容
*/
public
static
final
String
MSG_TAG
=
"msg"
;
/**
* 数据对象
*/
public
static
final
String
DATA_TAG
=
"data"
;
/**
* 总数
*/
public
static
final
String
TOTAL_TAG
=
"total"
;
/**
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
*/
public
AjaxResult
()
{
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
*/
public
AjaxResult
(
int
code
,
String
msg
)
{
super
.
put
(
CODE_TAG
,
code
);
super
.
put
(
MSG_TAG
,
msg
);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
* @param data 数据对象
*/
public
AjaxResult
(
int
code
,
String
msg
,
Object
data
)
{
super
.
put
(
CODE_TAG
,
code
);
super
.
put
(
MSG_TAG
,
msg
);
super
.
put
(
DATA_TAG
,
data
);
}
/**
* 返回成功消息
*
* @return 成功消息
*/
public
static
AjaxResult
success
()
{
return
AjaxResult
.
success
(
"操作成功"
);
}
/**
* 返回成功数据
*
* @return 成功消息
*/
public
static
AjaxResult
success
(
Object
data
)
{
AjaxResult
ajaxResult
=
AjaxResult
.
success
(
"操作成功"
,
data
);
/*if (data instanceof Page) {
ajaxResult.put(TOTAL_TAG, ((Page<?>) data).getTotal());
}*/
return
ajaxResult
;
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 成功消息
*/
public
static
AjaxResult
success
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
OK
.
value
(),
msg
,
data
);
}
/**
* 返回错误消息
*
* @return
*/
public
static
AjaxResult
error
()
{
return
AjaxResult
.
error
(
"操作失败"
);
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @return 警告消息
*/
public
static
AjaxResult
error
(
String
msg
)
{
return
AjaxResult
.
error
(
msg
,
null
);
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public
static
AjaxResult
error
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
msg
,
data
);
}
/**
* 返回错误消息
*
* @param code 状态码
* @param msg 返回内容
* @return 警告消息
*/
public
static
AjaxResult
error
(
int
code
,
String
msg
)
{
return
new
AjaxResult
(
code
,
msg
,
null
);
}
}
src/main/java/net/cdkj/gjj/adapter/utils/InternalUtils.java
View file @
5e707c49
...
@@ -71,4 +71,10 @@ public class InternalUtils {
...
@@ -71,4 +71,10 @@ public class InternalUtils {
}
}
return
time
;
return
time
;
}
}
public
static
String
getCurrentTime
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-mm-dd HH:mm:ss"
);
return
sdf
.
format
(
new
Date
());
}
}
}
src/main/resources/application.properties
View file @
5e707c49
#??????(1???????2??????????????)
#??????(1???????2??????????????)
#????????????????????
#????????????????????
timetype
:
1
timetype
:
1
#??????????????????
#??????????????????
#timetype:2
#timetype:2
#??????????
#??????????
...
@@ -9,12 +8,24 @@ startTime:20230201 00:00:00
...
@@ -9,12 +8,24 @@ startTime:20230201 00:00:00
#??????????
#??????????
endTime
:
20230208 23:00:00
endTime
:
20230208 23:00:00
#?????????
#正式环境
url
:
2NiJQAsT5i5vcdRA4+QoL0OxDje63w09kf/upD6cZocEy3IvgPXj3BdymdZCw0I0vnYI/K8K+PTYJrRjv6xbqA==
#url:2NiJQAsT5i5vcdRA4+QoL0OxDje63w09kf/upD6cZocEy3IvgPXj3BdymdZCw0I0vnYI/K8K+PTYJrRjv6xbqA==
user
:
7MSN/YEwcQpKaVmXkrQtI5zBlPm6ThDA
#user:7MSN/YEwcQpKaVmXkrQtI5zBlPm6ThDA
password
:
b6/rlcEodaunlW9hS3Uuigr6oiNIXV7ezgbK2ZAuuIo=
#password:b6/rlcEodaunlW9hS3Uuigr6oiNIXV7ezgbK2ZAuuIo=
#公司环境
driverClassName
:
oracle.jdbc.driver.OracleDriver
url
:
ENC(Et305ScSPFkdAEmh0PpvV6vTeZXprJV57rQ1eL5MOkJZyMnSTt5jttYCJJbnQbPyYyOpPTFhW58z/P5PA9vJbw==)
user
:
ENC(Dt42e5Z4WWim9j0Ls2G2YjmzwuQ2pjBx)
password
:
ENC(PI2/xdOsEObL0YZlfGfQnyiJeYUw/90FePU+sO4EDjU=)
#url:jdbc:oracle:thin:@192.168.101.194:1521:zfgjj
#user:GJJ80
#password:GJJ80_Hg41RG
# 前置服务URL
#frontEndProcessorServer:http://192.168.1.252:8888
frontEndProcessorServer
:
http://127.0.0.1:8081
frontEndProcessorServer
:
http://192.168.1.252:8888
dwxxbgPushTaskDelay
:
60000
dwxxbgPullTaskDelay
:
60000
src/main/resources/logback-spring.xml
0 → 100644
View file @
5e707c49
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property
name=
"log.path"
value=
"logs"
/>
<!-- 日志输出格式 -->
<property
name=
"log.pattern"
value=
"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"
/>
<!-- 控制台输出 -->
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${log.pattern}
</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender
name=
"file_debug"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${log.path}/sys-debug.log
</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志文件名格式 -->
<fileNamePattern>
${log.path}/sys-debug.%d{yyyy-MM-dd}.log
</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>
60
</maxHistory>
</rollingPolicy>
<encoder>
<pattern>
${log.pattern}
</pattern>
</encoder>
</appender>
<appender
name=
"file_error"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${log.path}/sys-error.log
</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志文件名格式 -->
<fileNamePattern>
${log.path}/sys-error.%d{yyyy-MM-dd}.log
</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>
60
</maxHistory>
</rollingPolicy>
<encoder>
<pattern>
${log.pattern}
</pattern>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<!-- 过滤的级别 -->
<level>
ERROR
</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>
ACCEPT
</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger
name=
"com.cdkj"
level=
"debug"
/>
<!--系统操作日志-->
<root
level=
"info"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"file_debug"
/>
<appender-ref
ref=
"file_error"
/>
</root>
</configuration>
src/main/webapp/WEB-INF/web.xml
deleted
100644 → 0
View file @
d7abe822
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app
xmlns=
"http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version=
"3.1"
>
<welcome-file-list>
<welcome-file>
index.html
</welcome-file>
<welcome-file>
index.htm
</welcome-file>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
src/test/java/net/cdkj/gjj/adapter/AdapterApplicationTests.java
deleted
100644 → 0
View file @
d7abe822
package
net.cdkj.gjj.adapter
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
AdapterApplicationTests
{
@Test
void
contextLoads
()
{
}
}
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