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
98859d13
Commit
98859d13
authored
Jun 09, 2022
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改视频监控批量导入时建筑位置字段保存错误修改(wl_video_source:parent_source_ids)
bug6303,bug6287
parent
9dad0c39
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
10 deletions
+34
-10
VideoDownloadVO.java
...yeejoin/equipmanage/common/entity/vo/VideoDownloadVO.java
+2
-2
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+2
-4
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+30
-4
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/VideoDownloadVO.java
View file @
98859d13
...
...
@@ -25,10 +25,10 @@ public class VideoDownloadVO implements Serializable {
@ExcelProperty
(
value
=
"token"
,
index
=
3
)
private
String
token
;
@ExcelProperty
(
value
=
"机构编码"
,
index
=
4
)
@ExcelProperty
(
value
=
"机构编码
(必填)
"
,
index
=
4
)
private
String
bizOrgCode
;
@ExcelProperty
(
value
=
"机构/部门名称"
,
index
=
5
)
@ExcelProperty
(
value
=
"机构/部门名称
(必填)
"
,
index
=
5
)
private
String
bizOrgName
;
@ExcelProperty
(
value
=
"所属建筑编码"
,
index
=
6
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
98859d13
...
...
@@ -34,7 +34,6 @@ import com.yeejoin.equipmanage.operation.SyncRiskOperator;
import
com.yeejoin.equipmanage.operation.factory.PageOperatorFactory
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.*
;
import
liquibase.pro.packaged.S
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -48,7 +47,6 @@ import org.typroject.tyboot.core.foundation.exception.BaseException;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
...
...
@@ -553,8 +551,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return
fireFightingSystemService
.
transferListToPointTree
(
responses
,
null
,
instanceId
);
}
public
List
<
PointTreeVo
>
getEquipTree
(
String
bizOrgCode
,
String
instanceId
,
String
displayName
)
{
@Override
public
List
<
PointTreeVo
>
getEquipTree
(
String
bizOrgCode
,
String
instanceId
,
String
displayName
)
{
//根据关键字筛选建筑树
List
<
PointTreeVo
>
responses
=
this
.
baseMapper
.
getBuildAll
(
displayName
);
if
(
ValidationUtil
.
isEmpty
(
bizOrgCode
)
&&
ValidationUtil
.
isEmpty
(
instanceId
)
&&
ValidationUtil
.
isEmpty
(
displayName
)
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
98859d13
...
...
@@ -4,11 +4,15 @@ 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.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
import
com.yeejoin.equipmanage.common.enums.IndustryEnum
;
...
...
@@ -361,6 +365,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
static
final
Pattern
urlPattern
=
Pattern
.
compile
(
"^(((http)|(https)):\\/\\/)?([0-9]{1,3}.){3}[0-9]{1,3}(:[1-3]?[0-9]{1,4})?$"
);
private
List
<
Long
>
getParents
(
Map
<
Long
,
Long
>
allMap
,
Long
wsId
)
{
List
<
Long
>
parents
=
Lists
.
newLinkedList
();
if
(
wsId
!=
null
&&
wsId
!=
0
)
{
parents
.
add
(
wsId
);
parents
.
addAll
(
getParents
(
allMap
,
allMap
.
get
(
wsId
)));
}
parents
.
remove
(
0L
);
return
parents
;
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
List
<
Video
>
videoUpload
(
List
<
VideoDownloadVO
>
videoDownloadVOS
)
{
...
...
@@ -374,8 +388,19 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
// 获取所有的视频设备编号
Set
<
String
>
videoCodeSet
=
new
HashSet
(
Bean
.
listToMap
(
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<>()),
"code"
,
Video
.
class
).
keySet
());
// 所有建筑列表
List
<
WarehouseStructure
>
allWarehouseStructureList
=
warehouseStructureService
.
list
().
stream
().
filter
(
z
->
StringUtil
.
isNotEmpty
(
z
.
getCode
())).
collect
(
Collectors
.
toList
());
// 建筑对应父级建筑map
Map
<
Long
,
String
>
withParentMap
=
Maps
.
newHashMap
();
if
(!
ValidationUtil
.
isEmpty
(
allWarehouseStructureList
))
{
Map
<
Long
,
Long
>
allMap
=
allWarehouseStructureList
.
stream
().
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getId
,
WarehouseStructure:
:
getParentId
));
allWarehouseStructureList
.
forEach
(
ws
->
withParentMap
.
put
(
ws
.
getId
(),
Joiner
.
on
(
","
).
join
(
getParents
(
allMap
,
ws
.
getId
()))));
}
// 获取所有的建筑code与id对应关系
Map
<
String
,
Long
>
buildingMap
=
new
HashMap
(
Bean
.
listToMap
(
warehouseStructureService
.
list
().
stream
().
filter
(
z
->
StringUtil
.
isNotEmpty
(
z
.
getCode
())).
collect
(
Collectors
.
toList
())
,
"code"
,
"id"
,
WarehouseStructure
.
class
));
Map
<
String
,
Long
>
buildingMap
=
new
HashMap
(
Bean
.
listToMap
(
allWarehouseStructureList
,
"code"
,
"id"
,
WarehouseStructure
.
class
));
// 获取所有的装备code与id对应关系
Map
<
String
,
Long
>
equipMap
=
new
HashMap
(
Bean
.
listToMap
(
equipmentSpecificSerivce
.
list
().
stream
().
filter
(
z
->
StringUtil
.
isNotEmpty
(
z
.
getCode
())).
collect
(
Collectors
.
toList
()),
"code"
,
"id"
,
EquipmentSpecific
.
class
));
// 获取所有重点设备code与id对应关系
...
...
@@ -398,13 +423,13 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":视频地址不能为空"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getType
()))
{
throw
new
RuntimeException
(
"
机构/部门编码
不能为空,请修改后上传!"
);
throw
new
RuntimeException
(
"
视频类型(枪机/球机)
不能为空,请修改后上传!"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgCode
()))
{
throw
new
RuntimeException
(
"机构
/部门名称
不能为空,请修改后上传!"
);
throw
new
RuntimeException
(
"机构
编码
不能为空,请修改后上传!"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgName
()))
{
throw
new
RuntimeException
(
"
视频类型为必填字段
,请修改后上传!"
);
throw
new
RuntimeException
(
"
机构/部门名称不能为空
,请修改后上传!"
);
}
// if (!urlPattern.matcher(x.getUrl().trim()).matches()) {
// throw new RuntimeException("错误行" + rowNum + ":视频地址格式有误,仅支持协议+ip+端口的格式");
...
...
@@ -432,6 +457,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
VideoSource
videoSource
=
new
VideoSource
();
videoSource
.
setVideoId
(
video
.
getId
());
videoSource
.
setSourceId
(
buildingMap
.
get
(
x
.
getBuildingCodes
().
trim
()));
videoSource
.
setParentSourceIds
(
withParentMap
.
get
(
buildingMap
.
get
(
x
.
getBuildingCodes
().
trim
())));
videoSources
.
add
(
videoSource
);
}
// 处理监控和多个装备关系(1个摄像头对多个装备)
...
...
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