Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-api-report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
雷紫添
xzxt-api-report
Commits
e1e35f27
Commit
e1e35f27
authored
Oct 18, 2023
by
wang_jiaxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
甘肃法律文书入库
parent
3ac64ab1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
325 additions
and
373 deletions
+325
-373
src/main/java/com/founder/config/DataSourceXjxzConfig.java
+0
-41
src/main/java/com/founder/config/DataSourceXjxznewConfig.java
+0
-41
src/main/java/com/founder/config/DataSourceXzxtConfig.java
+12
-10
src/main/java/com/founder/file/controller/GsFlwsController.java
+60
-0
src/main/java/com/founder/file/controller/XzFlwsController.java
+0
-149
src/main/java/com/founder/file/dao/jzzjk/JzzjkFlwsMapper.java
+0
-16
src/main/java/com/founder/file/dao/xjxz/XzxzFlwsMapper.java
+0
-30
src/main/java/com/founder/file/dao/xzxt/GsFlwsMapper.java
+9
-4
src/main/java/com/founder/file/entity/FlwsEntity.java
+15
-0
src/main/java/com/founder/file/service/GxFlwsService.java
+4
-11
src/main/java/com/founder/file/service/impl/GxFlwsServiceImpl.java
+182
-0
src/main/java/com/founder/file/service/impl/XzFlwsServiceImpl.java
+0
-0
src/main/resources/application-dev.yml
+14
-52
src/main/resources/mybatis/mapper/GsFlwsMapper.xml
+29
-0
src/main/resources/mybatis/xjnewFlwsMpaaer/XzxznewFlwsMapper.xml
+0
-19
No files found.
src/main/java/com/founder/config/DataSourceXjxzConfig.java
deleted
100644 → 0
View file @
3ac64ab1
package
com
.
founder
.
config
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
javax.sql.DataSource
;
/**
* Created by summer on 2016/11/25.
*/
@Configuration
@MapperScan
(
basePackages
=
"com.founder.file.dao.xjxz"
,
sqlSessionTemplateRef
=
"xjxzSqlSessionTemplate"
)
public
class
DataSourceXjxzConfig
{
@Bean
(
name
=
"xjxzDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.xjxz"
)
public
DataSource
db1DataSource
()
{
return
DataSourceBuilder
.
create
().
build
();
}
@Bean
(
name
=
"xjxzSqlSessionFactory"
)
public
SqlSessionFactory
db1SqlSessionFactory
(
@Qualifier
(
"xjxzDataSource"
)
DataSource
dataSource
)
throws
Exception
{
SqlSessionFactoryBean
bean
=
new
SqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSource
);
bean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
"classpath:mybatis/xjFlwsMpaaer/*.xml"
));
return
bean
.
getObject
();
}
@Bean
(
name
=
"xjxzSqlSessionTemplate"
)
public
SqlSessionTemplate
db1SqlSessionTemplate
(
@Qualifier
(
"xjxzSqlSessionFactory"
)
SqlSessionFactory
sqlSessionFactory
)
throws
Exception
{
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
}
}
src/main/java/com/founder/config/DataSourceXjxznewConfig.java
deleted
100644 → 0
View file @
3ac64ab1
package
com
.
founder
.
config
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
javax.sql.DataSource
;
/**
* Created by summer on 2016/11/25.
*/
@Configuration
@MapperScan
(
basePackages
=
"com.founder.file.dao.xjxznew"
,
sqlSessionTemplateRef
=
"xjxznewSqlSessionTemplate"
)
public
class
DataSourceXjxznewConfig
{
@Bean
(
name
=
"xjxznewDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.xjxznew"
)
public
DataSource
db1DataSource
()
{
return
DataSourceBuilder
.
create
().
build
();
}
@Bean
(
name
=
"xjxznewSqlSessionFactory"
)
public
SqlSessionFactory
db1SqlSessionFactory
(
@Qualifier
(
"xjxznewDataSource"
)
DataSource
dataSource
)
throws
Exception
{
SqlSessionFactoryBean
bean
=
new
SqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSource
);
bean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
"classpath:mybatis/xjnewFlwsMpaaer/*.xml"
));
return
bean
.
getObject
();
}
@Bean
(
name
=
"xjxznewSqlSessionTemplate"
)
public
SqlSessionTemplate
db1SqlSessionTemplate
(
@Qualifier
(
"xjxznewSqlSessionFactory"
)
SqlSessionFactory
sqlSessionFactory
)
throws
Exception
{
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
}
}
src/main/java/com/founder/config/DataSource
Jzzjk
Config.java
→
src/main/java/com/founder/config/DataSource
Xzxt
Config.java
View file @
e1e35f27
...
@@ -5,10 +5,12 @@ import org.mybatis.spring.SqlSessionFactoryBean;
...
@@ -5,10 +5,12 @@ import org.mybatis.spring.SqlSessionFactoryBean;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
...
@@ -17,24 +19,24 @@ import javax.sql.DataSource;
...
@@ -17,24 +19,24 @@ import javax.sql.DataSource;
* Created by summer on 2016/11/25.
* Created by summer on 2016/11/25.
*/
*/
@Configuration
@Configuration
@MapperScan
(
basePackages
=
"com.founder.file.dao.
jzzjk"
,
sqlSessionTemplateRef
=
"jzzjk
SqlSessionTemplate"
)
@MapperScan
(
basePackages
=
"com.founder.file.dao.
xzxt"
,
sqlSessionTemplateRef
=
"xzxt
SqlSessionTemplate"
)
public
class
DataSource
Jzzjk
Config
{
public
class
DataSource
Xzxt
Config
{
@Bean
(
name
=
"
jzzjk
DataSource"
)
@Bean
(
name
=
"
xzxt
DataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.
jzzjk
"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.
xzxt
"
)
public
DataSource
db2
DataSource
()
{
public
DataSource
xzxt
DataSource
()
{
return
DataSourceBuilder
.
create
().
build
();
return
DataSourceBuilder
.
create
().
build
();
}
}
@Bean
(
name
=
"
jzzjk
SqlSessionFactory"
)
@Bean
(
name
=
"
xzxt
SqlSessionFactory"
)
public
SqlSessionFactory
db2SqlSessionFactory
(
@Qualifier
(
"jzzjk
DataSource"
)
DataSource
dataSource
)
throws
Exception
{
public
SqlSessionFactory
xzxtSqlSessionFactory
(
@Qualifier
(
"xzxt
DataSource"
)
DataSource
dataSource
)
throws
Exception
{
SqlSessionFactoryBean
bean
=
new
SqlSessionFactoryBean
();
SqlSessionFactoryBean
bean
=
new
SqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSource
);
bean
.
setDataSource
(
dataSource
);
bean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
"classpath:mybatis/
xjFlwsMpaa
er/*.xml"
));
bean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
"classpath:mybatis/
mapp
er/*.xml"
));
return
bean
.
getObject
();
return
bean
.
getObject
();
}
}
@Bean
(
name
=
"
jzzjk
SqlSessionTemplate"
)
@Bean
(
name
=
"
xzxt
SqlSessionTemplate"
)
public
SqlSessionTemplate
db2SqlSessionTemplate
(
@Qualifier
(
"jzzjk
SqlSessionFactory"
)
SqlSessionFactory
sqlSessionFactory
)
throws
Exception
{
public
SqlSessionTemplate
xzxtSqlSessionTemplate
(
@Qualifier
(
"xzxt
SqlSessionFactory"
)
SqlSessionFactory
sqlSessionFactory
)
throws
Exception
{
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
}
}
...
...
src/main/java/com/founder/file/controller/GsFlwsController.java
0 → 100644
View file @
e1e35f27
package
com
.
founder
.
file
.
controller
;
import
com.founder.file.service.GxFlwsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@Slf4j
public
class
GsFlwsController
{
@Autowired
private
GxFlwsService
gxFlwsService
;
@Value
(
"${isStartFlws}"
)
private
String
isStartFlws
;
@Value
(
"${isStartRxzp}"
)
private
String
isStartRxzp
;
@RequestMapping
(
"/getFtpFlwsnrToAjFlws"
)
public
String
getFtpFlwsnrToAjFlws
(
@RequestParam
(
required
=
false
)
String
xxzjbh
){
try
{
return
gxFlwsService
.
getFtpFlwsnrToAjFlws
(
xxzjbh
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
return
e
.
getMessage
();
}
}
@Scheduled
(
cron
=
"${flwsCron}"
)
public
void
autoGetFtpFlwsnrToAjFlws
(){
if
(
"true"
.
equals
(
isStartFlws
)){
getFtpFlwsnrToAjFlws
(
null
);
}
}
@RequestMapping
(
"/getFtpFlwsnrToAjRxzp"
)
public
String
getFtpFlwsnrToAjRxzp
(
@RequestParam
(
required
=
false
)
String
xxzjbh
){
try
{
return
gxFlwsService
.
getFtpFlwsnrToAjRxzp
(
xxzjbh
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
return
e
.
getMessage
();
}
}
@Scheduled
(
cron
=
"${rxzpCron}"
)
public
void
autoGetFtpFlwsnrToAjRxzp
(){
if
(
"true"
.
equals
(
isStartRxzp
)){
getFtpFlwsnrToAjRxzp
(
null
);
}
}
}
src/main/java/com/founder/file/controller/XzFlwsController.java
deleted
100644 → 0
View file @
3ac64ab1
package
com
.
founder
.
file
.
controller
;
import
com.founder.file.service.XzFlwsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
@RestController
@Slf4j
public
class
XzFlwsController
{
@Autowired
private
XzFlwsService
xzFlwsService
;
@Value
(
"${isStart}"
)
private
String
isStart
;
@RequestMapping
(
"/getJzzjkFlwsnrToXjxz"
)
public
String
getJzzjkFlwsnrToXjxz
(
@DateTimeFormat
(
pattern
=
"yyyyMMdd"
)
Date
date
,
@RequestParam
(
required
=
false
)
String
xxzjbh
){
try
{
if
(
date
==
null
){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
-
1
);
date
=
calendar
.
getTime
();
}
return
xzFlwsService
.
getJzzjkFlwsnrToXjxz
(
date
,
xxzjbh
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
return
e
.
getMessage
();
}
}
@Scheduled
(
cron
=
"${cron}"
)
public
void
autoGetJzzjkFlwsnrToXjxz
(){
if
(
"true"
.
equals
(
isStart
)){
getJzzjkFlwsnrToXjxz
(
null
,
null
);
}
}
@RequestMapping
(
"/getRyzbnrToXzxz"
)
public
String
getRyzbnrToXzxz
(
@DateTimeFormat
(
pattern
=
"yyyyMMdd"
)
Date
date
,
@RequestParam
(
required
=
false
)
String
xxzjbh
){
try
{
if
(
date
==
null
){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
-
1
);
date
=
calendar
.
getTime
();
}
return
xzFlwsService
.
getRyzbnrToXzxz
(
date
,
xxzjbh
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
return
e
.
getMessage
();
}
}
@Scheduled
(
cron
=
"${zpCron}"
)
public
void
autoGetRyzbnrToXzxz
(){
if
(
"true"
.
equals
(
isStart
)){
getRyzbnrToXzxz
(
null
,
null
);
}
}
@RequestMapping
(
"/getCqbgwsnrToXzxz"
)
public
String
getCqbgwsnrToXzxz
(
@DateTimeFormat
(
pattern
=
"yyyyMMdd"
)
Date
date
,
@RequestParam
(
required
=
false
)
String
xxzjbh
){
try
{
if
(
date
==
null
){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
-
1
);
date
=
calendar
.
getTime
();
}
return
xzFlwsService
.
getCqbgwsnrToXzxz
(
date
,
xxzjbh
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
return
e
.
getMessage
();
}
}
@Scheduled
(
cron
=
"${cqbgCron}"
)
public
void
autoGetCqbgwsnrToXzxz
(){
if
(
"true"
.
equals
(
isStart
)){
getCqbgwsnrToXzxz
(
null
,
null
);
}
}
@RequestMapping
(
"/getMinioFlwsnrToXjxz"
)
public
String
getMinioFlwsnrToXjxz
(
@RequestParam
(
required
=
false
)
String
xxzjbh
){
try
{
return
xzFlwsService
.
getMinioFlwsnrToXjxz
(
xxzjbh
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
return
e
.
getMessage
();
}
}
@Scheduled
(
cron
=
"${minioCron}"
)
public
void
autoGetMinioFlwsnrToXjxz
(){
if
(
"true"
.
equals
(
isStart
)){
getMinioFlwsnrToXjxz
(
null
);
}
}
@RequestMapping
(
"/getAllMinioTong"
)
public
Map
<
String
,
Object
>
getAllMinioTong
(){
try
{
return
xzFlwsService
.
getAllMinioTong
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"error"
,
e
.
getMessage
());
return
map
;
}
}
@RequestMapping
(
"/getMinioTongByid"
)
public
Map
<
String
,
Object
>
getMinioTongByDcxxid
(
String
id
){
try
{
String
bucketName
=
xzFlwsService
.
getMinioTongByid
(
null
,
id
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bucketName"
,
bucketName
);
map
.
put
(
"isExists"
,
bucketName
!=
null
);
return
map
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"错误信息"
,
e
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"error"
,
e
.
getMessage
());
return
map
;
}
}
}
src/main/java/com/founder/file/dao/jzzjk/JzzjkFlwsMapper.java
deleted
100644 → 0
View file @
3ac64ab1
package
com
.
founder
.
file
.
dao
.
jzzjk
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
@Component
public
interface
JzzjkFlwsMapper
{
List
<
Map
<
String
,
String
>>
getFlwsWzByDate
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"page"
)
Integer
page
,
@Param
(
"rows"
)
Integer
rows
);
Integer
getFlwsCountWzByDate
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
);
}
src/main/java/com/founder/file/dao/xjxz/XzxzFlwsMapper.java
deleted
100644 → 0
View file @
3ac64ab1
package
com
.
founder
.
file
.
dao
.
xjxz
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
@Component
public
interface
XzxzFlwsMapper
{
int
update
(
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"bytes"
)
byte
[]
bytes
);
List
<
String
>
getNoFileFlwsXxzjbh
(
@Param
(
"flwsList"
)
List
<
Map
<
String
,
String
>>
flwsList
);
List
<
Map
<
String
,
String
>>
getFlwsWzByDate
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"begin"
)
Integer
page
,
@Param
(
"end"
)
Integer
rows
);
Integer
getFlwsCountWzByDate
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
);
List
<
String
>
getJzzjkFlwsList
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
);
List
<
String
>
getRyzpList
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
);
int
updateZp
(
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"bytes"
)
byte
[]
bytes
);
List
<
String
>
getCqbgList
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
);
int
updateCqbg
(
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"bytes"
)
byte
[]
bytes
);
}
src/main/java/com/founder/file/dao/x
jxznew/Xzxznew
FlwsMapper.java
→
src/main/java/com/founder/file/dao/x
zxt/Gs
FlwsMapper.java
View file @
e1e35f27
package
com
.
founder
.
file
.
dao
.
x
jxznew
;
package
com
.
founder
.
file
.
dao
.
x
zxt
;
import
com.founder.file.entity.FlwsEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -10,9 +11,13 @@ import java.util.Map;
...
@@ -10,9 +11,13 @@ import java.util.Map;
@Mapper
@Mapper
@Component
@Component
public
interface
Xzxznew
FlwsMapper
{
public
interface
Gs
FlwsMapper
{
List
<
String
>
getJzzjkFlws
List
(
@Param
(
"xxzjbh"
)
String
xxzjbh
);
List
<
FlwsEntity
>
getPdfFile
List
(
@Param
(
"xxzjbh"
)
String
xxzjbh
);
int
update
(
@Param
(
"id"
)
String
id
,
@Param
(
"bytes"
)
byte
[]
bytes
);
int
updateFlwsByPdfFile
(
@Param
(
"id"
)
String
id
,
@Param
(
"bytes"
)
byte
[]
bytes
);
List
<
FlwsEntity
>
getFileIdList
(
@Param
(
"xxzjbh"
)
String
xxzjbh
);
int
updateFlwsByFileId
(
@Param
(
"id"
)
String
id
,
@Param
(
"bytes"
)
byte
[]
bytes
);
}
}
src/main/java/com/founder/file/entity/FlwsEntity.java
0 → 100644
View file @
e1e35f27
package
com
.
founder
.
file
.
entity
;
import
lombok.Data
;
/**
* TODO
*
* @author create by lystar
* @date 2023/10/18 16:51
*/
@Data
public
class
FlwsEntity
{
private
String
id
;
private
String
gs
;
}
src/main/java/com/founder/file/service/
Xz
FlwsService.java
→
src/main/java/com/founder/file/service/
Gx
FlwsService.java
View file @
e1e35f27
...
@@ -9,16 +9,9 @@ import java.security.NoSuchAlgorithmException;
...
@@ -9,16 +9,9 @@ import java.security.NoSuchAlgorithmException;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Map
;
public
interface
Xz
FlwsService
{
public
interface
Gx
FlwsService
{
String
get
JzzjkFlwsnrToXjxz
(
Date
date
,
String
xxzjbh
)
throws
IOException
;
String
get
FtpFlwsnrToAjFlws
(
String
xxzjbh
)
;
String
getRyzbnrToXzxz
(
Date
date
,
String
xxzjbh
)
throws
IOException
;
String
getFtpFlwsnrToAjRxzp
(
String
xxzjbh
);
String
getCqbgwsnrToXzxz
(
Date
date
,
String
xxzjbh
);
String
getMinioFlwsnrToXjxz
(
String
xxzjbh
);
Map
<
String
,
Object
>
getAllMinioTong
()
throws
Exception
;
String
getMinioTongByid
(
MinioClient
minioClient
,
String
id
)
throws
Exception
;
}
}
src/main/java/com/founder/file/service/impl/GxFlwsServiceImpl.java
0 → 100644
View file @
e1e35f27
package
com
.
founder
.
file
.
service
.
impl
;
import
com.founder.file.dao.xzxt.GsFlwsMapper
;
import
com.founder.file.entity.FlwsEntity
;
import
com.founder.file.service.GxFlwsService
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.net.ftp.FTPClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
@Service
public
class
GxFlwsServiceImpl
implements
GxFlwsService
{
@Autowired
private
GsFlwsMapper
gsFlwsMapper
;
// FTP服务器地址
@Value
(
"${ftpHost}"
)
private
String
ftpHost
;
// FTP服务器端口号,默认为21
@Value
(
"${ftpPort}"
)
private
String
ftpPort
;
// FTP服务器用户名
@Value
(
"${ftpUsername}"
)
private
String
ftpUsername
;
// FTP服务器密码
@Value
(
"${ftpPassword}"
)
private
String
ftpPassword
;
@Value
(
"${ftpFlwsPath}"
)
private
String
ftpFlwsPath
;
@Value
(
"${ftpRxzpPath}"
)
private
String
ftpRxzpPath
;
@Override
public
String
getFtpFlwsnrToAjFlws
(
String
xxzjbh
)
{
List
<
FlwsEntity
>
list
=
gsFlwsMapper
.
getPdfFileList
(
xxzjbh
);
int
wssl
=
list
.
size
();
AtomicInteger
cgsl
=
new
AtomicInteger
(
0
);
AtomicInteger
cwsl
=
new
AtomicInteger
(
0
);
AtomicInteger
wswzwksl
=
new
AtomicInteger
(
0
);
AtomicInteger
wglsl
=
new
AtomicInteger
(
0
);
FTPClient
ftpClient
=
connectToFTP
();
if
(
ftpClient
==
null
)
{
throw
new
RuntimeException
(
"FTP链接失败"
);
}
list
.
forEach
(
entity
->
{
InputStream
is
=
null
;
try
{
is
=
ftpClient
.
retrieveFileStream
(
ftpFlwsPath
+
entity
.
getId
()
+
entity
.
getGs
());
if
(
is
!=
null
)
{
byte
[]
bytes
=
IOUtils
.
toByteArray
(
is
);
if
(
bytes
!=
null
&&
bytes
.
length
>
0
)
{
int
update
=
gsFlwsMapper
.
updateFlwsByPdfFile
(
entity
.
getId
(),
bytes
);
if
(
update
>
0
)
{
cgsl
.
incrementAndGet
();
}
else
{
wglsl
.
incrementAndGet
();
}
}
}
else
{
wswzwksl
.
incrementAndGet
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
cwsl
.
incrementAndGet
();
}
finally
{
if
(
is
!=
null
)
{
try
{
is
.
close
();
ftpClient
.
completePendingCommand
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
});
try
{
// 退出登录
ftpClient
.
logout
();
// 断开连接
ftpClient
.
disconnect
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
int
cg
=
cgsl
.
get
();
int
cw
=
cwsl
.
get
();
int
wswzwk
=
wswzwksl
.
get
();
int
wgl
=
wglsl
.
get
();
int
wnr
=
wssl
-
(
cg
+
cw
+
wswzwk
+
wgl
);
return
"共"
+
wssl
+
"个文书准备更新,"
+
"成功更新"
+
cg
+
"个,失败"
+
cw
+
"个,文书位置为空"
+
wswzwk
+
"个,未关联文书"
+
wgl
+
"个,文书内容为空"
+
wnr
+
"个"
;
}
@Override
public
String
getFtpFlwsnrToAjRxzp
(
String
xxzjbh
)
{
List
<
FlwsEntity
>
list
=
gsFlwsMapper
.
getFileIdList
(
xxzjbh
);
int
wssl
=
list
.
size
();
AtomicInteger
cgsl
=
new
AtomicInteger
(
0
);
AtomicInteger
cwsl
=
new
AtomicInteger
(
0
);
AtomicInteger
wswzwksl
=
new
AtomicInteger
(
0
);
AtomicInteger
wglsl
=
new
AtomicInteger
(
0
);
FTPClient
ftpClient
=
connectToFTP
();
if
(
ftpClient
==
null
)
{
throw
new
RuntimeException
(
"FTP链接失败"
);
}
list
.
forEach
(
entity
->
{
InputStream
is
=
null
;
try
{
is
=
ftpClient
.
retrieveFileStream
(
ftpRxzpPath
+
entity
.
getId
()
+
entity
.
getGs
());
if
(
is
!=
null
)
{
byte
[]
bytes
=
IOUtils
.
toByteArray
(
is
);
if
(
bytes
!=
null
&&
bytes
.
length
>
0
)
{
int
update
=
gsFlwsMapper
.
updateFlwsByFileId
(
entity
.
getId
(),
bytes
);
if
(
update
>
0
)
{
cgsl
.
incrementAndGet
();
}
else
{
wglsl
.
incrementAndGet
();
}
}
}
else
{
wswzwksl
.
incrementAndGet
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
cwsl
.
incrementAndGet
();
}
finally
{
if
(
is
!=
null
)
{
try
{
is
.
close
();
ftpClient
.
completePendingCommand
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
});
try
{
// 退出登录
ftpClient
.
logout
();
// 断开连接
ftpClient
.
disconnect
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
int
cg
=
cgsl
.
get
();
int
cw
=
cwsl
.
get
();
int
wswzwk
=
wswzwksl
.
get
();
int
wgl
=
wglsl
.
get
();
int
wnr
=
wssl
-
(
cg
+
cw
+
wswzwk
+
wgl
);
return
"共"
+
wssl
+
"个文书准备更新,"
+
"成功更新"
+
cg
+
"个,失败"
+
cw
+
"个,文书位置为空"
+
wswzwk
+
"个,未关联文书"
+
wgl
+
"个,文书内容为空"
+
wnr
+
"个"
;
}
private
FTPClient
connectToFTP
()
{
FTPClient
ftpClient
=
new
FTPClient
();
try
{
// 连接FTP服务器
ftpClient
.
connect
(
ftpHost
,
Integer
.
parseInt
(
ftpPort
));
// 登录FTP服务器
ftpClient
.
login
(
ftpUsername
,
ftpPassword
);
// 设置以二进制方式传输文件
ftpClient
.
setFileType
(
FTPClient
.
BINARY_FILE_TYPE
);
return
ftpClient
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
private
boolean
isNotEmpty
(
String
str
)
{
return
str
!=
null
&&
!
str
.
isEmpty
();
}
}
\ No newline at end of file
src/main/java/com/founder/file/service/impl/XzFlwsServiceImpl.java
deleted
100644 → 0
View file @
3ac64ab1
This diff is collapsed.
Click to expand it.
src/main/resources/application-dev.yml
View file @
e1e35f27
...
@@ -2,39 +2,9 @@ spring:
...
@@ -2,39 +2,9 @@ spring:
datasource
:
datasource
:
xzxt
:
xzxt
:
driver-class-name
:
oracle.jdbc.OracleDriver
driver-class-name
:
oracle.jdbc.OracleDriver
username
:
XZXT
username
:
GSJZ_KDXF
password
:
XZXT
password
:
GSJZ_KDXF
jdbc-url
:
jdbc:oracle:thin:@47.92.129.99:1600:orcl
jdbc-url
:
jdbc:oracle:thin:@10.178.8.72:1521:GSXZ2
type
:
com.alibaba.druid.pool.DruidDataSource
manager
:
driver-class-name
:
oracle.jdbc.OracleDriver
username
:
manager
password
:
manager
jdbc-url
:
jdbc:oracle:thin:@47.92.129.99:1600:orcl
type
:
com.alibaba.druid.pool.DruidDataSource
xjxz
:
# jdbc-url: jdbc:mysql://47.92.223.200:3365/xzxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
# username: xzxt
# password: xzxt
jdbc-url
:
jdbc:mysql://155.200.1.23:1106/jzzjk?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
username
:
root
password
:
XzxtPwd#54
driver-class-name
:
com.mysql.cj.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
jzzjk
:
jdbc-url
:
jdbc:oracle:thin:@10.20.2.208:6521:XJXZXT
username
:
JZZJK
password
:
JZZJK
driver-class-name
:
oracle.jdbc.driver.OracleDriver
type
:
com.alibaba.druid.pool.DruidDataSource
xjxznew
:
# jdbc-url: jdbc:mysql://47.92.223.200:3365/xzxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
# username: xzxt
# password: xzxt
jdbc-url
:
jdbc:mysql://155.200.1.23:1106/jzzjk?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
username
:
root
password
:
XzxtPwd#54
driver-class-name
:
com.mysql.cj.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
#配置jpa 使其展示sql语句
#配置jpa 使其展示sql语句
jpa
:
jpa
:
...
@@ -45,28 +15,20 @@ spring:
...
@@ -45,28 +15,20 @@ spring:
password
:
p!ssw0rd1
password
:
p!ssw0rd1
poorSize
:
1000
clusterSize
:
1
clusterId
:
1
#最后以/结尾
#最后以/结尾
wjwz
:
http://localhost:8080/
wjwz
:
http://localhost:8080/
#开始定时使用true
#开始定时使用true
isStart
:
false
isStartFlws
:
false
#定时 0秒 0分开始每3分钟 每时 每日 每月 任意周
isStartRxzp
:
false
cron
:
0 0/3 * * * ?
#定时 0秒 0分 0时 每日 每月 任意周
zpCron
:
0 0/3 * * * ?
flwsCron
:
0 0 0 * * ?
cqbgCron
:
0 0/3 * * * ?
rxzpCron
:
0 0 1 * * ?
ftpHost
:
95.3.202.80
minioCron
:
0 0 20 * * ?
ftpPort
:
2121
minioIp
:
155.3.2.230
#ip地址
ftpUsername
:
tp_ftp
minioPort
:
3090
# 端口号
ftpPassword
:
tp_ftp
accessKey
:
minio-jz
# 账号
ftpFlwsPath
:
/home/tp_ftp/flws/
secretKey
:
minio-jz0426
# 密码
ftpRxzpPath
:
/home/tp_ftp/ztry/
secure
:
false
#如果是true,则用的是https而不是http,默认值是true
bucketName
:
jz-zs
# 桶的名字
bucketCount
:
10
# 桶的名字
ftpserverip
:
47.92.129.99
ftpserverip
:
47.92.129.99
nginxport
:
9053
nginxport
:
9053
...
...
src/main/resources/mybatis/mapper/GsFlwsMapper.xml
0 → 100644
View file @
e1e35f27
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.founder.file.dao.xzxt.GsFlwsMapper"
>
<update
id=
"updateFlwsByPdfFile"
>
UPDATE AJ_FLWS SET DZWJNR = #{bytes} where PDF_FILE = #{id}
</update>
<update
id=
"updateFlwsByFileId"
>
UPDATE RXZPB SET DZWJNR = #{bytes} where FILE_ID = #{id}
</update>
<select
id=
"getPdfFileList"
resultType=
"com.founder.file.entity.FlwsEntity"
>
select PDF_FILE as id, GS as gs
FROM AJ_FLWS
where PDF_FILE is not null
and (DZWJNR is null or LENGTH(DZWJNR) = 0)
<if
test=
"xxzjbh != null and xxzjbh != ''"
>
and PDF_FILE = #{xxzjbh}
</if>
</select>
<select
id=
"getFileIdList"
resultType=
"com.founder.file.entity.FlwsEntity"
>
select FILE_ID as id,GS as gs
FROM RXZPB
where FILE_ID is not null
and (DZWJNR is null or LENGTH(DZWJNR) = 0)
<if
test=
"xxzjbh != null and xxzjbh != ''"
>
and FILE_ID = #{xxzjbh}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/xjnewFlwsMpaaer/XzxznewFlwsMapper.xml
deleted
100644 → 0
View file @
3ac64ab1
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.founder.file.dao.xjxznew.XzxznewFlwsMapper"
>
<update
id=
"update"
>
UPDATE tb_st_jzgl
set nr = #{bytes}
where dxcc_id = #{id}
and xt_zxbz = '0'
</update>
<select
id=
"getJzzjkFlwsList"
resultType=
"java.lang.String"
>
select dxcc_id
from tb_st_jzgl
where xt_zxbz = '0' and (nr is null or length(nr) = 0)
<if
test=
"xxzjbh != null and xxzjbh != ''"
>
and dxcc_id = #{xxzjbh}
</if>
</select>
</mapper>
\ No newline at end of file
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