Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
c7b8c2ee
Commit
c7b8c2ee
authored
Oct 11, 2022
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
9923 监盘概览/视频列表绑定功能实现
parent
ed504d97
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
204 additions
and
8 deletions
+204
-8
SupervisionVideo.java
...m/yeejoin/equipmanage/common/entity/SupervisionVideo.java
+14
-0
SupervisionConfigureController.java
...quipmanage/controller/SupervisionConfigureController.java
+65
-8
SupervisionVideoMapper.java
...om/yeejoin/equipmanage/mapper/SupervisionVideoMapper.java
+18
-0
ISupervisionVideoService.java
...yeejoin/equipmanage/service/ISupervisionVideoService.java
+23
-0
SupervisionVideoServiceImpl.java
...equipmanage/service/impl/SupervisionVideoServiceImpl.java
+68
-0
SupervisionVideoMapper.xml
...quip/src/main/resources/mapper/SupervisionVideoMapper.xml
+16
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/SupervisionVideo.java
0 → 100644
View file @
c7b8c2ee
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
@Data
@TableName
(
"wl_supervision_video"
)
@ApiModel
(
value
=
"Video对象"
,
description
=
""
)
public
class
SupervisionVideo
extends
BaseEntity
{
private
String
bizOrgCode
;
private
String
cameraId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java
View file @
c7b8c2ee
...
@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.fegin.IotFeign;
...
@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.fegin.IotFeign;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
com.yeejoin.equipmanage.service.ISupervisionVideoService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -46,6 +47,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -46,6 +47,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired
@Autowired
private
IotFeign
iotFeign
;
private
IotFeign
iotFeign
;
@Autowired
private
ISupervisionVideoService
supervisionVideoService
;
@PersonIdentify
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"监盘概览水源信息"
)
@ApiOperation
(
value
=
"监盘概览水源信息"
)
...
@@ -123,7 +127,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -123,7 +127,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
}
}
if
(
ObjectUtils
.
isEmpty
(
bizOrgCode
)){
if
(
ObjectUtils
.
isEmpty
(
bizOrgCode
))
{
return
CommonResponseUtil
.
success
(
null
);
return
CommonResponseUtil
.
success
(
null
);
}
}
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
statisticsByStation
(
bizOrgCode
));
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
statisticsByStation
(
bizOrgCode
));
...
@@ -184,11 +188,10 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -184,11 +188,10 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
}
@PersonIdentify
@PersonIdentify
@RequestMapping
(
value
=
"/fireAlarmLogPage"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/fireAlarmLogPage"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
列表分页查询"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"
列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
消防报警列表分页查询"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"消防报警
列表分页查询"
)
public
ResponseModel
pageQuery
(
@RequestParam
(
required
=
false
)
String
system
,
@RequestParam
(
required
=
false
)
String
specificIndexKey
,
CommonPageable
commonPageable
)
{
public
ResponseModel
pageQuery
(
@RequestParam
(
required
=
false
)
String
system
,
@RequestParam
(
required
=
false
)
String
specificIndexKey
,
CommonPageable
commonPageable
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
commonPageable
.
setPageNumber
(
1
);
...
@@ -295,7 +298,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -295,7 +298,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"FHS_PressurePump_Start"
)
&&
t
.
get
(
"FHS_PressurePump_Start"
).
equals
(
"true"
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"FHS_PressurePump_Start"
)
&&
t
.
get
(
"FHS_PressurePump_Start"
).
equals
(
"true"
))).
collect
(
Collectors
.
toList
());
int
num
=
collect
.
size
();
int
num
=
collect
.
size
();
item
.
put
(
"halfHourStartNum"
,
num
);
item
.
put
(
"halfHourStartNum"
,
num
);
}
else
if
(
200
==
twoHourEntity
.
getStatus
())
{
}
else
if
(
200
==
twoHourEntity
.
getStatus
())
{
String
json1
=
JSON
.
toJSONString
(
twoHourEntity
.
getResult
());
String
json1
=
JSON
.
toJSONString
(
twoHourEntity
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"FHS_PressurePump_Start"
)
&&
t
.
get
(
"FHS_PressurePump_Start"
).
equals
(
"true"
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"FHS_PressurePump_Start"
)
&&
t
.
get
(
"FHS_PressurePump_Start"
).
equals
(
"true"
))).
collect
(
Collectors
.
toList
());
...
@@ -337,13 +340,13 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -337,13 +340,13 @@ public class SupervisionConfigureController extends AbstractBaseController {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
stateMap
=
fireFightingSystemMapper
.
queryStartAndStopBySpecificId
(
ids
);
List
<
Map
<
String
,
Object
>>
stateMap
=
fireFightingSystemMapper
.
queryStartAndStopBySpecificId
(
ids
);
long
diffMinute
=
0L
;
long
diffMinute
=
0L
;
if
(!
ObjectUtils
.
isEmpty
(
stateMap
))
{
if
(!
ObjectUtils
.
isEmpty
(
stateMap
))
{
List
<
Map
<
String
,
Object
>>
map
=
fireFightingSystemMapper
.
queryStateBySpecificId
((
long
)
stateMap
.
get
(
0
).
get
(
"equipment_specific_id"
));
List
<
Map
<
String
,
Object
>>
map
=
fireFightingSystemMapper
.
queryStateBySpecificId
((
long
)
stateMap
.
get
(
0
).
get
(
"equipment_specific_id"
));
String
startTime
=
map
.
get
(
0
).
get
(
"update_date"
).
toString
();
String
startTime
=
map
.
get
(
0
).
get
(
"update_date"
).
toString
();
String
endTime
=
map
.
get
(
1
).
get
(
"update_date"
).
toString
();
String
endTime
=
map
.
get
(
1
).
get
(
"update_date"
).
toString
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
long
start
=
0L
;
long
start
=
0L
;
long
end
=
0L
;
long
end
=
0L
;
try
{
try
{
start
=
sdf
.
parse
(
startTime
.
replaceAll
(
"T"
,
" "
)).
getTime
();
start
=
sdf
.
parse
(
startTime
.
replaceAll
(
"T"
,
" "
)).
getTime
();
end
=
sdf
.
parse
(
endTime
.
replaceAll
(
"T"
,
" "
)).
getTime
();
end
=
sdf
.
parse
(
endTime
.
replaceAll
(
"T"
,
" "
)).
getTime
();
...
@@ -351,7 +354,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -351,7 +354,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
long
res
=
start
-
end
;
long
res
=
start
-
end
;
diffMinute
=
res
/
1000
/
60
;
diffMinute
=
res
/
1000
/
60
;
}
}
long
finalDiffMinute
=
diffMinute
;
long
finalDiffMinute
=
diffMinute
;
pressurePumpInfo
.
getRecords
().
stream
(
pressurePumpInfo
.
getRecords
().
stream
(
...
@@ -361,4 +364,58 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -361,4 +364,58 @@ public class SupervisionConfigureController extends AbstractBaseController {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
CommonResponseUtil
.
success
(
pressurePumpInfo
);
return
CommonResponseUtil
.
success
(
pressurePumpInfo
);
}
}
@PersonIdentify
@RequestMapping
(
value
=
"/addVideo"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"添加视频"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"添加视频"
)
public
ResponseModel
addVideo
(
@RequestParam
String
ids
,
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
if
(
StringUtils
.
isBlank
(
bizOrgCode
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
return
CommonResponseUtil
.
success
(
supervisionVideoService
.
addVide
(
ids
,
bizOrgCode
));
}
@PersonIdentify
@RequestMapping
(
value
=
"/queryVideoList"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询视频列表"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"查询视频列表"
)
public
ResponseModel
queryVideoList
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
if
(
StringUtils
.
isBlank
(
bizOrgCode
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
return
CommonResponseUtil
.
success
(
supervisionVideoService
.
queryVideoList
(
bizOrgCode
));
}
@PersonIdentify
@RequestMapping
(
value
=
"/delVideo"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"删除视频"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"删除视频"
)
public
ResponseModel
delVideo
(
String
id
)
{
return
CommonResponseUtil
.
success
(
supervisionVideoService
.
deleteVideo
(
id
));
}
@PersonIdentify
@RequestMapping
(
value
=
"/queryVideoAllId"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询对应站下所有视频id"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"根据id查询视频"
)
public
ResponseModel
queryVideoAllId
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
if
(
StringUtils
.
isBlank
(
bizOrgCode
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
return
CommonResponseUtil
.
success
(
supervisionVideoService
.
queryVideoAllId
(
bizOrgCode
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/SupervisionVideoMapper.java
0 → 100644
View file @
c7b8c2ee
package
com
.
yeejoin
.
equipmanage
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.equipmanage.common.entity.SupervisionVideo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
public
interface
SupervisionVideoMapper
extends
BaseMapper
<
SupervisionVideo
>
{
List
<
Map
<
String
,
Object
>>
getVideoByCompany
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
queryVideoAllId
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/ISupervisionVideoService.java
0 → 100644
View file @
c7b8c2ee
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.equipmanage.common.entity.SupervisionVideo
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author ZeHua Li
* @date 2020/11/23 15:28
* @since v2.0
*/
public
interface
ISupervisionVideoService
extends
IService
<
SupervisionVideo
>
{
List
queryVideoList
(
String
bizOrgCode
);
int
deleteVideo
(
String
id
);
boolean
addVide
(
String
ids
,
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
queryVideoAllId
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/SupervisionVideoServiceImpl.java
0 → 100644
View file @
c7b8c2ee
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.SupervisionVideo
;
import
com.yeejoin.equipmanage.mapper.SupervisionVideoMapper
;
import
com.yeejoin.equipmanage.service.ISupervisionVideoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
@Slf4j
@Service
//@EnableAsync
public
class
SupervisionVideoServiceImpl
extends
ServiceImpl
<
SupervisionVideoMapper
,
SupervisionVideo
>
implements
ISupervisionVideoService
{
@Autowired
SupervisionVideoMapper
supervisionVideoMapper
;
@Override
public
List
<
List
<
Map
<
String
,
Object
>>>
queryVideoList
(
String
bizOrgCode
)
{
List
<
List
<
Map
<
String
,
Object
>>>
resList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
list
=
supervisionVideoMapper
.
getVideoByCompany
(
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
list
.
size
()
>
1
&&
(
i
/
2
)
-
1
!=
0
&&
i
!=
0
)
{
mapList
.
add
(
list
.
get
(
i
));
resList
.
add
(
mapList
);
mapList
=
new
ArrayList
<>();
}
else
{
mapList
.
add
(
list
.
get
(
i
));
if
(
i
==
list
.
size
()
-
1
)
{
resList
.
add
(
mapList
);
}
}
}
return
resList
;
}
@Override
public
int
deleteVideo
(
String
id
)
{
return
supervisionVideoMapper
.
delete
(
new
QueryWrapper
<
SupervisionVideo
>().
eq
(
"camera_id"
,
id
));
}
@Override
public
boolean
addVide
(
String
ids
,
String
bizOrgCode
)
{
List
<
SupervisionVideo
>
list
=
new
ArrayList
<>();
for
(
String
s
:
ids
.
split
(
","
))
{
SupervisionVideo
supervisionVideo
=
new
SupervisionVideo
();
supervisionVideo
.
setCameraId
(
s
);
supervisionVideo
.
setBizOrgCode
(
bizOrgCode
);
supervisionVideo
.
setId
(
Long
.
valueOf
(
String
.
valueOf
(
UUID
.
randomUUID
().
getLeastSignificantBits
()).
replace
(
"-"
,
""
)));
list
.
add
(
supervisionVideo
);
}
return
saveBatch
(
list
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryVideoAllId
(
String
bizOrgCode
)
{
return
supervisionVideoMapper
.
queryVideoAllId
(
bizOrgCode
);
}
}
amos-boot-system-equip/src/main/resources/mapper/SupervisionVideoMapper.xml
0 → 100644
View file @
c7b8c2ee
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.equipmanage.mapper.SupervisionVideoMapper"
>
<select
id=
"getVideoByCompany"
resultType=
"java.util.Map"
>
select wv.*
from wl_supervision_video wsv left join wl_video wv on wsv.camera_id = wv.id
where wsv.biz_org_code = #{bizOrgCode}
</select>
<select
id=
"queryVideoAllId"
resultType=
"java.util.Map"
>
select wsv.camera_id
from wl_supervision_video wsv
where wsv.biz_org_code = #{bizOrgCode}
</select>
</mapper>
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