Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hzjtpushdateService
Project overview
Project overview
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
建金
hzjtpushdateService
Commits
1d1a1f06
Commit
1d1a1f06
authored
Jul 23, 2021
by
yzm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mqtt西复线服务解决id 重复问题
parent
8e42ad9e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
184 deletions
+109
-184
src/main/java/com/hzjt/controller/TraffController.java
src/main/java/com/hzjt/controller/TraffController.java
+100
-178
src/main/java/com/hzjt/redis/Receiver.java
src/main/java/com/hzjt/redis/Receiver.java
+3
-3
src/main/java/com/hzjt/util/DateUtils.java
src/main/java/com/hzjt/util/DateUtils.java
+2
-2
src/main/resources/mapper/Traffalarmrecord.xml
src/main/resources/mapper/Traffalarmrecord.xml
+4
-1
No files found.
src/main/java/com/hzjt/controller/TraffController.java
View file @
1d1a1f06
This diff is collapsed.
Click to expand it.
src/main/java/com/hzjt/redis/Receiver.java
View file @
1d1a1f06
...
...
@@ -95,8 +95,8 @@ public class Receiver {
/* 9:免审 */
traffAlarmRecord
.
setCheckstatus
(
9
);
}
int
recordid
=
traffAlarmRecordMapper
.
selectmax
();
traffAlarmRecord
.
setRecordid
((
long
)(
recordid
+
1
));
//
int recordid = traffAlarmRecordMapper.selectmax();
//
traffAlarmRecord.setRecordid((long)(recordid+1));
traffAlarmRecord
.
setProcessstatus
(
"0"
);
traffAlarmRecord
.
setAreaid
(
Long
.
valueOf
(
trffClientMessage
.
getDept
()));
traffAlarmRecord
.
setRecordtype
(
trffClientMessage
.
getIncident_type
().
toLowerCase
());
...
...
@@ -137,7 +137,7 @@ public class Receiver {
connection
.
setReadTimeout
(
2000
);
connection
.
setConnectTimeout
(
3000
);
connection
.
setRequestMethod
(
"GET"
);
String
pname
=
DateUtils
.
formatCurrDayNoSign
()
+
"_"
+
recordid
+
"_0000_"
+
key
.
replace
(
"path"
,
""
);
String
pname
=
DateUtils
.
formatCurrDayNoSign
()
+
"_"
+
traffAlarmRecord
.
getFdid
()
+
"_"
+
traffAlarmRecord
.
getRecordid
()
+
key
.
replace
(
"path"
,
""
);
String
fileName
=
pname
+
".mp4"
;
String
ftputl
=
FTPUtil
.
getFtpUrl
(
ftp
)
+
basepath
+
"/"
+
fileName
;
if
(
connection
.
getResponseCode
()
==
HttpURLConnection
.
HTTP_OK
)
{
...
...
src/main/java/com/hzjt/util/DateUtils.java
View file @
1d1a1f06
...
...
@@ -14,9 +14,9 @@ public class DateUtils {
public
static
String
getDateString
(
Date
date
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
log
.
info
(
"date timezone:{}"
,
formatter
.
getTimeZone
())
;
//
log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"Asia/Shanghai"
));
log
.
info
(
"date timezone:{}"
,
formatter
.
getTimeZone
())
;
//
log.info("date timezone:{}",formatter.getTimeZone()) ;
String
dateString
=
formatter
.
format
(
date
);
return
dateString
;
}
...
...
src/main/resources/mapper/Traffalarmrecord.xml
View file @
1d1a1f06
...
...
@@ -6,7 +6,7 @@
set retrytime= sysdate,
retrycount= retrycount+1
<trim
prefix=
","
suffixOverrides=
","
>
<
if
test=
"img1path!=null"
>
img1path=#{img1path},
</if
>
<
!--<if test="img1path!=null">img1path=#{img1path},</if>--
>
<if
test=
"img2path!=null"
>
img2path=#{img2path},
</if>
<if
test=
"img3path!=null"
>
img3path=#{img3path},
</if>
<if
test=
"img4path!=null"
>
img4path=#{img4path},
</if>
...
...
@@ -26,6 +26,9 @@
</update>
<insert
id=
"inserTraffAlarmRecord"
>
<selectKey
keyProperty=
"recordid"
resultType=
"Long"
order=
"BEFORE"
>
select nvl(max(recordid),0)+1 from traffalarmrecord
</selectKey>
insert into traffalarmrecord
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"recordid != null"
>
recordid,
</if>
...
...
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