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
56a562b4
Commit
56a562b4
authored
May 21, 2021
by
yzm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dx界面完善
parent
37a7ec1c
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1115 additions
and
638 deletions
+1115
-638
pom.xml
pom.xml
+1
-0
src/main/java/com/cx/cn/cxquartz/controller/ExtController.java
...ain/java/com/cx/cn/cxquartz/controller/ExtController.java
+158
-127
src/main/java/com/cx/cn/cxquartz/controller/QuartzController.java
.../java/com/cx/cn/cxquartz/controller/QuartzController.java
+43
-24
src/main/java/com/cx/cn/cxquartz/controller/SbtdspsrController.java
...ava/com/cx/cn/cxquartz/controller/SbtdspsrController.java
+6
-123
src/main/java/com/cx/cn/cxquartz/dao/SbtdspsrMapper.java
src/main/java/com/cx/cn/cxquartz/dao/SbtdspsrMapper.java
+1
-1
src/main/java/com/cx/cn/cxquartz/service/quartz/SbtdspsrService.java
...va/com/cx/cn/cxquartz/service/quartz/SbtdspsrService.java
+2
-0
src/main/java/com/cx/cn/cxquartz/service/quartz/impl/SbtdspsrImpl.java
.../com/cx/cn/cxquartz/service/quartz/impl/SbtdspsrImpl.java
+5
-0
src/main/java/com/cx/cn/cxquartz/util/FileTransferManager.java
...ain/java/com/cx/cn/cxquartz/util/FileTransferManager.java
+31
-1
src/main/java/com/cx/cn/cxquartz/util/RestTemplateConfig.java
...main/java/com/cx/cn/cxquartz/util/RestTemplateConfig.java
+2
-2
src/main/java/com/cx/cn/cxquartz/vo/ImageList.java
src/main/java/com/cx/cn/cxquartz/vo/ImageList.java
+10
-9
src/main/java/com/cx/cn/cxquartz/vo/Output.java
src/main/java/com/cx/cn/cxquartz/vo/Output.java
+40
-40
src/main/java/com/cx/cn/cxquartz/vo/TraffpictureParam.java
src/main/java/com/cx/cn/cxquartz/vo/TraffpictureParam.java
+10
-0
src/main/resources/application.yml
src/main/resources/application.yml
+8
-4
src/main/resources/file.properties
src/main/resources/file.properties
+1
-0
src/main/resources/mapper/QuartzTaskInformationsMapper.xml
src/main/resources/mapper/QuartzTaskInformationsMapper.xml
+3
-2
src/main/resources/mapper/SbtdspsrMapper.xml
src/main/resources/mapper/SbtdspsrMapper.xml
+28
-3
src/main/resources/mapper/TraffPictureMapper.xml
src/main/resources/mapper/TraffPictureMapper.xml
+1
-1
src/main/resources/templates/addtask.html
src/main/resources/templates/addtask.html
+398
-12
src/main/resources/templates/index.html
src/main/resources/templates/index.html
+32
-13
src/main/resources/templates/updatetask.html
src/main/resources/templates/updatetask.html
+335
-276
No files found.
pom.xml
View file @
56a562b4
...
...
@@ -136,6 +136,7 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<!--kafka依赖-->
<dependency>
<groupId>
org.springframework.kafka
</groupId>
...
...
src/main/java/com/cx/cn/cxquartz/controller/ExtController.java
View file @
56a562b4
This diff is collapsed.
Click to expand it.
src/main/java/com/cx/cn/cxquartz/controller/QuartzController.java
View file @
56a562b4
...
...
@@ -4,10 +4,14 @@ package com.cx.cn.cxquartz.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.cx.cn.cxquartz.bean.QuartzTaskErrors
;
import
com.cx.cn.cxquartz.bean.QuartzTaskInformations
;
import
com.cx.cn.cxquartz.service.quartz.FtpService
;
import
com.cx.cn.cxquartz.service.quartz.QuartzService
;
import
com.cx.cn.cxquartz.service.quartz.SbtdspsrService
;
import
com.cx.cn.cxquartz.util.FTPUtil
;
import
com.cx.cn.cxquartz.util.FileTransferManager
;
import
com.cx.cn.cxquartz.util.ResultEnum
;
import
com.cx.cn.cxquartz.util.ResultUtil
;
import
com.cx.cn.cxquartz.vo.Ftp
;
import
com.cx.cn.cxquartz.vo.QuartzTaskRecordsVo
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -46,6 +50,9 @@ public class QuartzController {
@Autowired
private
RestTemplate
restTemplate
;
@Autowired
FtpService
ftpService
;
@RequestMapping
(
value
=
"/add/taskpage"
,
method
=
RequestMethod
.
GET
)
public
String
addTaskpage
()
{
return
"addtask"
;
...
...
@@ -55,7 +62,7 @@ public class QuartzController {
@RequestMapping
(
value
=
"/add/task"
,
method
=
RequestMethod
.
POST
)
public
String
addTask
(
QuartzTaskInformations
taskInformations
)
{
try
{
taskInformations
.
setSchedulerrule
(
"*/"
+
taskInformations
.
getSchedulerrule
()+
" * * * * ?"
);
taskInformations
.
setSchedulerrule
(
"*/"
+
taskInformations
.
getSchedulerrule
()
+
" * * * * ?"
);
String
result
=
quartzService
.
addTask
(
taskInformations
);
return
result
;
}
catch
(
Exception
e
)
{
...
...
@@ -67,7 +74,7 @@ public class QuartzController {
@RequestMapping
(
value
=
"/edit/taskpage"
,
method
=
RequestMethod
.
GET
)
public
String
editTaskpage
(
Model
model
,
String
id
)
{
QuartzTaskInformations
taskInformation
=
quartzService
.
getTaskById
(
id
);
taskInformation
.
setSchedulerrule
(
taskInformation
.
getSchedulerrule
().
replaceAll
(
"\\?"
,
""
).
replaceAll
(
"\\*"
,
""
).
replaceAll
(
"\\/"
,
""
));
taskInformation
.
setSchedulerrule
(
taskInformation
.
getSchedulerrule
().
replaceAll
(
"\\?"
,
""
).
replaceAll
(
"\\*"
,
""
).
replaceAll
(
"\\/"
,
""
));
model
.
addAttribute
(
"taskInformation"
,
taskInformation
);
return
"updatetask"
;
}
...
...
@@ -76,11 +83,14 @@ public class QuartzController {
@RequestMapping
(
value
=
"/edit/task"
,
method
=
RequestMethod
.
POST
)
public
String
editTask
(
QuartzTaskInformations
taskInformations
)
{
try
{
taskInformations
.
setSchedulerrule
(
"*/"
+
taskInformations
.
getSchedulerrule
()+
" * * * * ?"
);
taskInformations
.
setSchedulerrule
(
"*/"
+
taskInformations
.
getSchedulerrule
()
+
" * * * * ?"
);
String
result
=
quartzService
.
updateTask
(
taskInformations
);
if
(
null
!=
taskInformations
.
getExecuteparamter
()
&&
!
taskInformations
.
getExecuteparamter
().
contains
(
"rtsp:"
))
{
int
upresult
=
sbtdspsrService
.
updateRecogByRtsp
(
taskInformations
.
getRtsp
(),
taskInformations
.
getVideoid
());
if
(
upresult
>
0
)
{
logger
.
info
(
"更新sbtddspsr squrllj 的值为:"
+
taskInformations
.
getExecuteparamter
());
logger
.
info
(
"更新sbtddspsr squrllj 的值为:"
+
taskInformations
.
getExecuteparamter
());
}
}
return
result
;
}
catch
(
Exception
e
)
{
...
...
@@ -177,33 +187,42 @@ public class QuartzController {
return
"redirect:/"
;
}
}
@RequestMapping
(
value
=
"/getRtsp/{devicecode}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getRtsp"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
String
getRTSP
(
@
PathVariable
(
"devicecode"
)
String
devicecode
)
{
public
String
getRTSP
(
@
RequestBody
JSONObject
devicecode
)
{
//判断rtsp 是否过期http://212.129.142.17:8281/gh/device/test?deviceCode=3YSCA44445TFCPX
//判断是否是rtsp 地址
String
rtspValue
=
devicecode
.
getString
(
"data"
);
if
(!
rtspValue
.
contains
(
"rtsp://"
))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"deviceCode"
,
devicecod
e
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getrtspbyurl
+
"?deviceCode={deviceCode}"
,
String
.
class
,
map
);
map
.
put
(
"deviceCode"
,
rtspValu
e
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getrtspbyurl
+
"?deviceCode={deviceCode}"
,
String
.
class
,
map
);
JSONObject
json
=
JSONObject
.
parseObject
(
responseEntity
.
getBody
());
if
(
null
!=
json
.
getString
(
"code"
)
&&
json
.
getString
(
"code"
).
equals
(
"0"
))
{
//返回rtsp 地址,更新 sbtdspsr 地址
String
rtspValue
=
String
.
valueOf
(
json
.
get
(
"obj"
));
rtspValue
=
String
.
valueOf
(
json
.
get
(
"obj"
));
}
}
//获得抽帧图片
Map
maps
=
new
HashMap
<>();
maps
.
put
(
"rtspvalue"
,
rtspValue
);
maps
.
put
(
"refresh"
,
1
);
maps
.
put
(
"rtspvalue"
,
rtspValue
);
maps
.
put
(
"refresh"
,
1
);
try
{
ResponseEntity
<
String
>
result
=
restTemplate
.
exchange
(
rtspurl
+
"?url={rtspvalue}&refresh={refresh}"
,
HttpMethod
.
GET
,
null
,
String
.
class
,
maps
);
JSONObject
jsonresult
=
JSONObject
.
parseObject
(
result
.
getBody
());
if
(
null
!=
jsonresult
.
getString
(
"ret"
)
&&
jsonresult
.
getString
(
"ret"
).
equals
(
"0"
))
{
if
(
null
!=
jsonresult
.
getString
(
"ret"
)
&&
jsonresult
.
getString
(
"ret"
).
equals
(
"0"
)
&&
!
""
.
equals
(
jsonresult
.
getString
(
"url"
))
)
{
//获得图片地址,存放到ftp上面
return
ResultUtil
.
success
(
ResultEnum
.
SUCCESS
.
getCode
(),
jsonresult
.
getString
(
"url"
)+
","
+
json
.
get
(
"obj"
));
//将图片存储到ftp 上去,jsonresult.getString("url")
Ftp
ftp
=
ftpService
.
reloadFtp
();
String
ftpfilepath
=
FileTransferManager
.
urlTransToFtp
(
jsonresult
.
getString
(
"url"
),
ftp
,
"gstraff/picturedemo/"
);
return
ResultUtil
.
success
(
ResultEnum
.
SUCCESS
.
getCode
(),
jsonresult
.
getString
(
"url"
)+
","
+
rtspValue
);
}
}
else
{
logger
.
info
(
"未获取到监控rtsp"
);
return
ResultUtil
.
fail
();
}
catch
(
Exception
ex
)
{
return
ResultUtil
.
fail
();
}
return
ResultUtil
.
success
();
}
}
src/main/java/com/cx/cn/cxquartz/controller/SbtdspsrController.java
View file @
56a562b4
...
...
@@ -5,9 +5,11 @@ import com.cx.cn.cxquartz.bean.QuartzTaskErrors;
import
com.cx.cn.cxquartz.bean.QuartzTaskInformations
;
import
com.cx.cn.cxquartz.service.quartz.QuartzService
;
import
com.cx.cn.cxquartz.service.quartz.QuartzTaskRecordsService
;
import
com.cx.cn.cxquartz.service.quartz.SbtdspsrService
;
import
com.cx.cn.cxquartz.util.ResultEnum
;
import
com.cx.cn.cxquartz.util.ResultUtil
;
import
com.cx.cn.cxquartz.vo.QuartzTaskRecordsVo
;
import
com.cx.cn.cxquartz.vo.Sbtdspsr
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -28,7 +30,7 @@ public class SbtdspsrController {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SbtdspsrController
.
class
);
@Autowired
private
QuartzService
quartz
Service
;
private
SbtdspsrService
sbtdspsr
Service
;
...
...
@@ -37,130 +39,11 @@ public class SbtdspsrController {
return
"addtask"
;
}
@ResponseBody
@RequestMapping
(
value
=
"/add/task"
,
method
=
RequestMethod
.
POST
)
public
String
addTask
(
QuartzTaskInformations
taskInformations
)
{
try
{
String
result
=
quartzService
.
addTask
(
taskInformations
);
return
result
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"/add/task exception={}"
,
e
);
return
ResultUtil
.
fail
();
}
}
@RequestMapping
(
value
=
"/edit/taskpage"
,
method
=
RequestMethod
.
GET
)
public
String
editTaskpage
(
Model
model
,
String
id
)
{
QuartzTaskInformations
taskInformation
=
quartzService
.
getTaskById
(
id
);
model
.
addAttribute
(
"taskInformation"
,
taskInformation
);
return
"updatetask"
;
}
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@RequestMapping
(
value
=
"/edit/task"
,
method
=
RequestMethod
.
POST
)
public
String
editTask
(
QuartzTaskInformations
taskInformations
)
{
try
{
QuartzTaskInformations
resultTaskInformations
=
quartzService
.
getTaskById
(
taskInformations
.
getTaskno
());
String
result
=
quartzService
.
updateTask
(
taskInformations
);
//判断corn 是否改变,改变重新生成任务
if
(!
resultTaskInformations
.
getSchedulerrule
().
equals
(
taskInformations
.
getSchedulerrule
()))
{
//重新启动,重新发布新的任务
quartzService
.
startJob
(
taskInformations
.
getTaskno
());
}
return
result
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"/edit/task exception={}"
,
e
);
return
ResultUtil
.
fail
();
}
}
/**
* 启动 或者 暂定定时任务
*
* @param taskNo
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/list/optionjob"
,
method
=
RequestMethod
.
GET
)
public
String
optionJob
(
String
taskNo
)
{
logger
.
info
(
""
);
if
(
StringUtils
.
isEmpty
(
taskNo
))
{
return
ResultUtil
.
success
(
ResultEnum
.
PARAM_EMPTY
.
getCode
(),
ResultEnum
.
PARAM_EMPTY
.
getMessage
());
}
try
{
return
quartzService
.
startJob
(
taskNo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"/list/optionjob exception={}"
,
e
);
return
ResultUtil
.
fail
();
}
}
public
List
<
Sbtdspsr
>
list
()
{
return
sbtdspsrService
.
list
();
/**
* 定时任务执行情况
*
* @param taskNo
* @param model
* @return
*/
@RequestMapping
(
value
=
"/taskrecords"
,
method
=
RequestMethod
.
GET
)
public
String
taskRecordsPage
(
@RequestParam
(
value
=
"taskno"
,
required
=
false
)
String
taskNo
,
Model
model
)
{
logger
.
info
(
""
);
try
{
if
(
StringUtils
.
isEmpty
(
taskNo
))
{
return
"redirect:/"
;
}
List
<
QuartzTaskRecordsVo
>
quartzTaskRecords
=
quartzService
.
taskRecords
(
taskNo
);
model
.
addAttribute
(
"quartzTaskRecords"
,
quartzTaskRecords
);
}
catch
(
Exception
e
)
{
logger
.
error
(
""
);
return
"redirect:/"
;
}
return
"taskrecords"
;
}
/**
* 立即运行一次定时任务
*
* @param taskNo
* @param model
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/runtask/rightnow"
,
method
=
RequestMethod
.
GET
)
public
String
runTaskRightNow
(
@RequestParam
(
value
=
"taskno"
,
required
=
false
)
String
taskNo
,
Model
model
)
{
logger
.
info
(
""
);
try
{
if
(
StringUtils
.
isEmpty
(
taskNo
))
{
return
ResultUtil
.
success
(
ResultEnum
.
PARAM_EMPTY
.
getCode
(),
ResultEnum
.
PARAM_EMPTY
.
getMessage
());
}
return
quartzService
.
runTaskRightNow
(
taskNo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
""
);
return
ResultUtil
.
success
(
ResultEnum
.
FAIL
.
getCode
(),
ResultEnum
.
FAIL
.
getMessage
());
}
}
/**
* 定时任务失败详情
*
* @param recordId
* @param model
* @return
*/
@RequestMapping
(
value
=
"/task/errors"
,
method
=
RequestMethod
.
GET
)
public
String
detailTaskErrors
(
@RequestParam
(
value
=
"recordid"
,
required
=
false
)
String
recordId
,
Model
model
)
{
logger
.
info
(
""
);
try
{
if
(
StringUtils
.
isEmpty
(
recordId
))
{
return
ResultUtil
.
success
(
ResultEnum
.
PARAM_EMPTY
.
getCode
(),
ResultEnum
.
PARAM_EMPTY
.
getMessage
());
}
QuartzTaskErrors
taskErrors
=
quartzService
.
detailTaskErrors
(
recordId
);
model
.
addAttribute
(
"taskErrors"
,
taskErrors
);
return
"taskerrors"
;
}
catch
(
Exception
e
)
{
logger
.
error
(
""
);
return
"redirect:/"
;
}
}
}
src/main/java/com/cx/cn/cxquartz/dao/SbtdspsrMapper.java
View file @
56a562b4
...
...
@@ -11,7 +11,7 @@ import java.util.Map;
@Mapper
public
interface
SbtdspsrMapper
{
List
<
Sbtdspsr
>
selectByRtsp
(
String
rtsp
);
List
<
Sbtdspsr
>
list
(
);
List
<
Map
>
selectRecogByRtsp
(
String
rtsp
);
int
updateRecogByRtsp
(
Map
map
);
}
src/main/java/com/cx/cn/cxquartz/service/quartz/SbtdspsrService.java
View file @
56a562b4
...
...
@@ -9,4 +9,6 @@ public interface SbtdspsrService {
List
<
Sbtdspsr
>
selectByRtsp
(
String
videoid
);
List
<
Map
>
selectRecogByRtsp
(
String
rtsp
);
int
updateRecogByRtsp
(
String
rtsp
,
String
devicecode
);
List
<
Sbtdspsr
>
list
();
}
src/main/java/com/cx/cn/cxquartz/service/quartz/impl/SbtdspsrImpl.java
View file @
56a562b4
...
...
@@ -35,4 +35,9 @@ public class SbtdspsrImpl implements SbtdspsrService {
return
sbtdspsrMapper
.
updateRecogByRtsp
(
map
);
}
@Override
public
List
<
Sbtdspsr
>
list
()
{
return
sbtdspsrMapper
.
list
();
}
}
src/main/java/com/cx/cn/cxquartz/util/FileTransferManager.java
View file @
56a562b4
...
...
@@ -20,7 +20,7 @@ import java.util.concurrent.TimeUnit;
public
class
FileTransferManager
{
private
static
CompletionService
<
TransferResult
>
completionService
=
new
ExecutorCompletionService
<
TransferResult
>(
ThreadPoolUtil
.
getPool
());
private
static
CompletionService
<
PictureResult
>
threadService
=
new
ExecutorCompletionService
<
PictureResult
>(
ThreadPoolUtil
.
getPool
());
private
static
CompletionService
<
String
>
threadService
=
new
ExecutorCompletionService
<
String
>(
ThreadPoolUtil
.
getPool
());
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ExtController
.
class
);
/**
* @param transferRecord
...
...
@@ -168,6 +168,36 @@ public class FileTransferManager {
}
}
public
static
String
urlTransToFtp
(
String
url
,
final
Ftp
ftp
,
final
String
basePath
){
threadService
.
submit
(()
->
{
try
{
HttpURLConnection
connection
=
(
HttpURLConnection
)
new
URL
(
url
).
openConnection
();
connection
.
setReadTimeout
(
2000
);
//延迟连接
connection
.
setConnectTimeout
(
3000
);
connection
.
setRequestMethod
(
"GET"
);
if
(
connection
.
getResponseCode
()
==
HttpURLConnection
.
HTTP_OK
||
connection
.
getResponseCode
()==
HttpURLConnection
.
HTTP_NOT_MODIFIED
)
{
InputStream
inputStream
=
connection
.
getInputStream
();
String
pname
=
DateUtils
.
formatCurrDayNoSign
()
+
".jpg"
;
String
ftputl
=
FTPUtil
.
getFtpUrl
(
ftp
)
+
basePath
+
pname
;
boolean
r
=
FTPUtil
.
uploadFile
(
ftp
,
basePath
,
pname
,
inputStream
);
if
(
r
)
{
return
ftputl
;
}
}
else
{
log
.
error
(
"connection code: "
+
connection
.
getResponseCode
());
}
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
e
.
toString
());
log
.
error
(
e
.
toString
());
}
return
url
;
});
try
{
return
threadService
.
poll
(
10
,
TimeUnit
.
SECONDS
).
get
();
}
catch
(
Exception
ex
){
return
url
;
}
}
}
src/main/java/com/cx/cn/cxquartz/util/RestTemplateConfig.java
View file @
56a562b4
...
...
@@ -16,8 +16,8 @@ public class RestTemplateConfig {
@Bean
public
ClientHttpRequestFactory
simpleClientHttpRequestFactory
(){
SimpleClientHttpRequestFactory
factory
=
new
SimpleClientHttpRequestFactory
();
factory
.
setConnectTimeout
(
15000
);
factory
.
setReadTimeout
(
5
000
);
factory
.
setConnectTimeout
(
15000
0
);
factory
.
setReadTimeout
(
150
000
);
return
factory
;
}
}
src/main/java/com/cx/cn/cxquartz/vo/ImageList.java
View file @
56a562b4
...
...
@@ -10,11 +10,12 @@ public class ImageList {
private
Long
[]
Roi
;
private
Integer
RoiPadding
;
//
private Integer RoiPadding;
private
Integer
CropObjectImage
;
private
Integer
CropObjectImagePadding
;
private
Integer
CropObjectImageQuality
;
@JSONField
(
name
=
"Roi"
)
public
Long
[]
getRoi
()
{
return
Roi
;
}
...
...
@@ -23,13 +24,13 @@ public class ImageList {
Roi
=
roi
;
}
public
Integer
getRoiPadding
()
{
return
RoiPadding
;
}
public
void
setRoiPadding
(
Integer
roiPadding
)
{
RoiPadding
=
roiPadding
;
}
//
public Integer getRoiPadding() {
//
return RoiPadding;
//
}
//
//
public void setRoiPadding(Integer roiPadding) {
//
RoiPadding = roiPadding;
//
}
public
Integer
getCropObjectImage
()
{
return
CropObjectImage
;
...
...
@@ -68,7 +69,7 @@ public class ImageList {
public
ImageList
(
String
imageID
,
Long
[]
roi
,
Integer
roiPadding
,
Integer
cropObjectImage
,
Integer
cropObjectImagePadding
,
Integer
cropObjectImageQuality
,
String
data
)
{
ImageID
=
imageID
;
Roi
=
roi
;
RoiPadding
=
roiPadding
;
//
RoiPadding = roiPadding;
CropObjectImage
=
cropObjectImage
;
CropObjectImagePadding
=
cropObjectImagePadding
;
CropObjectImageQuality
=
cropObjectImageQuality
;
...
...
src/main/java/com/cx/cn/cxquartz/vo/Output.java
View file @
56a562b4
...
...
@@ -6,22 +6,22 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
public
class
Output
{
private
int
SubClass
;
//最大行人细类输出个数为1
@JsonIgnore
private
int
MaxHumanSubClassNum
;
//最大车辆细类输出个数为输出全部
@JsonIgnore
private
int
MaxVehicleSubClassNum
;
//最大骑行细类输出个数为3
@JsonIgnore
private
int
MaxBikeSubClassNum
;
//
//最大行人细类输出个数为1
//
@JsonIgnore
//
private int MaxHumanSubClassNum;
//
//
//最大车辆细类输出个数为输出全部
//
@JsonIgnore
//
private int MaxVehicleSubClassNum;
//
//最大骑行细类输出个数为3
//
@JsonIgnore
//
private int MaxBikeSubClassNum;
public
Output
(
int
subClass
,
int
maxHumanSubClassNum
,
int
maxVehicleSubClassNum
,
int
maxBikeSubClassNum
)
{
SubClass
=
subClass
;
MaxHumanSubClassNum
=
maxHumanSubClassNum
;
MaxVehicleSubClassNum
=
maxVehicleSubClassNum
;
MaxBikeSubClassNum
=
maxBikeSubClassNum
;
//
MaxHumanSubClassNum = maxHumanSubClassNum;
//
MaxVehicleSubClassNum = maxVehicleSubClassNum;
//
MaxBikeSubClassNum = maxBikeSubClassNum;
}
public
void
setSubClass
(
int
SubClass
)
{
...
...
@@ -32,31 +32,31 @@ public class Output {
public
int
getSubClass
()
{
return
this
.
SubClass
;
}
public
void
setMaxHumanSubClassNum
(
int
MaxHumanSubClassNum
)
{
this
.
MaxHumanSubClassNum
=
MaxHumanSubClassNum
;
}
@JSONField
(
name
=
"MaxHumanSubClassNum"
)
public
int
getMaxHumanSubClassNum
()
{
return
this
.
MaxHumanSubClassNum
;
}
public
void
setMaxVehicleSubClassNum
(
int
MaxVehicleSubClassNum
)
{
this
.
MaxVehicleSubClassNum
=
MaxVehicleSubClassNum
;
}
@JSONField
(
name
=
"MaxVehicleSubClassNum"
)
public
int
getMaxVehicleSubClassNum
()
{
return
this
.
MaxVehicleSubClassNum
;
}
public
void
setMaxBikeSubClassNum
(
int
MaxBikeSubClassNum
)
{
this
.
MaxBikeSubClassNum
=
MaxBikeSubClassNum
;
}
@JSONField
(
name
=
"MaxBikeSubClassNum"
)
public
int
getMaxBikeSubClassNum
()
{
return
this
.
MaxBikeSubClassNum
;
}
//
//
public void setMaxHumanSubClassNum(int MaxHumanSubClassNum) {
//
this.MaxHumanSubClassNum = MaxHumanSubClassNum;
//
}
//
//
@JSONField(name = "MaxHumanSubClassNum")
//
public int getMaxHumanSubClassNum() {
//
return this.MaxHumanSubClassNum;
//
}
//
//
public void setMaxVehicleSubClassNum(int MaxVehicleSubClassNum) {
//
this.MaxVehicleSubClassNum = MaxVehicleSubClassNum;
//
}
//
//
@JSONField(name = "MaxVehicleSubClassNum")
//
public int getMaxVehicleSubClassNum() {
//
return this.MaxVehicleSubClassNum;
//
}
//
//
public void setMaxBikeSubClassNum(int MaxBikeSubClassNum) {
//
this.MaxBikeSubClassNum = MaxBikeSubClassNum;
//
}
//
//
@JSONField(name = "MaxBikeSubClassNum")
//
public int getMaxBikeSubClassNum() {
//
return this.MaxBikeSubClassNum;
//
}
}
src/main/java/com/cx/cn/cxquartz/vo/TraffpictureParam.java
View file @
56a562b4
...
...
@@ -68,6 +68,16 @@ public class TraffpictureParam extends Traffpicture {
@JsonIgnore
private
Integer
objh
;
private
String
metatype
;
public
String
getMetatype
()
{
return
metatype
;
}
public
void
setMetatype
(
String
metatype
)
{
this
.
metatype
=
metatype
;
}
public
Integer
getObjx
()
{
return
objx
;
}
...
...
src/main/resources/application.yml
View file @
56a562b4
...
...
@@ -38,15 +38,19 @@ spring:
enabled
:
true
encoding
:
UTF-8
mode
:
HTML
redis
:
database
:
0
host
:
172.16.24.29
port
:
6379
#logging:
# level:
# root:
# info
logging
:
level
:
com.cx.cn.cxquartz.dao
:
debug
#
logging:
#
level:
#
com.cx.cn.cxquartz.dao:
#
debug
src/main/resources/file.properties
View file @
56a562b4
...
...
@@ -12,3 +12,4 @@ file.rtspurl=http://172.16.24.29:8081/getrealcamerasnapshot.php
file.recogurl
=
http://172.16.24.29:9098/images/recog
redis.cachekey.ftplist
=
gs:traff:global:cache:ftplist
file.getrtspbyurl
=
http://212.129.142.17:8281/gh/device/test
src/main/resources/mapper/QuartzTaskInformationsMapper.xml
View file @
56a562b4
...
...
@@ -59,7 +59,7 @@
taskName, schedulerRule, frozenStatus,
executorNo, frozenTime, unfrozenTime,
createTime, lastModifyTime, sendType,
url, executeParamter, timeKey,objectx,objecty,
p
bjectw,objecth,recordtype,metatype,
url, executeParamter, timeKey,objectx,objecty,
o
bjectw,objecth,recordtype,metatype,
rtsp,imgsrc,videoid
)
values (#{id,jdbcType=BIGINT}, #{version,jdbcType=INTEGER}, #{taskno,jdbcType=VARCHAR},
...
...
@@ -70,9 +70,10 @@
#{executeparamter,jdbcType=VARCHAR}, #{timekey,jdbcType=VARCHAR}
, #{objectx,jdbcType=BIGINT}
, #{objecty,jdbcType=BIGINT}
, #{
p
bjectw,jdbcType=BIGINT}
, #{
o
bjectw,jdbcType=BIGINT}
, #{objecth,jdbcType=BIGINT}
, #{recordtype,jdbcType=VARCHAR}
, #{metatype,jdbcType=VARCHAR}
, #{rtsp,jdbcType=VARCHAR}
, #{imgsrc,jdbcType=VARCHAR}
, #{videoid,jdbcType=VARCHAR}
...
...
src/main/resources/mapper/SbtdspsrMapper.xml
View file @
56a562b4
...
...
@@ -5,18 +5,43 @@
<result
column=
"sbbh"
jdbcType=
"VARCHAR"
property=
"sbbh"
/>
<result
column=
"tdbh"
jdbcType=
"INTEGER"
property=
"tdbh"
/>
<result
column=
"xzbh"
jdbcType=
"VARCHAR"
property=
"xzbh"
/>
<result
column=
"tdmc"
jdbcType=
"VARCHAR"
property=
"tdmc"
/>
</resultMap>
<select
id=
"selectByRtsp"
parameterType=
"java.lang.String"
resultType=
"com.cx.cn.cxquartz.vo.Sbtdspsr"
>
select * from sbtdspsr where sbbh = #{videoid}
select * from sbtdspsr where sbbh = #{videoid}
or squrllj =#{rtsp}
</select>
<select
id=
"selectRecogByRtsp"
parameterType=
"java.lang.String"
resultType=
"java.util.HashMap"
>
select distinct metatype,recordtype ,objectx,objecty,objectw,objecth from quartz_task_informations where videoid=#{rtsp}
SELECT DISTINCT
metatype,
recordtype,
objectx,
objecty,
objectw,
objecth,(
SELECT
concat( sbbh, '_', tdbh )
FROM
sbtdspsr
WHERE squrllj =#{rtsp}
OR (
sbbh = substring_index( #{rtsp}, '_', 1 )
AND tdbh = substring_index( #{rtsp}, '_',- 1 ))) videoid
FROM
quartz_task_informations
WHERE
videoid =#{rtsp}
OR executeParamter =#{rtsp}
</select>
<update
id=
"updateRecogByRtsp"
parameterType=
"java.util.HashMap"
>
update sbtdspsr set squrllj= #{rtsp} where sbbh=#{devicecode}
</update>
<select
id=
"list"
resultType=
"com.cx.cn.cxquartz.vo.Sbtdspsr"
>
select * from sbtdspsr
</select>
</mapper>
src/main/resources/mapper/TraffPictureMapper.xml
View file @
56a562b4
...
...
@@ -110,7 +110,7 @@
</select>
<update
id=
"updateTraffpicture"
>
update traffpicture set objx=#{objx},objy=#{objy},objw=#{objw},objh=#{objh},imagedata=#{imagedata} where id=#{id}
update traffpicture set objx=#{objx},objy=#{objy},objw=#{objw},objh=#{objh},imagedata=#{imagedata}
,metatype=#{metatype}
where id=#{id}
</update>
...
...
src/main/resources/templates/addtask.html
View file @
56a562b4
This diff is collapsed.
Click to expand it.
src/main/resources/templates/index.html
View file @
56a562b4
...
...
@@ -29,14 +29,13 @@
</div>
<div
class=
"col-md-6"
>
<div
class=
"col-lg-12"
>
<form
action=
"/index"
>
<div
class=
"input-group"
>
<input
type=
"input"
class=
"form-control"
aria-label=
"..."
name
=
"name"
/>
<input
type=
"input"
class=
"form-control"
aria-label=
"..."
id
=
"name"
/>
<div
class=
"input-group-btn"
>
<input
type=
"
submit
"
class=
"btn btn-3d btn-success"
style=
"box-shadow:none;background-color: #73B18D !important;width:70px;margin-left: 19px;"
value=
"search"
/>
<input
type=
"
button"
id=
"search"
onclick=
"dosearch()
"
class=
"btn btn-3d btn-success"
style=
"box-shadow:none;background-color: #73B18D !important;width:70px;margin-left: 19px;"
value=
"search"
/>
</div>
</div>
</form>
</div>
</div>
</div>
...
...
@@ -48,8 +47,7 @@
<th
style=
"text-align:center;vertical-align:middle;"
>
任务名称
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
间隔时间(秒)
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
冻结状态
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
执行方
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
执行方式
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
执行参数
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
创建时间
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
最后修改时间
</th>
<th
style=
"text-align:center;vertical-align:middle;"
>
操作
</th>
...
...
@@ -66,11 +64,8 @@
<span
th:if=
"${task.frozenstatus eq 'UNFROZEN'}"
>
未冻结
</span>
<span
th:if=
"${task.frozenstatus eq 'FROZEN'}"
style=
"color:red;"
>
已冻结
</span>
</td>
<td
th:text=
"${task.executorno}"
/>
<td>
<span
th:if=
"${task.sendtype eq 'kafka'}"
>
kafka
</span>
<span
th:if=
"${task.sendtype eq 'http'}"
>
http
</span>
</td>
<td
th:text=
"${task.executeparamter}"
/>
<td
th:text=
"${#dates.format(task.createtime,'yyyy-MM-dd HH:mm:ss')}"
/>
<td
th:text=
"${#dates.format(task.lastmodifytime,'yyyy-MM-dd HH:mm:ss')}"
/>
<td>
...
...
@@ -131,11 +126,12 @@
<script
type=
"text/javascript"
th:inline=
"javascript"
>
function
editpage
(
id
)
{
location
.
href
=
"
/quartz/edit/taskpage?id=
"
+
id
;
window
.
open
(
"
/quartz/edit/taskpage?id=
"
+
id
)
;
}
function
addNewTask
()
{
location
.
href
=
"
/quartz/add/taskpage/
"
;
window
.
open
(
"
/quartz/add/taskpage/
"
);
}
function
startOrStop
(
taskNo
)
{
...
...
@@ -176,6 +172,29 @@
}
});
}
function
dosearch
(){
$
.
ajax
({
url
:
"
/quartz/list/optionjob?taskNo=
"
+
taskNo
,
type
:
"
GET
"
,
dataType
:
"
json
"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
200
)
{
alert
(
"
success!
"
);
location
.
href
=
"
/
"
;
}
else
if
(
result
.
code
==
6001
)
{
alert
(
"
任务编号为空!
"
);
}
else
if
(
result
.
code
==
1003
)
{
alert
(
"
无此定时任务!
"
);
}
else
{
alert
(
"
system error!
"
);
}
}
});
}
</script>
</body>
</html>
src/main/resources/templates/updatetask.html
View file @
56a562b4
This diff is collapsed.
Click to expand it.
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