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
d804242d
Commit
d804242d
authored
Nov 08, 2019
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
90a5aeab
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
140 deletions
+50
-140
ReportRecord.java
src/main/java/com/entity/report/ReportRecord.java
+20
-0
DataMapper.java
src/main/java/com/mapper/data/DataMapper.java
+0
-2
ReportRecordMapper.java
src/main/java/com/mapper/report/ReportRecordMapper.java
+0
-7
IReportServiceImpl.java
...main/java/com/service/report/impl/IReportServiceImpl.java
+9
-7
ReportTimer.java
src/main/java/com/timer/ReportTimer.java
+6
-6
ReportRecordMapper.xml
src/main/resources/mybatis/report/ReportRecordMapper.xml
+15
-118
No files found.
src/main/java/com/entity/report/ReportRecord.java
View file @
d804242d
...
...
@@ -15,6 +15,10 @@ public class ReportRecord {
private
String
feedback
;
private
Integer
loadcount
;
private
Integer
errorcount
;
private
Integer
status
;
private
Date
createtime
;
...
...
@@ -69,6 +73,22 @@ public class ReportRecord {
this
.
feedback
=
feedback
==
null
?
null
:
feedback
.
trim
();
}
public
Integer
getLoadcount
()
{
return
loadcount
;
}
public
void
setLoadcount
(
Integer
loadcount
)
{
this
.
loadcount
=
loadcount
;
}
public
Integer
getErrorcount
()
{
return
errorcount
;
}
public
void
setErrorcount
(
Integer
errorcount
)
{
this
.
errorcount
=
errorcount
;
}
public
Integer
getStatus
()
{
return
status
;
}
...
...
src/main/java/com/mapper/data/DataMapper.java
View file @
d804242d
package
com
.
mapper
.
data
;
import
com.entity.report.ReportRecord
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.Map
;
...
...
src/main/java/com/mapper/report/ReportRecordMapper.java
View file @
d804242d
...
...
@@ -4,17 +4,10 @@ import com.entity.report.ReportRecord;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
@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/report/impl/IReportServiceImpl.java
View file @
d804242d
...
...
@@ -24,7 +24,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.*
;
import
java.nio.charset.Charset
;
import
java.util.*
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.ExecutorService
;
...
...
@@ -123,7 +122,6 @@ public class IReportServiceImpl implements ReportService {
@Override
public
FileEntry
creatZipFile
(
List
<
Map
<
String
,
Object
>>
dataList
,
InfoType
infoType
,
BusinessType
businessType
)
throws
QgException
{
return
creatZipFile
(
null
,
dataList
,
infoType
,
businessType
);
}
...
...
@@ -371,9 +369,9 @@ public class IReportServiceImpl implements ReportService {
record
.
setReportmsg
(
"上报接口请求异常"
);
reportRecordMapper
.
insert
(
record
);
throw
new
QgException
(
"上报接口请求异常"
,
e
);
}
finally
{
if
(
file
!=
null
)
{
if
(
file
.
exists
())
{
}
finally
{
if
(
file
!=
null
)
{
if
(
file
.
exists
())
{
file
.
delete
();
}
}
...
...
@@ -441,14 +439,18 @@ public class IReportServiceImpl implements ReportService {
utils
.
deccryptFile
(
decEncFile
.
getPath
(),
txt
);
decEncFile
.
delete
();
ReportRecord
record
=
new
ReportRecord
();
record
.
setFeedback
(
"istatus:"
+
json
.
getString
(
"istatus"
)
+
"loadcount:"
+
json
.
getInteger
(
"loadcount"
)
+
",errorcount:"
+
json
.
getInteger
(
"errorcount"
));
record
.
setFeedback
(
json
.
getString
(
"istatus"
));
record
.
setErrorcount
(
json
.
getInteger
(
"errorcount"
));
record
.
setLoadcount
(
json
.
getInteger
(
"loadcount"
));
record
.
setIssearch
(
1
);
record
.
setFilename
(
fileEntry
.
getFileName
());
reportRecordMapper
.
updateByPrimaryKeySelectiveByFileName
(
record
);
throw
new
QgException
(
"查看报送状态接口有反馈"
,
"文件位置"
+
txt
);
}
else
{
ReportRecord
record
=
new
ReportRecord
();
record
.
setFeedback
(
"istatus:"
+
json
.
getString
(
"istatus"
)
+
"loadcount:"
+
json
.
getInteger
(
"loadcount"
)
+
",errorcount:"
+
json
.
getInteger
(
"errorcount"
));
record
.
setFeedback
(
json
.
getString
(
"istatus"
));
record
.
setErrorcount
(
json
.
getInteger
(
"errorcount"
));
record
.
setLoadcount
(
json
.
getInteger
(
"loadcount"
));
record
.
setIssearch
(
1
);
record
.
setFilename
(
fileEntry
.
getFileName
());
reportRecordMapper
.
updateByPrimaryKeySelectiveByFileName
(
record
);
...
...
src/main/java/com/timer/ReportTimer.java
View file @
d804242d
...
...
@@ -40,9 +40,9 @@ public class ReportTimer {
//每天凌晨2点
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
void
reportDayData
()
{
//
if (!isRun) {
//
return;
//
}
if
(!
isRun
)
{
return
;
}
dayReportIsRunning
=
true
;
try
{
//上报日放款数据
...
...
@@ -77,9 +77,9 @@ public class ReportTimer {
//一小时一次 延迟10秒
@Scheduled
(
fixedDelay
=
1000
*
60
*
60
,
initialDelay
=
10000
)
public
void
quaryReportedStatus
()
{
if
(!
isRun
)
{
return
;
}
//
if (!isRun) {
//
return;
//
}
if
(
monReportIsRunning
||
dayReportIsRunning
)
{
return
;
}
...
...
src/main/resources/mybatis/report/ReportRecordMapper.xml
View file @
d804242d
...
...
@@ -8,124 +8,27 @@
<result
column=
"reportmsg"
jdbcType=
"VARCHAR"
property=
"reportmsg"
/>
<result
column=
"issearch"
jdbcType=
"INTEGER"
property=
"issearch"
/>
<result
column=
"feedback"
jdbcType=
"VARCHAR"
property=
"feedback"
/>
<result
column=
"loadcount"
jdbcType=
"INTEGER"
property=
"loadcount"
/>
<result
column=
"errorcount"
jdbcType=
"INTEGER"
property=
"errorcount"
/>
<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
id, filename, filepath, reportmsg, issearch, feedback, loadcount, errorcount, 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
)
loadcount, errorcount, 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}
)
#{
loadcount,jdbcType=INTEGER}, #{errorcount,jdbcType=INTEGER}, #{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
...
...
@@ -145,6 +48,12 @@
<if
test=
"feedback != null"
>
feedback = #{feedback,jdbcType=VARCHAR},
</if>
<if
test=
"loadcount != null"
>
loadcount = #{loadcount,jdbcType=INTEGER},
</if>
<if
test=
"errorcount != null"
>
errorcount = #{errorcount,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
...
...
@@ -157,18 +66,6 @@
</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
...
...
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