Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Imagedx
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
Imagedx
Commits
238fd7d4
Commit
238fd7d4
authored
Jan 14, 2022
by
wangjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布的版本
parent
adf5dfe2
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
1281 additions
and
839 deletions
+1281
-839
pom.xml
pom.xml
+13
-1
src/main/java/im/dx/ShiroActionApplication.java
src/main/java/im/dx/ShiroActionApplication.java
+0
-2
src/main/java/im/dx/common/config/ScheduleTaskConfig.java
src/main/java/im/dx/common/config/ScheduleTaskConfig.java
+4
-0
src/main/java/im/dx/common/exception/WebExceptionHandler.java
...main/java/im/dx/common/exception/WebExceptionHandler.java
+28
-28
src/main/java/im/dx/common/shiro/ShiroActionProperties.java
src/main/java/im/dx/common/shiro/ShiroActionProperties.java
+21
-25
src/main/java/im/dx/system/controller/CodeController.java
src/main/java/im/dx/system/controller/CodeController.java
+47
-15
src/main/java/im/dx/system/controller/DeptController.java
src/main/java/im/dx/system/controller/DeptController.java
+63
-43
src/main/java/im/dx/system/controller/DeptTreeController.java
...main/java/im/dx/system/controller/DeptTreeController.java
+61
-14
src/main/java/im/dx/system/controller/IndexController.java
src/main/java/im/dx/system/controller/IndexController.java
+6
-13
src/main/java/im/dx/system/controller/LoginController.java
src/main/java/im/dx/system/controller/LoginController.java
+15
-14
src/main/java/im/dx/system/controller/LoginLogController.java
...main/java/im/dx/system/controller/LoginLogController.java
+6
-2
src/main/java/im/dx/system/controller/MenuController.java
src/main/java/im/dx/system/controller/MenuController.java
+28
-6
src/main/java/im/dx/system/controller/OAuth2Controller.java
src/main/java/im/dx/system/controller/OAuth2Controller.java
+5
-28
src/main/java/im/dx/system/controller/OperatorController.java
...main/java/im/dx/system/controller/OperatorController.java
+4
-2
src/main/java/im/dx/system/controller/RoleController.java
src/main/java/im/dx/system/controller/RoleController.java
+50
-15
src/main/java/im/dx/system/controller/TrafficStatisticsController.java
.../im/dx/system/controller/TrafficStatisticsController.java
+230
-128
src/main/java/im/dx/system/controller/UserController.java
src/main/java/im/dx/system/controller/UserController.java
+68
-14
src/main/java/im/dx/system/controller/UserOnlineController.java
...in/java/im/dx/system/controller/UserOnlineController.java
+0
-17
src/main/java/im/dx/system/controller/VideoController.java
src/main/java/im/dx/system/controller/VideoController.java
+110
-69
src/main/java/im/dx/system/mapper/DeptTreeMapper.java
src/main/java/im/dx/system/mapper/DeptTreeMapper.java
+1
-1
src/main/java/im/dx/system/mapper/TraffalarmrecordMapper.java
...main/java/im/dx/system/mapper/TraffalarmrecordMapper.java
+0
-1
src/main/java/im/dx/system/mapper/TrafficStatisticsMapper.java
...ain/java/im/dx/system/mapper/TrafficStatisticsMapper.java
+16
-3
src/main/java/im/dx/system/mapper/VideoMapper.java
src/main/java/im/dx/system/mapper/VideoMapper.java
+3
-1
src/main/java/im/dx/system/model/DeptVideo.java
src/main/java/im/dx/system/model/DeptVideo.java
+9
-0
src/main/java/im/dx/system/model/ResponseEnum.java
src/main/java/im/dx/system/model/ResponseEnum.java
+18
-18
src/main/java/im/dx/system/model/ResultObj.java
src/main/java/im/dx/system/model/ResultObj.java
+19
-19
src/main/java/im/dx/system/model/TraffpictureParam.java
src/main/java/im/dx/system/model/TraffpictureParam.java
+7
-5
src/main/java/im/dx/system/service/DeptTreeService.java
src/main/java/im/dx/system/service/DeptTreeService.java
+2
-2
src/main/java/im/dx/system/service/MenuService.java
src/main/java/im/dx/system/service/MenuService.java
+1
-1
src/main/java/im/dx/system/service/TrafficStatisticsService.java
...n/java/im/dx/system/service/TrafficStatisticsService.java
+23
-1
src/main/java/im/dx/system/service/VideoService.java
src/main/java/im/dx/system/service/VideoService.java
+2
-2
src/main/resources/application-im.properties
src/main/resources/application-im.properties
+4
-4
src/main/resources/application-local.properties
src/main/resources/application-local.properties
+2
-2
src/main/resources/application.properties
src/main/resources/application.properties
+1
-3
src/main/resources/logback-spring.xml
src/main/resources/logback-spring.xml
+1
-1
src/main/resources/mapper/DeptMapper.xml
src/main/resources/mapper/DeptMapper.xml
+33
-28
src/main/resources/mapper/DeptTreeMapper.xml
src/main/resources/mapper/DeptTreeMapper.xml
+25
-38
src/main/resources/mapper/LoginLogMapper.xml
src/main/resources/mapper/LoginLogMapper.xml
+5
-25
src/main/resources/mapper/MenuMapper.xml
src/main/resources/mapper/MenuMapper.xml
+0
-1
src/main/resources/mapper/OperatorMapper.xml
src/main/resources/mapper/OperatorMapper.xml
+4
-27
src/main/resources/mapper/TrafficStatisticsMapper.xml
src/main/resources/mapper/TrafficStatisticsMapper.xml
+130
-30
src/main/resources/mapper/VideoMapper.xml
src/main/resources/mapper/VideoMapper.xml
+12
-8
src/main/resources/static/js/jgsbgl/jgsbgl.js
src/main/resources/static/js/jgsbgl/jgsbgl.js
+39
-78
src/main/resources/static/js/rgjy/rgjy.js
src/main/resources/static/js/rgjy/rgjy.js
+1
-1
src/main/resources/static/js/rwpfhistory/rwpfhistory.js
src/main/resources/static/js/rwpfhistory/rwpfhistory.js
+56
-10
src/main/resources/static/js/sjcx/sjcx.js
src/main/resources/static/js/sjcx/sjcx.js
+64
-59
src/main/resources/templates/error/500.html
src/main/resources/templates/error/500.html
+0
-1
src/main/resources/templates/login.html
src/main/resources/templates/login.html
+0
-11
src/main/resources/templates/page/jgsbgl.html
src/main/resources/templates/page/jgsbgl.html
+22
-12
src/main/resources/templates/page/jksj.html
src/main/resources/templates/page/jksj.html
+1
-1
src/main/resources/templates/page/rwpfhistory.html
src/main/resources/templates/page/rwpfhistory.html
+2
-2
src/main/resources/templates/page/sjcx.html
src/main/resources/templates/page/sjcx.html
+5
-5
src/main/resources/templates/page/test.html
src/main/resources/templates/page/test.html
+14
-2
No files found.
pom.xml
View file @
238fd7d4
...
...
@@ -94,7 +94,7 @@
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.11
</version>
<version>
8.0.27
</version>
</dependency>
<dependency>
...
...
@@ -178,6 +178,18 @@
<version>
1.2.3
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.8.6
</version>
<scope>
compile
</scope>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
<version>
2.17.0
</version>
</dependency>
</dependencies>
<repositories>
...
...
src/main/java/im/dx/ShiroActionApplication.java
View file @
238fd7d4
...
...
@@ -6,8 +6,6 @@ import tk.mybatis.spring.annotation.MapperScan;
@SpringBootApplication
//@MapperScan("im.dx.system.mapper")
//@PropertySource("file:${spring.profiles.path}")
public
class
ShiroActionApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ShiroActionApplication
.
class
,
args
);
...
...
src/main/java/im/dx/common/config/ScheduleTaskConfig.java
View file @
238fd7d4
...
...
@@ -61,5 +61,9 @@ public class ScheduleTaskConfig {
}
}
// @Scheduled(cron = "0/16 * 1-18 * * ?")
private
void
st
()
{
log
.
info
(
new
Date
().
toLocaleString
());
}
}
src/main/java/im/dx/common/exception/WebExceptionHandler.java
View file @
238fd7d4
...
...
@@ -28,7 +28,7 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
@ControllerAdvice
//
@ControllerAdvice
public
class
WebExceptionHandler
{
@Resource
...
...
@@ -52,79 +52,79 @@ public class WebExceptionHandler {
@ExceptionHandler
public
String
unauthorized
(
NoHandlerFoundException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
请求的地址不存在
"
,
e
);
log
.
debug
(
"
请求的地址不存在"
,
e
);
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
请求的地址不存在
"
,
HttpStatus
.
NOT_FOUND
.
value
());
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
请求的地址不存在"
,
HttpStatus
.
NOT_FOUND
.
value
());
}
@ExceptionHandler
(
value
=
{
UnauthorizedException
.
class
})
public
String
unauthorized
(
Exception
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
无权限
"
);
log
.
debug
(
"
无权限"
);
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
无权限
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
无权限"
);
}
@ExceptionHandler
public
String
unknownAccount
(
UnknownAccountException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
账号不存在
"
);
log
.
debug
(
"
账号不存在"
)
;
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
账号不存在
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
账号不存在"
)
;
}
@ExceptionHandler
public
String
incorrectCredentials
(
IncorrectCredentialsException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
密码错误
"
);
log
.
debug
(
"
密码错误"
)
;
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
密码错误
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
密码错误"
)
;
}
@ExceptionHandler
public
String
excessiveAttemptsException
(
ExcessiveAttemptsException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
登录失败次数过多
"
);
log
.
debug
(
"
登录失败次数过多"
);
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
登录失败次数过多, 请稍后再试
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
登录失败次数过多, 请稍后再试"
);
}
@ExceptionHandler
public
String
lockedAccount
(
LockedAccountException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
账号已锁定
"
);
log
.
debug
(
"
账号已锁定"
)
;
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
账号已锁定
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
账号已锁定"
)
;
}
@ExceptionHandler
public
String
lockedAccount
(
CaptchaIncorrectException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
验证码错误
"
);
log
.
debug
(
"
验证码错误"
)
;
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
验证码错误
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
验证码错误"
)
;
}
@ExceptionHandler
public
String
lockedAccount
(
DuplicateNameException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
用户名已存在
"
);
log
.
debug
(
"
用户名已存在"
);
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
用户名已存在
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
用户名已存在"
);
}
@ExceptionHandler
public
String
missingRequestParameter
(
MissingServletRequestParameterException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
请求参数无效
"
);
log
.
debug
(
"
请求参数无效"
);
}
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
请求参数缺失
"
);
return
generateErrorInfo
(
ResultBean
.
FAIL
,
"
请求参数缺失"
);
}
@ExceptionHandler
public
String
methodArgumentNotValid
(
BindException
e
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
参数校验失败
"
,
e
);
log
.
debug
(
"
参数校验失败"
,
e
);
}
List
<
ObjectError
>
allErrors
=
e
.
getBindingResult
().
getAllErrors
();
StringBuilder
errorMessage
=
new
StringBuilder
();
...
...
@@ -140,19 +140,19 @@ public class WebExceptionHandler {
@ExceptionHandler
public
String
all
(
Exception
e
)
{
String
msg
=
e
.
getMessage
()
==
null
?
"
系统出现异常
"
:
e
.
getMessage
();
String
msg
=
e
.
getMessage
()
==
null
?
"
系统出现异常"
:
e
.
getMessage
();
log
.
error
(
msg
,
e
);
generateErrorInfo
(
ResultBean
.
FAIL
,
msg
,
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
"forward:/error"
;
}
/**
*
生成错误信息, 放到 request 域中
.
*
生成错误信息, 放到 request 域中.
*
* @param code
错误码
* @param msg
错误信息
* @param httpStatus HTTP
状态码
* @return SpringBoot
默认提供的 /error Controller 处理器
* @param code
错误码
* @param msg
错误信息
* @param httpStatus HTTP
状态码
* @return SpringBoot
默认提供的 /error Controller 处理器
*/
private
String
generateErrorInfo
(
int
code
,
String
msg
,
int
httpStatus
)
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
...
...
@@ -164,14 +164,14 @@ public class WebExceptionHandler {
/**
*
捕获 ClientAbortException 异常, 不做任何处理, 防止出现大量堆栈日志输出, 此异常不影响功能
.
*
捕获 ClientAbortException 异常, 不做任何处理, 防止出现大量堆栈日志输出, 此异常不影响功能.
*/
@ExceptionHandler
({
HttpMediaTypeNotAcceptableException
.
class
,
ClientAbortException
.
class
})
@ResponseBody
@ResponseStatus
public
void
clientAbortException
(
Exception
ex
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"
出现了断开异常
:"
,
ex
);
log
.
debug
(
"
出现了断开异常:"
,
ex
);
}
}
...
...
src/main/java/im/dx/common/shiro/ShiroActionProperties.java
View file @
238fd7d4
...
...
@@ -3,13 +3,9 @@ package im.dx.common.shiro;
import
im.dx.common.constants.AuthcTypeEnum
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.PostConstruct
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Set
;
@Component
@ConfigurationProperties
(
prefix
=
"shiro-action"
)
...
...
@@ -80,27 +76,27 @@ public class ShiroActionProperties {
this
.
permsCacheTimeout
=
permsCacheTimeout
;
}
@PostConstruct
public
void
validate
()
{
Set
<
String
>
set
=
new
HashSet
<>();
for
(
Provider
provider
:
this
.
oauth2Provider
.
values
())
{
// ClientId 不能为空
if
(!
StringUtils
.
hasText
(
provider
.
getClientId
()))
{
throw
new
IllegalStateException
(
"Client id must not be empty."
);
}
// ClientSecret 不能为空
if
(!
StringUtils
.
hasText
(
provider
.
getClientSecret
()))
{
throw
new
IllegalStateException
(
"Client secret must not be empty."
);
}
// 回调地址不能重复.
if
(!
set
.
add
(
provider
.
redirectUrl
))
{
throw
new
IllegalStateException
(
"redirectUrl must not be duplicate."
);
}
}
}
//
@PostConstruct
//
public void validate() {
//
Set<String> set = new HashSet<>();
//
//
for (Provider provider : this.oauth2Provider.values()) {
//
// ClientId 不能为空
//
if (!StringUtils.hasText(provider.getClientId())) {
//
throw new IllegalStateException("Client id must not be empty.");
//
}
//
//
// ClientSecret 不能为空
//
if (!StringUtils.hasText(provider.getClientSecret())) {
//
throw new IllegalStateException("Client secret must not be empty.");
//
}
//
//
// 回调地址不能重复.
//
if (!set.add(provider.redirectUrl)) {
//
throw new IllegalStateException("redirectUrl must not be duplicate.");
//
}
//
}
//
}
public
static
class
Provider
{
private
String
clientId
;
...
...
src/main/java/im/dx/system/controller/CodeController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.util.PageResultBean
;
import
im.dx.common.util.ResultBean
;
import
im.dx.system.model.Code
;
...
...
@@ -20,7 +19,12 @@ public class CodeController {
@Resource
private
CodeService
codeService
;
@OperationLog
(
"获取code列表"
)
/***
* 获取code列表
* @param page
* @param limit
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
PageResultBean
<
Code
>
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
@@ -30,30 +34,47 @@ public class CodeController {
return
new
PageResultBean
<>(
userPageInfo
.
getTotal
(),
userPageInfo
.
getList
());
}
@OperationLog
(
"获取指定type的code列表"
)
/***
* 获取指定type的code列表
* @param typeid
* @return
*/
@GetMapping
(
"/list/{typeid}"
)
@ResponseBody
public
ResultBean
getList
(
@PathVariable
(
"typeid"
)
String
typeid
)
{
List
<
Code
>
codes
=
codeService
.
selectAllWithType
(
typeid
);
return
ResultBean
.
success
(
codes
);
};
}
@OperationLog
(
"更新code"
)
/**
* 更新code
* @param codelist
* @return
*/
@PostMapping
(
"/update"
)
public
ResultBean
update
(
@RequestBody
List
<
Code
>
codelist
)
{
int
result
=
codeService
.
updatecode
(
codelist
);
return
ResultBean
.
success
();
}
@OperationLog
(
"新增"
)
/***
* 新增
* @param codelist
* @return
*/
@PostMapping
(
"/add"
)
public
ResultBean
add
(
@RequestBody
List
<
Code
>
codelist
)
{
int
result
=
codeService
.
addcode
(
codelist
);
return
ResultBean
.
success
();
}
@OperationLog
(
"新增videoalarm"
)
/***
* 新增videoalarm
* @param videoeRecordType
* @return
*/
@PostMapping
(
"/addvideoeRecordType"
)
public
ResultBean
VideoeRecordType
(
@RequestBody
VideoeRecordType
videoeRecordType
)
{
//判断存不存在
...
...
@@ -65,16 +86,19 @@ public class CodeController {
return
ResultBean
.
success
();
}
@OperationLog
(
"更新用户列表"
)
@GetMapping
(
"/codetest"
)
/***
* 更新用户列表
*/
public
void
test
()
{
List
<
Code
>
codes
=
codeService
.
selectAllWithKey
(
1
,
10
);
}
@OperationLog
(
"更新code time"
)
/**
* 更新code time
* @param codelist
* @return
*/
@PostMapping
(
"/updatetime"
)
public
ResultBean
updatetime
(
@RequestBody
List
<
Code
>
codelist
)
{
...
...
@@ -82,14 +106,22 @@ public class CodeController {
return
ResultBean
.
success
();
}
@OperationLog
(
"禁用账号"
)
/***
* 禁用账号
* @param codeId
* @return
*/
@PostMapping
(
"/{codeId}/disable"
)
@ResponseBody
public
ResultBean
disable
(
@PathVariable
(
"codeId"
)
String
codeId
)
{
return
ResultBean
.
success
(
codeService
.
disableCodeByCodeID
(
codeId
));
}
@OperationLog
(
"激活账号"
)
/***
* 激活账号
* @param codeId
* @return
*/
@PostMapping
(
"/{codeId}/enable"
)
@ResponseBody
public
ResultBean
enable
(
@PathVariable
(
"codeId"
)
String
codeId
)
{
...
...
src/main/java/im/dx/system/controller/DeptController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.shiro.ShiroActionProperties
;
import
im.dx.common.util.ResultBean
;
import
im.dx.common.util.TreeUtil
;
...
...
@@ -39,7 +38,11 @@ public class DeptController {
return
"dept/dept-list"
;
}
@OperationLog
(
"获取部门列表"
)
/***
* 获取部门列表
* @param parentId
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
ResultBean
getList
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
Integer
parentId
)
{
...
...
@@ -68,7 +71,11 @@ public class DeptController {
return
"dept/dept-add"
;
}
@OperationLog
(
"新增部门"
)
/***
* 新增部门
* @param dept
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
public
ResultBean
add
(
Dept
dept
)
{
...
...
@@ -81,7 +88,11 @@ public class DeptController {
return
ResultBean
.
success
(
deptService
.
insert
(
dept
));
}
@OperationLog
(
"删除部门"
)
/***
* 删除部门
* @param deptId
* @return
*/
@DeleteMapping
(
"/{deptId}"
)
@ResponseBody
public
ResultBean
delete
(
@PathVariable
(
"deptId"
)
Integer
deptId
)
{
...
...
@@ -89,7 +100,11 @@ public class DeptController {
return
ResultBean
.
success
();
}
@OperationLog
(
"修改部门"
)
/***
* 修改部门
* @param dept
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
)
public
ResultBean
update
(
Dept
dept
)
{
...
...
@@ -113,7 +128,13 @@ public class DeptController {
return
ResultBean
.
success
(
dept
);
}
@OperationLog
(
"调整部门排序"
)
/***
* 调整部门排序
* @param currentId
* @param swapId
* @return
*/
@PostMapping
(
"/swap"
)
@ResponseBody
public
ResultBean
swapSort
(
Integer
currentId
,
Integer
swapId
)
{
...
...
@@ -121,8 +142,13 @@ public class DeptController {
return
ResultBean
.
success
();
}
@OperationLog
(
"查询部门及監控"
)
/***
* 查询部门及監控
* @param deptId
* @param username
* @param tdmc
* @return
*/
@GetMapping
(
"/listvideo"
)
@ResponseBody
public
ResultBean
listvideo
(
@RequestParam
(
"deptId"
)
String
deptId
,
@RequestParam
(
"username"
)
String
username
,
@RequestParam
(
"tdmc"
)
String
tdmc
)
{
...
...
@@ -135,8 +161,13 @@ public class DeptController {
return
ResultBean
.
success
(
deptlist
);
}
@OperationLog
(
"查询部门及監控"
)
/***
* 查询部门及監控
* @param deptId
* @param username
* @param tdmc
* @return
*/
@GetMapping
(
"/listvideotree"
)
@ResponseBody
public
ResultBean
listvideotree
(
@RequestParam
(
"deptId"
)
String
deptId
,
@RequestParam
(
"username"
)
String
username
,
@RequestParam
(
"tdmc"
)
String
tdmc
)
{
...
...
@@ -150,9 +181,12 @@ public class DeptController {
return
ResultBean
.
success
(
list
);
}
@OperationLog
(
"查询部门及其子節點"
)
/***
* 查询部门及其子节点
* @param deptId
* @param username
* @return
*/
@GetMapping
(
"/listChildDept"
)
@ResponseBody
public
ResultBean
listChildDept
(
@RequestParam
(
"deptId"
)
Integer
deptId
,
@RequestParam
(
"username"
)
String
username
)
{
...
...
@@ -165,7 +199,12 @@ public class DeptController {
return
ResultBean
.
success
(
deptlist
);
}
@OperationLog
(
"更新部門默認監控"
)
/***
* 更新部门默认监控
* @param deptId
* @param videoId
* @return
*/
@PostMapping
(
"/updateDefaultVideo"
)
@ResponseBody
public
ResultBean
updateDefaultVideo
(
@RequestParam
(
"deptId"
)
String
deptId
,
@RequestParam
(
"videoId"
)
String
videoId
)
{
...
...
@@ -177,16 +216,12 @@ public class DeptController {
}
}
@OperationLog
(
"查詢部門默認監控"
)
@GetMapping
(
"/queryDefaultVideoId"
)
@ResponseBody
public
ResultBean
queryDefaultVideo
(
@RequestParam
(
"deptId"
)
String
deptId
)
{
return
ResultBean
.
success
(
deptService
.
selectDefaultVideoByDeptId
(
deptId
));
}
/***
* 查询所有部门默认监控
* @param deptId
* @return
*/
@OperationLog
(
"查詢所有部門默認監控"
)
@GetMapping
(
"/queryAllDefaultVideo"
)
@ResponseBody
public
ResultBean
queryAllDefaultVideo
(
@RequestParam
(
"deptId"
)
String
deptId
)
{
...
...
@@ -195,26 +230,11 @@ public class DeptController {
}
@OperationLog
(
"新增部門默認監控"
)
@PostMapping
(
"/insertDefaultVideo"
)
@ResponseBody
public
ResultBean
insertDefaultVideo
(
@RequestParam
(
"deptId"
)
String
deptId
,
@RequestParam
(
"videoId[]"
)
List
<
String
>
videoId
)
{
for
(
String
videoid:
videoId
)
{
//判断是否存在
int
result
=
deptService
.
selectExistsDefaultVideo
(
deptId
,
videoid
);
if
(
result
==
0
){
deptService
.
insertDefaultVideo
(
deptId
,
videoid
);
}
}
return
ResultBean
.
success
();
}
@OperationLog
(
"查询所有监控"
)
/**
* 查询所有监控
* @param deptid
* @return
*/
@GetMapping
(
"/listAllvideoIdsByDeptid"
)
@ResponseBody
public
ResultBean
listAllvideoIdsByDeptid
(
@RequestParam
(
"deptid"
)
String
deptid
)
{
...
...
src/main/java/im/dx/system/controller/DeptTreeController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.shiro.ShiroActionProperties
;
import
im.dx.common.util.PageResultBean
;
import
im.dx.common.util.ResultBean
;
...
...
@@ -43,7 +42,11 @@ public class DeptTreeController {
return
"dept/dept-list"
;
}
@OperationLog
(
"获取部门列表"
)
/***
* 获取部门列表
* @param parentId
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
ResultBean
getList
(
@RequestParam
(
required
=
false
)
String
parentId
)
{
...
...
@@ -54,13 +57,17 @@ public class DeptTreeController {
@GetMapping
(
"/tree/root"
)
@ResponseBody
public
ResultBean
treeAndRoot
()
{
return
ResultBean
.
success
(
deptTreeService
.
selectAllDeptTreeAndRoot
());
return
ResultBean
.
success
(
deptTreeService
.
selectAllDeptTreeAndRoot
());
}
@GetMapping
(
"/tree"
)
@ResponseBody
public
ResultBean
tree
()
{
return
ResultBean
.
success
(
TreeUtil
.
toTree
(
deptTreeService
.
selectAllDeptTree
(
"0"
),
"deptId"
,
"parentId"
,
"children"
,
DeptTree
.
class
,
"0"
));
return
ResultBean
.
success
(
TreeUtil
.
toTree
(
deptTreeService
.
selectAllDeptTree
(
"0"
),
"deptId"
,
"parentId"
,
"children"
,
DeptTree
.
class
,
"0"
));
}
@GetMapping
(
"/alltree"
)
@ResponseBody
...
...
@@ -68,10 +75,16 @@ public class DeptTreeController {
return
ResultBean
.
success
(
deptTreeService
.
selectAllDeptTree
(
"0"
));
}
@GetMapping
(
"/videotree/{deptId}"
)
@GetMapping
(
"/videotree/{deptId}
/{username}
"
)
@ResponseBody
public
ResultBean
videotree
(
@PathVariable
(
"deptId"
)
String
deptId
)
{
List
<
DeptTree
>
dept
=
deptTreeService
.
selectAllVideoTree
(
"0"
);
public
ResultBean
videotree
(
@PathVariable
(
"deptId"
)
String
deptId
,
@PathVariable
(
"username"
)
String
username
)
{
if
(
null
!=
username
&&
shiroActionProperties
.
getSuperAdminUsername
().
equals
(
username
))
{
deptId
=
"0"
;
username
=
null
;
}
List
<
DeptTree
>
dept
=
deptTreeService
.
selectAllVideoTree
(
deptId
,
username
);
return
ResultBean
.
success
(
TreeUtil
.
toTree
(
dept
,
"deptId"
,
"parentId"
,
"children"
,
DeptTree
.
class
,
"0"
));
}
...
...
@@ -95,7 +108,11 @@ public class DeptTreeController {
// return ResultBean.success(deptTreeService.insert(dept));
// }
@OperationLog
(
"删除部门"
)
/***
* 删除部门
* @param deptId
* @return
*/
@DeleteMapping
(
"/{deptId}"
)
@ResponseBody
public
ResultBean
delete
(
@PathVariable
(
"deptId"
)
String
deptId
)
{
...
...
@@ -103,7 +120,11 @@ public class DeptTreeController {
return
ResultBean
.
success
();
}
@OperationLog
(
"修改部门"
)
/***
* 修改部门
* @param dept
* @return
*/
@PutMapping
@ResponseBody
public
ResultBean
update
(
DeptTree
dept
)
{
...
...
@@ -119,7 +140,12 @@ public class DeptTreeController {
return
"dept/dept-add"
;
}
@OperationLog
(
"调整部门排序"
)
/***
* 调整部门排序
* @param currentId
* @param swapId
* @return
*/
@PostMapping
(
"/swap"
)
@ResponseBody
public
ResultBean
swapSort
(
Integer
currentId
,
Integer
swapId
)
{
...
...
@@ -127,7 +153,12 @@ public class DeptTreeController {
return
ResultBean
.
success
();
}
@OperationLog
(
"获取部门列表"
)
/***
* 获取部门列表
* @param parentId
* @param username
* @return
*/
@GetMapping
(
"/listByUsername"
)
@ResponseBody
public
ResultBean
listByUsername
(
@RequestParam
(
required
=
false
)
String
parentId
,
String
username
)
{
...
...
@@ -138,7 +169,11 @@ public class DeptTreeController {
return
ResultBean
.
success
(
deptList
);
}
@OperationLog
(
"获取角色所管辖事件监控"
)
/**
* 获取角色所管辖事件监控
* @param userID
* @return
*/
@GetMapping
(
"/listeventByvideoid/{userID}"
)
@ResponseBody
public
ResultBean
listeventByvideoid
(
@PathVariable
(
"userID"
)
String
userID
)
{
...
...
@@ -147,7 +182,13 @@ public class DeptTreeController {
return
ResultBean
.
success
(
eventids
);
}
@OperationLog
(
"获取监控控制的事件"
)
/***
* 获取监控控制的事件
* @param parentId
* @param page
* @param limit
* @return
*/
@GetMapping
(
"/recordtype/list"
)
@ResponseBody
public
PageResultBean
<
Map
>
getrecordtypeList
(
@RequestParam
(
required
=
false
)
String
parentId
,
...
...
@@ -160,7 +201,13 @@ public class DeptTreeController {
PageInfo
<
Map
>
rolePageInfo
=
new
PageInfo
<>(
menuList
);
return
new
PageResultBean
<>(
rolePageInfo
.
getTotal
(),
rolePageInfo
.
getList
());
}
@OperationLog
(
"删除监控控制的事件"
)
/***
* 删除监控控制的事件
* @param taskno
* @param status
* @return
*/
@GetMapping
(
"/delvideorecord/{taskno}/{status}"
)
@ResponseBody
public
TaskResultObj
delvideorecord
(
@PathVariable
(
"taskno"
)
String
taskno
,
@PathVariable
(
"status"
)
String
status
)
{
...
...
src/main/java/im/dx/system/controller/IndexController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
im.dx.common.util.DateUtils
;
import
im.dx.system.model.Menu
;
import
im.dx.system.service.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeoutException
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -41,9 +31,6 @@ public class IndexController {
@Resource
private
RoleService
roleService
;
@Resource
private
SysLogService
sysLogService
;
@Resource
private
UserOnlineService
userOnlineService
;
...
...
@@ -142,6 +129,12 @@ public class IndexController {
model
.
addAttribute
(
"menus"
,
menuTreeVOS
);
return
"page/manualscreen"
;
}
@GetMapping
(
value
=
{
"/xxtj"
})
public
String
xxtj
(
Model
model
)
{
List
<
Menu
>
menuTreeVOS
=
menuService
.
selectCurrentUserMenuTree
();
model
.
addAttribute
(
"menus"
,
menuTreeVOS
);
return
"page/xxtj"
;
}
@GetMapping
(
value
=
{
"/symrjk"
})
...
...
src/main/java/im/dx/system/controller/LoginController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
cn.hutool.core.util.IdUtil
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.shiro.ShiroActionProperties
;
import
im.dx.common.util.CaptchaUtil
;
import
im.dx.common.util.DateUtils
;
import
im.dx.common.util.ResultBean
;
import
im.dx.system.model.ResultObj
;
...
...
@@ -11,7 +8,6 @@ import im.dx.system.model.User;
import
im.dx.system.service.UserService
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.UsernamePasswordToken
;
import
org.apache.shiro.session.Session
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpEntity
;
...
...
@@ -21,16 +17,10 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.thymeleaf.TemplateEngine
;
import
javax.annotation.Resource
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.OutputStream
;
@Controller
public
class
LoginController
{
...
...
@@ -73,15 +63,21 @@ public class LoginController {
return
ResultBean
.
success
(
cuser
);
}
@OperationLog
(
"注销"
)
/***
* 注销
* @return
*/
@GetMapping
(
"/logout"
)
public
String
logout
()
{
SecurityUtils
.
getSubject
().
logout
();
return
"redirect:login"
;
}
@OperationLog
(
"用户账号查询权限"
)
/***
* 用户账号查询权限
* @param username
* @return
*/
@PostMapping
(
"/firstmenu"
)
@ResponseBody
public
ResultBean
firstmenu
(
String
username
)
{
...
...
@@ -95,7 +91,12 @@ public class LoginController {
return
ResultBean
.
success
();
}
@OperationLog
(
"用户账号查询权限"
)
/***
* 用户账号查询权限
* @param menuid
* @param username
* @return
*/
@PostMapping
(
"/secondmenu"
)
@ResponseBody
public
ResultBean
firstmenu
(
Integer
menuid
,
String
username
)
{
...
...
src/main/java/im/dx/system/controller/LoginLogController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.util.PageResultBean
;
import
im.dx.system.model.LoginLog
;
import
im.dx.system.service.LoginLogService
;
...
...
@@ -26,7 +25,12 @@ public class LoginLogController {
return
"log/login-logs"
;
}
@OperationLog
(
"查看登录日志"
)
/***
* 查看登录日志
* @param page
* @param limit
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
PageResultBean
<
LoginLog
>
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
src/main/java/im/dx/system/controller/MenuController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.annotation.RefreshFilterChain
;
import
im.dx.common.util.ResultBean
;
import
im.dx.system.model.Menu
;
...
...
@@ -26,7 +25,12 @@ public class MenuController {
return
"menu/menu-list"
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
@OperationLog
(
"获取菜单列表"
)
/***
* 获取菜单列表
* @param parentId
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
ResultBean
getList
(
@RequestParam
(
required
=
false
)
Integer
parentId
)
{
...
...
@@ -57,7 +61,11 @@ public class MenuController {
return
ResultBean
.
success
(
menuService
.
getALLMenuAndCountOperatorTreeAndRoot
());
}
@OperationLog
(
"新增菜单"
)
/**
* 新增菜单
* @param menu
* @return
*/
@RefreshFilterChain
@PostMapping
@ResponseBody
...
...
@@ -68,7 +76,11 @@ public class MenuController {
return
ResultBean
.
success
();
}
@OperationLog
(
"删除菜单"
)
/***
* 删除菜单
* @param menuId
* @return
*/
@RefreshFilterChain
@DeleteMapping
(
"/{menuId}"
)
@ResponseBody
...
...
@@ -84,7 +96,12 @@ public class MenuController {
return
"menu/menu-add"
;
}
@OperationLog
(
"修改菜单"
)
/***
* 修改菜单
* @param menu
* @return
*/
@RefreshFilterChain
@PutMapping
@ResponseBody
...
...
@@ -94,7 +111,12 @@ public class MenuController {
return
ResultBean
.
success
();
}
@OperationLog
(
"调整部门排序"
)
/***
* 调整部门排序
* @param currentId
* @param swapId
* @return
*/
@PostMapping
(
"/swap"
)
@ResponseBody
public
ResultBean
swapSort
(
Integer
currentId
,
Integer
swapId
)
{
...
...
src/main/java/im/dx/system/controller/OAuth2Controller.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.constants.AuthcTypeEnum
;
import
im.dx.common.shiro.OAuth2Helper
;
import
im.dx.common.util.ResultBean
;
...
...
@@ -8,7 +7,6 @@ import im.dx.common.util.ShiroUtil;
import
im.dx.system.model.UserAuths
;
import
im.dx.system.model.vo.OAuth2VO
;
import
im.dx.system.service.UserAuthsService
;
import
me.zhyd.oauth.request.AuthRequest
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -16,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -30,34 +27,15 @@ public class OAuth2Controller {
@Resource
private
UserAuthsService
userAuthsService
;
/**
* 生成 Github 授权地址
*/
@OperationLog
(
"Github OAuth2 登录"
)
@GetMapping
(
"/render/github"
)
@ResponseBody
public
ResultBean
renderGithubAuth
(
HttpServletResponse
response
)
{
AuthRequest
authRequest
=
oAuth2Helper
.
getAuthRequest
(
AuthcTypeEnum
.
GITHUB
);
return
ResultBean
.
successData
(
authRequest
.
authorize
());
}
/**
* 生成 Gitee 授权地址
*/
@OperationLog
(
"Gitee OAuth2 登录"
)
@GetMapping
(
"/render/gitee"
)
@ResponseBody
public
ResultBean
renderGiteeAuth
(
HttpServletResponse
response
)
{
AuthRequest
authRequest
=
oAuth2Helper
.
getAuthRequest
(
AuthcTypeEnum
.
GITEE
);
return
ResultBean
.
successData
(
authRequest
.
authorize
());
}
@GetMapping
(
"/index"
)
public
String
index
()
{
return
"oauth2/oauth2-list"
;
}
@OperationLog
(
"获取账号绑定信息"
)
/***
* 获取账号绑定信息
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
ResultBean
list
()
{
...
...
@@ -80,9 +58,8 @@ public class OAuth2Controller {
}
/**
* 取消
授权
* 取消
账号绑定
*/
@OperationLog
(
"取消账号绑定"
)
@GetMapping
(
"/revoke/{provider}"
)
@ResponseBody
public
Object
revokeAuth
(
@PathVariable
(
"provider"
)
AuthcTypeEnum
provider
)
{
...
...
src/main/java/im/dx/system/controller/OperatorController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.annotation.RefreshFilterChain
;
import
im.dx.common.util.ResultBean
;
import
im.dx.system.model.Operator
;
...
...
@@ -19,7 +18,10 @@ public class OperatorController {
@Resource
private
OperatorService
operatorService
;
@OperationLog
(
"查看操作日志"
)
/***
* 查看操作日志
* @return
*/
@GetMapping
(
"/index"
)
public
String
index
()
{
return
"operator/operator-list"
;
...
...
src/main/java/im/dx/system/controller/RoleController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.util.PageResultBean
;
import
im.dx.common.util.ResultBean
;
import
im.dx.common.util.TreeUtil
;
import
im.dx.system.model.Role
;
import
im.dx.system.model.TaskParams
;
import
im.dx.system.model.UserRoleTree
;
import
im.dx.system.service.RoleService
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
...
...
@@ -28,7 +25,13 @@ public class RoleController {
return
"role/role-list"
;
}
@OperationLog
(
"查询角色列表"
)
/**
* 查询角色列表
* @param page
* @param limit
* @param roleQuery
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
PageResultBean
<
Role
>
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
@@ -44,7 +47,11 @@ public class RoleController {
return
"role/role-add"
;
}
@OperationLog
(
"新增角色"
)
/**
* 新增角色
* @param role
* @return
*/
@PostMapping
@ResponseBody
public
ResultBean
add
(
Role
role
)
{
...
...
@@ -59,7 +66,11 @@ public class RoleController {
return
"role/role-add"
;
}
@OperationLog
(
"修改角色"
)
/**
* 修改角色
* @param role
* @return
*/
@PutMapping
@ResponseBody
public
ResultBean
update
(
Role
role
)
{
...
...
@@ -67,8 +78,11 @@ public class RoleController {
return
ResultBean
.
success
();
}
@OperationLog
(
"删除角色"
)
/***
* 删除角色
* @param roleId
* @return
*/
@DeleteMapping
(
"/{roleId}"
)
@ResponseBody
public
ResultBean
delete
(
@PathVariable
(
"roleId"
)
Integer
roleId
)
{
...
...
@@ -76,7 +90,12 @@ public class RoleController {
return
ResultBean
.
success
();
}
@OperationLog
(
"为角色授予菜单"
)
/***
* 为角色授予菜单
* @param roleId
* @param menuIds
* @return
*/
@PostMapping
(
"/{roleId}/grant/menu"
)
@ResponseBody
public
ResultBean
grantMenu
(
@PathVariable
(
"roleId"
)
Integer
roleId
,
@RequestParam
(
value
=
"menuIds[]"
,
required
=
false
)
Integer
[]
menuIds
)
{
...
...
@@ -84,8 +103,12 @@ public class RoleController {
return
ResultBean
.
success
();
}
@OperationLog
(
"为角色授予操作权限"
)
/***
* 为角色授予操作权限
* @param roleId
* @param operatorIds
* @return
*/
@PostMapping
(
"/{roleId}/grant/operator"
)
@ResponseBody
public
ResultBean
grantOperator
(
@PathVariable
(
"roleId"
)
Integer
roleId
,
@RequestParam
(
value
=
"operatorIds[]"
,
required
=
false
)
Integer
[]
operatorIds
)
{
...
...
@@ -115,8 +138,12 @@ public class RoleController {
return
ResultBean
.
success
(
operatorIds
);
}
@OperationLog
(
"为角色授予菜单"
)
/***
* 为角色授予菜单
* @param roleId
* @param videorecordIds
* @return
*/
@PostMapping
(
"/{roleId}/grant/videorecord"
)
@ResponseBody
public
ResultBean
grantVideorecord
(
@PathVariable
(
"roleId"
)
Integer
roleId
,
@RequestParam
(
value
=
"videorecordIds[]"
,
required
=
false
)
String
[]
videorecordIds
)
{
...
...
@@ -124,14 +151,22 @@ public class RoleController {
return
ResultBean
.
success
();
}
@OperationLog
(
"查询角色用户树形数据"
)
/***
* 查询角色用户树形数据
* @return
*/
@GetMapping
(
"/listAllUsers"
)
@ResponseBody
public
ResultBean
listAllUsers
()
{
return
ResultBean
.
success
(
roleService
.
queryRoleUserTree
());
}
@OperationLog
(
"给用户添加任务"
)
/***
* 给用户添加任务
* @param taskParams
* @return
*/
@PostMapping
(
"/addtaskinfo"
)
@ResponseBody
public
ResultBean
addtaskinfo
(
@RequestBody
TaskParams
taskParams
)
{
...
...
src/main/java/im/dx/system/controller/TrafficStatisticsController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.
annotation.OperationLog
;
import
im.dx.common.
shiro.ShiroActionProperties
;
import
im.dx.common.util.*
;
import
im.dx.system.model.*
;
import
im.dx.system.service.DeptService
;
import
im.dx.system.service.TrafficStatisticsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.tomcat.util.http.fileupload.IOUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
sun.net.www.protocol.ftp.FtpURLConnection
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Slf4j
@Controller
...
...
@@ -35,37 +26,46 @@ public class TrafficStatisticsController {
@Resource
private
TrafficStatisticsService
trafficStatisticsService
;
@Resource
private
ShiroActionProperties
shiroActionProperties
;
@OperationLog
(
"查询字典表"
)
@Resource
DeptService
deptService
;
/***
* 查询字典表
* @param codeid
* @param level
* @return
*/
@GetMapping
(
"/listcode"
)
@ResponseBody
public
ResultBean
listcode
(
@RequestParam
(
"codeid"
)
String
codeid
,
@RequestParam
(
"alarmlevel"
)
String
level
)
{
)
{
List
<
CodeData
>
deptList
=
trafficStatisticsService
.
selectCodeByCodeId
(
codeid
,
level
);
return
ResultBean
.
success
(
deptList
);
}
@PostMapping
(
"/queryTraffalarmrecordByPage/{sendOrNot}"
)
@ResponseBody
public
PageResultBean
<
TraffpictureParam
>
queryTraffalarmrecordByPage
(
@PathVariable
(
"sendOrNot"
)
String
sendOrNot
,
@RequestBody
TraffalarmrecordParams
params
)
{
public
PageResultBean
<
TraffpictureParam
>
queryTraffalarmrecordByPage
(
@PathVariable
(
"sendOrNot"
)
String
sendOrNot
,
@RequestBody
TraffalarmrecordParams
params
)
{
String
[]
arry
=
{};
Map
parammap
=
new
HashMap
();
parammap
.
put
(
"videoids"
,
Arrays
.
asList
(
""
.
equals
(
params
.
getVideoids
())||
"null"
.
equals
(
params
.
getVideoids
())
?
arry
:
params
.
getVideoids
().
split
(
","
)));
parammap
.
put
(
"videoids"
,
Arrays
.
asList
(
""
.
equals
(
params
.
getVideoids
())
||
"null"
.
equals
(
params
.
getVideoids
())
?
arry
:
params
.
getVideoids
().
split
(
","
)));
parammap
.
put
(
"starttime"
,
params
.
getStarttime
());
parammap
.
put
(
"endtime"
,
params
.
getEndtime
());
parammap
.
put
(
"recordtype"
,
Arrays
.
asList
(
params
.
getRecordtype
()
==
""
?
arry
:
params
.
getRecordtype
().
split
(
","
))
);
parammap
.
put
(
"recordtype"
,
Arrays
.
asList
(
params
.
getRecordtype
()
==
""
?
arry
:
params
.
getRecordtype
().
split
(
","
))
);
parammap
.
put
(
"checkstatus"
,
params
.
getCheckstatus
());
parammap
.
put
(
"deptid"
,
params
.
getDeptid
());
parammap
.
put
(
"construction"
,
params
.
getConstruction
());
parammap
.
put
(
"objlables"
,
Arrays
.
asList
(
params
.
getObjlabel
()
==
""
?
arry
:
params
.
getObjlabel
().
split
(
","
)));
parammap
.
put
(
"processstatus"
,
Arrays
.
asList
(
params
.
getProcessstatus
()
==
""
?
arry
:
params
.
getProcessstatus
().
split
(
","
)));
parammap
.
put
(
"rectificationtype"
,
params
.
getRectificationtype
());
parammap
.
put
(
"userId"
,
params
.
getUserid
());
parammap
.
put
(
"pushstatus"
,
sendOrNot
);
parammap
.
put
(
"sfpf"
,
params
.
getSfpf
());
parammap
.
put
(
"rectificationtype"
,
params
.
getRectificationtype
());
parammap
.
put
(
"pushstatus"
,
sendOrNot
);
parammap
.
put
(
"sfpf"
,
params
.
getSfpf
());
List
<
TraffpictureParam
>
traffalarmrecordResults
=
trafficStatisticsService
.
queryTraffalarmrecordByPage
(
parammap
,
params
.
getPage
()
...
...
@@ -79,99 +79,33 @@ public class TrafficStatisticsController {
@PostMapping
(
"/updateTraffalarmrecordById"
)
@ResponseBody
public
ResultBean
updateTraffalarmrecordById
(
@RequestBody
List
<
TraffpictureParam
>
recrdlist
)
{
//支持对某一点位某一事件类型标注正检后,该事件类型之前的MANUALCHECKTIME 重复事件类型自动标注为正检.
//支持对某一点位某一事件类型标注正检后,该事件类型之前的MANUALCHECKTIME 重复事件类型自动标注为正检.
int
result
=
trafficStatisticsService
.
updateTraffalarmrecordById
(
recrdlist
);
//记录该次正检的时间
// int result2 = trafficStatisticsService.updateVideochecktime(recrdlist);
return
ResultBean
.
success
();
}
@OperationLog
(
"查询事件本月及各分类数量"
)
@GetMapping
(
"/list/todaytraffRecords"
)
@ResponseBody
public
ResultBean
todaytraffRecords
(
@RequestParam
(
"videoId"
)
String
videoId
,
@RequestParam
(
"starttime"
)
String
starttime
,
@RequestParam
(
"endtime"
)
String
endtime
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"starttime"
,
starttime
);
map
.
put
(
"endtime"
,
endtime
);
map
.
put
(
"videoId"
,
videoId
);
List
<
RecordResult
>
carList
=
trafficStatisticsService
.
todaytraffRecords
(
map
);
Date
entdate
=
DateUtils
.
parseDate
(
endtime
);
Date
startdate
=
DateUtils
.
parseDate
(
starttime
);
map
.
put
(
"starttime"
,
DateUtils
.
getlastMonthTime
(
startdate
,
-
1
));
map
.
put
(
"endtime"
,
DateUtils
.
getlastMonthTime
(
startdate
,
-
1
));
List
<
Map
>
tblist
=
trafficStatisticsService
.
todaythbtraffRecords
(
map
);
//上周
map
.
put
(
"starttime"
,
DateUtils
.
getlastDayTime
(
startdate
,
-
7
));
map
.
put
(
"endtime"
,
DateUtils
.
getlastDayTime
(
entdate
,
-
7
));
List
<
Map
>
hblist
=
trafficStatisticsService
.
todaythbtraffRecords
(
map
);
for
(
RecordResult
item
:
carList
)
{
for
(
Map
mp
:
tblist
)
{
if
(
null
!=
mp
.
get
(
"total"
))
item
.
setTbtotal
(
String
.
valueOf
(
mp
.
get
(
"total"
)));
}
for
(
Map
mp
:
hblist
)
{
if
(
null
!=
mp
.
get
(
"total"
))
item
.
setHbtotal
(
String
.
valueOf
(
mp
.
get
(
"total"
)));
}
}
return
ResultBean
.
success
(
carList
);
}
@OperationLog
(
"查询历史一个月事件及各分类数量"
)
@GetMapping
(
"/list/historytraffRecords"
)
@ResponseBody
public
ResultBean
selecthistorytraffRecords
(
@RequestParam
(
"videoId"
)
String
videoId
,
@RequestParam
(
"starttime"
)
String
starttime
,
@RequestParam
(
"endtime"
)
String
endtime
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"starttime"
,
starttime
);
map
.
put
(
"videoId"
,
videoId
);
map
.
put
(
"endtime"
,
endtime
);
List
<
VehiclesStatisticResult
>
carList
=
trafficStatisticsService
.
selecthistorytraffRecords
(
map
);
return
ResultBean
.
success
(
carList
);
}
@OperationLog
(
"查询历史一个月流量及各分类数量"
)
@GetMapping
(
"/list/historyvehicles"
)
@ResponseBody
public
ResultBean
selecthistoryvehicles
(
@RequestParam
(
"videoId"
)
String
videoId
,
@RequestParam
(
"starttime"
)
String
starttime
,
@RequestParam
(
"endtime"
)
String
endtime
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"starttime"
,
starttime
);
map
.
put
(
"videoId"
,
videoId
);
map
.
put
(
"endtime"
,
endtime
);
List
<
VehiclesStatisticResult
>
carList
=
trafficStatisticsService
.
selecthistoryvehicles
(
map
);
return
ResultBean
.
success
(
carList
);
//更新任务表处理状态
int
result2
=
trafficStatisticsService
.
updateDisputesInfo
(
recrdlist
);
return
ResultBean
.
success
();
}
/***
* 查询推送第三方的记录
* @param map
* @return
*/
@OperationLog
(
"查询推送第三方的记录"
)
@PostMapping
(
"/list/pushrecordsBypage"
)
@ResponseBody
public
PageResultBean
<
Traffalarmrecord
>
selectPushRecordsBypage
(
@RequestBody
Map
map
)
{
List
<
Traffalarmrecord
>
carList
=
trafficStatisticsService
.
selectPushRecordsBypage
(
map
,
Integer
.
parseInt
(
map
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
map
.
get
(
"limit"
).
toString
()));
List
<
Traffalarmrecord
>
carList
=
trafficStatisticsService
.
selectPushRecordsBypage
(
map
,
Integer
.
parseInt
(
map
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
map
.
get
(
"limit"
).
toString
()));
PageInfo
<
Traffalarmrecord
>
rolePageInfo
=
new
PageInfo
<>(
carList
);
return
new
PageResultBean
<>(
rolePageInfo
.
getTotal
(),
rolePageInfo
.
getList
());
}
@OperationLog
(
"统计事件推送结果"
)
/**
* 统计事件推送结果
* @param traffalarmrecordstatParams
* @return
*/
@PostMapping
(
"/list/eventresultBypage"
)
@ResponseBody
public
PageResultBean
<
Traffalarmrecordstate
>
selecteventresultBypage
(
@RequestBody
TraffalarmrecordstatParams
traffalarmrecordstatParams
)
{
...
...
@@ -182,8 +116,12 @@ public class TrafficStatisticsController {
}
/***
* 导出事件推送结果
* @param response
* @param traffalarmrecordstatParams
*/
@OperationLog
(
"导出事件推送结果"
)
@RequestMapping
(
"/expTraffalarmrecordstat"
)
@ResponseBody
public
void
expTraffalarmrecordstat
(
HttpServletResponse
response
,
TraffalarmrecordstatParams
traffalarmrecordstatParams
)
{
...
...
@@ -226,38 +164,50 @@ public class TrafficStatisticsController {
}
/***
* 取消推送事件信息
* @param recordid
* @return
*/
//删除某一事件
@OperationLog
(
"取消推送事件信息"
)
@GetMapping
(
"/deleteTraffalarmrecordById/{recordid}"
)
@ResponseBody
public
ResultBean
deleteTraffalarmrecordById
(
@PathVariable
(
"recordid"
)
String
recordid
)
{
return
ResultBean
.
success
(
trafficStatisticsService
.
deleteTraffalarmrecordById
(
recordid
));
}
@OperationLog
(
"查询事件详情"
)
/**
* 查询事件详情
* @param id
* @param recordtype
* @return
*/
@GetMapping
(
"/queryTraffDetail/{id}/{recordtype}"
)
@ResponseBody
public
ResultBean
queryTraffDetail
(
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"recordtype"
)
String
recordtype
)
{
if
(
"1"
.
equals
(
recordtype
))
{
List
<
Pedestrian
>
results
=
trafficStatisticsService
.
queryTraffPedeDetail
(
id
);
public
ResultBean
queryTraffDetail
(
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"recordtype"
)
String
recordtype
)
{
if
(
"1"
.
equals
(
recordtype
))
{
List
<
Pedestrian
>
results
=
trafficStatisticsService
.
queryTraffPedeDetail
(
id
);
return
ResultBean
.
success
(
results
);
}
else
if
(
"2"
.
equals
(
recordtype
)){
//车辆
List
<
Traffic
>
results
=
trafficStatisticsService
.
queryTrafficDetail
(
id
);
}
else
if
(
"2"
.
equals
(
recordtype
))
{
//车辆
List
<
Traffic
>
results
=
trafficStatisticsService
.
queryTrafficDetail
(
id
);
return
ResultBean
.
success
(
results
);
}
else
if
(
"3"
.
equals
(
recordtype
)){
//人脸
List
<
Face
>
results
=
trafficStatisticsService
.
queryTraffFaceDetail
(
id
);
}
else
if
(
"3"
.
equals
(
recordtype
))
{
//人脸
List
<
Face
>
results
=
trafficStatisticsService
.
queryTraffFaceDetail
(
id
);
return
ResultBean
.
success
(
results
);
}
else
if
(
"4"
.
equals
(
recordtype
)){
//人骑车
List
<
PeopleRideBicyc
>
results
=
trafficStatisticsService
.
queryTraffPeopleRideBicycDetail
(
id
);
}
else
if
(
"4"
.
equals
(
recordtype
))
{
//人骑车
List
<
PeopleRideBicyc
>
results
=
trafficStatisticsService
.
queryTraffPeopleRideBicycDetail
(
id
);
return
ResultBean
.
success
(
results
);
}
return
ResultBean
.
success
();
}
/***
* 删除告警信息
* @param recrdlist
* @return
*/
@PostMapping
(
"/delTraffalarmrecordByIds"
)
@ResponseBody
public
ResultBean
delTraffalarmrecordByIds
(
@RequestBody
List
<
TraffpictureParam
>
recrdlist
)
{
...
...
@@ -265,20 +215,25 @@ public class TrafficStatisticsController {
trafficStatisticsService
.
deltaskinfoByIds
(
recrdlist
);
//删除告警信息
int
result
=
trafficStatisticsService
.
delTraffalarmrecordByIds
(
recrdlist
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
return
ResultBean
.
error
(
"-1"
);
}
return
ResultBean
.
success
();
return
ResultBean
.
success
();
}
@PostMapping
(
"/deltaskinfoByIds"
)
@ResponseBody
public
ResultBean
deltaskinfoByIds
(
@RequestBody
List
<
TraffpictureParam
>
recrdlist
)
{
//支持对某一点位某一事件类型标注正检后,该事件类型之前的MANUALCHECKTIME 重复事件类型自动标注为正检.
int
result
=
trafficStatisticsService
.
deltaskinfoByIds
(
recrdlist
);
return
ResultBean
.
success
();
}
/**
* 分页查询告警信息
* @param params
* @return
*/
@PostMapping
(
"/queryTaskInfoByPage"
)
@ResponseBody
...
...
@@ -286,18 +241,18 @@ public class TrafficStatisticsController {
String
[]
arry
=
{};
Map
parammap
=
new
HashMap
();
parammap
.
put
(
"videoids"
,
Arrays
.
asList
(
""
.
equals
(
params
.
getVideoids
())||
"null"
.
equals
(
params
.
getVideoids
())
?
arry
:
params
.
getVideoids
().
split
(
","
)));
parammap
.
put
(
"videoids"
,
Arrays
.
asList
(
""
.
equals
(
params
.
getVideoids
())
||
"null"
.
equals
(
params
.
getVideoids
())
?
arry
:
params
.
getVideoids
().
split
(
","
)));
parammap
.
put
(
"starttime"
,
params
.
getStarttime
());
parammap
.
put
(
"endtime"
,
params
.
getEndtime
());
parammap
.
put
(
"recordtype"
,
Arrays
.
asList
(
params
.
getRecordtype
()
==
""
?
arry
:
params
.
getRecordtype
().
split
(
","
))
);
parammap
.
put
(
"recordtype"
,
Arrays
.
asList
(
params
.
getRecordtype
()
==
""
?
arry
:
params
.
getRecordtype
().
split
(
","
))
);
parammap
.
put
(
"checkstatus"
,
params
.
getCheckstatus
());
parammap
.
put
(
"deptid"
,
params
.
getDeptid
());
parammap
.
put
(
"construction"
,
params
.
getConstruction
());
parammap
.
put
(
"objlables"
,
Arrays
.
asList
(
params
.
getObjlabel
()
==
""
?
arry
:
params
.
getObjlabel
().
split
(
","
)));
parammap
.
put
(
"processstatus"
,
Arrays
.
asList
(
params
.
getProcessstatus
()
==
""
?
arry
:
params
.
getProcessstatus
().
split
(
","
)));
parammap
.
put
(
"rectificationtype"
,
params
.
getRectificationtype
());
parammap
.
put
(
"userId"
,
params
.
getUserid
());
parammap
.
put
(
"sfpf"
,
params
.
getSfpf
());
parammap
.
put
(
"rectificationtype"
,
params
.
getRectificationtype
());
parammap
.
put
(
"userId"
,
params
.
getUserid
());
parammap
.
put
(
"sfpf"
,
params
.
getSfpf
());
List
<
TraffpictureParam
>
traffalarmrecordResults
=
trafficStatisticsService
.
queryTaskInfoByPage
(
parammap
,
params
.
getPage
()
,
params
.
getLimit
());
...
...
@@ -306,8 +261,155 @@ public class TrafficStatisticsController {
return
new
PageResultBean
<
TraffpictureParam
>(
rolePageInfo
.
getTotal
(),
rolePageInfo
.
getList
());
}
/***
* 撤回任务
* @param recrdlist
* @return
*/
@PostMapping
(
"/delDisputesInfo"
)
@ResponseBody
public
ResultBean
delDisputesInfo
(
@RequestBody
List
<
TraffpictureParam
>
recrdlist
)
{
try
{
trafficStatisticsService
.
delDisputesInfo
(
recrdlist
);
}
catch
(
Exception
ex
)
{
return
ResultBean
.
error
(
"-1"
);
}
return
ResultBean
.
success
();
}
/***
* 事件统计
*/
@PostMapping
(
"/eventStatistics"
)
@ResponseBody
public
ResultBean
delDisputesInfo
(
@RequestBody
StatisticsParam
statisticsParam
)
{
try
{
//统计所有事件类型,事件数量,部门名称、部门编号
List
<
StatisticsData
>
statisticsDataList
=
trafficStatisticsService
.
eventStatistics
(
statisticsParam
);
List
<
String
>
xlist
=
new
ArrayList
<>();
List
<
Integer
>
ylist
=
new
ArrayList
<>();
for
(
StatisticsData
item
:
statisticsDataList
)
{
xlist
.
add
(
item
.
getName
()
==
null
?
"未知"
:
item
.
getName
());
ylist
.
add
(
item
.
getNum
());
}
Map
map
=
new
HashMap
();
map
.
put
(
"x"
,
xlist
);
map
.
put
(
"y"
,
ylist
);
return
ResultBean
.
success
(
map
);
}
catch
(
Exception
ex
)
{
return
ResultBean
.
error
(
"-1"
);
}
}
@PostMapping
(
"/deviceStatistics"
)
@ResponseBody
public
ResultBean
deviceStatistics
(
@RequestBody
StatisticsParam
statisticsParam
)
{
try
{
//查询所有部门下的设备
List
<
Dept
>
deptlist
=
deptService
.
selectAllTree
();
//统计所有事件类型,事件数量,部门名称、部门编号
List
<
StatisticsData
>
statisticsDataList
=
trafficStatisticsService
.
deviceStatistics
(
statisticsParam
);
List
<
StatisticsData
>
resultList
=
new
ArrayList
<>();
//遍历每个部门,统计所有部门的数量
for
(
Dept
item
:
deptlist
)
{
List
<
StatisticsData
>
filterdata
=
statisticsDataList
.
stream
().
filter
(
st
->
st
.
getId
().
contains
(
","
+
item
.
getDeptId
()+
","
)
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
collect
=
filterdata
.
stream
().
map
(
dto
->
Integer
.
valueOf
(
dto
.
getNum
())).
collect
(
Collectors
.
toList
());
Integer
num
=
collect
.
stream
().
reduce
(
Integer:
:
sum
).
orElse
(
0
);
StatisticsData
data
=
new
StatisticsData
();
data
.
setId
(
item
.
getDeptId
().
toString
());
data
.
setName
(
item
.
getDeptName
());
data
.
setNum
(
num
);
resultList
.
add
(
data
);
}
List
<
String
>
xlist
=
new
ArrayList
<>();
List
<
Integer
>
ylist
=
new
ArrayList
<>();
for
(
StatisticsData
item
:
resultList
)
{
xlist
.
add
(
item
.
getName
()
==
null
?
"未知"
:
item
.
getName
());
ylist
.
add
(
item
.
getNum
());
}
Map
map
=
new
HashMap
();
map
.
put
(
"x"
,
xlist
);
map
.
put
(
"y"
,
ylist
);
return
ResultBean
.
success
(
map
);
}
catch
(
Exception
ex
)
{
return
ResultBean
.
error
(
"-1"
);
}
}
/***
* 推送统计
*/
@PostMapping
(
"/sendInfoStatistics"
)
@ResponseBody
public
ResultBean
sendInfoStatistics
(
@RequestBody
StatisticsParam
statisticsParam
)
{
try
{
//统计所有事件推送情况
List
<
Map
>
statisticsDataList
=
trafficStatisticsService
.
sendInfoStatistics
(
statisticsParam
);
return
ResultBean
.
success
(
statisticsDataList
);
}
catch
(
Exception
ex
)
{
return
ResultBean
.
error
(
"-1"
);
}
}
/***
* 部门事件统计
*/
@PostMapping
(
"/departmentEventStatistics"
)
@ResponseBody
public
ResultBean
departmentEventStatistics
(
@RequestBody
StatisticsParam
statisticsParam
)
{
try
{
//查询所有部门包括监控
List
<
DeptVideo
>
deptlist
=
deptService
.
listvideo
(
"0"
,
null
,
null
);
//查询所有告警信息
List
<
CodeData
>
codelist
=
trafficStatisticsService
.
selectCodeByCodeId
(
"2"
,
null
);
//统计所有事件推送情况
List
<
StatisticsData
>
statisticsDataList
=
trafficStatisticsService
.
departmentEventStatistics
(
statisticsParam
);
//统计所有监控事件
List
<
String
>
deptdatalist
=
deptlist
.
stream
().
map
(
dto
->
dto
.
getDeptName
()).
collect
(
Collectors
.
toList
());
List
<
Series
>
seriesList
=
new
ArrayList
<>();
List
<
Integer
>
intlist
=
new
ArrayList
<>();
for
(
CodeData
code
:
codelist
)
{
intlist
.
clear
();
for
(
DeptVideo
item
:
deptlist
)
{
//遍历每个部门,统计所有部门的数量
item
.
setIdsets
(
","
+
item
.
getIdsets
()
+
","
);
List
<
StatisticsData
>
filterdata
=
statisticsDataList
.
stream
().
filter
(
st
->
code
.
getKey
().
equalsIgnoreCase
(
st
.
getId
())
&&
(
st
.
getPid
().
contains
((
","
+
item
.
getDeptId
()
+
","
))
||
st
.
getXid
().
equalsIgnoreCase
(
item
.
getDeptId
())
)
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
collect
=
filterdata
.
stream
().
map
(
dto
->
Integer
.
valueOf
(
dto
.
getNum
())).
collect
(
Collectors
.
toList
());
Integer
num
=
collect
.
stream
().
reduce
(
Integer:
:
sum
).
orElse
(
0
);
intlist
.
add
(
num
);
}
Series
se
=
new
Series
();
se
.
setName
(
code
.
getName
());
se
.
setData
(
intlist
.
toArray
());
se
.
setStack
(
"Ad"
);
se
.
setType
(
"bar"
);
se
.
setEmphasis
((
Map
)
new
HashMap
().
put
(
"focus"
,
"series"
));
seriesList
.
add
(
se
);
}
Map
mapresult
=
new
HashMap
();
mapresult
.
put
(
"x"
,
deptdatalist
);
mapresult
.
put
(
"y"
,
seriesList
);
return
ResultBean
.
success
(
mapresult
);
}
catch
(
Exception
ex
)
{
return
ResultBean
.
error
(
"-1"
);
}
}
}
src/main/java/im/dx/system/controller/UserController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.annotation.OperationLog
;
import
im.dx.common.util.PageResultBean
;
import
im.dx.common.util.ResultBean
;
import
im.dx.common.validate.groups.Create
;
...
...
@@ -43,7 +42,13 @@ public class UserController {
return
"user/user-send"
;
}
@OperationLog
(
"获取用户列表"
)
/***
* 获取用户列表
* @param page
* @param pageSize
* @param userQuery
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
PageResultBean
<
User
>
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
@@ -54,7 +59,14 @@ public class UserController {
return
new
PageResultBean
<>(
userPageInfo
.
getTotal
(),
userPageInfo
.
getList
());
}
@OperationLog
(
"根據部門获取用户列表"
)
/***
* 根據部門获取用户列表
* @param page
* @param pageSize
* @param deptId
* @param userName
* @return
*/
@GetMapping
(
"/list/userByDeptId"
)
@ResponseBody
public
PageResultBean
<
User
>
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
@@ -83,7 +95,12 @@ public class UserController {
return
"user/user-add"
;
}
@OperationLog
(
"编辑角色"
)
/***
* 编辑角色
* @param user
* @param roleIds
* @return
*/
@PutMapping
@ResponseBody
public
ResultBean
putupdate
(
@Valid
User
user
,
@RequestParam
(
value
=
"role[]"
,
required
=
false
)
Integer
[]
roleIds
)
{
...
...
@@ -91,8 +108,12 @@ public class UserController {
return
ResultBean
.
success
();
}
@OperationLog
(
"编辑角色"
)
/***
* 编辑角色
* @param user
* @param roleIds
* @return
*/
@PostMapping
(
"/edit"
)
@ResponseBody
public
ResultBean
update
(
@Valid
User
user
,
@RequestParam
(
value
=
"role[]"
,
required
=
false
)
Integer
[]
roleIds
)
{
...
...
@@ -101,7 +122,13 @@ public class UserController {
return
ResultBean
.
success
();
}
@OperationLog
(
"新增用户"
)
/***
* 新增用户
* @param user
* @param roleIds
* @return
*/
@PostMapping
@ResponseBody
public
ResultBean
adduser
(
@Validated
(
Create
.
class
)
User
user
,
@RequestParam
(
value
=
"role[]"
,
required
=
false
)
Integer
[]
roleIds
)
{
...
...
@@ -110,7 +137,12 @@ public class UserController {
return
ResultBean
.
success
(
userService
.
add
(
user
,
roleIds
));
}
@OperationLog
(
"新增用户"
)
/***
* 新增用户
* @param user
* @param roleIds
* @return
*/
@PostMapping
(
"/add"
)
@ResponseBody
public
ResultBean
add
(
@Validated
(
Create
.
class
)
User
user
,
@RequestParam
(
value
=
"role[]"
,
required
=
false
)
Integer
[]
roleIds
)
{
...
...
@@ -119,21 +151,34 @@ public class UserController {
return
ResultBean
.
success
(
userService
.
add
(
user
,
roleIds
));
}
@OperationLog
(
"禁用账号"
)
/***
* 禁用账号
* @param userId
* @return
*/
@PostMapping
(
"/{userId:\\d+}/disable"
)
@ResponseBody
public
ResultBean
disable
(
@PathVariable
(
"userId"
)
Integer
userId
)
{
return
ResultBean
.
success
(
userService
.
disableUserByID
(
userId
));
}
@OperationLog
(
"激活账号"
)
/**
* 激活账号
* @param userId
* @return
*/
@PostMapping
(
"/{userId}/enable"
)
@ResponseBody
public
ResultBean
enable
(
@PathVariable
(
"userId"
)
Integer
userId
)
{
return
ResultBean
.
success
(
userService
.
enableUserByID
(
userId
));
}
@OperationLog
(
"删除账号"
)
/***
* 删除账号
* @param userId
* @return
*/
@DeleteMapping
(
"/{userId}"
)
@ResponseBody
public
ResultBean
delete
(
@PathVariable
(
"userId"
)
Integer
userId
)
{
...
...
@@ -147,9 +192,13 @@ public class UserController {
return
"user/user-reset-pwd"
;
}
/***
* 重置密码
* @param userId
* @param password
* @return
*/
@OperationLog
(
"重置密码"
)
@PostMapping
(
"/{userId}/reset"
)
@ResponseBody
public
ResultBean
resetPassword
(
@PathVariable
(
"userId"
)
Integer
userId
,
String
password
)
{
...
...
@@ -160,7 +209,12 @@ public class UserController {
return
ResultBean
.
error
(
""
);
}
@OperationLog
(
"重置密码"
)
/**
* 重置密码
* @param user
* @param newpwd
* @return
*/
@PostMapping
(
"/myreset/{newpwd}"
)
@ResponseBody
public
ResultBean
resetPassword
(
User
user
,
@PathVariable
(
"newpwd"
)
String
newpwd
)
{
...
...
src/main/java/im/dx/system/controller/UserOnlineController.java
View file @
238fd7d4
...
...
@@ -21,22 +21,11 @@ import java.util.concurrent.*;
@Slf4j
public
class
UserOnlineController
{
@Value
(
"${ipurl}"
)
String
ipurl
;
@Autowired
private
RestTemplate
restTemplate
;
@Resource
private
UserOnlineService
userOnlineService
;
private
static
CompletionService
<
String
>
completionService
=
new
ExecutorCompletionService
<
String
>(
ThreadPoolUtil
.
getPool
());
@GetMapping
(
"/index"
)
public
String
index
()
{
return
"online/user-online-list"
;
}
@GetMapping
(
"/list"
)
@ResponseBody
...
...
@@ -45,12 +34,6 @@ public class UserOnlineController {
return
new
PageResultBean
<>(
list
.
size
(),
list
);
}
@PostMapping
(
"/kickout"
)
@ResponseBody
public
ResultBean
forceLogout
(
String
sessionId
)
{
userOnlineService
.
forceLogout
(
sessionId
);
return
ResultBean
.
success
();
}
}
src/main/java/im/dx/system/controller/VideoController.java
View file @
238fd7d4
package
im
.
dx
.
system
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
im.dx.common.
annotation.OperationLog
;
import
im.dx.common.
shiro.ShiroActionProperties
;
import
im.dx.common.util.DateUtils
;
import
im.dx.common.util.JsonUtil
;
import
im.dx.common.util.PageResultBean
;
...
...
@@ -26,9 +26,7 @@ import javax.annotation.Resource;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeoutException
;
@Controller
@RequestMapping
(
"/video"
)
...
...
@@ -46,9 +44,8 @@ public class VideoController {
private
String
rtspurl
;
@Value
(
"${file.taskurl}"
)
private
String
addtaskurl
;
@Value
(
"${dixanxinAIurl}"
)
private
String
dixanxinAIurl
;
@Resource
private
ShiroActionProperties
shiroActionProperties
;
...
...
@@ -59,23 +56,39 @@ public class VideoController {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
@OperationLog
(
"根据deptId获取用户列表"
)
/***
* 根据deptId获取用户列表
* @param page
* @param pageSize
* @param deptId
* @param userId
* @param username
* @param videoName
* @return
*/
@GetMapping
(
"/list"
)
@ResponseBody
public
PageResultBean
<
Video
>
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
value
=
"deptId"
)
String
deptId
,
@RequestParam
(
value
=
"userId"
)
String
userId
,
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"videoName"
)
String
videoName
)
{
List
<
Video
>
videos
=
videoService
.
selectByMutiParam
(
page
,
pageSize
,
deptId
,
videoName
);
if
(
null
!=
username
&&
shiroActionProperties
.
getSuperAdminUsername
().
equals
(
username
))
{
userId
=
null
;
}
List
<
Video
>
videos
=
videoService
.
selectByMutiParam
(
page
,
pageSize
,
deptId
,
userId
,
videoName
);
PageInfo
<
Video
>
userPageInfo
=
new
PageInfo
<>(
videos
);
return
new
PageResultBean
<>(
userPageInfo
.
getTotal
(),
userPageInfo
.
getList
());
}
/***
* 新增监控
* @param video
* @return
*/
@OperationLog
(
"新增监控"
)
@PostMapping
(
"/add"
)
@ResponseBody
public
ResultBean
add
(
Sbtdspsr
video
)
{
...
...
@@ -84,7 +97,11 @@ public class VideoController {
return
ResultBean
.
success
(
videoService
.
add
(
video
));
}
@OperationLog
(
"删除监控"
)
/***
* 删除监控
* @param id
* @return
*/
@GetMapping
(
"/delete/{Id}"
)
@ResponseBody
public
ResultBean
delete
(
@PathVariable
(
"Id"
)
String
id
)
{
...
...
@@ -92,12 +109,15 @@ public class VideoController {
return
ResultBean
.
success
();
}
@OperationLog
(
"抽帧"
)
/***
* 抽帧
* @param videoid
* @return
*/
@PostMapping
(
"/getSnapshot"
)
@ResponseBody
public
ResultObj
getSnapshot
(
@RequestBody
String
videoid
)
{
//
根据rtsp 获得 图片地址
//
根据rtsp 获得 图片地址
videoid
=
videoid
.
replace
(
"\""
,
""
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON_UTF8
);
...
...
@@ -107,32 +127,40 @@ public class VideoController {
if
(
null
!=
result
)
{
if
(
null
!=
result
.
get
(
"ret"
)
&&
String
.
valueOf
(
result
.
get
(
"ret"
)).
equals
(
"0"
)
&&
result
.
get
(
"desc"
).
toString
().
contains
(
"succ"
))
{
//
获得图片地址
//
获得图片地址
return
ResultObj
.
ok
(
result
.
get
(
"url"
).
toString
());
}
}
return
ResultObj
.
error
(
999
,
"
超时
"
);
return
ResultObj
.
error
(
999
,
"
超时"
);
}
@OperationLog
(
"添加任务"
)
/***
* 添加任务
* @param jobParam
* @return
*/
@PostMapping
(
"/task"
)
@ResponseBody
public
TaskResultObj
scheduleJob
(
@RequestBody
JobParam
jobParam
)
{
//根据type 判断是新增、删除、停止、开始
//0新增 1开启 2停止 3删除
if
(
jobParam
.
getType
().
equals
(
"0"
))
{
//根据taskno 判断是否存在
String
taskno
=
"fx_"
+
jobParam
.
getDeviceId
()
+
"_"
+
jobParam
.
getDetectType
();
if
(
null
!=
jobParam
.
getParams
().
get
(
"taskno"
))
{
taskno
=
jobParam
.
getParams
().
get
(
"taskno"
).
toString
();
}
//根据type 判断是新增、删除、停止、开始
//0新增 1开启 2停止 3删除
//根据taskno 判断是否存在
String
objstr
=
"0"
;
if
(
null
!=
jobParam
.
getParams
().
get
(
"objectType"
)){
objstr
=
jobParam
.
getParams
().
get
(
"objectType"
).
toString
();
}
String
taskno
=
"fx_"
+
jobParam
.
getDeviceId
()
+
"_"
+
jobParam
.
getDetectType
()+
"_"
+
objstr
;
if
(
null
!=
jobParam
.
getParams
().
get
(
"taskno"
))
{
taskno
=
jobParam
.
getParams
().
get
(
"taskno"
).
toString
();
}
if
(
null
!=
jobParam
.
getType
()
&&
jobParam
.
getType
().
equals
(
"0"
))
{
int
fxtasknum
=
videoService
.
taskExists
(
taskno
);
if
(
fxtasknum
>
0
)
{
return
TaskResultObj
.
error
(
"-2"
,
"
任务已经存在
"
);
return
TaskResultObj
.
error
(
"-2"
,
""
);
}
}
//
调用第三方接口
//
调用第三方接口
List
<
Point
>
points
=
new
ArrayList
<>();
Point
point
=
jobParam
.
getArea
()
!=
null
?
jobParam
.
getArea
().
size
()
>
0
?
jobParam
.
getArea
().
get
(
0
)
:
null
:
null
;
if
(
null
!=
point
)
{
...
...
@@ -157,59 +185,59 @@ public class VideoController {
try
{
return
CompletableFuture
.
supplyAsync
(()
->
restTemplate
.
postForObject
(
addtaskurl
,
requestEntity
,
TaskResultObj
.
class
)).
get
(
500
,
TimeUnit
.
MILLISECONDS
);
}
catch
(
TimeoutException
ex
){
log
.
error
(
"添加任务error:{}"
,
ex
.
toString
());
return
TaskResultObj
.
error
(
"-1"
,
"请求超时!"
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"添加任务error:{}"
,
e
.
toString
());
return
TaskResultObj
.
error
(
"-1"
,
"请求中断!"
);
}
catch
(
ExecutionException
e
)
{
log
.
error
(
"添加任务error:{}"
,
e
.
toString
());
return
TaskResultObj
.
error
(
"-1"
,
"请求失败!"
);
catch
(
Exception
ex
){
log
.
error
(
"添加任务error:{}"
,
ex
.
toString
());
return
TaskResultObj
.
error
(
"-1"
,
"!"
);
}
}
/***
* 添加垃圾溢出识别任务
* @param jobParam
* @return
*/
@OperationLog
(
"添加垃圾溢出识别任务"
)
@PostMapping
(
"/LJTtask"
)
@ResponseBody
public
TaskResultObj
LJTtask
(
@RequestBody
JobLJTParam
jobParam
)
{
if
(
jobParam
.
getParams
()
!=
null
)
{
//获得四个点的坐标
log
.
info
(
"添加垃圾溢出识别任务"
);
if
(
jobParam
.
getParams
()
!=
null
)
{
//获得四个点的坐标
if
(
null
!=
jobParam
.
getParams
().
get
(
"region"
)
)
{
Map
pointmap
=(
Map
)
jobParam
.
getParams
().
get
(
"region"
);
try
{
Point
point
=
JsonUtil
.
strToObj
(
JsonUtil
.
objToStr
(
pointmap
),
Point
.
class
);
//
调用第三方
//
调用第三方
Integer
[][]
arrresult
=
{{
point
.
getX
(),
point
.
getY
()
+
point
.
getH
()},
{
point
.
getX
(),
point
.
getY
()},
{
point
.
getX
()
+
point
.
getW
(),
point
.
getY
()},
{
point
.
getX
()
+
point
.
getW
(),
point
.
getY
()
+
point
.
getH
()}};
//
入表数据
//
入表数据
jobParam
.
getParams
().
put
(
"region"
,
point
.
getX
()+
","
+
point
.
getY
()+
","
+
point
.
getW
()+
","
+
point
.
getH
()
);
//
新增任务
//
调用电信算法,返回结果成功后入表
//
新增任务
//
调用电信算法,返回结果成功后入表
Map
mapresult
=
cutpictureService
.
CreateTaskLJTMYJC
(
jobParam
.
getDeviceNum
(),
jobParam
.
getInterval
(),
arrresult
);
log
.
info
(
JsonUtil
.
objToStr
(
mapresult
));
if
(
null
!=
mapresult
&&
null
!=
mapresult
.
get
(
"errorCode"
)&&
mapresult
.
get
(
"errorCode"
).
toString
().
equals
(
"0"
))
{
//
任务新建成功,数据入表{"errorCode":"0","errorMsg":"成功
","data":{"taskId":"da7fa7b502014547b1bdced4ea5bc8629344"}}
//
任务新建成功,数据入表{"errorCode":"0","errorMsg":"成功","dat
a":{"taskId":"da7fa7b502014547b1bdced4ea5bc8629344"}}
Map
result
=(
Map
)
mapresult
.
get
(
"data"
);
if
(
null
!=
result
.
get
(
"taskId"
)){
//
表,将开始时间结束时间放入表中
//
表,将开始时间结束时间放入表中
jobParam
.
getParams
().
put
(
"taskId"
,
result
.
get
(
"taskId"
).
toString
());
algorithmPreprocessService
.
add
(
jobParam
);
}
}
else
{
log
.
error
(
"
添加垃圾溢出识别任务
:error:{}"
,
mapresult
.
get
(
"errorMsg"
));
log
.
error
(
"
添加垃圾溢出识别任务 :err
or:{}"
,
mapresult
.
get
(
"errorMsg"
));
return
TaskResultObj
.
error
(
"-1"
,
mapresult
.
get
(
"errorMsg"
).
toString
());
}
}
catch
(
Exception
ex
){
log
.
error
(
"
添加垃圾溢出识别任务
:error:{}"
,
ex
.
toString
());
return
TaskResultObj
.
error
(
"-1"
,
"
异常
"
);
log
.
error
(
"
添加垃圾溢出识别任务 :err
or:{}"
,
ex
.
toString
());
return
TaskResultObj
.
error
(
"-1"
,
"
异常"
);
}
}
...
...
@@ -218,14 +246,17 @@ public class VideoController {
return
TaskResultObj
.
ok
();
}
@OperationLog
(
"开启或者停止任务"
)
/***
* 开启或者停止任务
* @param jobParam
* @return
*/
@PostMapping
(
"/taskmange"
)
@ResponseBody
public
TaskResultObj
taskstop
(
@RequestBody
JobLJTParam
jobParam
)
{
//
调用第三方的停止任务
//
调用第三方的停止任务
try
{
if
(
jobParam
.
getStatus
()==
2
&&
null
!=
jobParam
.
getParams
().
get
(
"taskId"
))
{
//1:
新建,2:暂停,3:重启,4:删除
if
(
jobParam
.
getStatus
()==
2
&&
null
!=
jobParam
.
getParams
().
get
(
"taskId"
))
{
//1:
新建,2:暂停,3:重启,4:删除
Map
result
=
cutpictureService
.
StopTask
(
jobParam
.
getDeviceNum
(),
jobParam
.
getParams
().
get
(
"taskId"
).
toString
());
if
(
null
!=
result
.
get
(
"errorCode"
)
&&
result
.
get
(
"errorCode"
).
toString
().
equals
(
"0"
))
{
algorithmPreprocessService
.
update
(
jobParam
);
...
...
@@ -245,7 +276,7 @@ public class VideoController {
}
else
if
(
jobParam
.
getStatus
()==
4
&&
null
!=
jobParam
.
getParams
().
get
(
"taskId"
))
{
Map
result
=
cutpictureService
.
DeleteTask
(
jobParam
.
getDeviceNum
(),
jobParam
.
getParams
().
get
(
"taskId"
).
toString
());
//
删除记录
//
删除记录
if
(
null
!=
result
.
get
(
"errorCode"
)
&&
result
.
get
(
"errorCode"
).
toString
().
equals
(
"0"
))
{
algorithmPreprocessService
.
delete
(
jobParam
);
}
...
...
@@ -256,13 +287,17 @@ public class VideoController {
}
}
catch
(
Exception
ex
){
log
.
error
(
"
任务管理失败:{
}"
,
ex
);
log
.
error
(
"
任务管理失败:{}"
,
ex
);
return
TaskResultObj
.
error
(
"-1"
,
"error"
);
}
return
TaskResultObj
.
ok
();
}
@OperationLog
(
"编辑监控"
)
/**
* 编辑监控
* @param video
* @return
*/
@PostMapping
(
"/edit"
)
@ResponseBody
public
ResultBean
edit
(
Sbtdspsr
video
)
{
...
...
@@ -275,24 +310,27 @@ public class VideoController {
return
ResultBean
.
success
();
}
@OperationLog
(
"添加相机自动抓拍任务"
)
/**
* 添加相机自动抓拍任务
* @param jobParam
* @return
*/
@PostMapping
(
"/autoSnapTask"
)
@ResponseBody
public
TaskResultObj
autoSnapTask
(
@RequestBody
JobParam
jobParam
)
{
//0
新增 1开启 2停止 3删除
//0
新增 1开启 2停止 3删除
String
taskno
=
jobParam
.
getDeviceId
()
+
"_"
+
jobParam
.
getDetectType
();
if
(
jobParam
.
getType
().
equals
(
"0"
))
{
//
根据taskno 判断是否存在
//
根据taskno 判断是否存在
if
(
null
!=
jobParam
.
getParams
().
get
(
"taskno"
))
{
taskno
=
jobParam
.
getParams
().
get
(
"taskno"
).
toString
();
}
int
fxtasknum
=
autoSnapService
.
taskAutoSnapExists
(
taskno
);
if
(
fxtasknum
>
0
)
{
return
TaskResultObj
.
error
(
"-2"
,
"
任务已经存在
"
);
return
TaskResultObj
.
error
(
"-2"
,
"
任务已经存在"
);
}
}
//
新增到表中
//
新增到表中
Autosnaptaskinfo
autosnaptaskinfo
=
new
Autosnaptaskinfo
();
autosnaptaskinfo
.
setAlgorithmfrom
(
"1"
);
autosnaptaskinfo
.
setDevicenum
(
jobParam
.
getDeviceId
());
...
...
@@ -319,7 +357,7 @@ public class VideoController {
autoSnapService
.
add
(
autosnaptaskinfo
);
}
catch
(
Exception
ex
){
log
.
error
(
ex
.
toString
());
return
TaskResultObj
.
error
(
"-2"
,
"
新增失败
"
);
return
TaskResultObj
.
error
(
"-2"
,
"
新增失败"
)
;
}
return
TaskResultObj
.
ok
();
...
...
@@ -328,28 +366,28 @@ public class VideoController {
@PostMapping
(
"/autosnaptaskmange"
)
@ResponseBody
public
TaskResultObj
autosnaptaskmange
(
@RequestBody
JobParam
jobParam
)
{
//
根据type 判断是新增、删除、停止、开始
//0
新增 1开启 2停止 3删除
//
根据type 判断是新增、删除、停止、开始
//0
新增 1开启 2停止 3删除
if
(
null
!=
jobParam
.
getParams
()
&&
null
!=
jobParam
.
getParams
().
get
(
"taskId"
))
{
String
taskid
=
jobParam
.
getParams
().
get
(
"taskId"
).
toString
();
try
{
if
(
jobParam
.
getType
().
equalsIgnoreCase
(
"3"
)
&&
null
!=
jobParam
.
getParams
().
get
(
"taskId"
))
{
//
删除
//
删除
autoSnapService
.
delete
(
taskid
);
}
else
{
//
更新任务状态
}
else
{
//
更新任务状态
autoSnapService
.
update
(
taskid
,
jobParam
.
getType
());
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"
任务管理失败:{
}"
,
ex
);
log
.
error
(
"
任务管理失败:{}"
,
ex
);
return
TaskResultObj
.
error
(
"-1"
,
"error"
);
}
return
TaskResultObj
.
ok
();
}
return
TaskResultObj
.
error
(
"-1"
,
"
参数为空
"
);
return
TaskResultObj
.
error
(
"-1"
,
"
参数为空"
)
;
}
/***
*
随机抽一帧图片,返回结果为存到表里吧
*
随机抽一帧图片,返回结果为存到表里吧
*/
@GetMapping
(
"/getsnap/{sbbh}"
)
...
...
@@ -363,6 +401,9 @@ public class VideoController {
Map
result
=
restTemplate
.
getForObject
(
rtspurl
+
"?deviceCode={deviceCode}"
,
Map
.
class
,
maps
);
if
(
null
!=
result
)
{
if
(
null
!=
result
.
get
(
"ret"
)
&&
String
.
valueOf
(
result
.
get
(
"ret"
)).
equals
(
"0"
))
{
if
(
result
.
get
(
"url"
).
equals
(
""
)){
return
TaskResultObj
.
error
(
"-1"
,
"图片地址获取失败"
);
}
videoService
.
updateImgSrc
(
result
.
get
(
"url"
)
==
null
?
""
:
result
.
get
(
"url"
).
toString
(),
sbbh
);
return
TaskResultObj
.
ok
(
result
.
get
(
"url"
)
==
null
?
""
:
result
.
get
(
"url"
).
toString
());
}
...
...
src/main/java/im/dx/system/mapper/DeptTreeMapper.java
View file @
238fd7d4
...
...
@@ -22,7 +22,7 @@ public interface DeptTreeMapper {
List
<
DeptTree
>
selectByParentId
(
@Param
(
"parentId"
)
String
parentId
);
List
<
DeptTree
>
selectAllTree
(
@Param
(
"parent_id"
)
String
parent_id
);
List
<
DeptTree
>
selectAllVideoTree
(
@Param
(
"parent_id"
)
String
parent_id
);
List
<
DeptTree
>
selectAllVideoTree
(
@Param
(
"parent_id"
)
String
parent_id
,
@Param
(
"username"
)
String
username
);
List
<
String
>
selectChildrenIDByPrimaryKey
(
@Param
(
"deptId"
)
String
deptId
);
...
...
src/main/java/im/dx/system/mapper/TraffalarmrecordMapper.java
View file @
238fd7d4
package
im
.
dx
.
system
.
mapper
;
import
com.sun.tracing.dtrace.ModuleAttributes
;
import
im.dx.system.model.DeviceChannelid
;
import
im.dx.system.model.Traffalarmrecord
;
import
im.dx.system.model.TraffalarmrecordResult
;
...
...
src/main/java/im/dx/system/mapper/TrafficStatisticsMapper.java
View file @
238fd7d4
...
...
@@ -23,9 +23,13 @@ public interface TrafficStatisticsMapper {
List
<
TraffpictureParam
>
queryTraffalarmrecordByPage
(
Map
map
);
List
<
TraffpictureParam
>
queryTaskInfoByPage
(
Map
map
);
int
updateTraffalarmrecordById
(
@Param
(
value
=
"list"
)
List
<
TraffpictureParam
>
recordlist
);
int
updateDisputesInfo
(
@Param
(
value
=
"list"
)
List
<
TraffpictureParam
>
recordlist
);
List
<
RecordResult
>
todaytraffRecords
(
Map
map
);
public
List
<
Map
>
todaythbtraffRecords
(
Map
map
);
...
...
@@ -39,10 +43,11 @@ public interface TrafficStatisticsMapper {
List
<
Traffalarmrecordstate
>
selecteventresultBypage
(
TraffalarmrecordstatParams
params
);
int
deleteTraffalarmrecordById
(
String
recordid
);
int
deleteTraffalarmrecordById
(
String
recordid
);
int
updateTraffalarmrecordPushStatusById
(
String
recordid
);
int
updateTraffalarmrecordPushStatusById
(
String
recordid
);
int
deleteTraffalarmrecordByIds
(
String
recordid
);
int
deleteTraffalarmrecordByIds
(
String
recordid
);
List
<
Pedestrian
>
queryTraffPedeDetail
(
String
id
);
...
...
@@ -53,5 +58,13 @@ public interface TrafficStatisticsMapper {
List
<
PeopleRideBicyc
>
queryTraffPeopleRideBicycDetail
(
String
id
);
int
delTraffalarmrecordByIds
(
@Param
(
value
=
"list"
)
List
<
TraffpictureParam
>
recordlist
);
int
delDisputesInfo
(
@Param
(
value
=
"list"
)
List
<
TraffpictureParam
>
recordlist
);
int
deltaskinfoByIds
(
@Param
(
value
=
"list"
)
List
<
TraffpictureParam
>
recordlist
);
List
<
StatisticsData
>
eventStatistics
(
StatisticsParam
statisticsParam
);
List
<
StatisticsData
>
deviceStatistics
(
StatisticsParam
statisticsParam
);
List
<
StatisticsData
>
departmentEventStatistics
(
StatisticsParam
statisticsParam
);
List
<
Map
>
sendInfoStatistics
(
StatisticsParam
statisticsParam
);
}
\ No newline at end of file
src/main/java/im/dx/system/mapper/VideoMapper.java
View file @
238fd7d4
...
...
@@ -10,7 +10,9 @@ import java.util.List;
@Mapper
public
interface
VideoMapper
{
List
<
Video
>
selectByMutiParam
(
@Param
(
"deptId"
)
String
deptId
,
@Param
(
"videoName"
)
String
videoName
);
List
<
Video
>
selectByMutiParam
(
@Param
(
"deptId"
)
String
deptId
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"videoName"
)
String
videoName
);
int
insert
(
Sbtdspsr
video
);
void
delete
(
String
id
);
void
updateByPrimaryKey
(
Sbtdspsr
video
);
...
...
src/main/java/im/dx/system/model/DeptVideo.java
View file @
238fd7d4
...
...
@@ -58,6 +58,15 @@ public class DeptVideo implements Serializable {
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
private
List
<
DeptVideo
>
nodes
;
private
Integer
vels
;
private
String
idsets
;
public
String
getIdsets
()
{
return
idsets
;
}
public
void
setIdsets
(
String
idsets
)
{
this
.
idsets
=
idsets
;
}
public
String
getDeptId
()
{
return
deptId
;
...
...
src/main/java/im/dx/system/model/ResponseEnum.java
View file @
238fd7d4
...
...
@@ -4,29 +4,29 @@ package im.dx.system.model;
import
lombok.Getter
;
/**
*
通用返回值 枚举类
*
通用返回值 枚举类
* @author cp
*/
@Getter
public
enum
ResponseEnum
{
/*
错误信息
*/
E_1000
(
1000
,
"
返回值必须为
PageResult"
),
E_1001
(
1001
,
"
必须传递分页参数
"
),
E_1002
(
1002
,
"
参数值异常
"
),
E_1003
(
1003
,
"
参数值转换异常
"
),
E_1004
(
1004
,
"
参数值为空
"
),
/*
保存 更新 重置 删除 等
*/
E_1005
(
1005
,
"
更新失败
"
),
E_1006
(
1006
,
"
无结果
"
),
E_1007
(
1007
,
"
未登录
"
),
E_1008
(
1008
,
"
请求超时
"
),
E_1009
(
1009
,
"
请求下游服务异常
"
),
E_1010
(
1010
,
"
数据保存失败
"
),
E_1011
(
1011
,
"
数据重复
"
),
E_9999
(
9999
,
"
系统异常
"
),
SUCCESS
(
200
,
"
请求成功
"
);
/*
错误信息 *
/
E_1000
(
1000
,
"
返回值必须为Pag
eResult"
),
E_1001
(
1001
,
"
必须传递分页参数"
),
E_1002
(
1002
,
"
参数值异常"
)
,
E_1003
(
1003
,
"
参数值转换异常"
),
E_1004
(
1004
,
"
参数值为空"
)
,
/*
保存 更新 重置 删除 等 */
E_1005
(
1005
,
"
更新失败"
)
,
E_1006
(
1006
,
"
无结果"
),
E_1007
(
1007
,
"
未登录"
),
E_1008
(
1008
,
"
请求超时"
)
,
E_1009
(
1009
,
"
请求下游服务异常"
),
E_1010
(
1010
,
"
数据保存失败"
),
E_1011
(
1011
,
"
数据重复"
)
,
E_9999
(
9999
,
"
系统异常"
)
,
SUCCESS
(
200
,
"
请求成功"
)
;
private
int
code
;
...
...
src/main/java/im/dx/system/model/ResultObj.java
View file @
238fd7d4
...
...
@@ -8,31 +8,31 @@ import lombok.Setter;
import
java.util.List
;
/**
*
自定义响应结构
*
自定义响应结构
* @author cp
*/
@Getter
@Setter
public
class
ResultObj
{
//
定义jackson对象
//
定义jackson对象
private
static
final
ObjectMapper
MAPPER
=
new
ObjectMapper
();
/**
*
响应业务状态
* 200
成功
* 201
错误
* 400
参数错误
*
响应业务状态
* 200
成功
* 201
错误
* 400
参数错误
*/
private
Integer
status
;
/**
*
响应消息
*
响应消息
*/
private
String
msg
;
/**
*
响应中的数据
*
响应中的数据
*/
private
Object
data
;
...
...
@@ -70,11 +70,11 @@ public class ResultObj {
/**
*
将json结果集转化为SysResult对象
*
将json结果集转化为SysResult对象
*
* @param jsonData json
数据
* @param clazz SysResult
中的object类型
* @return SysResult
对象
* @param jsonData json
数据
* @param clazz SysResult
中的object类型
* @return SysResult
对象
*/
public
static
ResultObj
formatToPojo
(
String
jsonData
,
Class
<?>
clazz
)
{
try
{
...
...
@@ -97,10 +97,10 @@ public class ResultObj {
}
/**
*
没有object对象的转化
*
没有object对象的转化
*
* @param json
字符串
* @return SysResult
对象
* @param json
字符串
* @return SysResult
对象
*/
public
static
ResultObj
format
(
String
json
)
{
try
{
...
...
@@ -112,11 +112,11 @@ public class ResultObj {
}
/**
* Object
是集合转化
* Object
是集合转化
*
* @param jsonData json
数据
* @param clazz
集合中的类型
* @return SysResult
对象
* @param jsonData json
数据
* @param clazz
集合中的类型
* @return SysResult
对象
*/
public
static
ResultObj
formatToList
(
String
jsonData
,
Class
<?>
clazz
)
{
try
{
...
...
src/main/java/im/dx/system/model/TraffpictureParam.java
View file @
238fd7d4
...
...
@@ -14,7 +14,7 @@ import java.util.Date;
* @since 2021-04-29
*/
public
class
TraffpictureParam
extends
Traffpicture
{
private
Long
record
id
;
private
Long
id
;
private
String
fdid
;
private
Integer
channelid
;
private
Long
areaid
;
...
...
@@ -151,12 +151,14 @@ public class TraffpictureParam extends Traffpicture {
this
.
imagedata
=
imagedata
;
}
public
Long
getRecordid
()
{
return
recordid
;
@Override
public
Long
getId
()
{
return
id
;
}
public
void
setRecordid
(
Long
recordid
)
{
this
.
recordid
=
recordid
;
@Override
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getFdid
()
{
...
...
src/main/java/im/dx/system/service/DeptTreeService.java
View file @
238fd7d4
...
...
@@ -82,8 +82,8 @@ public class DeptTreeService {
/**
* 查找所有的部门的树形结构
*/
public
List
<
DeptTree
>
selectAllVideoTree
(
String
parentId
)
{
return
deptTreeMapper
.
selectAllVideoTree
(
parentId
);
public
List
<
DeptTree
>
selectAllVideoTree
(
String
parentId
,
String
userId
)
{
return
deptTreeMapper
.
selectAllVideoTree
(
parentId
,
userId
);
}
...
...
src/main/java/im/dx/system/service/MenuService.java
View file @
238fd7d4
...
...
@@ -60,7 +60,7 @@ public class MenuService {
*/
public
List
<
Menu
>
getALLMenuTreeAndRoot
()
{
List
<
Menu
>
allMenuTree
=
getALLTree
();
return
addRootNode
(
"
导航目录
"
,
0
,
allMenuTree
);
return
addRootNode
(
""
,
0
,
allMenuTree
);
}
/**
...
...
src/main/java/im/dx/system/service/TrafficStatisticsService.java
View file @
238fd7d4
...
...
@@ -27,7 +27,6 @@ public class TrafficStatisticsService {
public
List
<
TraffpictureParam
>
queryTaskInfoByPage
(
Map
map
,
int
page
,
int
limit
)
{
PageHelper
.
startPage
(
page
,
limit
);
List
<
TraffpictureParam
>
traffalarmrecordResults
=
trafficStatisticsMapper
.
queryTaskInfoByPage
(
map
);
return
traffalarmrecordResults
;
}
...
...
@@ -35,6 +34,10 @@ public class TrafficStatisticsService {
return
trafficStatisticsMapper
.
updateTraffalarmrecordById
(
recordlist
);
}
public
int
updateDisputesInfo
(
List
<
TraffpictureParam
>
recordlist
){
return
trafficStatisticsMapper
.
updateDisputesInfo
(
recordlist
);
}
public
List
<
RecordResult
>
todaytraffRecords
(
Map
map
)
{
return
trafficStatisticsMapper
.
todaytraffRecords
(
map
);
...
...
@@ -94,4 +97,23 @@ public class TrafficStatisticsService {
return
trafficStatisticsMapper
.
selectCodeByCodeid
(
codeid
,
level
);
}
public
int
delDisputesInfo
(
List
<
TraffpictureParam
>
recordlist
){
return
trafficStatisticsMapper
.
delDisputesInfo
(
recordlist
);
}
public
List
<
StatisticsData
>
eventStatistics
(
StatisticsParam
statisticsParam
){
return
trafficStatisticsMapper
.
eventStatistics
(
statisticsParam
);
}
public
List
<
StatisticsData
>
deviceStatistics
(
StatisticsParam
statisticsParam
){
return
trafficStatisticsMapper
.
deviceStatistics
(
statisticsParam
);
}
public
List
<
Map
>
sendInfoStatistics
(
StatisticsParam
statisticsParam
){
return
trafficStatisticsMapper
.
sendInfoStatistics
(
statisticsParam
);
}
public
List
<
StatisticsData
>
departmentEventStatistics
(
StatisticsParam
statisticsParam
){
return
trafficStatisticsMapper
.
departmentEventStatistics
(
statisticsParam
);
}
}
\ No newline at end of file
src/main/java/im/dx/system/service/VideoService.java
View file @
238fd7d4
...
...
@@ -19,9 +19,9 @@ public class VideoService {
/**
* 根据父 ID 获取所有部门下的监控信息
*/
public
List
<
Video
>
selectByMutiParam
(
int
page
,
int
rows
,
String
deptId
,
String
videoName
)
{
public
List
<
Video
>
selectByMutiParam
(
int
page
,
int
rows
,
String
deptId
,
String
userId
,
String
videoName
)
{
PageHelper
.
startPage
(
page
,
rows
);
return
videoMapper
.
selectByMutiParam
(
deptId
,
videoName
);
return
videoMapper
.
selectByMutiParam
(
deptId
,
userId
,
videoName
);
}
@Transactional
...
...
src/main/resources/application-im.properties
View file @
238fd7d4
spring.datasource.username
=
root
spring.datasource.password
=
123456
#spring.datasource.url=jdbc:mysql://172.22.135.45:12345/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&
allowPublicKeyRetrieval=true
spring.datasource.url
=
jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=
UTC&allowPublicKeyRetrieval=true
#spring.datasource.url=jdbc:mysql://172.22.135.45:12345/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&
serverTimezone=GMT%2B8
spring.datasource.url
=
jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=
GMT%2B8
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.filters
=
stat
spring.datasource.driver-class-name
=
com.mysql.
cj.
jdbc.Driver
spring.datasou
name
rce.filters
=
stat
spring.datasource.maxActive
=
1000
spring.datasource.initialSize
=
100
spring.datasource.maxWait
=
60000
...
...
src/main/resources/application-local.properties
View file @
238fd7d4
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=
Asia/Shanghai
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=
GMT%2B8
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.
cj.
jdbc.Driver
spring.datasource.filters
=
stat
spring.datasource.maxActive
=
1000
spring.datasource.initialSize
=
100
...
...
src/main/resources/application.properties
View file @
238fd7d4
spring.profiles.active
=
local
spring.profiles.active
=
devzjgs
server.port
=
8083
mybatis.configuration.map-underscore-to-camel-case
=
true
mybatis.configuration.default-fetch-size
=
100
mybatis.configuration.default-statement-timeout
=
3000
mybatis.type-aliases-package
=
im.dx.system.model.vo
mybatis.mapper-locations
=
classpath:mapper/*.xml
file.rtspurl
=
http://zjh189.ncpoi.cc:7180/getDeviceSnapshot
file.taskurl
=
http://172.16.24.29:8089/ai/task
spring.http.encoding.force
=
true
...
...
src/main/resources/logback-spring.xml
View file @
238fd7d4
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
scan=
"false"
>
<springProperty
scop=
"context"
name=
"spring.application.name"
source=
"spring.application.name"
defaultValue=
""
/>
<property
name=
"log.path"
value=
"/home/ubuntu/tar/
videoalarm/logs
/${spring.application.name}"
/>
<property
name=
"log.path"
value=
"/home/ubuntu/tar/
logs/zjgszdVideoAlarmService
/${spring.application.name}"
/>
<!--<property name="log.path" value="/home/prod/deploy/HZDXService/logs/${spring.application.name}"/>-->
<!-- 彩色日志格式 -->
<property
name=
"CONSOLE_LOG_PATTERN"
...
...
src/main/resources/mapper/DeptMapper.xml
View file @
238fd7d4
...
...
@@ -55,6 +55,7 @@
<result
column=
"parent_id"
jdbcType=
"INTEGER"
property=
"parentId"
/>
<result
column=
"order_num"
jdbcType=
"INTEGER"
property=
"orderNum"
/>
<result
column=
"vels"
jdbcType=
"INTEGER"
property=
"vels"
/>
<result
column=
"idsets"
jdbcType=
"VARCHAR"
property=
"idsets"
/>
</resultMap>
...
...
@@ -160,10 +161,10 @@
<where>
<choose>
<when
test=
"parent_id!=null"
>
and
parent_id = #{parent_id}
and
find_in_set(#{parent_id},idsets)
</when>
<otherwise>
and
parent_id =0
and
find_in_set('0',idsets)
</otherwise>
</choose>
</where>
...
...
@@ -171,43 +172,47 @@
</select>
<select
id=
"listvideo"
resultMap=
"VideoTreeBaseResultMap"
>
select distinct t.dept_id dept_id,
select distinct t.dept_id dept_id,
t.dept_name ,
parent_id
parent_id,
levels
,t.order_num,0 vel
s
parent_id parent_id,
levels
,t.order_num,0 vels,idset
s
from dept t
<if
test=
"deptId != null and deptId!=0"
>
,t_user a
where a.dept_id = t.dept_id
and a.dept_id = #{deptId}
<if
test=
"username != null and username!='' "
>
and a.username = #{username}
</if>
</if>
union all
select a.* ,0 vels from (SELECT
CONCAT_WS( '_' ,A .sbbh , tdbh) dept_id,
union
select a.* ,0 vels from (SELECT
A .sbbh dept_id,
A .tdmc dept_name,
A .xzbh
parent_id,
A .xzbh parent_id,
'' levels,
(
SELECT
max(order_num)
FROM
dept
) + (@rownum := @rownum + 1) order_num
0 order_num,0 idsets
FROM
dept T,(SELECT @rownum:=0) r ,
sbtdspsr A where
T .dept_id = A .xzbh
sbtdspsr
A where
T .dept_id = A .xzbh and
find_in_set(A.xzbh,T.idsets)
and find_in_set(#{deptId},idsets)
<if
test=
"tdmc != null and tdmc!='' "
>
and tdmc like '%${tdmc}%'
</if>
)a
and tdmc like '%${tdmc}%'
</if>
)a
union
select a.* ,0 vels,0 idsets from (SELECT
a .sbbh dept_id,
a .tdmc dept_name,
a .xzbh parent_id,
'' levels,
0 order_num
from sbtdspsr a,role_videoerecordtype b,user_role c
where a.sbbh=b.videorecordtypeid and b.roleid=c.role_id
and c.user_id=
(select distinct user_id from t_user where username=#{username})
)a
</select>
<select
id=
"listAllvideoIdsByDeptid"
resultType=
"java.util.HashMap"
>
select
concat(sbbh,'_',tdbh)
vidoid
select
sbbh
vidoid
from sbtdspsr a
where a.xzbh in (
select t1.dept_id
...
...
src/main/resources/mapper/DeptTreeMapper.xml
View file @
238fd7d4
...
...
@@ -28,8 +28,8 @@
<result
column=
"order_num"
jdbcType=
"INTEGER"
property=
"orderNum"
/>
<result
column=
"create_time"
jdbcType=
"VARCHAR"
property=
"createTime"
/>
<result
column=
"modify_time"
jdbcType=
"VARCHAR"
property=
"modifyTime"
/>
<
!--<collection property="children" ofType="im.zhaojun.system.model.DeptTree" select="selectAllTree"-->
<!--column="{parent_id = dept_id}"/>--
>
<
collection
property=
"children"
ofType=
"im.dx.system.model.DeptTree"
select=
"selectAllTree"
column=
"{parent_id = dept_id}"
/
>
</resultMap>
<resultMap
id=
"TreeBaseVideoResultMap"
type=
"im.dx.system.model.DeptTree"
>
...
...
@@ -131,18 +131,14 @@
<select
id=
"selectAllTree"
resultMap=
"TreeBaseResultMap"
>
select
t1.dept_id, t1.dept_name, t1.parent_id, t1.order_num, t1.create_time, t1.modify_time,t1.levels
from dept t1 left join dept t2
on t1.parent_id = t2.dept_id
from dept t1
<where>
<choose>
<when
test=
"parent_id!=null"
>
and t1.parent_id = #{parent_id}
or t1.dept_id = #{parent_id}
or t2.parent_id =#{parent_id}
or t2.dept_id = #{parent_id}
<when
test=
"parent_id != null"
>
and parent_id = #{parent_id}
</when>
<otherwise>
t1.parent_id =
0
and parent_id =
0
</otherwise>
</choose>
</where>
...
...
@@ -158,35 +154,26 @@
t.order_num
from dept t
union
select distinct t1.dept_id dept_id,
t1.dept_name,
t1.parent_id parent_id,
t1.levels,
t1.order_num
from dept t1
left join dept t2
on t1.parent_id = t2.dept_id
where t1.parent_id =0
or t1.dept_id =0
or t2.parent_id =0
or t2.dept_id =0
union
select sbbh dept_id,
select a.* , (SELECT count(*) FROM dept) + (@rownum := @rownum + 1) order_num from (
select distinct sbbh dept_id,
tdmc dept_name,
xzbh parent_id,
'3' levels,
(SELECT count(*) FROM dept) + (@rownum := @rownum + 1) order_num
from sbtdspsr,(SELECT @rownum:=0) r
-- union
-- select taskno dept_id,
-- b.name dept_name,
-- videoid parent_id,
-- '4' levels,
-- (SELECT count(*) FROM sbtdspsr) + (@rownum := @rownum + 1) order_num
-- from quartz_task_informations a
-- left join t_code b
-- on a.recordtype = b.key and b.type=1
) a,(SELECT @rownum:=0) r
(select max(levels)+1 from dept ) levels
from dept t1, sbtdspsr A where
t1.dept_id = A.xzbh and
find_in_set(A.xzbh,idsets)
and find_in_set(#{parent_id},idsets)
union
select a.* from (SELECT
a .sbbh dept_id,
a .tdmc dept_name,
a .xzbh parent_id,
(select max(levels)+1 from dept ) levels
from sbtdspsr a,role_videoerecordtype b,user_role c
where a.sbbh=b.videorecordtypeid and b.roleid=c.role_id
and c.user_id=(select user_id from t_user where username=#{username} limit 1)
)a)a
) a,(SELECT @rownum:=0) r
order by order_num
</select>
...
...
@@ -226,7 +213,7 @@
(select name from t_code b where a.sendtype=b.key and b.type=2)sendtype,'3' tasktype,imgsrc
from autosnaptaskinfo a
where a.devicenum=#{videoId} and status!=4
order by
frozenstatus
desc
order by
id
desc
</select>
...
...
src/main/resources/mapper/LoginLogMapper.xml
View file @
238fd7d4
...
...
@@ -2,56 +2,36 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"im.dx.system.mapper.LoginLogMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"im.dx.system.model.LoginLog"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"login_time"
jdbcType=
"VARCHAR"
property=
"loginTime"
/>
<result
column=
"username"
jdbcType=
"VARCHAR"
property=
"username"
/>
<result
column=
"login_status"
jdbcType=
"CHAR"
property=
"loginStatus"
/>
<result
column=
"ip"
jdbcType=
"VARCHAR"
property=
"ip"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, login_time, username, login_status, ip
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
from login_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from login_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"im.dx.system.model.LoginLog"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into login_log (login_time, username, login_status,
ip)
values (#{loginTime,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{loginStatus,jdbcType=CHAR},
#{ip,jdbcType=VARCHAR})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"im.dx.system.model.LoginLog"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update login_log
set login_time = #{loginTime,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
...
...
src/main/resources/mapper/MenuMapper.xml
View file @
238fd7d4
...
...
@@ -49,7 +49,6 @@
<result
column=
"create_time"
jdbcType=
"VARCHAR"
property=
"createTime"
/>
<result
column=
"modify_time"
jdbcType=
"VARCHAR"
property=
"modifyTime"
/>
<result
column=
"icon"
jdbcType=
"VARCHAR"
property=
"icon"
/>
<!--<collection property="children" ofType="im.zhaojun.system.model.Menu" select="selectAllMenuAndCountOperator" column="{parent_id = menu_id}"/>-->
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
src/main/resources/mapper/OperatorMapper.xml
View file @
238fd7d4
...
...
@@ -2,10 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"im.dx.system.mapper.OperatorMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"im.dx.system.model.Operator"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"operator_id"
jdbcType=
"INTEGER"
property=
"operatorId"
/>
<result
column=
"menu_id"
jdbcType=
"INTEGER"
property=
"menuId"
/>
<result
column=
"operator_name"
jdbcType=
"VARCHAR"
property=
"operatorName"
/>
...
...
@@ -16,46 +12,27 @@
<result
column=
"modify_time"
jdbcType=
"VARCHAR"
property=
"modifyTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
operator_id, menu_id, operator_name, url, perms, http_method, create_time, modify_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
select
<include
refid=
"Base_Column_List"
/>
from operator
where operator_id = #{operatorId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from operator
where operator_id = #{operatorId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
keyColumn=
"operator_id"
keyProperty=
"operatorId"
parameterType=
"im.dx.system.model.Operator"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into operator (operator_id , menu_id, operator_name, url,
insert into operator (operator_id , menu_id, operator_name, url,
perms, http_method, create_time,
modify_time)
select max(operator_id )+1,#{menuId,jdbcType=INTEGER}, #{operatorName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},#{perms,jdbcType=VARCHAR}, #{httpMethod,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR},#{modifyTime,jdbcType=VARCHAR},#{createTime,jdbcType=VARCHAR},#{modifyTime,jdbcType=VARCHAR}
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"im.dx.system.model.Operator"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update operator
update operator
set menu_id = #{menuId,jdbcType=INTEGER},
operator_name = #{operatorName,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
...
...
src/main/resources/mapper/TrafficStatisticsMapper.xml
View file @
238fd7d4
...
...
@@ -107,7 +107,6 @@
<select
id=
"queryTraffalarmrecordByPage"
resultType=
"im.dx.system.model.TraffpictureParam"
>
SELECT
TA.*,
TA.createtime recordtime,tdmc,dept_name xzmc, NAME recordname, b.alarmnum,
...
...
@@ -118,19 +117,33 @@
AND tdbh = channelid
LEFT JOIN dept on dept_id = TA.areaid
LEFT JOIN t_code b ON TA.recordtype = LOWER( b.KEY ) AND type = 2
<if
test=
"sfpf!= null and sfpf==1"
>
INNER JOIN (
select a.*,b.username from
taskinfo a,t_user b where user_id=a.HANDLER and handler=#{userId})c ON TA.id = traffid
taskinfo a,t_user b where user_id=a.HANDLER and
state!=0 and
handler=#{userId})c ON TA.id = traffid
where c.id is not null
</if>
<if
test=
"sfpf== null or sfpf==0"
>
<if
test=
"sfpf!= null and sfpf==0"
>
left JOIN (
select a.*,b.username from
taskinfo a,t_user b where user_id=a.HANDLER and state!=0 and handler is not null)c ON TA.id = traffid
where c.id is null
</if>
<if
test=
"sfpf!= null and sfpf==2"
>
INNER JOIN (
select a.*,b.username from
taskinfo a,t_user b where user_id=a.HANDLER and state!=0 and handler is not null )c ON TA.id = traffid
where c.id is not null
</if>
<if
test=
"sfpf== null or sfpf==''"
>
LEFT JOIN (
select a.*,b.username from
taskinfo a,t_user b where user_id=a.HANDLER and handler=#{userId})c ON TA.id = traffid
taskinfo a,t_user b where user_id=a.HANDLER
and state!=0
and handler=#{userId})c ON TA.id = traffid
where c.id is null
</if>
<if
test=
"recordtype!=null and recordtype.size>0"
>
AND
<foreach
collection=
"recordtype"
open=
"("
close=
")"
separator=
" OR "
item=
"item"
>
...
...
@@ -139,10 +152,10 @@
</if>
<if
test=
"starttime!=null and starttime != ''"
>
AND TA.createtime >=
STR_TO_DATE( #{starttime}, '%Y-%m-%d %H:%i:%s'
)
AND TA.createtime >=
str_to_date( #{starttime}, '%Y-%m-%d %H:%i:%s'
)
</if>
<if
test=
"endtime!=null and endtime != ''"
>
AND TA.createtime
<
=
STR_TO_DATE( #{endtime}, '%Y-%m-%d %H:%i:%s'
)
AND TA.createtime
<
=
str_to_date( #{endtime}, '%Y-%m-%d %H:%i:%s'
)
</if>
<if
test=
"processstatus!= null and processstatus.size>0"
>
...
...
@@ -158,6 +171,7 @@
( TA.fdid = #{item} )
</foreach>
</if>
ORDER BY TA.createtime DESC
</select>
<select
id=
"queryTaskInfoByPage"
resultType=
"im.dx.system.model.TraffpictureParam"
>
...
...
@@ -172,11 +186,11 @@
LEFT join dept on dept_id = TA.areaid
LEFT JOIN t_code b ON TA.recordtype = LOWER( b.KEY )AND type = 2
<if
test=
"sfpf!= null and sfpf==1"
>
inner JOIN taskinfo c ON TA.id = traffid and handler=#{userId}
inner JOIN taskinfo c ON TA.id = traffid and
state!=0 and
handler=#{userId}
where c.id is not null
</if>
<if
test=
"sfpf== null or sfpf==0"
>
LEFT JOIN taskinfo c ON TA.id = traffid and handler=#{userId}
LEFT JOIN taskinfo c ON TA.id = traffid
and state!=0 x
and handler=#{userId}
where c.id is null
</if>
<if
test=
"recordtype!=null and recordtype.size>0"
>
...
...
@@ -198,7 +212,6 @@
</foreach>
</if>
<if
test=
"videoids!= null and videoids.size>0"
>
AND
<foreach
collection=
"videoids"
open=
"("
close=
")"
separator=
" OR "
item=
"item"
>
...
...
@@ -308,27 +321,25 @@
<select
id=
"selectPushRecordsBypage"
resultType=
"im.dx.system.model.TraffalarmrecordResult"
>
SELECT A.*,B.TDMC TDMC,C.NAME RECORDNAME,
D.dept_NAME XZMC
FROM traffpicture A
INNER JOIN SBTDSPSR B ON A.FDID=B.SBBH AND A.CHANNELID=B.TDBH
LEFT JOIN T_CODE C ON C.KEY=UPPER(RECORDTYPE)
LEFT JOIN dept D ON D.dept_ID=A.AREAID
SELECT a.*,b.tdmc tdmc,c.name recordname
FROM traffpicture a
INNER JOIN sbtdspsr b on a.fdid=b.sbbh
LEFT JOIN t_code c on c.key=upper(recordtype)
<where>
<if
test=
"starttime != '' and starttime != null "
>
AND
A.CREATETIME >= STR_TO_DATE
( #{starttime}, '%Y-%m-%d %H:%i:%s' )
AND
a.createtime >= str_to_date
( #{starttime}, '%Y-%m-%d %H:%i:%s' )
</if>
<if
test=
"endtime != '' and endtime != null "
>
AND
A.CREATETIME
<![CDATA[ <= ]]>
STR_TO_DATE
( #{endtime}, '%Y-%m-%d %H:%i:%s' )
AND
a.createtime
<![CDATA[ <= ]]>
str_to_date
( #{endtime}, '%Y-%m-%d %H:%i:%s' )
</if>
<if
test=
"pushstatus!=null and pushstatus!=9"
>
AND
PUSHSTATUS
= #{pushstatus}
AND
pushstatus
= #{pushstatus}
</if>
<if
test=
"pushstatus!=null and pushstatus==9"
>
AND (
PUSHSTATUS
is null OR PUSHSTATUS=9)
AND (
pushstatus
is null OR PUSHSTATUS=9)
</if>
<if
test=
"tdmc!=null and tdmc!=''"
>
AND
(B.TDMC
like concat('%',#{tdmc},'%')
AND
b.tdmc
like concat('%',#{tdmc},'%')
</if>
<if
test=
"userId!=null and userId!=''"
>
AND sbbh in ( select videorecordtypeid from user_role a , role_videoerecordtype b where
...
...
@@ -342,7 +353,7 @@
)
</if>
</where>
ORDER BY CREATETIME DESC
order by createtime desc
</select>
<select
id=
"selecteventresultBypage"
parameterType=
"im.dx.system.model.TraffalarmrecordstatParams"
...
...
@@ -437,10 +448,7 @@
(select name from t_code t where type='GenderType' and t.key=gender ) gender,
(select name from t_code t where type='AgeType' and t.key=age ) age,
(select name from t_code t where type='AngleType' and t.key=angle )angle,
hasbackpack,
hasglasses,
hascarrybag,
hasumbrella,
hasbackpack,hasglasses, hascarrybag, hasumbrella,
(select name from t_code t where t.type='CoatType' and t.key=coatlength)coatlength,
coatcolornums,
(select group_concat(name separator ',') name from t_code t where type='ObjectColorType' and instr( coatcolor,t.key)>0 ) coatcolor,
...
...
@@ -463,8 +471,7 @@
facey 'FaceBoundingBox.y',
facew 'FaceBoundingBox.w',
faceh 'FaceBoundingBox.h',
hashat,
hasmask,
hashat, hasmask,
(select name from t_code t where type='HairStyle' and t.key=hairstyle ) hairstyle,
(select name from t_code t where type='CoatTexture' and t.key=coattexture ) coattexture ,
(select name from t_code t where type='TrousersTexture' and t.key=trouserstexture ) trouserstexture , hastrolley,
...
...
@@ -572,7 +579,7 @@
delete from traffpicture where
<if
test=
"list!= null and list.size>0"
>
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
" OR "
item=
"item"
>
(id= #{item.
record
id} )
(id= #{item.id} )
</foreach>
</if>
</delete>
...
...
@@ -581,11 +588,104 @@
delete from taskinfo where
<if
test=
"list!= null and list.size>0"
>
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
" OR "
item=
"item"
>
(traffid= #{item.
record
id} )
(traffid= #{item.id} )
</foreach>
</if>
</delete>
<update
id=
"delDisputesInfo"
parameterType=
"java.util.List"
>
update taskinfo set state=0 where
<if
test=
"list!= null and list.size>0"
>
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
" OR "
item=
"item"
>
(traffid= #{item.id} )
</foreach>
</if>
</update>
<update
id=
"updateDisputesInfo"
parameterType=
"java.util.List"
>
update taskinfo set state=2 where
<if
test=
"list!= null and list.size>0"
>
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
" OR "
item=
"item"
>
(traffid= #{item.id} )
</foreach>
</if>
</update>
<select
id=
"eventStatistics"
parameterType=
"im.dx.system.model.StatisticsParam"
resultType=
"im.dx.system.model.StatisticsData"
>
select recordtype xname ,name,b.num from
t_code a
left join
(select recordtype ,count(*) num from traffpicture b
<where>
<if
test=
"starttime!=null and starttime != ''"
>
AND b.createtime >= str_to_date( #{starttime}, '%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endtime!=null and endtime != ''"
>
AND b.createtime
<
= str_to_date( #{endtime}, '%Y-%m-%d %H:%i:%s')
</if>
</where>
group by recordtype )b
on a.key=b.recordtype where a.type=2
</select>
<select
id=
"deviceStatistics"
parameterType=
"im.dx.system.model.StatisticsParam"
resultType=
"im.dx.system.model.StatisticsData"
>
select dept_id xid, dept_name name ,b.num ,concat(",",idsets,",") id from
dept a
left join
(select xzbh,count(*) num from sbtdspsr b
group by xzbh )b
on a.dept_id=b.xzbh
</select>
<select
id=
"sendInfoStatistics"
parameterType=
"im.dx.system.model.StatisticsParam"
resultType=
"java.util.Map"
>
SELECT ifnull( pushstatus, 9 ) xid,
CASE
WHEN pushstatus = 9 or pushstatus IS NULL THEN
'待推送'
WHEN pushstatus =- 1 THEN
'推送失败'
WHEN pushstatus = 0 THEN
'推送成功'
END name,
count(*) value
FROM
traffpicture b
<where>
<if
test=
"starttime!=null and starttime != ''"
>
AND b.createtime >= str_to_date( #{starttime}, '%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endtime!=null and endtime != ''"
>
AND b.createtime
<
= str_to_date( #{endtime}, '%Y-%m-%d %H:%i:%s')
</if>
</where>
GROUP BY pushstatus
</select>
<select
id=
"departmentEventStatistics"
parameterType=
"im.dx.system.model.StatisticsParam"
resultType=
"im.dx.system.model.StatisticsData"
>
SELECT
xid,
tdmc,
id,
NAME,
num,
(select concat(",",idsets,",") from dept where dept_id=a.xzbh limit 1) pid
FROM
sbtdspsr a
LEFT JOIN ( SELECT fdid xid, recordtype id, count(*) num FROM traffpicture a
<where>
<if
test=
"starttime!=null and starttime != ''"
>
AND a.createtime >= str_to_date( #{starttime}, '%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endtime!=null and endtime != ''"
>
AND a.createtime
<
= str_to_date( #{endtime}, '%Y-%m-%d %H:%i:%s')
</if>
</where>
GROUP BY fdid, recordtype ) b ON a.sbbh = b.xid
LEFT JOIN t_code c ON c.type = 2
AND b.id = c.KEY
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/VideoMapper.xml
View file @
238fd7d4
...
...
@@ -43,18 +43,22 @@
<select
id=
"selectByMutiParam"
resultMap=
"BaseResultMap"
>
select a.xh, a.tdmc, a.sbbh ,a.tdbh,a.squrllj,a.xzbh,a.jd,a.wd , b.dept_name qymc, a.tdlx,a.kz3
from sbtdspsr a,(select t1.dept_id, t1.dept_name
from dept t1
left join dept t2
on t1.parent_id = t2.dept_id
where t1.parent_id = #{deptId}
or t1.dept_id = #{deptId}
or t2.parent_id =#{deptId}
or t2.dept_id = #{deptId})b
from sbtdspsr a,
(select t1.dept_id, t1.dept_name
from dept t1 where find_in_set( #{deptId},idsets))b
where a.xzbh=b.dept_id
<if
test=
"videoName != null and videoName != '' "
>
and tdmc like '%${videoName}%'
</if>
union
select a.xh, a.tdmc, a.sbbh ,a.tdbh,a.squrllj,a.xzbh,a.jd,a.wd ,
(select b.dept_name from dept b where b.dept_id=a.xzbh limit 1) qymc, a.tdlx,a.kz3
from sbtdspsr a
<if
test=
"userId !=null and userId !=''"
>
,role_videoerecordtype b
where a.sbbh=b.videorecordtypeid
and b.roleid=(select role_id from user_role where user_id=#{userId} limit 1)
</if>
order by sbbh
</select>
<insert
id=
"insert"
parameterType=
"im.dx.system.model.Sbtdspsr"
>
...
...
src/main/resources/static/js/jgsbgl/jgsbgl.js
View file @
238fd7d4
...
...
@@ -21,39 +21,19 @@ let vue_right = new Vue({
iframe
.
onload
=
function
()
{
document
.
getElementById
(
'
iframe
'
).
contentWindow
.
frames
.
setImg
();
}
// setimg();
// draw = new DrawRectangle('draw-canvas', {
// src:this.imgsrc,
// layers: [{},
// {
// "x1":x,
// "y1": y,
// "x2": x+w,
// "y2": y+h,
// "width": w,
// "height": h,
// "strokeStyle": "red",
// "type": 0
// }
// ]
// });
},
},
add
:
function
(
item
){
$
(
"
#myjgModal1
"
).
modal
(
"
show
"
);
},
edit
:
function
(
item
)
{
vue_default
.
data_s
.
xh
=
item
.
xh
;
vue_default
.
data_s
.
xh
=
item
.
xh
;
vue_default
.
data_s
.
sbbh
=
item
.
sbbh
;
vue_default
.
data_s
.
tdbh
=
item
.
tdbh
;
vue_default
.
data_s
.
tdmc
=
item
.
tdmc
;
vue_default
.
valueId
=
item
.
xzbh
;
vue_default
.
data_s
.
tdlx
=
item
.
tdlx
;
vue_default
.
initHandle
();
// vue_default.data_s.qymc = item.qymc,
// vue_myjgModal1_edit.data_s.squrllj = item.squrllj
$
(
"
#myjgModal1
"
).
modal
(
"
show
"
);
$
(
"
#myjgModal1
"
).
modal
(
"
show
"
);
},
del
:
function
(
item
)
{
if
(
!
confirm
(
"
确认删除监控吗?
"
))
{
...
...
@@ -80,6 +60,8 @@ let vue_right = new Vue({
page
:
pages
,
pageSize
:
this
.
fy_select
,
deptId
:
this
.
xz_jg
,
userId
:
getCookie
(
"
bjpt_userId
"
),
username
:
getCookie
(
"
bjpt_realName
"
),
videoName
:
$
(
"
#ryxm
"
).
val
(),
},
success
:
function
(
result
)
{
...
...
@@ -118,7 +100,6 @@ let vue_right = new Vue({
});
},
getChange
:
function
()
{
// alert(this.fy_select);
this
.
queryRY
(
1
,
true
);
}
},
...
...
@@ -135,6 +116,7 @@ let vue_sjcx = new Vue({
timetype
:
0
,
detectType
:
null
,
notljt
:
1
,
notface
:
1
,
sfzdzptype
:
0
,
imgsrc
:
''
},
...
...
@@ -156,8 +138,6 @@ let vue_sjcx = new Vue({
else
if
(
this
.
cheakallornot
==
"
1
"
)
{
this
.
widthdata
=
"
440px
"
;
}
},
getPic
:
function
(){
...
...
@@ -171,7 +151,8 @@ let vue_sjcx = new Vue({
success
:
function
(
result
)
{
if
(
result
.
errorCode
==
"
0
"
){
that
.
imgsrc
=
result
.
data
;
draw
.
src
=
result
.
data
;
document
.
getElementById
(
'
iframe
'
).
contentWindow
.
frames
.
setImg
();
// draw.src=result.data;
}
},
error
:
function
(
result
){
...
...
@@ -179,18 +160,21 @@ let vue_sjcx = new Vue({
}
});
},
changedetectType
:
function
(){
if
(
this
.
detectType
==
"
15
"
){
if
(
this
.
detectType
==
"
15
"
){
//垃圾桶检测
this
.
notljt
=
0
;
}
else
{
this
.
notljt
=
1
;
}
this
.
notljt
=
1
;
}
if
(
this
.
detectType
==
"
60
"
){
this
.
notljt
=
2
;
this
.
objectType
=
"
6
"
;
}
else
{
this
.
notljt
=
1
;
}
},
addtask
:
function
(
item
)
{
if
(
$
(
"
#starthour
"
).
val
()
==
""
&&
$
(
"
#endhour
"
).
val
()
!=
""
)
...
...
@@ -255,7 +239,7 @@ let vue_sjcx = new Vue({
params
:
{
starthour
:
$
(
"
#starthour
"
).
val
()
,
endhour
:
$
(
"
#endhour
"
).
val
(),
thresholdValue
:
0
,
thresholdValue
:
$
(
"
#thresholdValue
"
).
val
()
,
objectType
:
$
(
"
#objectType
"
).
val
(),
sendType
:
$
(
"
#autosend
"
).
val
(),
//是否自动推送,
},
...
...
@@ -284,13 +268,12 @@ let vue_sjcx = new Vue({
}
}
});
}
else
{
if
(
this
.
timetype
==
0
){
str
=
$
(
"
#starthour
"
).
val
()
+
"
,
"
+
$
(
"
#endhour
"
).
val
()
+
"
,
"
+
$
(
"
#schedulerRule
"
).
val
();
}
else
{
str
=
$
(
"
#starthour
"
).
val
()
+
"
,
"
+
$
(
"
#endhour
"
).
val
()
+
"
,
"
+
$
(
"
#schedulerRule
"
).
val
()
*
this
.
timetype
*
60
;
}
//确认添加任务事件
$
.
ajax
({
...
...
@@ -305,9 +288,8 @@ let vue_sjcx = new Vue({
type
:
"
0
"
,
name
:
$
(
"
#name
"
).
val
(),
params
:
{
schedulerRule
:
this
.
timetype
==
0
?
$
(
"
#starthour
"
).
val
()
+
"
,
"
+
$
(
"
#endhour
"
).
val
()
+
"
,
"
+
$
(
"
#schedulerRule
"
).
val
()
:
$
(
"
#starthour
"
).
val
()
+
"
,
"
+
$
(
"
#endhour
"
).
val
()
+
"
,
"
+
$
(
"
#schedulerRule
"
).
val
()
*
this
.
timetype
*
60
,
thresholdValue
:
0
,
schedulerRule
:
str
,
thresholdValue
:
$
(
"
#thresholdValue
"
).
val
(),
objectType
:
$
(
"
#objectType
"
).
val
(),
sendType
:
$
(
"
#autosend
"
).
val
(),
//是否自动推送,
},
...
...
@@ -329,6 +311,13 @@ let vue_sjcx = new Vue({
});
$
(
"
#myModal2
"
).
modal
(
"
hide
"
);
}
else
{
if
(
result
.
errorCode
==
'
-1
'
)
{
result
.
errorMg
=
"
超时
"
;
}
else
{
result
.
errorMsg
=
"
任务已存在
"
;
}
layer
.
msg
(
result
.
errorMsg
,
{
icon
:
2
,
time
:
2000
...
...
@@ -339,6 +328,11 @@ let vue_sjcx = new Vue({
}
}
else
{
//调用垃圾识别算法服务
str
=
$
(
"
#schedulerRule
"
).
val
()
*
this
.
timetype
*
60000
;
if
(
this
.
timetype
==
0
){
str
=
$
(
"
#schedulerRule
"
).
val
()
*
1000
;
}
$
.
ajax
({
url
:
"
/video/LJTtask
"
,
dataType
:
"
json
"
,
...
...
@@ -349,8 +343,7 @@ let vue_sjcx = new Vue({
deviceNum
:
vue_sjcx
.
sbbh
,
spId
:
vue_sjcx
.
sbbh
,
interfaceCode
:
"
NEW_LJTMYJC_001
"
,
interval
:
this
.
timetype
==
0
?
$
(
"
#schedulerRule
"
).
val
()
*
1000
:
$
(
"
#schedulerRule
"
).
val
()
*
this
.
timetype
*
60000
,
interval
:
str
,
status
:
1
,
params
:
{
starthour
:
$
(
"
#starthour
"
).
val
(),
...
...
@@ -383,39 +376,7 @@ let vue_sjcx = new Vue({
}
},
});
// let vue_myjgModal1 = new Vue({
// el: '#myjgModal1',
// data: {
// data_s: {
// sbbh: '',
// tdmc: '',
// squrllj: '',
// xzbh: '',
// tdlx:'1'
// },
// },
// methods: {
// define: function () {
// vue_myjgModal1.data_s.xzbh=vue_myjgModal1.data_s.qybh;
// $.ajax({
// url: "/video/add",
// dataType: "json",
// type: "POST",
// data: vue_myjgModal1.data_s,
// success: function (result) {
// if (result.code == 0) {
// vue_right.queryRY(1, true);
// $("#myjgModal1").modal("hide");
// info_new("监控新增成功");
// window.setTimeout("$('#info-warning-new').modal('hide')", 2000);
// }
// }
// });
// }
// }
// });
let
vue_default
=
new
Vue
({
el
:
"
#myjgModal1
"
,
name
:
"
el-tree-select
"
,
...
...
src/main/resources/static/js/rgjy/rgjy.js
View file @
238fd7d4
...
...
@@ -726,7 +726,7 @@ let vue_sjsstxnow = new Vue({
state_cli
:
function
(
item
,
e
,
index
,
type
)
{
let
json_s
=
[];
json_s
.
push
({
recordid
:
item
.
record
id
+
''
,
id
:
item
.
id
+
''
,
channelid
:
item
.
channelid
,
fdid
:
item
.
fdid
,
recordtime
:
item
.
recordtime
,
...
...
src/main/resources/static/js/rwpfhistory/rwpfhistory.js
View file @
238fd7d4
...
...
@@ -27,10 +27,9 @@ let vue_rwpfhistory = new Vue({
taskwp_select
:[{
'
id
'
:
0
,
'
name
'
:
'
否
'
},
{
'
id
'
:
1
,
'
id
'
:
2
,
'
name
'
:
'
是
'
},
...
...
@@ -324,6 +323,52 @@ let vue_rwpfhistory = new Vue({
},
100
);
},
back
:
function
(){
let
taskexists
=
0
;
if
(
vue_rwpfhistory
.
state_arr
.
length
>
0
)
{
//判断是否是已经下派的任务
vue_rwpfhistory
.
state_arr
.
forEach
(
function
(
item
,
index
)
{
if
(
item
.
handler
==
"
undefined
"
||
item
.
handler
==
null
||
item
.
handler
==
''
)
{
taskexists
=
1
;
}
});
}
let
str
=
""
;
if
(
taskexists
==
1
){
str
=
"
存在尚未分配的告警,只撤回已经分派的任务,
"
}
if
(
vue_rwpfhistory
.
state_arr
.
length
>
0
)
{
layer
.
confirm
(
str
+
"
确认撤回
"
,
{
icon
:
3
,
title
:
"
提示
"
},
function
(
index
)
{
//将分派出去的任务信息删除
$
.
ajax
({
url
:
"
/TrafficStatistics/delDisputesInfo
"
,
dateType
:
'
json
'
,
type
:
"
POST
"
,
contentType
:
'
application/json
'
,
data
:
JSON
.
stringify
(
vue_rwpfhistory
.
state_arr
),
success
:
function
(
result
)
{
if
(
result
.
code
==
0
)
{
vue_rwpfhistory
.
query
(
1
,
true
);
layer
.
msg
(
"
撤回成功
"
);
vue_rwpfhistory
.
state_arr
=
[];
}
else
{
layer
.
msg
(
"
撤回失败
"
);
}
}
});
layer
.
close
(
index
);
},
function
(
index
)
{
//取消回调
layer
.
close
(
index
);
}
);
}
else
{
layer
.
msg
(
"
请选择告警信息!
"
)
}
},
distributed
:
function
(){
...
...
@@ -339,20 +384,20 @@ let vue_rwpfhistory = new Vue({
if
(
vue_rwpfhistory
.
state_arr
.
length
>
0
)
{
//判断是否是已经下派的任务
vue_rwpfhistory
.
state_arr
.
forEach
(
function
(
item
,
index
)
{
if
(
typeof
item
.
handler
!=
'
undefined
'
&&
item
.
handler
!=
null
&&
item
.
handler
!=
''
)
{
if
(
item
.
handler
!=
"
undefined
"
&&
item
.
handler
!=
null
&&
item
.
handler
!=
''
)
{
taskexists
=
1
;
}
});
return
taskexists
;
}
},
del
:
function
()
{
sfpf
=
this
.
sfpfrw
();
let
sfpf
=
this
.
sfpfrw
();
msg
=
"
确认删除该告警?
"
;
if
(
sfpf
==
1
)
{
msg
=
"
存在已经被分派的告警信息,确认删除?
"
;
}
layer
.
confirm
(
msg
,
{
icon
:
3
,
title
:
"
提示
"
},
function
(
index
)
{
layer
.
close
(
index
);
...
...
@@ -383,7 +428,7 @@ let vue_rwpfhistory = new Vue({
$
(
"
.div-ul
"
).
find
(
'
input:checked
'
).
each
(
function
()
{
let
arr
=
$
(
this
).
val
().
split
(
"
|
"
);
vue_rwpfhistory
.
state_arr
.
push
({
record
id
:
arr
[
0
],
id
:
arr
[
0
],
channelid
:
arr
[
1
],
fdid
:
arr
[
2
],
recordtime
:
arr
[
3
],
...
...
@@ -543,7 +588,7 @@ let vue_sjsstxnow = new Vue({
state_cli
:
function
(
item
,
e
,
index
,
type
)
{
let
json_s
=
[];
json_s
.
push
({
record
id
:
item
.
recordid
+
''
,
id
:
item
.
recordid
+
''
,
channelid
:
item
.
channelid
,
fdid
:
item
.
fdid
,
recordtime
:
item
.
recordtime
,
...
...
@@ -592,7 +637,7 @@ let vue_sjsstxnow = new Vue({
//获得选中的userid,告警id
let
jsonstr
=
[];
vue_rwpfhistory
.
state_arr
.
forEach
(
function
(
item
,
index
){
jsonstr
.
push
(
item
.
record
id
);
jsonstr
.
push
(
item
.
id
);
});
$
.
ajax
({
url
:
"
/role/addtaskinfo
"
,
...
...
@@ -763,11 +808,12 @@ $("#all").click(function () {
// vue_rwpfhistory.state_arr.push($(this).val());
let
arr
=
$
(
this
).
val
().
split
(
"
|
"
);
vue_rwpfhistory
.
state_arr
.
push
({
record
id
:
arr
[
0
],
id
:
arr
[
0
],
channelid
:
arr
[
1
],
fdid
:
arr
[
2
],
recordtime
:
arr
[
3
],
recordtype
:
arr
[
4
]
recordtype
:
arr
[
4
],
handler
:
arr
[
5
]
});
});
vue_rwpfhistory
.
show_nums
=
true
;
...
...
src/main/resources/static/js/sjcx/sjcx.js
View file @
238fd7d4
...
...
@@ -29,67 +29,69 @@ let vue_sjcx = new Vue({
this
.
xzml
();
},
xzml
:
function
()
{
_that
=
this
;
$
.
ajax
({
url
:
"
/dept/
getDeptParent/
"
+
getCookie
(
"
bjpt_deptId
"
)
,
url
:
"
/dept/
listvideo
"
,
dataType
:
"
json
"
,
type
:
"
GET
"
,
data
:
{},
data
:
{
deptId
:
getCookie
(
"
bjpt_deptId
"
),
username
:
getCookie
(
"
bjpt_realName
"
),
tdmc
:
_that
.
searchText
,
},
success
:
function
(
result
)
{
let
defaultData
=
[];
_that
.
jk_arr
=
[];
if
(
result
.
code
==
0
)
{
let
parIds
=
result
.
data
[
0
].
parentId
;
$
.
ajax
({
url
:
"
/dept/listvideo
"
,
dataType
:
"
json
"
,
type
:
"
GET
"
,
data
:
{
deptId
:
getCookie
(
"
bjpt_deptId
"
),
username
:
getCookie
(
"
bjpt_realName
"
),
tdmc
:
vue_sjcx
.
searchText
,
},
success
:
function
(
result
)
{
let
defaultData
=
[];
vue_sjcx
.
jk_arr
=
[];
if
(
result
.
code
==
0
)
{
vue_sjcx
.
jk_arr
=
result
.
data
;
defaultData
=
toTree
(
result
.
data
,
parIds
+
''
);
$
(
'
#tree-xzxq
'
).
treeview
({
expandIcon
:
'
glyphicon glyphicon-triangle-right selected-span
'
,
collapseIcon
:
'
glyphicon glyphicon-triangle-bottom selected-span
'
,
nodeIcon
:
'
glyphicon glyphicon-folder-open selected-span
'
,
selectedBackColor
:
'
#ff000000
'
,
selectedColor
:
'
#368ff3
'
,
onhoverColor
:
'
#73a5ff26
'
,
showBorder
:
false
,
data
:
defaultData
,
multiSelect
:
false
,
level
:
2
,
showCheckbox
:
1
,
//复选框设置,也可以是true
onNodeChecked
:
function
(
event
,
node
)
{
//选中节点
let
selectNodes
=
getChildNodeIdArr
(
node
);
//获取所有子节点
if
(
selectNodes
)
{
//子节点不为空,则选中所有子节点
$
(
this
).
treeview
(
'
checkNode
'
,
[
selectNodes
,
{
silent
:
true
}]);
}
//如果当前节点的子节点都被选中了。则父节点也应该要选中
setParentNodeCheck
(
node
);
},
onNodeUnchecked
:
function
(
event
,
node
)
{
//取消选中节点
let
selectNodes
=
getChildNodeIdArr
(
node
);
//获取所有子节点
if
(
selectNodes
)
{
//子节点不为空,则取消选中所有子节点
$
(
this
).
treeview
(
'
uncheckNode
'
,
[
selectNodes
,
{
silent
:
true
}]);
}
},
onNodeExpanded
:
function
(
event
,
data
)
{
},
onNodeSelected
:
function
(
event
,
node
)
{
_that
.
jk_arr
=
result
.
data
;
defaultData
=
toTree
(
result
.
data
,
"
0
"
);
$
(
'
#tree-xzxq
'
).
treeview
({
expandIcon
:
'
glyphicon glyphicon-triangle-right selected-span
'
,
collapseIcon
:
'
glyphicon glyphicon-triangle-bottom selected-span
'
,
nodeIcon
:
'
glyphicon glyphicon-folder-open selected-span
'
,
selectedBackColor
:
'
#ff000000
'
,
selectedColor
:
'
#368ff3
'
,
onhoverColor
:
'
#73a5ff26
'
,
showBorder
:
false
,
data
:
defaultData
,
multiSelect
:
false
,
level
:
2
,
showCheckbox
:
1
,
//复选框设置,也可以是true
onNodeChecked
:
function
(
event
,
node
)
{
//选中节点
let
selectNodes
=
getChildNodeIdArr
(
node
);
//获取所有子节点
if
(
selectNodes
)
{
//子节点不为空,则选中所有子节点
$
(
this
).
treeview
(
'
checkNode
'
,
[
selectNodes
,
{
silent
:
true
}]);
}
//如果当前节点的子节点都被选中了。则父节点也应该要选中
setParentNodeCheck
(
node
);
},
onNodeUnchecked
:
function
(
event
,
node
)
{
//取消选中节点
let
selectNodes
=
getChildNodeIdArr
(
node
);
//获取所有子节点
if
(
selectNodes
)
{
//子节点不为空,则取消选中所有子节点
$
(
this
).
treeview
(
'
uncheckNode
'
,
[
selectNodes
,
{
silent
:
true
}]);
}
},
onNodeExpanded
:
function
(
event
,
data
)
{
}
},
onNodeSelected
:
function
(
event
,
node
)
{
});
vue_sjcx
.
query
(
1
,
true
);
}
}
});
_that
.
query
(
1
,
true
);
}
}
});
// $.ajax({
// url: "/dept/getDeptParent/" + getCookie("bjpt_deptId"),
// dataType: "json",
// type: "GET",
// data: {},
// success: function (result) {
// if (result.code == 0) {
// let parIds = result.data[0].parentId;
//
// }
// }
// });
},
qh_tab
:
function
(
el
)
{
if
(
el
==
1
)
{
...
...
@@ -183,7 +185,7 @@ let vue_sjcx = new Vue({
}
,
query
:
function
(
pages
,
items
)
{
let
nodes
=
$
(
'
#tree-xzxq
'
).
treeview
(
'
getChecked
'
).
filter
(
n
=>
n
.
level
==
null
let
nodes
=
$
(
'
#tree-xzxq
'
).
treeview
(
'
getChecked
'
).
filter
(
n
=>
n
.
level
==
null
||
n
.
level
==
""
).
map
(
n
=>
{
return
n
.
href
...
...
@@ -353,6 +355,7 @@ let vue_sjcx = new Vue({
}
},
mounted
(){
_that
=
this
;
$
(
"
#kssj
"
).
val
(
getTime_extent
(
6
).
pre_rq_start
+
'
-
'
+
getTime
().
jssj
);
$
.
ajax
({
url
:
"
/dept/listAllvideoIdsByDeptid
"
,
...
...
@@ -362,10 +365,11 @@ let vue_sjcx = new Vue({
deptid
:
getCookie
(
"
bjpt_deptId
"
),
},
success
:
function
(
result
)
{
vue_sjcx
.
jk_s
=
[];
if
(
result
.
code
==
0
)
{
_that
.
jk_s
=
[];
if
(
result
.
data
.
length
>
0
)
{
vue_sjcx
.
jk_s
=
result
.
data
;
_that
.
jk_s
=
result
.
data
;
}
}
}
...
...
@@ -379,13 +383,13 @@ let vue_sjcx = new Vue({
alarmlevel
:
''
,
},
success
:
function
(
result
)
{
vue_sjcx
.
arr_cllx
=
[];
_that
.
arr_cllx
=
[];
if
(
result
.
code
==
0
)
{
if
(
result
.
data
.
length
>
0
)
{
result
.
data
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
id
!=
'
TRICYCLE
'
&&
item
.
id
!=
'
CART
'
)
vue_sjcx
.
arr_cllx
.
push
({
id
:
item
.
id
,
value
:
item
.
name
});
_that
.
arr_cllx
.
push
({
id
:
item
.
id
,
value
:
item
.
name
});
})
;
setTimeout
(
function
()
{
...
...
@@ -405,14 +409,14 @@ let vue_sjcx = new Vue({
alarmlevel
:
''
,
},
success
:
function
(
result
)
{
vue_sjcx
.
data_sjlxs
=
[];
_that
.
data_sjlxs
=
[];
if
(
result
.
code
==
0
)
{
if
(
result
.
data
.
length
>
0
)
{
vue_sjcx
.
data_sjlxs
=
result
.
data
;
_that
.
data_sjlxs
=
result
.
data
;
}
}
vue_sjcx
.
data_sjlxs
.
unshift
({
name
:
'
全部
'
,
id
:
""
,
type
:
""
,});
_that
.
data_sjlxs
.
unshift
({
name
:
'
全部
'
,
id
:
""
,
type
:
""
,});
}
});
this
.
xzml
();
...
...
@@ -676,7 +680,7 @@ let vue_sjsstxnow = new Vue({
state_cli
:
function
(
item
,
e
,
index
,
type
)
{
let
json_s
=
[];
json_s
.
push
({
recordid
:
item
.
record
id
+
''
,
id
:
item
.
id
+
''
,
channelid
:
item
.
channelid
,
fdid
:
item
.
fdid
,
recordtime
:
item
.
recordtime
,
...
...
@@ -871,7 +875,8 @@ wss.onmessage = function (evt) {
//jk_video_id为监控id
// let a_id = data.data.video_id.slice(0, data.data.video_id.length - 1) + (parseInt(data.data.video_id.slice(data.data.video_id.length - 1, data.data.video_id.length)) + 1) + '';
let
jk_video_id
=
data
.
fdid
+
"
_
"
+
data
.
channelid
;
// let jk_video_id = data.fdid + "_" + data.channelid;
let
jk_video_id
=
data
.
fdid
;
// let jk_video_id = data.data.video_id;
vue_sjcx
.
jk_s
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
VIDOID
==
jk_video_id
...
...
src/main/resources/templates/error/500.html
View file @
238fd7d4
...
...
@@ -51,7 +51,6 @@
<img
class=
"error-page-img"
th:src=
"@{/images/ic_500.svg}"
>
<div
class=
"error-page-info"
>
<h1>
500
</h1>
<h1
th:text=
"${message}"
></h1>
<div
class=
"error-page-info-desc"
>
诶呦,服务器开了个小差~
</div>
</div>
</div>
...
...
src/main/resources/templates/login.html
View file @
238fd7d4
...
...
@@ -97,18 +97,7 @@
<script
type=
"text/javascript"
>
function
oauth2_github
()
{
$
.
get
(
'
/oauth2/render/github
'
,
function
(
data
)
{
console
.
log
(
data
);
handlerResult
(
data
,
renderDone
);
});
}
function
oauth2_gitee
()
{
$
.
get
(
'
/oauth2/render/gitee
'
,
function
(
result
)
{
handlerResult
(
result
,
renderDone
);
});
}
function
renderDone
(
data
)
{
var
winObj
=
window
.
open
(
data
,
'
newwindow
'
,
'
height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no
'
);
...
...
src/main/resources/templates/page/jgsbgl.html
View file @
238fd7d4
...
...
@@ -248,21 +248,18 @@
</tr>
<tr
v-show=
"notljt==1"
>
<td
width=
"120px"
>
检测对象
<font
color=
"red"
>
*
</font></td>
<td
width=
"240px"
>
<td
width=
"240px"
>
<select
class=
"form-control"
id=
"objectType"
required
>
<option
th:value=
"0"
>
所有
</option>
<option
th:value=
"1"
>
人脸
所有
</option>
<option
th:value=
"
2
"
>
<option
th:value=
"
5
"
>
机动车
</option>
<option
th:value=
"
3
"
>
<option
th:value=
"
4
"
>
非机动车
</option>
<option
th:value=
"
4
"
>
<option
th:value=
"
7
"
>
人
</option>
</select>
...
...
@@ -307,12 +304,12 @@
<td
width=
"100px"
>
执行时间间隔
<font
color=
"red"
>
*
</font></td>
<td
width=
"240px"
>
<input
type=
"number"
required
class=
"form-control"
max=
"59"
min=
"1"
id=
"schedulerRule"
>
</td>
</tr>
<tr
v-show=
"notljt==1"
>
<tr
v-show=
"notljt==1
|| notljt==2
"
>
<td>
告警阀值
<font
color=
"red"
>
*
</font></td>
<td
width=
"240px"
><input
type=
"number"
required
id=
"thresholdValue"
class=
"form-control"
min=
"0"
th:value=
"0"
>
</td>
</tr>
<tr
v-show=
"notljt==1"
id=
"threshold"
>
<tr
v-show=
"notljt==1
|| notljt==2
"
id=
"threshold"
>
<td>
是否自动推送
<font
color=
"red"
>
*
</font></td>
<td
width=
"240px"
>
<select
class=
"form-control"
id=
"autosend"
required
>
...
...
@@ -349,7 +346,7 @@
style=
"float: left;padding-left: 12px;padding-top: 10px;"
>
刷新图片
</a>
</td>
</tr>
<tr
v-show=
"notljt==1"
>
<tr
v-show=
"notljt==1
|| notljt==2
"
>
<td
width=
"150px"
>
告警回调地址
<font
color=
"red"
>
*
</font></td>
<td
colspan=
"1"
><input
required
type=
"text"
class=
"form-control"
id=
"url"
>
</td>
</tr>
...
...
@@ -457,8 +454,14 @@
init
(
cvw
,
cvh
,
imgw
,
imgh
)
{
var
item
=
this
.
layers
[
1
];
this
.
ratew
=
cvw
/
imgw
;
this
.
rateh
=
cvh
/
imgh
;
console
.
log
(
"
ratew==
"
+
this
.
ratew
);
console
.
log
(
"
rateh==
"
+
this
.
rateh
);
this
.
ctx
.
beginPath
();
this
.
startX
=
(
item
.
x1
)
*
this
.
ratew
;
this
.
startY
=
(
item
.
y1
)
*
this
.
rateh
;
...
...
@@ -482,6 +485,7 @@
//设置图片为canvas的背景
setImageBackground
(
src
)
{
debugger
const
img
=
new
Image
();
img
.
src
=
src
;
img
.
onload
=
()
=>
...
...
@@ -658,7 +662,6 @@
let
allNotIn
=
1
;
let
item
=
this
.
layers
[
0
];
this
.
ctx
.
beginPath
();
console
.
log
(
item
.
x1
);
this
.
ctx
.
rect
(
item
.
x1
,
item
.
y1
,
item
.
width
,
item
.
height
);
this
.
ctx
.
strokeStyle
=
item
.
strokeStyle
;
if
(
this
.
ctx
.
isPointInPath
(
x
*
this
.
scale
,
y
*
this
.
scale
))
{
...
...
@@ -763,6 +766,11 @@
}))
var
ratew
=
this
.
config
.
width
/
this
.
canvas
.
width
;
var
rateh
=
this
.
config
.
height
/
this
.
canvas
.
height
;
console
.
log
(
ratew
);
console
.
log
(
"
this.ratew==
"
+
this
.
ratew
);
console
.
log
(
"
rateh==
"
+
rateh
);
console
.
log
(
"
this.rateh==
"
+
this
.
rateh
);
console
.
log
(
"
this.startX==
"
+
this
.
startX
);
this
.
layers
.
splice
(
1
,
1
,
this
.
fixPosition
({
x1
:
Math
.
ceil
(
this
.
startX
*
ratew
),
...
...
@@ -772,6 +780,8 @@
strokeStyle
:
this
.
config
.
solidColor
,
type
:
this
.
type
}));
document
.
getElementById
(
'
objectxy
'
).
value
=
Math
.
ceil
(
this
.
startX
*
this
.
ratew
)
+
"
,
"
+
Math
.
ceil
(
this
.
startY
*
this
.
rateh
)
+
"
,
"
+
Math
.
ceil
((
this
.
endX
-
this
.
startX
)
*
this
.
ratew
)
+
"
,
"
+
Math
.
ceil
((
this
.
endY
-
this
.
startY
)
*
this
.
rateh
);
...
...
src/main/resources/templates/page/jksj.html
View file @
238fd7d4
...
...
@@ -119,7 +119,7 @@
var
DTree
=
dtree
.
render
({
elem
:
"
#menuTree
"
,
url
:
"
/depttree/videotree/
"
+
getCookie
(
"
bjpt_deptId
"
),
url
:
"
/depttree/videotree/
"
+
getCookie
(
"
bjpt_deptId
"
)
+
"
/
"
+
getCookie
(
"
bjpt_realName
"
)
,
dataStyle
:
"
layuiStyle
"
,
initLevel
:
5
,
// 初始打开节点级别
method
:
"
GET
"
,
...
...
src/main/resources/templates/page/rwpfhistory.html
View file @
238fd7d4
...
...
@@ -59,8 +59,8 @@
</span>
<div
style=
"padding: 10px"
>
<span
class=
"div-right-top"
>
<img
src=
"../img/back.png"
title=
"回退
"
@
click=
"back()"
>
<img
src=
"../img/pftask.png"
title=
"派发"
@
click=
"distributed()"
></span>
<img
v-show=
"taskwpmodel_select!=1"
src=
"../img/back.png"
title=
"撤回
"
@
click=
"back()"
>
<img
v-show=
"taskwpmodel_select!=2"
src=
"../img/pftask.png"
title=
"派发"
@
click=
"distributed()"
></span>
</div>
<div
style=
"height:calc(100% - 164px);margin-top: 20px;"
class=
"tables"
>
<ul
class=
"div-ul div-pub-gt"
v-if=
"show"
>
...
...
src/main/resources/templates/page/sjcx.html
View file @
238fd7d4
...
...
@@ -107,11 +107,11 @@
<!--<span>辖区名称:</span>-->
<!--<span v-text="item.xzmc"></span>-->
<!--</div>-->
<div
v-show=
"item.targetnum!=null && item.targetnum
>0
"
>
<span
>
密度:
</span>
<span
v-
text=
"item.targetnum!=null"
>
{{item.targetnum==null?'':item.targetnum.split('/')[0]}}
</span>
<span
>
警界值:
</span>
<span
v-text=
"item.targetnum!=null"
>
{{item.targetnum==null?'':item.targetnum.split('/')[1]}}
</span>
<div
v-show=
"item.targetnum!=null && item.targetnum
!=''
"
>
<span
v-show=
"item.recordtype=='60'"
>
检测值(戴口罩/总人数/阀值):
<span
>
{{item.targetnum}}
</span>
</span>
<span
v-
show=
"item.recordtype=='10'"
>
检测值(总数/阀值):
<span
>
{{item.targetnum}}
</span>
</span>
<span
v-show=
"item.recordtype=='12'"
>
检测值(总数):
<span
>
{{item.targetnum}}
</span>
</span>
</div>
</div>
<div
class=
"li-bottom"
>
...
...
src/main/resources/templates/page/test.html
View file @
238fd7d4
...
...
@@ -105,6 +105,11 @@
type
:
this
.
type
}));
this
.
ctx
.
stroke
();
console
.
log
(
"
cvw==
"
+
cvw
);
console
.
log
(
"
cvh==
"
+
cvh
);
console
.
log
(
"
imgw==
"
+
imgw
);
console
.
log
(
"
imgh==
"
+
imgh
);
parent
.
document
.
getElementById
(
'
objectxy
'
).
value
=
Math
.
ceil
(
this
.
startX
*
this
.
ratew
)
+
"
,
"
+
Math
.
ceil
(
this
.
startY
*
this
.
rateh
)
+
"
,
"
+
Math
.
ceil
((
this
.
endX
-
this
.
startX
)
*
this
.
ratew
)
+
"
,
"
+
Math
.
ceil
((
this
.
endY
-
this
.
startY
)
*
this
.
rateh
);
}
...
...
@@ -402,8 +407,15 @@
strokeStyle
:
this
.
config
.
solidColor
,
type
:
this
.
type
}));
parent
.
document
.
getElementById
(
'
objectxy
'
).
value
=
Math
.
ceil
(
this
.
startX
*
this
.
ratew
)
+
"
,
"
+
Math
.
ceil
(
this
.
startY
*
this
.
rateh
)
+
"
,
"
+
Math
.
ceil
((
this
.
endX
-
this
.
startX
)
*
this
.
ratew
)
+
"
,
"
+
Math
.
ceil
((
this
.
endY
-
this
.
startY
)
*
this
.
rateh
);
console
.
log
(
"
ratew==
"
+
ratew
);
console
.
log
(
"
rateh==
"
+
rateh
);
console
.
log
(
"
this.rateh==
"
+
this
.
rateh
);
console
.
log
(
"
this.ratew==
"
+
this
.
ratew
);
console
.
log
(
"
this.startX==
"
+
this
.
startX
);
parent
.
document
.
getElementById
(
'
objectxy
'
).
value
=
Math
.
ceil
(
this
.
startX
*
ratew
)
+
"
,
"
+
Math
.
ceil
(
this
.
startY
*
rateh
)
+
"
,
"
+
Math
.
ceil
((
this
.
endX
-
this
.
startX
)
*
ratew
)
+
"
,
"
+
Math
.
ceil
((
this
.
endY
-
this
.
startY
)
*
rateh
);
}
else
if
(
this
.
optype
>=
3
)
{
this
.
fixPosition
(
this
.
currentR
);
...
...
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