Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
VieoAITaskProducerService
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
VideoAIService
VieoAITaskProducerService
Commits
12254c87
Commit
12254c87
authored
Jul 01, 2021
by
yzm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复ftpbug
parent
42a7d921
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
383 additions
and
363 deletions
+383
-363
pom.xml
pom.xml
+3
-19
src/main/java/com/cx/cn/cxquartz/config/ScheduleTaskConfig.java
...in/java/com/cx/cn/cxquartz/config/ScheduleTaskConfig.java
+17
-1
src/main/java/com/cx/cn/cxquartz/controller/ExtController.java
...ain/java/com/cx/cn/cxquartz/controller/ExtController.java
+241
-324
src/main/java/com/cx/cn/cxquartz/controller/IndexController.java
...n/java/com/cx/cn/cxquartz/controller/IndexController.java
+1
-1
src/main/java/com/cx/cn/cxquartz/controller/QuartzController.java
.../java/com/cx/cn/cxquartz/controller/QuartzController.java
+1
-1
src/main/java/com/cx/cn/cxquartz/service/quartz/SbtdspsrService.java
...va/com/cx/cn/cxquartz/service/quartz/SbtdspsrService.java
+0
-1
src/main/java/com/cx/cn/cxquartz/service/quartz/impl/SbtdspsrImpl.java
.../com/cx/cn/cxquartz/service/quartz/impl/SbtdspsrImpl.java
+3
-0
src/main/java/com/cx/cn/cxquartz/util/RestUtil.java
src/main/java/com/cx/cn/cxquartz/util/RestUtil.java
+93
-0
src/main/resources/application.yml
src/main/resources/application.yml
+5
-7
src/main/resources/file.properties
src/main/resources/file.properties
+2
-2
src/main/resources/mapper/SbtdspsrMapper.xml
src/main/resources/mapper/SbtdspsrMapper.xml
+2
-2
src/main/resources/mapper/TraffAlarmRecordMapper.xml
src/main/resources/mapper/TraffAlarmRecordMapper.xml
+1
-1
src/main/resources/templates/addtask.html
src/main/resources/templates/addtask.html
+14
-4
No files found.
pom.xml
View file @
12254c87
...
@@ -93,10 +93,6 @@
...
@@ -93,10 +93,6 @@
<version>
1.9
</version>
<version>
1.9
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
junit
</groupId>
<groupId>
junit
</groupId>
...
@@ -120,15 +116,9 @@
...
@@ -120,15 +116,9 @@
<artifactId>
spring-boot-starter-quartz
</artifactId>
<artifactId>
spring-boot-starter-quartz
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-io
</groupId>
<groupId>
commons-httpclient
</groupId>
<artifactId>
commons-io
</artifactId>
<artifactId>
commons-httpclient
</artifactId>
<version>
2.6
</version>
<version>
3.1
</version>
</dependency>
<dependency>
<groupId>
commons-net
</groupId>
<artifactId>
commons-net
</artifactId>
<version>
3.6
</version>
</dependency>
</dependency>
<!-- redis -->
<!-- redis -->
...
@@ -142,12 +132,6 @@
...
@@ -142,12 +132,6 @@
<groupId>
org.springframework.kafka
</groupId>
<groupId>
org.springframework.kafka
</groupId>
<artifactId>
spring-kafka
</artifactId>
<artifactId>
spring-kafka
</artifactId>
</dependency>
</dependency>
<!-- HttpClient依赖 -->
<dependency>
<groupId>
commons-httpclient
</groupId>
<artifactId>
commons-httpclient
</artifactId>
<version>
3.1
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<artifactId>
fastjson
</artifactId>
...
...
src/main/java/com/cx/cn/cxquartz/config/ScheduleTaskConfig.java
View file @
12254c87
package
com
.
cx
.
cn
.
cxquartz
.
config
;
package
com
.
cx
.
cn
.
cxquartz
.
config
;
import
com.cx.cn.cxquartz.service.quartz.SbtdspsrService
;
import
com.cx.cn.cxquartz.util.RestUtil
;
import
com.cx.cn.cxquartz.vo.Sbtdspsr
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.List
;
@Configuration
@Configuration
@EnableScheduling
@EnableScheduling
public
class
ScheduleTaskConfig
{
public
class
ScheduleTaskConfig
{
@Autowired
private
SbtdspsrService
sbtdspsrService
;
@Value
(
"${file.getrtspbyurl}"
)
private
String
getrtspbyurl
;
RestUtil
restUtil
=
new
RestUtil
();
/***
/***
* 每隔20分钟执行一遍判断rtsp 是否变换
* 每隔20分钟执行一遍判断rtsp 是否变换
*/
*/
@Scheduled
(
cron
=
"0 0 2 * * ? "
)
@Scheduled
(
cron
=
"0 0 2 * * ? "
)
private
void
statis
()
{
private
void
statis
()
{
//查询所有监控设备,更新rtsp 地址
List
<
Sbtdspsr
>
sbtdpsrList
=
sbtdspsrService
.
list
();
//调用decice 端口获得新的rtsp 地址,如果与表里的一样无需更新,不一样则立即更新
for
(
Sbtdspsr
sbtd:
sbtdpsrList
)
{
restUtil
.
rtspChangeVlue
(
sbtd
.
getSbbh
(),
sbtd
.
getSqurllj
(),
getrtspbyurl
);
}
}
}
...
...
src/main/java/com/cx/cn/cxquartz/controller/ExtController.java
View file @
12254c87
This diff is collapsed.
Click to expand it.
src/main/java/com/cx/cn/cxquartz/controller/IndexController.java
View file @
12254c87
...
@@ -35,7 +35,7 @@ public class IndexController {
...
@@ -35,7 +35,7 @@ public class IndexController {
@Autowired
@Autowired
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Value
(
"${ftppath}"
)
@Value
(
"${f
ile.f
tppath}"
)
private
String
ftppath
;
private
String
ftppath
;
@Autowired
@Autowired
...
...
src/main/java/com/cx/cn/cxquartz/controller/QuartzController.java
View file @
12254c87
...
@@ -45,7 +45,7 @@ public class QuartzController {
...
@@ -45,7 +45,7 @@ public class QuartzController {
private
String
rtspurl
;
private
String
rtspurl
;
@Value
(
"${ftppath}"
)
@Value
(
"${f
ile.f
tppath}"
)
private
String
ftppath
;
private
String
ftppath
;
...
...
src/main/java/com/cx/cn/cxquartz/service/quartz/SbtdspsrService.java
View file @
12254c87
...
@@ -9,6 +9,5 @@ public interface SbtdspsrService {
...
@@ -9,6 +9,5 @@ public interface SbtdspsrService {
List
<
Sbtdspsr
>
selectByRtsp
(
String
videoid
);
List
<
Sbtdspsr
>
selectByRtsp
(
String
videoid
);
List
<
Map
>
selectRecogByRtsp
(
String
rtsp
);
List
<
Map
>
selectRecogByRtsp
(
String
rtsp
);
int
updateRecogByRtsp
(
String
rtsp
,
String
devicecode
);
int
updateRecogByRtsp
(
String
rtsp
,
String
devicecode
);
List
<
Sbtdspsr
>
list
();
List
<
Sbtdspsr
>
list
();
}
}
src/main/java/com/cx/cn/cxquartz/service/quartz/impl/SbtdspsrImpl.java
View file @
12254c87
package
com
.
cx
.
cn
.
cxquartz
.
service
.
quartz
.
impl
;
package
com
.
cx
.
cn
.
cxquartz
.
service
.
quartz
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cx.cn.cxquartz.dao.SbtdspsrMapper
;
import
com.cx.cn.cxquartz.dao.SbtdspsrMapper
;
import
com.cx.cn.cxquartz.service.quartz.SbtdspsrService
;
import
com.cx.cn.cxquartz.service.quartz.SbtdspsrService
;
import
com.cx.cn.cxquartz.vo.Sbtdspsr
;
import
com.cx.cn.cxquartz.vo.Sbtdspsr
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
...
src/main/java/com/cx/cn/cxquartz/util/RestUtil.java
0 → 100644
View file @
12254c87
package
com
.
cx
.
cn
.
cxquartz
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cx.cn.cxquartz.controller.ExtController
;
import
com.cx.cn.cxquartz.service.quartz.SbtdspsrService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
RestUtil
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RestUtil
.
class
);
@Autowired
private
RestTemplate
restTemplate
;
@Autowired
SbtdspsrService
sbtdspsrService
;
public
String
getnewRtspVlue
(
String
devicecode
,
String
getrtspbyurl
){
String
rtspnewvalue
=
""
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"deviceCode"
,
devicecode
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getrtspbyurl
+
"?deviceCode={deviceCode}"
,
String
.
class
,
map
);
JSONObject
json
=
JSONObject
.
parseObject
(
responseEntity
.
getBody
());
if
(
null
!=
json
.
getString
(
"errorCode"
)
&&
json
.
getString
(
"errorCode"
).
equals
(
"0"
))
{
//返回rtsp 地址
json
=
JSONObject
.
parseObject
(
json
.
getString
(
"data"
));
if
(
null
!=
json
.
get
(
"rtspUri"
)
&&
!
""
.
equals
(
json
.
get
(
"rtspUri"
)))
{
rtspnewvalue
=
String
.
valueOf
(
json
.
get
(
"rtspUri"
));
if
(
rtspnewvalue
.
contains
(
"rtsp"
))
{
//更新sbtdspsr 地址
int
result
=
sbtdspsrService
.
updateRecogByRtsp
(
rtspnewvalue
,
devicecode
);
if
(
result
>
0
)
{
logger
.
info
(
"更新rtsp success"
);
}
else
{
logger
.
info
(
"设备"
+
devicecode
+
"不存在"
);
}
}
else
{
logger
.
info
(
"获取失败"
);
}
}
}
return
rtspnewvalue
;
}
public
void
rtspChangeVlue
(
String
devicecode
,
String
oldrtsp
,
String
getrtspbyurl
){
String
rtspnewvalue
=
""
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"deviceCode"
,
devicecode
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getrtspbyurl
+
"?deviceCode={deviceCode}"
,
String
.
class
,
map
);
JSONObject
json
=
JSONObject
.
parseObject
(
responseEntity
.
getBody
());
if
(
null
!=
json
.
getString
(
"errorCode"
)
&&
json
.
getString
(
"errorCode"
).
equals
(
"0"
))
{
//返回rtsp 地址
json
=
JSONObject
.
parseObject
(
json
.
getString
(
"data"
));
if
(
null
!=
json
.
get
(
"rtspUri"
)
&&
!
""
.
equals
(
json
.
get
(
"rtspUri"
)))
{
rtspnewvalue
=
String
.
valueOf
(
json
.
get
(
"rtspUri"
));
//与新获得的rtsp 比较,如果一样则不更新,否则更新
if
(
oldrtsp
.
contains
(
"rtsp"
)
&&
!
oldrtsp
.
equals
(
rtspnewvalue
))
{
//更新sbtdspsr 地址
int
result
=
sbtdspsrService
.
updateRecogByRtsp
(
rtspnewvalue
,
devicecode
);
if
(
result
>
0
)
{
logger
.
info
(
"更新rtsp success"
);
}
else
{
logger
.
info
(
"设备"
+
devicecode
+
"不存在"
);
}
}
else
{
logger
.
info
(
"获取失败"
);
}
}
}
}
public
void
getPicture
(
List
<
String
>
imgUrls
,
Map
<
String
,
Object
>
maps
,
HttpEntity
<
String
>
formEntity
,
String
rtspurl
)
{
ResponseEntity
<
String
>
exchange
=
restTemplate
.
exchange
(
rtspurl
+
"?url={rtspvalue}&refresh={refresh}"
,
HttpMethod
.
GET
,
formEntity
,
String
.
class
,
maps
);
if
(
null
!=
exchange
.
getBody
())
{
JSONObject
json
=
JSONObject
.
parseObject
(
exchange
.
getBody
());
if
(
null
!=
json
.
getString
(
"ret"
)
&&
json
.
getString
(
"ret"
).
equals
(
"0"
))
{
//获得图片地址
imgUrls
.
add
(
json
.
getString
(
"url"
));
}
}
}
}
src/main/resources/application.yml
View file @
12254c87
...
@@ -11,12 +11,12 @@ mybatis:
...
@@ -11,12 +11,12 @@ mybatis:
spring
:
spring
:
datasource
:
datasource
:
# url: jdbc:mysql://192.168.168.212:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
url
:
jdbc:mysql://192.168.168.110:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
#username: zn06
#password: znznzn8
url
:
jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
username
:
root
username
:
root
password
:
123456
password
:
123456
# url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
# username: root
# password: 123456
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
filters
:
stat
filters
:
stat
...
@@ -51,6 +51,4 @@ spring:
...
@@ -51,6 +51,4 @@ spring:
logging
:
logging
:
level
:
level
:
com.cx.cn.cxquartz.dao
:
com.cx.cn.cxquartz.dao
:
debug
debug
\ No newline at end of file
src/main/resources/file.properties
View file @
12254c87
...
@@ -20,6 +20,6 @@ eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraa
...
@@ -20,6 +20,6 @@ eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraa
countryside.appid
=
05744e80b2c211ebe32a8e271066b19e
countryside.appid
=
05744e80b2c211ebe32a8e271066b19e
countryside.appsecret
=
a55a8870b2e911ebe32a8e271066b19e
countryside.appsecret
=
a55a8870b2e911ebe32a8e271066b19e
countryside.tokenurl
=
http://countryside.51iwifi.com/gw/getAccessToken
countryside.tokenurl
=
http://countryside.51iwifi.com/gw/getAccessToken
file.publicpictureurl
=
http://zjh189.ncpoi.cc:10001
file.publicpictureurl
=
http://zjh189.ncpoi.cc:10001
/api/alg/files
ftppath
=
jiuling:9ling.cn@172.16.24.29:21
f
ile.f
tppath
=
jiuling:9ling.cn@172.16.24.29:21
src/main/resources/mapper/SbtdspsrMapper.xml
View file @
12254c87
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<select
id=
"selectRecogByRtsp"
parameterType=
"java.lang.String"
resultType=
"java.util.HashMap"
>
<select
id=
"selectRecogByRtsp"
parameterType=
"java.lang.String"
resultType=
"java.util.HashMap"
>
SELECT DISTINCT
SELECT DISTINCT
(select
concat(sbbh,"_",tdbh)
from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) videoid,
(select
sbbh
from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) videoid,
(select tdmc from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) tdmc,
(select tdmc from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) tdmc,
metatype,
metatype,
recordtype,
recordtype,
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
FROM
FROM
quartz_task_informations b
quartz_task_informations b
WHERE
WHERE
(videoid=#{rtsp} or executeparamter=#{rtsp})
(videoid=#{rtsp} or executeparamter=#{rtsp})
and recordtype is not null
</select>
</select>
<update
id=
"updateRecogByRtsp"
parameterType=
"java.util.HashMap"
>
<update
id=
"updateRecogByRtsp"
parameterType=
"java.util.HashMap"
>
...
...
src/main/resources/mapper/TraffAlarmRecordMapper.xml
View file @
12254c87
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
</update>
</update>
<select
id=
"getTraffAlarmRecordByProgress"
parameterType=
"java.util.HashMap"
resultType=
"com.cx.cn.cxquartz.vo.TraffAlarmRecord"
>
<select
id=
"getTraffAlarmRecordByProgress"
parameterType=
"java.util.HashMap"
resultType=
"com.cx.cn.cxquartz.vo.TraffAlarmRecord"
>
select * from traffalarmrecord where fdid=#{sbbh}
and channelid=#{tdbh}
and processstatus='-2'
select * from traffalarmrecord where fdid=#{sbbh} and processstatus='-2'
</select>
</select>
<update
id=
"updateTraffAlarmRecordProcess"
parameterType=
"com.cx.cn.cxquartz.vo.TraffAlarmRecord"
>
<update
id=
"updateTraffAlarmRecordProcess"
parameterType=
"com.cx.cn.cxquartz.vo.TraffAlarmRecord"
>
...
...
src/main/resources/templates/addtask.html
View file @
12254c87
...
@@ -72,7 +72,18 @@
...
@@ -72,7 +72,18 @@
</div>
</div>
<div
class=
"form-group"
><label
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label text-right"
>
监控id:
</label>
class=
"col-sm-2 control-label text-right"
>
监控id:
</label>
、
<select
class=
"form-control"
id=
"metatype"
>
<option
th:value=
"3DHCA343714GMCE"
山河村
</
option
>
<option
th:value=
"3DHCA34401BUXS9"
>
赵家上村
</option>
<option
th:value=
"3YSCA44524PUH3B"
>
3YSCA44524PUH3B
</option>
</select>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -81,8 +92,8 @@
...
@@ -81,8 +92,8 @@
id=
"videoid"
class=
"form-control"
style=
"width:65%;float: left"
>
id=
"videoid"
class=
"form-control"
style=
"width:65%;float: left"
>
<a
id=
"getrtsp"
href=
" javascript:void(0)"
<a
id=
"getrtsp"
href=
" javascript:void(0)"
style=
"float: left;padding-left: 12px;padding-top: 10px;"
>
获得监控图片
</a>
style=
"float: left;padding-left: 12px;padding-top: 10px;"
>
获得监控图片
</a>
<
a
id=
"getwidth"
href=
" javascript:void(0)"
<
!--<a id="getwidth" href=" javascript:void(0)"-->
style=
"float: left;padding-left: 12px;padding-top: 10px;"
>
编辑监控范围
</a
>
<!--style="float: left;padding-left: 12px;padding-top: 10px;">编辑监控范围</a>--
>
</div>
</div>
</div>
</div>
...
@@ -95,7 +106,6 @@
...
@@ -95,7 +106,6 @@
</
option
>
</
option
>
<option
th:value=
"2"
>
<option
th:value=
"2"
>
行人、骑行、车辆检测识别
行人、骑行、车辆检测识别
</option>
</option>
<option
th:value=
"3"
>
<option
th:value=
"3"
>
人脸检测识别
人脸检测识别
...
...
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