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
1293d095
Commit
1293d095
authored
Jan 04, 2021
by
高飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
五分钟
parent
7208731a
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
235 additions
and
233 deletions
+235
-233
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
+1
-1
src/main/java/com/hzjt/controller/TraffController.java
src/main/java/com/hzjt/controller/TraffController.java
+151
-154
src/main/java/com/hzjt/domain/Traffalarmrecord.java
src/main/java/com/hzjt/domain/Traffalarmrecord.java
+36
-35
src/main/java/com/hzjt/handler/WebSocket.java
src/main/java/com/hzjt/handler/WebSocket.java
+4
-2
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
+1
-1
src/main/java/com/hzjt/mapper/TraffFlowMapper.java
src/main/java/com/hzjt/mapper/TraffFlowMapper.java
+1
-1
src/main/java/com/hzjt/service/EventWriteService.java
src/main/java/com/hzjt/service/EventWriteService.java
+4
-1
src/main/java/com/hzjt/service/TraffFlowService.java
src/main/java/com/hzjt/service/TraffFlowService.java
+2
-2
src/main/java/com/hzjt/util/DateUtils.java
src/main/java/com/hzjt/util/DateUtils.java
+4
-0
src/main/resources/application.properties
src/main/resources/application.properties
+2
-2
src/main/resources/mapper/TraffFlow.xml
src/main/resources/mapper/TraffFlow.xml
+2
-2
src/main/resources/mapper/Traffalarmrecord.xml
src/main/resources/mapper/Traffalarmrecord.xml
+27
-32
No files found.
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
View file @
1293d095
...
...
@@ -48,7 +48,7 @@ public class ScheduleTaskConfig {
if
(
c
.
get
(
Calendar
.
DATE
)
==
c
.
getActualMaximum
(
Calendar
.
DATE
))
{
log
.
info
(
"每个月最后一天执行删除前2个月车流量数据操作start"
);
//删除2个月之前车流量详情的数据
traffFlowService
.
deleteBeforeTwoMonthVehicles
(
DateUtils
.
getlastMonth
(-
2
)
);
traffFlowService
.
deleteBeforeTwoMonthVehicles
();
}
}
...
...
src/main/java/com/hzjt/controller/TraffController.java
View file @
1293d095
This diff is collapsed.
Click to expand it.
src/main/java/com/hzjt/domain/Traffalarmrecord.java
View file @
1293d095
...
...
@@ -9,43 +9,44 @@ import java.util.Date;
public
class
Traffalarmrecord
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
Long
recordid
;
//
记录编号 主键序列
private
Integer
algotype
;
//--
算法类型 默认是 0:公司 1:第三方公
司
private
Long
areaid
;
//--辖
区编号
private
String
fdid
;
//
设备编号
private
Integer
channelid
;
//--通
道编号
private
Integer
channeletype
;
//通
道类型 可忽略
private
String
channelname
;
//通
道名称
private
Date
recordtime
;
//
事件记录时间
private
String
recordtype
;
//
事件记录类型
private
String
location
;
//目
标定位信
息
private
String
img1urlfrom
;
//图片源
地
址
private
String
img1path
;
//图片
存储地
址
private
String
img2urlfrom
;
//图片源
地
址
private
String
img2path
;
//图片
存储地
址
private
String
img3urlfrom
;
//图片源
地
址
private
String
img3path
;
//图片
存储地
址
private
String
img4urlfrom
;
//图片源
地
址
private
String
img4path
;
//图片
存储地
址
private
String
img5urlfrom
;
//图片源
地
址
private
String
img5path
;
//图片
存储地
址
private
String
videourlfrom
;
//
视频源地
址
private
String
videopath
;
//
视频存储地
址
private
Date
retrytime
;
//video
重试的最近一次的读取;时间
private
Integer
retrycount
;
//ideo
重试读取总次数
private
Integer
recordlevel
;
//
事件级别 --默认为0 其他类型暂
时未知
private
Integer
checkstatus
;
//0:
待审核 1:审核通过 2:审核不通过 9:免审
private
String
creator
;
//
创建人
private
Date
createtime
;
//
创建时间
private
String
updator
;
//
更新人
private
Date
updatetime
;
//
更新时间
private
Long
recordid
;
//
��¼��� ��������
private
Integer
algotype
;
//--
�㷨���� Ĭ���� 0:��˾ 1:��������˾
private
Long
areaid
;
//--Ͻ
�����
private
String
fdid
;
//
�豸���
private
Integer
channelid
;
//--ͨ
�����
private
Integer
channeletype
;
//ͨ
������ �ɺ���
private
String
channelname
;
//ͨ
������
private
Date
recordtime
;
//
�¼���¼ʱ��
private
String
recordtype
;
//
�¼���¼����
private
String
location
;
//Ŀ
�궨λ��Ϣ
private
String
img1urlfrom
;
//ͼƬԴ
��ַ
private
String
img1path
;
//ͼƬ
�洢��ַ
private
String
img2urlfrom
;
//ͼƬԴ
��ַ
private
String
img2path
;
//ͼƬ
�洢��ַ
private
String
img3urlfrom
;
//ͼƬԴ
��ַ
private
String
img3path
;
//ͼƬ
�洢��ַ
private
String
img4urlfrom
;
//ͼƬԴ
��ַ
private
String
img4path
;
//ͼƬ
�洢��ַ
private
String
img5urlfrom
;
//ͼƬԴ
��ַ
private
String
img5path
;
//ͼƬ
�洢��ַ
private
String
videourlfrom
;
//
��ƵԴ��ַ
private
String
videopath
;
//
��Ƶ�洢��ַ
private
Date
retrytime
;
//video
���Ե����һ�εĶ�ȡ��ʱ��
private
Integer
retrycount
;
//ideo
���Զ�ȡ�ܴ���
private
Integer
recordlevel
;
//
�¼����� --Ĭ��Ϊ0 ����������ʱδ֪
private
Integer
checkstatus
;
//0:
����� 1:���ͨ�� 2:��˲�ͨ�� 9:����
private
String
creator
;
//
������
private
Date
createtime
;
//
����ʱ��
private
String
updator
;
//
������
private
Date
updatetime
;
//
����ʱ��
private
String
remark
;
private
Integer
pushstatus
;
//
推送
状态
private
String
pushdesc
;
//
推送描述
private
String
pushcount
;
//
推送次数
private
Date
pushdate
;
//
推送时间
private
String
processstatus
;
//
处理
状态;
private
Integer
pushstatus
;
//
����״̬
private
String
pushdesc
;
//
��������
private
String
pushcount
;
//
���ʹ���
private
Date
pushdate
;
//
����ʱ��
private
String
processstatus
;
//
����״̬
;
private
String
objlable
;
private
String
rectificationtype
;
@Override
public
String
toString
()
{
...
...
src/main/java/com/hzjt/handler/WebSocket.java
View file @
1293d095
...
...
@@ -106,18 +106,20 @@ public class WebSocket {
* 根据videoid 群发
*/
public
void
GroupSendingByVideoid
(
String
name
)
{
log
.
info
(
"name"
+
name
);
if
(
null
==
traffFlowService
)
return
;
try
{
List
<
Map
>
map
=
new
ArrayList
<>();
if
(
null
!=
webSocketSet
.
get
(
name
)
&&
null
!=
webSocketSet
.
get
(
name
).
session
&&
null
!=
webSocketSet
.
get
(
name
).
session
.
getBasicRemote
())
{
//
log.info("name" + name);
log
.
info
(
"name"
+
name
);
List
<
Map
>
dDayFlowmap
=
traffFlowService
.
selectFiveAndDayFlow
(
name
);
if
(
null
!=
dDayFlowmap
)
map
.
addAll
(
dDayFlowmap
);
List
<
Map
>
TypeDayFlow
=
traffFlowService
.
selectFiveAndTypeDayFlow
(
name
);
if
(
null
!=
dDayFlowmap
)
map
.
addAll
(
TypeDayFlow
);
if
(!
map
.
isEmpty
()
&&
null
!=
webSocketSet
.
get
(
name
)&&
null
!=
webSocketSet
.
get
(
name
).
session
)
{
log
.
info
(
"JSONUtil.toJsonStr(map)"
+
JSONUtil
.
toJsonStr
(
map
));
if
(!
map
.
isEmpty
()
&&
null
!=
webSocketSet
.
get
(
name
)
&&
null
!=
webSocketSet
.
get
(
name
).
session
)
{
synchronized
(
webSocketSet
.
get
(
name
).
session
)
{
webSocketSet
.
get
(
name
).
session
.
getBasicRemote
().
sendText
(
JSONUtil
.
toJsonStr
(
map
));
}
...
...
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
View file @
1293d095
...
...
@@ -29,6 +29,6 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co
Integer
selectInChecktimeTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
Integer
select
InworkRectifytimeTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
Integer
update
InworkRectifytimeTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
}
\ No newline at end of file
src/main/java/com/hzjt/mapper/TraffFlowMapper.java
View file @
1293d095
...
...
@@ -20,7 +20,7 @@ public interface TraffFlowMapper {
Integer
statisVehiclesByDay
();
Integer
deleteBeforeTwoMonthVehiclesDetails
(
String
startime
);
Integer
deleteBeforeTwoMonthVehiclesDetails
();
Integer
deleteVehiclesByDay
();
...
...
src/main/java/com/hzjt/service/EventWriteService.java
View file @
1293d095
...
...
@@ -191,12 +191,15 @@ public class EventWriteService {
condition
.
setRecordid
(
traffalarmrecord
.
getRecordid
());
String
message
=
writeResultObj
.
getMessage
();
boolean
successFlag
=
writeResultObj
.
getStatus
()
==
ResponseEnum
.
SUCCESS
.
getCode
();
condition
.
setPushdesc
(
message
);
/* 失败但是因为数据已存在 */
if
(!
successFlag
&&
StringUtils
.
isNotBlank
(
message
)
&&
message
.
contains
(
CONTAINS_EXIST
))
{
condition
.
setPushstatus
(
1
);
traffAlarmRecordMapper
.
updatePushEvent
(
condition
);
return
;
}
/* 成功 */
condition
.
setPushdesc
(
message
);
if
(
successFlag
)
{
condition
.
setPushstatus
(
0
);
traffAlarmRecordMapper
.
updatePushEvent
(
condition
);
...
...
src/main/java/com/hzjt/service/TraffFlowService.java
View file @
1293d095
...
...
@@ -39,8 +39,8 @@ public class TraffFlowService {
}
public
void
deleteBeforeTwoMonthVehicles
(
String
starttime
)
{
traffFlowMapper
.
deleteBeforeTwoMonthVehiclesDetails
(
starttime
);
public
void
deleteBeforeTwoMonthVehicles
()
{
traffFlowMapper
.
deleteBeforeTwoMonthVehiclesDetails
();
}
...
...
src/main/java/com/hzjt/util/DateUtils.java
View file @
1293d095
...
...
@@ -25,6 +25,10 @@ public class DateUtils {
return
formatCurrDateByType
(
YMDHMS
);
}
public
static
String
formatCurrDateYMD
(){
return
formatCurrDateByType
(
Y_M_D
);
}
public
static
String
formatCurrDayNoSign
(){
return
formatCurrDateByType
(
YMD
);
}
...
...
src/main/resources/application.properties
View file @
1293d095
...
...
@@ -13,7 +13,7 @@ mybatis.configuration.map-underscore-to-camel-case=true
mybatis.configuration.default-fetch-size
=
100
mybatis.configuration.default-statement-timeout
=
3000
#mybatis.mapperLocations = classpath:xxx.xml
#
logging.level.com.hzjt=debug
logging.level.com.hzjt
=
debug
## �������ݿ�-����Դ����
#spring.datasource.url=jdbc:dm://127.0.0.1:12345/auditlocal_cq
...
...
@@ -31,7 +31,7 @@ mybatis.configuration.default-statement-timeout=3000
# Mysql���ݿ�-����Դ����
#spring.datasource.username=test
#spring.datasource.password=test
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:152
2
:helowin
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:152
3
:helowin
spring.datasource.username
=
hzjt
spring.datasource.password
=
hzjt
spring.datasource.url
=
jdbc:oracle:thin:@33.50.1.22:1521:orcl
...
...
src/main/resources/mapper/TraffFlow.xml
View file @
1293d095
...
...
@@ -20,7 +20,7 @@
#{video_id,jdbcType=VARCHAR},#{ts,jdbcType=VARCHAR},sysdate)
</insert>
<select
id=
"selectFiveAndDayFlow"
resultType=
"java.util.HashMap"
>
select
select
NVL(sum(case when CREATE_TIME>=(SYSDATE-1-5/1440) and CREATE_TIME
<![CDATA[ <= ]]>
(SYSDATE-1) then 1 else 0 end),0)tbfiveflow,
NVL(sum(case when CREATE_TIME>= (SYSDATE-10/1440) and CREATE_TIME
<![CDATA[ <= ]]>
(SYSDATE-5/1440) then 1 else 0 end),0)hbfiveflow,
NVL(sum(case when CREATE_TIME>= (SYSDATE-5/1440) then 1 else 0 end),0)fiveflow,
...
...
@@ -102,7 +102,7 @@
b.video_id
</insert>
<delete
id=
"deleteBeforeTwoMonthVehiclesDetails"
>
delete from vehicle WHERE create_time
<![CDATA[ <= ]]>
to_date( #{starttime}||' 23:59:59','yyyy-mm-dd hh24:mi:ss')
delete from vehicle WHERE create_time
<![CDATA[ <= ]]>
sysdate-33
</delete>
<delete
id=
"deleteVehiclesByDay"
>
...
...
src/main/resources/mapper/Traffalarmrecord.xml
View file @
1293d095
...
...
@@ -63,6 +63,7 @@
<if
test=
"pushdesc != null"
>
pushdesc,
</if>
<if
test=
"processstatus != null"
>
processstatus,
</if>
<if
test=
"objlable != null"
>
objlable,
</if>
<if
test=
"rectificationtype != null"
>
rectificationtype ,
</if>
</trim>
<trim
prefix=
"select"
suffix=
"from dual"
suffixOverrides=
","
>
...
...
@@ -101,6 +102,7 @@
<if
test=
"pushdesc != null"
>
#{pushdesc},
</if>
<if
test=
"processstatus != null"
>
#{processstatus},
</if>
<if
test=
"objlable != null"
>
#{objlable},
</if>
<if
test=
"rectificationtype != null"
>
#{rectificationtype},
</if>
</trim>
...
...
@@ -129,55 +131,48 @@
<update
id=
"updateTraffAlarmRectificationType"
parameterType=
"com.hzjt.domain.Traffalarmrecord"
>
UPDATE TRAFFALARMRECORD
<set>
<if
test=
"
item.
processstatus != null"
>
<if
test=
"processstatus != null"
>
rectificationtype=1,
</if>
</set>
from TRAFFALARMRECORD a,
(select * from TRAFFALARMRECORD a,(select * from TRAFFALARMRECORD b where
recordid=#{
item.
recordid,jdbcType=VARCHAR} )b
recordid=#{recordid,jdbcType=VARCHAR} )b
where a.fdid =b.fdid and a.channelid=b.channelid
AND ( a.recordtime
<![CDATA[ <= ]]>
b.recordtime-10/
(24*60)
)
AND ( a.recordtime
<![CDATA[ <= ]]>
b.recordtime-10/
1440
)
AND recordtype in ('roadworks_out_of_line','roadworks'))b
where recordtype in('illegal_parking','no_motor_ban') and a.fdid =b.fdid and a.channelid=b.channelid
</update>
<
select
id=
"selectExitsTraffAlarm"
parameterType=
"com.hzjt.domain.Traffalarmrecord"
resultType=
"java.lang.Integer"
>
select count(1) from TRAFFALARMRECORD a,t_code b where a.recordtype=#{item.recordtype,jdbcType=VARCHAR}
and a.recordtype=LOWER (b.key)and recordtime>=sysdate-(b.REPEATTIME)/(24*60)
and a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
<
!--<select id="selectExitsTraffAlarm" parameterType="com.hzjt.domain.Traffalarmrecord" resultType="java.lang.Integer">--
>
<!--select count(1) from TRAFFALARMRECORD a,t_code b where a.recordtype=#{recordtype,jdbcType=VARCHAR}-->
<!--and a.recordtype=LOWER (b.key)and recordtime>=sysdate-(b.REPEATTIME)/(24*60)-->
<!--and a.fdid=#{fdid,jdbcType=VARCHAR}-->
<!--and a.channelid=#{channelid,jdbcType=VARCHAR}-->
<
/select
>
<
!--</select>--
>
<select
id=
"selectInChecktimeTraffAlarm"
parameterType=
"com.hzjt.domain.Traffalarmrecord"
resultType=
"java.lang.Integer"
>
select count(1) from TRAFFALARMRECORD a,t_code b
where a.recordtype=#{item.recordtype,jdbcType=VARCHAR}
and a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and a.recordtype=LOWER (b.key)
and recordtime
<![CDATA[ <= ]]>
(select LASTCHECKTIME from videochecktime c where
a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and recordtype=#{item.recordtype,jdbcType=VARCHAR})+(b.PUSHCHECKTIME)/(24*60)
and recordtime>(select LASTCHECKTIME from videochecktime c where
a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and recordtype=#{item.recordtype,jdbcType=VARCHAR})
</select>
select count(1) from videochecktime a,t_code b where
a.FDID=#{fdid,jdbcType=VARCHAR}
and a.CHANNELID=#{channelid,jdbcType=VARCHAR}
and a.RECORDTYPE=#{recordtype,jdbcType=VARCHAR}
and a.RECORDTYPE=lower(b.key)
and LASTCHECKTIME+(b.PUSHCHECKTIME)/1440
<![CDATA[ >= ]]>
#{recordtime,jdbcType=TIMESTAMP}
and LASTCHECKTIME
<![CDATA[ < ]]>
#{recordtime,jdbcType=TIMESTAMP}
<select
id=
"selectInworkRectifytimeTraffAlarm"
parameterType=
"com.hzjt.domain.Traffalarmrecord"
resultType=
"java.lang.Integer"
>
select count(1) from TRAFFALARMRECORD a,t_code b
where a.recordtype=#{item.recordtype,jdbcType=VARCHAR}
and a.recordtype=LOWER (b.key)
and a.fdid=#{item.fdid,jdbcType=VARCHAR}
and a.channelid=#{item.channelid,jdbcType=VARCHAR}
and recordtime>=#{item.recordtime,jdbcType=TIMESTAMP}-(b.RECTIFYTIME)/(24*60)
and recordtime
<![CDATA[ < ]]>
#{item.recordtime,jdbcType=TIMESTAMP}
and recordtype in ('roadworks_out_of_line','roadworks')
</select>
<update
id=
"updateInworkRectifytimeTraffAlarm"
parameterType=
"com.hzjt.domain.Traffalarmrecord"
>
update TRAFFALARMRECORD set rectificationtype=1,recordtype='roadworks'
where fdid=#{fdid,jdbcType=VARCHAR}
and channelid=#{channelid,jdbcType=VARCHAR}
and recordtime>=#{recordtime,jdbcType=TIMESTAMP}-(select b.RECTIFYTIME from t_code b where recordtype=LOWER (b.key) )/1440
and recordtime
<![CDATA[ < ]]>
#{recordtime,jdbcType=TIMESTAMP}
and recordtype in ('illegal_parking','no_motor_ban')
</update>
</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