Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhj-report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
data-spider
zhj-report
Commits
57389afe
Commit
57389afe
authored
Oct 31, 2019
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shangbao
parent
30b5a8d6
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
540 additions
and
48 deletions
+540
-48
pom.xml
pom.xml
+5
-0
ZhjreportApplication.java
src/main/java/com/ZhjreportApplication.java
+1
-0
ReportDataSourceConfig.java
src/main/java/com/config/ReportDataSourceConfig.java
+8
-8
PathType.java
src/main/java/com/emums/PathType.java
+19
-0
FileEntry.java
src/main/java/com/entity/FileEntry.java
+8
-3
ReportRecord.java
src/main/java/com/entity/report/ReportRecord.java
+95
-0
ReportRecordMapper.java
src/main/java/com/mapper/report/ReportRecordMapper.java
+26
-0
ReportService.java
src/main/java/com/service/ReportService.java
+9
-2
ReportServiceImpl.java
src/main/java/com/service/impl/ReportServiceImpl.java
+169
-17
Utils.java
src/main/java/com/util/Utils.java
+1
-0
application.properties
src/main/resources/application.properties
+18
-18
ReportRecordMapper.xml
src/main/resources/mybatis/report/ReportRecordMapper.xml
+181
-0
No files found.
pom.xml
View file @
57389afe
...
...
@@ -128,6 +128,11 @@
<artifactId>
commons-beanutils
</artifactId>
<version>
1.9.3
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/ZhjreportApplication.java
View file @
57389afe
...
...
@@ -8,6 +8,7 @@ public class ZhjreportApplication {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ZhjreportApplication
.
class
,
args
);
System
.
out
.
println
(
"上报系统启动完成"
);
}
}
src/main/java/com/config/DataSourceConfig.java
→
src/main/java/com/config/
Report
DataSourceConfig.java
View file @
57389afe
...
...
@@ -22,8 +22,8 @@ import javax.sql.DataSource;
* @version: 1.0
*/
@Configuration
@MapperScan
(
basePackages
=
"com.mapper.
*
"
)
public
class
DataSourceConfig
{
@MapperScan
(
basePackages
=
"com.mapper.
report
"
)
public
class
Report
DataSourceConfig
{
@Value
(
"${db.driver}"
)
private
String
driverClass
;
...
...
@@ -42,8 +42,8 @@ public class DataSourceConfig {
@Value
(
"${config-location}"
)
private
String
mapperConfig
;
@Bean
(
name
=
"
d
ataSource"
)
public
DataSource
xyqbUser
Datasource
()
{
@Bean
(
name
=
"
reportD
ataSource"
)
public
DataSource
report
Datasource
()
{
HikariConfig
config
=
new
HikariConfig
();
config
.
setJdbcUrl
(
jdbcUrl
);
config
.
setUsername
(
username
);
...
...
@@ -53,13 +53,13 @@ public class DataSourceConfig {
return
new
HikariDataSource
(
config
);
}
@Bean
(
name
=
"transactionManager"
)
public
DataSourceTransactionManager
xyqbUserDatasourceTransactionManager
(
@Qualifier
(
"dataSource"
)
DataSource
xyqbUserD
atasource
)
{
return
new
DataSourceTransactionManager
(
xyqbUserD
atasource
);
@Bean
public
DataSourceTransactionManager
reporDatasourceTransactionManager
(
@Qualifier
(
"reportDataSource"
)
DataSource
d
atasource
)
{
return
new
DataSourceTransactionManager
(
d
atasource
);
}
@Bean
(
name
=
"sqlSessionFactory"
)
public
SqlSessionFactory
sqlSessionFactory
(
@Qualifier
(
"
d
ataSource"
)
DataSource
dataSource
)
throws
Exception
{
public
SqlSessionFactory
sqlSessionFactory
(
@Qualifier
(
"
reportD
ataSource"
)
DataSource
dataSource
)
throws
Exception
{
final
SqlSessionFactoryBean
sessionFactory
=
new
SqlSessionFactoryBean
();
sessionFactory
.
setDataSource
(
dataSource
);
sessionFactory
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
()
...
...
src/main/java/com/emums/PathType.java
0 → 100644
View file @
57389afe
package
com
.
emums
;
import
jdk.nashorn.internal.runtime.regexp.joni.constants.StringType
;
public
enum
PathType
{
REPORT
(
"upload"
,
"上报路径"
),
FEEDBACK
(
"feed"
,
"反馈路径"
),
;
private
String
path
;
private
String
type
;
PathType
(
String
path
,
String
type
){
this
.
path
=
path
;
this
.
type
=
type
;
}
public
String
getPath
()
{
return
path
;
}
}
src/main/java/com/entity/
Report
Entry.java
→
src/main/java/com/entity/
File
Entry.java
View file @
57389afe
package
com
.
entity
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* @author :dongjianhua
* @date :Created in 2019/10/30 14:57
...
...
@@ -7,7 +10,9 @@ package com.entity;
* @modified By:
* @version: 1.0
*/
public
class
ReportEntry
{
@Getter
@Setter
public
class
FileEntry
{
String
fileName
;
String
filePath
;
}
src/main/java/com/entity/report/ReportRecord.java
0 → 100644
View file @
57389afe
package
com
.
entity
.
report
;
import
java.util.Date
;
public
class
ReportRecord
{
private
Integer
id
;
private
String
filename
;
private
String
filepath
;
private
String
reportmsg
;
private
Integer
issearch
;
private
String
feedback
;
private
Integer
status
;
private
Date
createtime
;
private
Date
updatetime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getFilename
()
{
return
filename
;
}
public
void
setFilename
(
String
filename
)
{
this
.
filename
=
filename
==
null
?
null
:
filename
.
trim
();
}
public
String
getFilepath
()
{
return
filepath
;
}
public
void
setFilepath
(
String
filepath
)
{
this
.
filepath
=
filepath
==
null
?
null
:
filepath
.
trim
();
}
public
String
getReportmsg
()
{
return
reportmsg
;
}
public
void
setReportmsg
(
String
reportmsg
)
{
this
.
reportmsg
=
reportmsg
==
null
?
null
:
reportmsg
.
trim
();
}
public
Integer
getIssearch
()
{
return
issearch
;
}
public
void
setIssearch
(
Integer
issearch
)
{
this
.
issearch
=
issearch
;
}
public
String
getFeedback
()
{
return
feedback
;
}
public
void
setFeedback
(
String
feedback
)
{
this
.
feedback
=
feedback
==
null
?
null
:
feedback
.
trim
();
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Date
getCreatetime
()
{
return
createtime
;
}
public
void
setCreatetime
(
Date
createtime
)
{
this
.
createtime
=
createtime
;
}
public
Date
getUpdatetime
()
{
return
updatetime
;
}
public
void
setUpdatetime
(
Date
updatetime
)
{
this
.
updatetime
=
updatetime
;
}
}
\ No newline at end of file
src/main/java/com/mapper/report/ReportRecordMapper.java
0 → 100644
View file @
57389afe
package
com
.
mapper
.
report
;
import
com.entity.report.ReportRecord
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
ReportRecordMapper
{
List
<
ReportRecord
>
getReportedRecord
();
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
ReportRecord
record
);
int
insertSelective
(
ReportRecord
record
);
ReportRecord
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
ReportRecord
record
);
int
updateByPrimaryKeySelectiveByFileName
(
ReportRecord
record
);
int
updateByPrimaryKey
(
ReportRecord
record
);
}
\ No newline at end of file
src/main/java/com/service/ReportService.java
View file @
57389afe
...
...
@@ -2,12 +2,19 @@ package com.service;
import
com.emums.BusinessType
;
import
com.emums.InfoType
;
import
com.entity.FileEntry
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ReportService
{
String
creatZipFile
(
List
<
Map
<
String
,
Object
>>
dataList
,
InfoType
infoType
,
BusinessType
businessType
);
FileEntry
creatZipFile
(
List
<
Map
<
String
,
Object
>>
dataList
,
InfoType
infoType
,
BusinessType
businessType
);
Map
<
String
,
Object
>
reportData
(
FileEntry
fileEntry
);
Map
<
String
,
Object
>
quaryReportedStatus
();
Map
<
String
,
Object
>
quaryReportedStatus
(
FileEntry
fileEntry
);
void
reportLoanData
();
Map
<
String
,
Object
>
reportData
(
String
fileName
);
}
src/main/java/com/service/impl/ReportServiceImpl.java
View file @
57389afe
This diff is collapsed.
Click to expand it.
src/main/java/com/util/Utils.java
View file @
57389afe
...
...
@@ -231,4 +231,5 @@ public class Utils {
return
random
.
nextInt
(
max
);
}
}
src/main/resources/application.properties
View file @
57389afe
...
...
@@ -5,39 +5,39 @@ db.driver=com.mysql.jdbc.Driver
config-location
=
classpath:mybatis-config.xml
db.minPoolSize
=
1
db.maxPoolSize
=
5
mapper.location
=
classpath
*:mybatis
/*.xml
data.source.jdbcUrl
=
jdbc:mysql://172.
17.5.8:31024/xyqb_user
?useUnicode=true&characterEncoding=UTF8
mapper.location
=
classpath
:mybatis/report
/*.xml
data.source.jdbcUrl
=
jdbc:mysql://172.
30.220.9:3306/project
?useUnicode=true&characterEncoding=UTF8
data.source.username
=
qa
data.source.password
=
qatest
#
报送相关配置
#
组织机构代码 测试阶段使用
06346639-3
#
报送相关配置
#
组织机构代码 测试阶段使用063466
39-3
organizationCode
=
06346639-3
#
统一社会信用代码
913606000634663936
uniformSocialCreditCode
=
91360600
063466393
6
#
接口的k
ey
#
统一社会信用代码 913
606000634663936
uniformSocialCreditCode
=
91360600
MA05M6KK9
6
#
接口的ke
y
interFaceKey
=
cfcc
#code
组织结构代码或者统一社会信用代码的9-17 测试直接用demo给的
#code
组织结构代码或者统一社会信用代码的9-17 MA05M6KK9
code
=
MA05M6KK9
#
查询接口
url
#
查询接口ur
l
infoUrl
=
https://testcredit.nifa.org.cn/NifaServer/context/info/json/upload
#
报送接口u
ri
#
报送接口ur
i
dataUri
=
https://testcredit.nifa.org.cn/NifaServer/context/data/json/asynlist
#
报送状态查看接口
#
报送状态查看接口
taskUri
=
https://testcredit.nifa.org.cn/NifaServer/context/task/json/upload
#
报送文件加密用公钥1 测试阶段无需修改,生产接入时另行发放
#
报送文件加密用公钥1 测试阶段无需修改,生产接入时另行发放
xPubkey
=
dc5f89775f11266dbb166638710463db31a91f7b3061aeddb69444d5ec748929
#
报送文件加密用公钥2 测试阶段无需修改,生产接入时另行发放
#
报送文件加密用公钥2 测试阶段无需修改,生产接入时另行发放
yPubKey
=
740e50cb6e6e04003029a66920d1ba4bc39519035ea423bf0079ef58128202fb
#
反馈文件解密用私钥 测试阶段无需修改,生产接入时另行发放
#
反馈文件解密用私钥 测试阶段无需修改,生产接入时另行发放
prvKey
=
9401d5a563967f8bd39fbd81d5dedea4e552bf97f5dd8cab95749421a477e7d0
#
业务信息文件名
#
业务信息文件名
businfoFileName
=
121EXPORTTRADEINFO
#
删除信息文件名
#
删除信息文件名
delinfoFileName
=
000DELETEINFO
#
报送文件存储路径临时位置前缀
#
报送文件存储路径临时位置前缀
filePathPre
=
D:/report/
#
是否脱敏
#
是否脱敏
isDesensitization
=
true
\ No newline at end of file
src/main/resources/mybatis/report/ReportRecordMapper.xml
0 → 100644
View file @
57389afe
<?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.mapper.report.ReportRecordMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.entity.report.ReportRecord"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"filename"
jdbcType=
"VARCHAR"
property=
"filename"
/>
<result
column=
"filepath"
jdbcType=
"VARCHAR"
property=
"filepath"
/>
<result
column=
"reportmsg"
jdbcType=
"VARCHAR"
property=
"reportmsg"
/>
<result
column=
"issearch"
jdbcType=
"INTEGER"
property=
"issearch"
/>
<result
column=
"feedback"
jdbcType=
"VARCHAR"
property=
"feedback"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"createtime"
jdbcType=
"TIMESTAMP"
property=
"createtime"
/>
<result
column=
"updatetime"
jdbcType=
"TIMESTAMP"
property=
"updatetime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, filename, filepath, reportmsg, issearch, feedback, status, createtime, updatetime
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from reportrecord
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from reportrecord
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.entity.report.ReportRecord"
>
insert into reportrecord (id, filename, filepath,
reportmsg, issearch, feedback,
status, createtime, updatetime
)
values (#{id,jdbcType=INTEGER}, #{filename,jdbcType=VARCHAR}, #{filepath,jdbcType=VARCHAR},
#{reportmsg,jdbcType=VARCHAR}, #{issearch,jdbcType=INTEGER}, #{feedback,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.entity.report.ReportRecord"
>
insert into reportrecord
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"filename != null"
>
filename,
</if>
<if
test=
"filepath != null"
>
filepath,
</if>
<if
test=
"reportmsg != null"
>
reportmsg,
</if>
<if
test=
"issearch != null"
>
issearch,
</if>
<if
test=
"feedback != null"
>
feedback,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"createtime != null"
>
createtime,
</if>
<if
test=
"updatetime != null"
>
updatetime,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"filename != null"
>
#{filename,jdbcType=VARCHAR},
</if>
<if
test=
"filepath != null"
>
#{filepath,jdbcType=VARCHAR},
</if>
<if
test=
"reportmsg != null"
>
#{reportmsg,jdbcType=VARCHAR},
</if>
<if
test=
"issearch != null"
>
#{issearch,jdbcType=INTEGER},
</if>
<if
test=
"feedback != null"
>
#{feedback,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
<if
test=
"createtime != null"
>
#{createtime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatetime != null"
>
#{updatetime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.entity.report.ReportRecord"
>
update reportrecord
<set>
<if
test=
"filename != null"
>
filename = #{filename,jdbcType=VARCHAR},
</if>
<if
test=
"filepath != null"
>
filepath = #{filepath,jdbcType=VARCHAR},
</if>
<if
test=
"reportmsg != null"
>
reportmsg = #{reportmsg,jdbcType=VARCHAR},
</if>
<if
test=
"issearch != null"
>
issearch = #{issearch,jdbcType=INTEGER},
</if>
<if
test=
"feedback != null"
>
feedback = #{feedback,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"createtime != null"
>
createtime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatetime != null"
>
updatetime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKeySelectiveByFileName"
parameterType=
"com.entity.report.ReportRecord"
>
update reportrecord
<set>
<if
test=
"filename != null"
>
filename = #{filename,jdbcType=VARCHAR},
</if>
<if
test=
"filepath != null"
>
filepath = #{filepath,jdbcType=VARCHAR},
</if>
<if
test=
"reportmsg != null"
>
reportmsg = #{reportmsg,jdbcType=VARCHAR},
</if>
<if
test=
"issearch != null"
>
issearch = #{issearch,jdbcType=INTEGER},
</if>
<if
test=
"feedback != null"
>
feedback = #{feedback,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"createtime != null"
>
createtime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatetime != null"
>
updatetime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where filename = #{filename,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.entity.report.ReportRecord"
>
update reportrecord
set filename = #{filename,jdbcType=VARCHAR},
filepath = #{filepath,jdbcType=VARCHAR},
reportmsg = #{reportmsg,jdbcType=VARCHAR},
issearch = #{issearch,jdbcType=INTEGER},
feedback = #{feedback,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
createtime = #{createtime,jdbcType=TIMESTAMP},
updatetime = #{updatetime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"getReportedRecord"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
from reportrecord
where status = 1
and
createtime
<
date_add(NOW(),interval -10 minute)
</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