Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
王衍超
cloud-fb
Commits
3c5bea93
Commit
3c5bea93
authored
Mar 29, 2021
by
高晓磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建场站工程&摄像头管理功能
parent
5a5e6ef0
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
203 additions
and
15 deletions
+203
-15
build.gradle
backend/build.war/build.gradle
+1
-0
settings.gradle
backend/build.war/settings.gradle
+1
-0
settings.gradle
backend/settings.gradle
+1
-0
CameraInfoDaoImpl.java
...va/com/xyst/dinas/biz/internal/dao/CameraInfoDaoImpl.java
+4
-1
DinasTypeDaoImpl.java
...ava/com/xyst/dinas/biz/internal/dao/DinasTypeDaoImpl.java
+16
-7
ShipInfoDaoImpl.java
...java/com/xyst/dinas/biz/internal/dao/ShipInfoDaoImpl.java
+9
-1
CameraInfoServiceImpl.java
...yst/dinas/biz/internal/service/CameraInfoServiceImpl.java
+6
-6
build.gradle
backend/xyst.dinas.station/build.gradle
+32
-0
settings.gradle
backend/xyst.dinas.station/settings.gradle
+1
-0
StationCameraConfiguration.java
...xyst/dinas/station/config/StationCameraConfiguration.java
+16
-0
StationCameraPlayController.java
...m/xyst/dinas/station/web/StationCameraPlayController.java
+112
-0
spring.factories
...inas.station/src/main/resources/META-INF/spring.factories
+4
-0
No files found.
backend/build.war/build.gradle
View file @
3c5bea93
...
...
@@ -138,6 +138,7 @@ dependencies {
compile
"com.beecode:xyst.dinas.biz:${inzVersion}"
compile
"com.beecode:xyst.dinas.project:${inzVersion}"
compile
"com.beecode:xyst.dinas.production:${inzVersion}"
compile
"com.beecode:xyst.dinas.station:${inzVersion}"
providedRuntime
lib
.
spring_boot_starter_tomcat
}
...
...
backend/build.war/settings.gradle
View file @
3c5bea93
...
...
@@ -15,6 +15,7 @@ includeBuild("../") {
substitute
module
(
'com.beecode:xyst.dinas.biz'
)
with
project
(
':xyst.dinas.biz'
)
substitute
module
(
'com.beecode:xyst.dinas.project'
)
with
project
(
':xyst.dinas.project'
)
substitute
module
(
'com.beecode:xyst.dinas.production'
)
with
project
(
':xyst.dinas.production'
)
substitute
module
(
'com.beecode:xyst.dinas.station'
)
with
project
(
':xyst.dinas.station'
)
}
}
...
...
backend/settings.gradle
View file @
3c5bea93
...
...
@@ -13,4 +13,5 @@ include "xyst.dinas.oa"
include
"xyst.dinas.biz"
include
"xyst.dinas.project"
include
"xyst.dinas.production"
include
"xyst.dinas.station"
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/dao/CameraInfoDaoImpl.java
View file @
3c5bea93
...
...
@@ -9,6 +9,7 @@ import com.beecode.bcp.type.KObject;
import
com.beecode.inz.basis.internal.dao.AbstractBaseDao
;
import
com.xyst.dinas.biz.constant.CameraInfoConstant
;
import
com.xyst.dinas.biz.dao.CameraInfoDao
;
import
com.xyst.dinas.biz.enumeration.OrganizationTypeEnum
;
import
org.apache.commons.lang3.StringUtils
;
import
org.hibernate.criterion.DetachedCriteria
;
import
org.hibernate.criterion.Order
;
...
...
@@ -57,7 +58,9 @@ public class CameraInfoDaoImpl extends AbstractBaseDao implements CameraInfoDao,
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
currentLoginRegionalCompany
.
getUuid
(
"id"
)));
if
(
currentLoginRegionalCompany
!=
null
&&
currentLoginRegionalCompany
.
getString
(
"type"
).
equals
(
OrganizationTypeEnum
.
REGIONAL_COMPANY
.
name
()))
{
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
currentLoginRegionalCompany
.
getUuid
(
"id"
)));
}
detachedCriteria
.
addOrder
(
Order
.
desc
(
"sortOrder"
));
if
(
null
!=
stationId
){
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalStation.id"
,
stationId
));
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/dao/DinasTypeDaoImpl.java
View file @
3c5bea93
...
...
@@ -10,6 +10,8 @@ import com.beecode.inz.basis.internal.dao.AbstractBaseDao;
import
com.xyst.dinas.biz.constant.DinasTypeConstant
;
import
com.xyst.dinas.biz.dao.DinasOrganizationDao
;
import
com.xyst.dinas.biz.dao.DinasTypeDao
;
import
com.xyst.dinas.biz.enumeration.OrganizationTypeEnum
;
import
org.apache.commons.lang3.StringUtils
;
import
org.hibernate.criterion.DetachedCriteria
;
import
org.hibernate.criterion.Order
;
import
org.hibernate.criterion.Restrictions
;
...
...
@@ -69,7 +71,7 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
public
Page
<
KObject
>
listDinasTypeInfoPaging
(
Page
<
KObject
>
page
)
{
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
ENTITY
,
KClass
.
class
);
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
getCurrentLoginRegionalCompany
().
getUuid
(
"id"
))
);
addRegionalConpanyFilter
(
detachedCriteria
);
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
detachedCriteria
.
addOrder
(
Order
.
desc
(
"sortOrder"
));
page
.
setTotal
(
template
.
findByCriteria
(
detachedCriteria
).
size
());
...
...
@@ -79,6 +81,13 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
return
page
;
}
private
void
addRegionalConpanyFilter
(
DetachedCriteria
detachedCriteria
)
{
KObject
currentLoginRegionalCompany
=
getCurrentLoginRegionalCompany
();
if
(
currentLoginRegionalCompany
!=
null
&&
currentLoginRegionalCompany
.
getString
(
"type"
).
equals
(
OrganizationTypeEnum
.
REGIONAL_COMPANY
.
name
()))
{
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
currentLoginRegionalCompany
.
getUuid
(
"id"
)));
}
}
@Override
public
List
<
KObject
>
getByName
(
String
name
,
UUID
id
)
{
...
...
@@ -88,7 +97,7 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
// detachedCriteria.add(Restrictions.eq("department.id", departmentId));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"dinasTypeName"
,
name
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
getCurrentLoginRegionalCompany
().
getUuid
(
"id"
))
);
addRegionalConpanyFilter
(
detachedCriteria
);
if
(
id
!=
null
)
{
detachedCriteria
.
add
(
Restrictions
.
ne
(
"id"
,
id
));
...
...
@@ -187,10 +196,10 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
public
KObject
getCurrentLoginRegionalCompany
()
{
Map
<
String
,
String
>
map
=
bapContext
.
getCurrentUserDatas
();
String
currentRegionalCompany
=
map
.
get
(
"currentRegionalCompany"
);
JSONObject
obj
=
new
JSONObject
(
currentRegionalCompany
);
KObject
regionalCompany
=
dinasOrganizationDao
.
load
(
UUID
.
fromString
(
obj
.
getString
(
"id"
)));
return
regionalCompany
;
if
(
StringUtils
.
isNotBlank
(
currentRegionalCompany
)){
JSONObject
obj
=
new
JSONObject
(
currentRegionalCompany
);
return
dinasOrganizationDao
.
load
(
UUID
.
fromString
(
obj
.
getString
(
"id"
)));
}
return
null
;
}
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/dao/ShipInfoDaoImpl.java
View file @
3c5bea93
...
...
@@ -11,6 +11,7 @@ import com.xyst.dinas.biz.constant.ShipInfoConstant;
import
com.xyst.dinas.biz.dao.CameraInfoDao
;
import
com.xyst.dinas.biz.dao.DinasTypeDao
;
import
com.xyst.dinas.biz.dao.ShipInfoDao
;
import
com.xyst.dinas.biz.enumeration.OrganizationTypeEnum
;
import
com.xyst.dinas.biz.service.CameraInfoService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.hibernate.criterion.DetachedCriteria
;
...
...
@@ -63,7 +64,7 @@ public class ShipInfoDaoImpl extends AbstractBaseDao implements ShipInfoDao, Shi
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
ENTITY
,
KClass
.
class
);
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
dinasTypeDao
.
getCurrentLoginRegionalCompany
().
getUuid
(
"id"
))
);
addRegionalCompanyFilter
(
detachedCriteria
);
if
(
StringUtils
.
isNotBlank
(
shipName
)){
detachedCriteria
.
add
(
Restrictions
.
like
(
"shipName"
,
"%"
+
shipName
+
"%"
));
...
...
@@ -79,6 +80,13 @@ public class ShipInfoDaoImpl extends AbstractBaseDao implements ShipInfoDao, Shi
return
page
;
}
private
void
addRegionalCompanyFilter
(
DetachedCriteria
detachedCriteria
)
{
KObject
currentLoginRegionalCompany
=
dinasTypeDao
.
getCurrentLoginRegionalCompany
();
if
(
currentLoginRegionalCompany
!=
null
&&
currentLoginRegionalCompany
.
getString
(
"type"
).
equals
(
OrganizationTypeEnum
.
REGIONAL_COMPANY
.
name
()))
{
detachedCriteria
.
add
(
Restrictions
.
eq
(
"regionalCompany.id"
,
currentLoginRegionalCompany
.
getUuid
(
"id"
)));
}
}
@Override
public
List
<
KObject
>
getByName
(
String
name
,
UUID
id
)
{
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/service/CameraInfoServiceImpl.java
View file @
3c5bea93
...
...
@@ -7,6 +7,7 @@ import com.xyst.dinas.biz.dao.CameraInfoDao;
import
com.xyst.dinas.biz.service.CameraInfoService
;
import
com.xyst.dinas.biz.service.DinasOrganizationService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -73,11 +74,10 @@ public class CameraInfoServiceImpl implements CameraInfoService {
public
KObject
getCurrentLoginRegionalCompany
()
{
Map
<
String
,
String
>
map
=
bapContext
.
getCurrentUserDatas
();
String
currentRegionalCompany
=
map
.
get
(
"currentRegionalCompany"
);
JSONObject
obj
=
new
JSONObject
(
currentRegionalCompany
);
KObject
regionalCompany
=
dinasOrganizationService
.
load
(
UUID
.
fromString
(
obj
.
getString
(
"id"
)));
return
regionalCompany
;
if
(
StringUtils
.
isNotBlank
(
currentRegionalCompany
)){
JSONObject
obj
=
new
JSONObject
(
currentRegionalCompany
);
return
dinasOrganizationService
.
load
(
UUID
.
fromString
(
obj
.
getString
(
"id"
)));
}
return
null
;
}
}
backend/xyst.dinas.station/build.gradle
0 → 100644
View file @
3c5bea93
apply
from:
'../common.gradle'
dependencies
{
compile
lib
.
bcp_import
compile
lib
.
bcp_type
compile
lib
.
bcp_store
compile
lib
.
hibernate_core
compile
lib
.
spring_web
compile
lib
.
spring_boot_autoconfigure
compile
lib
.
jackson_datatype_jdk8
compile
lib
.
jackson_datatype_jsr310
compile
lib
.
json
compile
"com.beecode:bap2.participant:${aminoVersion}"
compile
"com.beecode:bcp.org:${aminoVersion}"
compile
"com.beecode:bap2.department:${aminoVersion}"
compile
"com.beecode:bap2.staff:${aminoVersion}"
compile
'com.deepoove:poi-tl:1.5.0'
compile
project
(
":inz.common"
)
compile
project
(
":inz.query"
)
compile
project
(
":inz.workflow"
)
compile
project
(
":inz.basis"
)
compile
project
(
":inz.authentication"
)
compile
project
(
":xyst.dinas.biz"
)
compile
project
(
":xyst.dinas.production"
)
compile
project
(
":xyst.dinas.project"
)
testCompile
lib
.
amino_boot_web
testCompile
lib
.
mysql_connector
}
backend/xyst.dinas.station/settings.gradle
0 → 100644
View file @
3c5bea93
rootProject
.
name
=
'xyst.dinas.station'
backend/xyst.dinas.station/src/main/java/com/xyst/dinas/station/config/StationCameraConfiguration.java
0 → 100644
View file @
3c5bea93
package
com
.
xyst
.
dinas
.
station
.
config
;
import
com.xyst.dinas.station.web.StationCameraPlayController
;
import
org.springframework.context.annotation.Bean
;
public
class
StationCameraConfiguration
{
@Bean
public
StationCameraPlayController
cameraPlayController
(){
return
new
StationCameraPlayController
();
}
}
\ No newline at end of file
backend/xyst.dinas.station/src/main/java/com/xyst/dinas/station/web/StationCameraPlayController.java
0 → 100644
View file @
3c5bea93
package
com
.
xyst
.
dinas
.
station
.
web
;
import
com.beecode.bap.attachment.common.Page
;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.inz.authentication.constants.AuthcConstants
;
import
com.beecode.inz.basis.pojo.WarehouseUser
;
import
com.beecode.inz.basis.service.WarehouseUserService
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.xyst.dinas.biz.service.CameraInfoService
;
import
com.xyst.dinas.biz.service.StationService
;
import
com.xyst.dinas.production.service.CameraPlayService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
java.util.*
;
/**
* @author scol
*/
@RestController
public
class
StationCameraPlayController
{
@Autowired
private
CameraInfoService
cameraInfoService
;
@Autowired
private
CameraPlayService
cameraPlayService
;
@Autowired
private
StationService
stationService
;
@Autowired
private
WarehouseUserService
warehouseUserService
;
@GetMapping
(
value
=
"/warehouse/api/cameraPlay/getStationCameraTree"
)
public
ResponseObj
<
ArrayList
<
Map
<
String
,
Object
>>>
getStationCameraTree
()
throws
Exception
{
Page
<
KObject
>
kObjectPage
=
new
Page
<>();
kObjectPage
.
setPageNo
(
1
);
kObjectPage
.
setPageSize
(
1000
);
ServletRequestAttributes
attr
=
(
ServletRequestAttributes
)
RequestContextHolder
.
currentRequestAttributes
();
Object
attribute
=
attr
.
getRequest
().
getSession
().
getAttribute
(
AuthcConstants
.
USERID
);
UUID
attribute1
=
(
UUID
)
attribute
;
WarehouseUser
byId
=
warehouseUserService
.
getById
(
attribute1
);
KObject
station
=
stationService
.
getById
(
byId
.
getStationId
());
HashMap
<
String
,
Object
>
stringObjectHashMap
;
ArrayList
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
stringObjectHashMap
=
new
HashMap
<>();
stringObjectHashMap
.
put
(
"name"
,
station
.
getString
(
"stationName"
));
stringObjectHashMap
.
put
(
"id"
,
station
.
getUuid
(
"id"
));
List
<
KObject
>
datas
=
cameraInfoService
.
queryByPaging
(
kObjectPage
,
station
.
getUuid
(
"id"
),
null
,
null
).
getDatas
();
for
(
KObject
kObject
:
datas
)
{
String
picUrl
=
cameraPlayService
.
capturePic
(
kObject
.
getUuid
(
"id"
),
kObject
.
getString
(
"deviceSerial"
),
kObject
.
getString
(
"channelNo"
));
kObject
.
set
(
"videoUrl"
,
picUrl
);
}
stringObjectHashMap
.
put
(
"cameras"
,
datas
);
maps
.
add
(
stringObjectHashMap
);
return
ResponseObj
.
response
(
200
,
"查询成功"
,
maps
);
}
/**
* @return
* @Description 云台控制
* @author zhouzy-a
* @date 2017年5月22日 下午1:47:41
* @direction 操作命令:0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下,8-放大,9-缩小,10-近焦距,11-远焦距
* @speed 云台速度:0-慢,1-适中,2-快
* @speed 控制操作:1-开始转动,2-停止转动
*/
@GetMapping
(
"/ptzControl"
)
public
ResponseObj
ptzControl
(
UUID
cameraId
,
int
direction
,
int
speed
,
int
op
)
{
Map
<
String
,
Object
>
retMap
=
new
HashMap
<>();
retMap
.
put
(
"status"
,
"00"
);
try
{
//调用后台服务
return
cameraPlayService
.
ptzControl
(
cameraId
,
direction
,
speed
,
op
);
}
catch
(
Exception
e
)
{
return
ResponseObj
.
error
(
"控制失败"
);
}
}
/**
*得到萤石云token
* @return
*/
@GetMapping
(
"/getEZVIZToken/{id}"
)
public
ResponseObj
getEZVIZToken
(
@PathVariable
(
"id"
)
UUID
id
)
{
//调用后台服务
String
token
=
cameraPlayService
.
getEZVIZToken
(
id
);
return
ResponseObj
.
success
(
token
);
}
/**
*获取萤石云文件信息
* @return
*/
@GetMapping
(
"/getCameraVideFileInfo"
)
public
ResponseObj
getCameraVideFileInfo
(
@RequestParam
(
"id"
)
UUID
id
,
@RequestParam
(
value
=
"startDate"
,
required
=
false
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
false
)
Long
endDate
,
@RequestParam
(
value
=
"recType"
,
required
=
false
)
Integer
recType
)
{
return
ResponseObj
.
success
(
""
,
cameraPlayService
.
getCameraVideFileInfo
(
id
,
startDate
,
endDate
,
recType
));
}
/**
*获取萤石云状态
* @return
*/
@GetMapping
(
"/getCameraStatus/{id}"
)
public
ResponseObj
getCameraStatus
(
@PathVariable
(
"id"
)
UUID
id
)
{
return
cameraPlayService
.
getCameraStatus
(
id
);
}
}
backend/xyst.dinas.station/src/main/resources/META-INF/spring.factories
0 → 100644
View file @
3c5bea93
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.xyst.dinas.station.config.StationCameraConfiguration
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment