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
808de20a
Commit
808de20a
authored
Dec 17, 2021
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改点位图视频相关接口
parent
89c6cb1b
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
191 additions
and
135 deletions
+191
-135
AlamVideoVO.java
...com/yeejoin/equipmanage/common/entity/vo/AlamVideoVO.java
+8
-0
DetailPaneVO.java
...om/yeejoin/equipmanage/common/entity/vo/DetailPaneVO.java
+2
-1
BitmapEnum.java
...java/com/yeejoin/equipmanage/common/enums/BitmapEnum.java
+29
-0
EquipmentSpecificController.java
...n/equipmanage/controller/EquipmentSpecificController.java
+2
-2
VideoController.java
...a/com/yeejoin/equipmanage/controller/VideoController.java
+1
-1
VideoFeignClient.java
.../java/com/yeejoin/equipmanage/fegin/VideoFeignClient.java
+23
-0
VideoMapper.java
...main/java/com/yeejoin/equipmanage/mapper/VideoMapper.java
+2
-1
IEquipmentSpecificSerivce.java
...eejoin/equipmanage/service/IEquipmentSpecificSerivce.java
+1
-1
IVideoService.java
...n/java/com/yeejoin/equipmanage/service/IVideoService.java
+1
-1
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+1
-1
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+3
-3
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+1
-1
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+30
-7
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+71
-105
application.properties
...ot-system-equip/src/main/resources/application.properties
+2
-0
VideoMapper.xml
...ot-system-equip/src/main/resources/mapper/VideoMapper.xml
+14
-11
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/AlamVideoVO.java
View file @
808de20a
...
...
@@ -8,11 +8,19 @@ import lombok.Data;
@Data
public
class
AlamVideoVO
{
private
Long
id
;
private
String
url
;
private
String
token
;
private
String
name
;
private
String
code
;
private
String
address
;
private
String
img
;
private
String
presetPosition
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/DetailPaneVO.java
View file @
808de20a
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity.vo;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -18,6 +19,6 @@ public class DetailPaneVO {
//图片
private
String
pic
;
//参数
private
List
<
Map
<
String
,
String
>>
items
;
private
List
<
Map
<
String
,
String
>>
items
=
new
ArrayList
<
Map
<
String
,
String
>>()
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/BitmapEnum.java
0 → 100644
View file @
808de20a
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
/**
* 画布资源枚举
* @author DELL
*
*/
public
enum
BitmapEnum
{
equipment
(
"消防类设备"
,
"equipment"
),
video
(
"视频类设备"
,
"video"
);
BitmapEnum
(
String
name
,
String
key
)
{
this
.
name
=
name
;
this
.
key
=
key
;
}
private
String
name
;
private
String
key
;
public
String
getName
()
{
return
name
;
}
public
String
getKey
()
{
return
key
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java
View file @
808de20a
...
...
@@ -153,8 +153,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping
(
value
=
"/getOneCard"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"组装组态使用装备卡片数据"
)
public
DetailPaneVO
getOneCard
(
Long
id
)
{
return
equipmentSpecificSerivce
.
getOneCard
(
id
);
public
Object
getOneCard
(
Long
id
,
String
type
)
{
return
equipmentSpecificSerivce
.
getOneCard
(
id
,
type
);
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/VideoController.java
View file @
808de20a
...
...
@@ -280,7 +280,7 @@ public class VideoController extends AbstractBaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过视频id和预置位获取可播放的flv格式地址"
,
notes
=
"通过视频id和预置位获取可播放的flv格式地址"
)
public
String
getVideoFlvUrl
(
@RequestParam
String
videoId
,
@RequestParam
String
presetIndex
)
{
String
flvUrl
=
videoService
.
getVideoUrl
(
videoId
,
presetIndex
,
""
);
String
flvUrl
=
videoService
.
getVideoUrl
(
videoId
,
presetIndex
,
""
,
""
);
return
flvUrl
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/VideoFeignClient.java
0 → 100644
View file @
808de20a
package
com
.
yeejoin
.
equipmanage
.
fegin
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
/**
* @description:
* @author: tw
* @createDate: 2021/10/20
*/
@FeignClient
(
name
=
"${video.fegin.name}"
,
path
=
"video"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
VideoFeignClient
{
@RequestMapping
(
value
=
"/video-original/url/video/{indexCode}"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
String
>
videoUrlByIndexCode
(
@PathVariable
(
"indexCode"
)
String
indexCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/VideoMapper.java
View file @
808de20a
...
...
@@ -41,7 +41,8 @@ public interface VideoMapper extends BaseMapper<Video> {
* @return
*/
List
<
AlamVideoVO
>
getVideoBySpeId
(
Long
id
);
List
<
AlamVideoVO
>
getVideoById
(
Long
id
);
AlamVideoVO
getVideoById
(
Long
id
);
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificSerivce.java
View file @
808de20a
...
...
@@ -80,7 +80,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @param id
* @return
*/
DetailPaneVO
getOneCard
(
Long
id
);
Object
getOneCard
(
Long
id
,
String
type
);
/**
* 通过id获取设备区域建筑等信息
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IVideoService.java
View file @
808de20a
...
...
@@ -75,5 +75,5 @@ public interface IVideoService extends IService<Video> {
* @param defaultUrl
* @return
*/
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
);
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
,
String
code
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
808de20a
...
...
@@ -763,7 +763,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x
.
setLocation
(
x
.
getAddress
());
}
}
x
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
()));
x
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
()
,
x
.
getCode
()
));
});
}
return
pages
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
808de20a
...
...
@@ -83,9 +83,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
final
String
alarmType
=
"IOT_CORE_PARAM"
;
Map
<
String
,
Object
>
res
=
new
HashMap
<>();
if
(
videoType
.
equals
(
type
))
{
List
<
AlamVideoVO
>
video
=
videoMapper
.
getVideoById
(
equipId
);
List
<
AlamVideoVO
>
video
=
videoMapper
.
getVideoBy
Spe
Id
(
equipId
);
video
.
forEach
(
action
->
{
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
()));
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
()
,
action
.
getCode
()
));
});
res
.
put
(
"video"
,
video
);
return
res
;
...
...
@@ -103,7 +103,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
}
videoBySpeId
.
forEach
(
action
->
{
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
()));
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
()
,
action
.
getCode
()
));
});
res
.
put
(
"data"
,
specificAlarm
);
res
.
put
(
"video"
,
videoBySpeId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
808de20a
...
...
@@ -237,7 +237,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
video
.
setName
(
x
.
getName
());
video
.
setTokens
(
x
.
getToken
());
video
.
setUrl
(
x
.
getUrl
());
video
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
()));
video
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
()
,
x
.
getCode
()
));
video
.
setIp
(
x
.
getIp
());
video
.
setPort
(
x
.
getPort
());
video
.
setCode
(
x
.
getCode
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
808de20a
...
...
@@ -57,6 +57,7 @@ import com.yeejoin.equipmanage.common.entity.Video;
import
com.yeejoin.equipmanage.common.entity.Warehouse
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.AlarmVO
;
import
com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO
;
...
...
@@ -76,6 +77,7 @@ import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO;
import
com.yeejoin.equipmanage.common.entity.vo.TechInfoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.VideoVO
;
import
com.yeejoin.equipmanage.common.enums.BillContentEnum
;
import
com.yeejoin.equipmanage.common.enums.BitmapEnum
;
import
com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.FileTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.StockBillTypeEnum
;
...
...
@@ -89,10 +91,12 @@ import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import
com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo
;
import
com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig
;
import
com.yeejoin.equipmanage.fegin.VideoFeignClient
;
import
com.yeejoin.equipmanage.mapper.EquipmentIndexMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.mapper.UploadFileMapper
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.service.IEquPropertyService
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
...
...
@@ -109,6 +113,7 @@ import com.yeejoin.equipmanage.service.IStockService;
import
com.yeejoin.equipmanage.service.ISyncDataService
;
import
com.yeejoin.equipmanage.service.ISystemDicService
;
import
com.yeejoin.equipmanage.service.IUploadFileService
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.service.IWarehouseService
;
import
com.yeejoin.equipmanage.service.IWarehouseStructureService
;
import
com.yeejoin.equipmanage.utils.RelationRedisUtil
;
...
...
@@ -175,6 +180,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
IEquipmentIndexService
iEquipmentIndexService
;
@Autowired
private
IVideoService
videoService
;
@Value
(
"${systemctl.dict.iot-core-param}"
)
private
String
iotCoreParam
;
...
...
@@ -196,10 +204,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
private
RelationRedisUtil
relationRedisUtil
;
@Autowired
private
VideoMapper
videoMapper
;
@Value
(
"${systemctl.sync.switch}"
)
private
Boolean
syncSwitch
;
private
final
String
injection
=
"{\n"
+
"\n"
+
" \"items\": [\n"
+
...
...
@@ -1050,13 +1062,24 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
@Override
public
DetailPaneVO
getOneCard
(
Long
id
)
{
DetailPaneVO
detailPaneVO
=
new
DetailPaneVO
();
Map
<
String
,
String
>
map
=
this
.
baseMapper
.
getQrCodeAndPic
(
id
);
detailPaneVO
.
setQrCode
(
map
.
get
(
"qrCode"
));
detailPaneVO
.
setPic
(
map
.
get
(
"pic"
));
detailPaneVO
.
setItems
(
this
.
baseMapper
.
getOneCard
(
id
));
return
detailPaneVO
;
public
Object
getOneCard
(
Long
id
,
String
type
)
{
if
(
BitmapEnum
.
video
.
getKey
().
equals
(
type
)){
AlamVideoVO
video
=
videoMapper
.
getVideoById
(
id
);
if
(!
ObjectUtils
.
isEmpty
(
video
)){
video
.
setUrl
(
videoService
.
getVideoUrl
(
video
.
getName
().
toString
(),
video
.
getPresetPosition
(),
video
.
getUrl
(),
video
.
getCode
()));
}
return
video
;
}
else
{
DetailPaneVO
detailPaneVO
=
new
DetailPaneVO
();
Map
<
String
,
String
>
map
=
this
.
baseMapper
.
getQrCodeAndPic
(
id
);
if
(
ObjectUtils
.
isEmpty
(
map
)){
return
detailPaneVO
;
}
detailPaneVO
.
setQrCode
(
map
.
get
(
"qrCode"
));
detailPaneVO
.
setPic
(
map
.
get
(
"pic"
));
detailPaneVO
.
setItems
(
this
.
baseMapper
.
getOneCard
(
id
));
return
detailPaneVO
;
}
}
@Override
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
808de20a
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.VideoImportantEquipment
;
import
com.yeejoin.equipmanage.common.entity.VideoSource
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentCategoryTypeTreeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PageVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.VideoDownloadVO
;
import
com.yeejoin.equipmanage.common.entity.vo.VideoListVo
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
import
com.yeejoin.equipmanage.common.enums.IndustryEnum
;
import
com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.fegin.VideoFeignClient
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.service.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
com.yeejoin.equipmanage.service.IBuilldService
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService
;
import
com.yeejoin.equipmanage.service.IVideoImportantEquipmentService
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.service.IVideoSourceService
;
import
com.yeejoin.equipmanage.service.IWarehouseStructureService
;
import
java.util.*
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @author ZeHua Li
...
...
@@ -67,6 +102,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Autowired
VideoMapper
videoMapper
;
@Autowired
VideoFeignClient
videoFeignClient
;
@Value
(
"${param.htvideo.url}"
)
...
...
@@ -482,12 +521,26 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Override
public
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
)
{
public
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
,
String
code
)
{
if
(
"off"
.
equals
(
isUseVideoTranscoding
))
{
return
defaultUrl
;
String
url
=
getVideoUrl
(
code
);
return
ObjectUtils
.
isEmpty
(
url
)
?
defaultUrl
:
url
;
}
return
getFlvUrlByVideoIdOrPresetIndex
(
videoId
,
presetIndex
);
}
private
String
getVideoUrl
(
String
code
){
String
url
=
""
;
try
{
ResponseModel
<
String
>
da
=
videoFeignClient
.
videoUrlByIndexCode
(
code
);
if
(!
ObjectUtils
.
isEmpty
(
da
)){
url
=
da
.
getResult
().
substring
(
da
.
getResult
().
indexOf
(
"openUrl"
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"视频服务调用失败"
,
e
.
getMessage
());
}
return
url
;
}
public
String
getFlvUrlByVideoIdOrPresetIndex
(
String
videoId
,
String
presetIndex
)
{
try
{
...
...
@@ -542,91 +595,4 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return
"rtsp"
;
}
// /**
// * 异步保存监控和建筑关联关系
// * @param buildingCodes
// * @param videoId
// */
// @Async
// void saveVideoSource(String[] buildingCodes,Long videoId){
// List<VideoSource> videoSources = new ArrayList<>();
//
// //转map,方便后面code转id
// List<WarehouseStructure> list = warehouseStructureService.list();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
//
// //拼接数据
// for (int i = 0; i < buildingCodes.length; i++) {
// VideoSource videoSource = new VideoSource();
// videoSource.setVideoId(videoId);
// //通过code取id
// videoSource.setSourceId(map.get(buildingCodes[i]));
// videoSources.add(videoSource);
// }
//
// videoSourceService.saveBatch(videoSources);
// }
//
// /**
// * 异步保存监控和单个装备关联关系
// * @param equipmentSpecificCodes
// * @param videoId
// */
// @Async
// void saveEquipmentSpecificCodes(String[] equipmentSpecificCodes,Long videoId){
//
// List<VideoEquipmentSpecific> videoSources = new ArrayList<>();
//
// //转map,方便后面code转id
// List<EquipmentSpecific> list = equipmentSpecificSerivce.list();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
// //拼接数据
// for (int i = 0; i < equipmentSpecificCodes.length; i++) {
// VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
// videoEquipmentSpecific.setVideoId(videoId);
// //通过code取id
// videoEquipmentSpecific.setEquipmentSpecificId(map.get(equipmentSpecificCodes[i]));
// videoSources.add(videoEquipmentSpecific);
// }
//
// videoEquipmentSpecificService.saveBatch(videoSources);
// }
//
//
// /**
// * 异步保存监控和重点设备关联关系
// * @param importantEquipmentCodes
// * @param videoId
// */
// @Async
// void saveImportantEquipmentCodes(String[] importantEquipmentCodes,Long videoId){
//
// List<VideoImportantEquipment> videoImportantEquipments = new ArrayList<>();
//
// //转map,方便后面code转id
// List<EquipmentSpecificVo> list = baseMapper.selectImportantEquipment();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
//
// //拼接数据
// for (int i = 0; i < importantEquipmentCodes.length; i++) {
// VideoImportantEquipment videoImportantEquipment = new VideoImportantEquipment();
// videoImportantEquipment.setVideoId(videoId);
// //通过code取id
// videoImportantEquipment.setImportantEquipmentId(map.get(importantEquipmentCodes[i]));
// videoImportantEquipments.add(videoImportantEquipment);
// }
// videoImportantEquipmentService.saveBatch(videoImportantEquipments);
// }
}
amos-boot-system-equip/src/main/resources/application.properties
View file @
808de20a
...
...
@@ -50,6 +50,8 @@ iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name
=
JCS
video.fegin.name
=
VIDEO
#项目初始化画布id
morphic.projectSeq
=
1390314016458514433
...
...
amos-boot-system-equip/src/main/resources/mapper/VideoMapper.xml
View file @
808de20a
...
...
@@ -136,17 +136,20 @@
where equipment_specific_id = #{id}
</select>
<select
id=
"getVideoById"
resultType=
"com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO"
>
select
vid.id,
vid.token,
vid.name,
vid.url,
vid.code,
vid.preset_position as presetPosition
from
wl_video_equipment_specific as ves
left join wl_video as vid on ves.video_id = vid.id
where video_id = #{id}
SELECT
v.`name`,
v.`code`,
v.url,
v.token,
CONCAT_WS(' ', ws.full_name, v.address) AS address,
v.img,
v.preset_position as presetPosition
FROM
wl_video v
LEFT JOIN wl_video_source vs ON vs.video_id = v.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = vs.source_id
WHERE
v.id = #{id}
</select>
<select
id=
"pageColaBuildingVideo"
resultType=
"com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO"
>
...
...
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