Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
60155ad9
Commit
60155ad9
authored
May 06, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.调试接口,2.新增右侧检索查询接口
parent
b505fa5e
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1323 additions
and
91 deletions
+1323
-91
CoordDTO.java
...a/com/yeejoin/amos/fas/core/common/response/CoordDTO.java
+48
-0
Node3DVoResponse.java
...ejoin/amos/fas/core/common/response/Node3DVoResponse.java
+390
-0
RegionTreeResponse.java
...oin/amos/fas/core/common/response/RegionTreeResponse.java
+46
-0
BaseController.java
.../yeejoin/amos/fas/business/controller/BaseController.java
+8
-0
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+37
-3
RiskSourceMapper.java
...eejoin/amos/fas/business/dao/mapper/RiskSourceMapper.java
+2
-2
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+8
-1
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+4
-4
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+56
-14
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+2
-2
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+10
-4
CrossDomainFilter.java
.../main/java/com/yeejoin/amos/filter/CrossDomainFilter.java
+1
-1
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+13
-0
dbTemplate_patrol.xml
...sStart/src/main/resources/db/mapper/dbTemplate_patrol.xml
+10
-7
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+28
-10
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+660
-43
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/response/CoordDTO.java
0 → 100644
View file @
60155ad9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
common
.
response
;
/**
*
* <pre>
* 三维坐标点实体
* </pre>
*
*/
public
class
CoordDTO
{
/**
* <pre>
*
* </pre>
*/
private
Double
x
;
private
Double
y
;
private
Double
z
;
public
Double
getX
()
{
return
x
;
}
public
void
setX
(
Double
x
)
{
this
.
x
=
x
;
}
public
Double
getY
()
{
return
y
;
}
public
void
setY
(
Double
y
)
{
this
.
y
=
y
;
}
public
Double
getZ
()
{
return
z
;
}
public
void
setZ
(
Double
z
)
{
this
.
z
=
z
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/response/Node3DVoResponse.java
0 → 100644
View file @
60155ad9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
common
.
response
;
import
com.alibaba.fastjson.JSON
;
/**
*
* <pre>
* 三维视图节点元素
* </pre>
*/
public
class
Node3DVoResponse
{
protected
String
id
;
private
String
key
;
/**
* 设备名称
*/
private
String
label
;
/**
* 类型,nodeVo中填充View3DNodeType中的name值
*/
private
String
type
;
/**
* 等级
*/
private
String
level
;
/**
* "level_0"
*/
private
String
levelStr
;
/**
* 所属模型,例如floor_1’,‘floor_2’,‘floor_3’
*/
private
String
objKey
;
/**
* 显示图标
*/
private
String
displayIcon
;
/**
* 节点位置,{x: 17.6681, y: 39.7036, z: 13.8012}
*/
private
String
positionDTO
;
/**
* 节点位置,{x: 0, y: 0, z: 0}
*/
private
String
rotationDTO
;
/**
* 节点位置,{x: 1, y: 1, z: 1}
*/
private
String
scaleDTO
;
/**
* 节点位置,包括x,y,z值
*/
private
CoordDTO
position
;
/**
* 节点位置,包括x,y,z值
*/
private
CoordDTO
rotation
;
/**
* 节点位置,包括x,y,z值
*/
private
CoordDTO
scale
;
/**
* 显示图标闪烁标题
*/
private
Boolean
showInfo
=
false
;
/**
* 显示图标闪烁
*/
private
Boolean
twinkle
=
false
;
/**
* 显示图标闪烁标题
*/
private
String
title
;
/**
* 点编号
*/
private
String
dataCode
;
/**
* 点等级
*/
private
String
dataLevel
;
/**
* 保护对象名称
*/
private
String
protectObjName
;
/**
* 是否室内(默认false,为室外)
*/
private
Boolean
isDoor
=
false
;
private
String
orgCode
;
/**
* 闪烁频率每秒
*/
private
int
rate
=
0
;
public
int
getRate
()
{
return
rate
;
}
public
void
setRate
(
int
rate
)
{
this
.
rate
=
rate
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getLabel
()
{
return
label
;
}
public
void
setLabel
(
String
label
)
{
this
.
label
=
label
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getLevel
()
{
return
level
;
}
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
public
String
getLevelStr
()
{
return
levelStr
;
}
public
void
setLevelStr
(
String
levelStr
)
{
this
.
levelStr
=
levelStr
;
}
public
String
getObjKey
()
{
return
objKey
;
}
public
void
setObjKey
(
String
objKey
)
{
this
.
objKey
=
objKey
;
}
public
String
getDisplayIcon
()
{
return
displayIcon
;
}
public
void
setDisplayIcon
(
String
displayIcon
)
{
this
.
displayIcon
=
displayIcon
;
}
public
Boolean
getShowInfo
()
{
return
showInfo
;
}
public
void
setShowInfo
(
Boolean
showInfo
)
{
this
.
showInfo
=
showInfo
;
}
public
Boolean
getTwinkle
()
{
return
twinkle
;
}
public
void
setTwinkle
(
Boolean
twinkle
)
{
this
.
twinkle
=
twinkle
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDataCode
()
{
return
dataCode
;
}
public
void
setDataCode
(
String
dataCode
)
{
this
.
dataCode
=
dataCode
;
}
public
String
getDataLevel
()
{
return
dataLevel
;
}
public
void
setDataLevel
(
String
dataLevel
)
{
this
.
dataLevel
=
dataLevel
;
}
public
String
getProtectObjName
()
{
return
protectObjName
;
}
public
void
setProtectObjName
(
String
protectObjName
)
{
this
.
protectObjName
=
protectObjName
;
}
public
Boolean
getIsDoor
()
{
return
isDoor
;
}
public
void
setIsDoor
(
Boolean
isDoor
)
{
this
.
isDoor
=
isDoor
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getPositionDTO
()
{
return
positionDTO
;
}
public
void
setPositionDTO
(
String
positionDTO
)
{
this
.
positionDTO
=
positionDTO
;
}
public
String
getRotationDTO
()
{
return
rotationDTO
;
}
public
void
setRotationDTO
(
String
rotationDTO
)
{
this
.
rotationDTO
=
rotationDTO
;
}
public
String
getScaleDTO
()
{
return
scaleDTO
;
}
public
void
setScaleDTO
(
String
scaleDTO
)
{
this
.
scaleDTO
=
scaleDTO
;
}
public
CoordDTO
getPosition
()
{
return
positionDTO
==
null
?
null
:
JSON
.
parseObject
(
positionDTO
,
CoordDTO
.
class
);
}
public
void
setPosition
(
CoordDTO
position
)
{
this
.
position
=
position
;
}
public
CoordDTO
getRotation
()
{
return
rotationDTO
==
null
?
null
:
JSON
.
parseObject
(
rotationDTO
,
CoordDTO
.
class
);
}
public
void
setRotation
(
CoordDTO
rotation
)
{
this
.
rotation
=
rotation
;
}
public
CoordDTO
getScale
()
{
return
scaleDTO
==
null
?
null
:
JSON
.
parseObject
(
scaleDTO
,
CoordDTO
.
class
);
}
public
void
setScale
(
CoordDTO
scale
)
{
this
.
scale
=
scale
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/response/RegionTreeResponse.java
View file @
60155ad9
...
...
@@ -19,6 +19,10 @@ public class RegionTreeResponse {
private
Boolean
isBind
;
private
String
type
;
private
Boolean
isRegion
;
private
String
position3d
;
private
String
routePath
;
private
String
level
;
private
String
levelStr
;
private
List
<
RegionTreeResponse
>
children
=
new
ArrayList
<>();
...
...
@@ -88,6 +92,48 @@ public class RegionTreeResponse {
public
void
setIsRegion
(
Boolean
isRegion
)
{
this
.
isRegion
=
isRegion
;
}
public
String
getPosition3d
()
{
return
position3d
;
}
public
void
setPosition3d
(
String
position3d
)
{
this
.
position3d
=
position3d
;
}
/**
* @return the routePath
*/
public
String
getRoutePath
()
{
return
routePath
;
}
/**
* @param routePath the routePath to set
*/
public
void
setRoutePath
(
String
routePath
)
{
this
.
routePath
=
routePath
;
}
/**
* @return the levelStr
*/
public
String
getLevelStr
()
{
return
levelStr
;
}
/**
* @param levelStr the levelStr to set
*/
public
void
setLevelStr
(
String
levelStr
)
{
this
.
levelStr
=
levelStr
;
}
/**
* @return the level
*/
public
String
getLevel
()
{
return
level
;
}
/**
* @param level the level to set
*/
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/BaseController.java
View file @
60155ad9
...
...
@@ -94,6 +94,14 @@ public class BaseController {
return
authToken
;
}
protected
String
getChannelType
()
{
String
channelType
=
request
.
getHeader
(
"channelType"
);
if
(
channelType
==
null
)
{
channelType
=
request
.
getParameter
(
"channelType"
);
}
return
channelType
;
}
//redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
//return "region_" + userId + "_" + token.substring(0, token.indexOf('_', 1));
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
60155ad9
...
...
@@ -13,10 +13,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
...
...
@@ -48,7 +50,8 @@ public class View3dController extends BaseController {
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
orgCode
));
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
channelType
,
orgCode
));
}
@ApiOperation
(
value
=
"区域详情查询"
,
notes
=
"区域详情查询"
)
...
...
@@ -57,7 +60,8 @@ public class View3dController extends BaseController {
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
));
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
,
channelType
));
}
@ApiOperation
(
value
=
"区域绑定"
,
notes
=
"区域绑定"
)
...
...
@@ -84,7 +88,8 @@ public class View3dController extends BaseController {
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
));
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
,
channelType
));
}
return
CommonResponseUtil
.
failure
(
type
+
" 类型不存在"
);
}
...
...
@@ -203,4 +208,33 @@ public class View3dController extends BaseController {
return
CommonResponseUtil
.
success
();
}
/**
* <pre>
* 初始化三维视图节点
* </pre>
*/
@GetMapping
(
value
=
"/init3dViewNode"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"初始化三维视图节点"
,
notes
=
"初始化三维视图节点"
)
public
CommonResponse
init3dViewNode
(
@ApiParam
(
value
=
"节点类型"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
type
)
{
if
(
StringUtil
.
isNotEmpty
(
type
))
{
return
CommonResponseUtil
.
success
(
view3dService
.
find3dViewDataByType
(
type
));
}
return
CommonResponseUtil
.
failure
();
}
@GetMapping
(
value
=
"/retrieve/all"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"右侧边栏搜索"
,
notes
=
"右侧边栏搜索"
)
public
CommonResponse
retrieveAll
(
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
(
required
=
false
)
String
inputText
,
@RequestParam
(
required
=
true
)
int
current
,
@RequestParam
(
required
=
true
)
int
pageSize
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
return
view3dService
.
retrieveAll
(
type
,
inputText
,
current
,
pageSize
,
orgCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/RiskSourceMapper.java
View file @
60155ad9
...
...
@@ -99,9 +99,9 @@ public interface RiskSourceMapper extends BaseMapper {
void
updateRpn
(
RiskSource
riskSource
);
List
<
RegionTreeResponse
>
getRegionList
(
String
orgCode
);
List
<
RegionTreeResponse
>
getRegionList
(
String
channelType
,
String
orgCode
);
HashMap
<
String
,
Object
>
findRegionById
(
@Param
(
"id"
)
Long
id
,
@Param
(
"orgCode"
)
String
orgCode
);
HashMap
<
String
,
Object
>
findRegionById
(
@Param
(
"id"
)
Long
id
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"channelType"
)
String
channelType
);
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
60155ad9
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
org.apache.ibatis.annotations.Param
;
import
com.yeejoin.amos.fas.core.common.response.Node3DVoResponse
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
public
interface
View3dMapper
extends
BaseMapper
{
...
...
@@ -20,7 +21,7 @@ public interface View3dMapper extends BaseMapper{
* @param orgCode
* @return
*/
List
<
RegionTreeResponse
>
getPointTreeByType
(
@Param
(
"type"
)
String
type
,
@Param
(
"orgCode"
)
String
orgCode
);
List
<
RegionTreeResponse
>
getPointTreeByType
(
@Param
(
"type"
)
String
type
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"channelType"
)
String
channelType
);
/**
* 获取点详情
...
...
@@ -112,4 +113,10 @@ public interface View3dMapper extends BaseMapper{
* @return
*/
List
<
View3dNodeVo
>
initViewErrorNode
(
String
type
,
String
orgCode
);
List
<
Node3DVoResponse
>
findViewDataByType
(
String
type
);
Long
retrieveAllCount
(
String
type
,
String
inputText
,
String
orgCode
);
List
<
HashMap
<
String
,
Object
>>
retrieveAll
(
String
type
,
String
inputText
,
long
start
,
int
length
,
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
60155ad9
...
...
@@ -1748,8 +1748,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
@Override
public
List
<
RegionTreeResponse
>
findRegionTree
(
String
orgCode
)
{
List
<
RegionTreeResponse
>
regionList
=
riskSourceMapper
.
getRegionList
(
orgCode
);
public
List
<
RegionTreeResponse
>
findRegionTree
(
String
channelType
,
String
orgCode
)
{
List
<
RegionTreeResponse
>
regionList
=
riskSourceMapper
.
getRegionList
(
channelType
,
orgCode
);
return
getRiskRegionTree
(
regionList
);
}
...
...
@@ -1773,8 +1773,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
@Override
public
HashMap
<
String
,
Object
>
findRegionById
(
Long
id
,
String
orgCode
)
{
HashMap
<
String
,
Object
>
regionDetail
=
riskSourceMapper
.
findRegionById
(
id
,
orgCode
);
public
HashMap
<
String
,
Object
>
findRegionById
(
Long
id
,
String
orgCode
,
String
channelType
)
{
HashMap
<
String
,
Object
>
regionDetail
=
riskSourceMapper
.
findRegionById
(
id
,
orgCode
,
channelType
);
if
(
regionDetail
!=
null
)
{
Long
isBind
=
(
Long
)
regionDetail
.
get
(
"isBind"
);
regionDetail
.
put
(
"isBind"
,
isBind
==
0
?
false
:
true
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
60155ad9
...
...
@@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -53,7 +55,9 @@ import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import
com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum
;
import
com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
com.yeejoin.amos.fas.core.common.response.Node3DVoResponse
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -155,8 +159,12 @@ public class View3dServiceImpl implements IView3dService {
Optional
<
FireCar
>
data
=
iFireCarDao
.
findById
(
pointBo
.
getPointId
());
if
(
data
.
isPresent
()){
FireCar
fireCar
=
data
.
get
();
fireCar
.
setUe4Location
(
pointBo
.
getUe4Location
());
fireCar
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
String
ue4Location
=
pointBo
.
getUe4Location
();
String
ue4Rotation
=
pointBo
.
getUe4Rotation
();
String
position3d
=
pointBo
.
getPosition3d
();
if
(
ue4Location
!=
null
)
fireCar
.
setUe4Location
(
ue4Location
);
if
(
ue4Rotation
!=
null
)
fireCar
.
setUe4Rotation
(
ue4Rotation
);
if
(
position3d
!=
null
)
fireCar
.
setPosition3d
(
position3d
);
iFireCarDao
.
save
(
fireCar
);
}
}
...
...
@@ -165,8 +173,12 @@ public class View3dServiceImpl implements IView3dService {
Optional
<
WaterResource
>
data
=
iWaterResourceDao
.
findById
(
pointBo
.
getPointId
());
if
(
data
.
isPresent
()){
WaterResource
waterResource
=
data
.
get
();
waterResource
.
setUe4Location
(
pointBo
.
getUe4Location
());
waterResource
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
String
ue4Location
=
pointBo
.
getUe4Location
();
String
ue4Rotation
=
pointBo
.
getUe4Rotation
();
String
position3d
=
pointBo
.
getPosition3d
();
if
(
ue4Location
!=
null
)
waterResource
.
setUe4Location
(
ue4Location
);
if
(
ue4Rotation
!=
null
)
waterResource
.
setUe4Rotation
(
ue4Rotation
);
if
(
position3d
!=
null
)
waterResource
.
setPosition3d
(
position3d
);
iWaterResourceDao
.
save
(
waterResource
);
}
}
...
...
@@ -175,8 +187,12 @@ public class View3dServiceImpl implements IView3dService {
Optional
<
FireStation
>
data
=
iFireStationDao
.
findById
(
pointBo
.
getPointId
());
if
(
data
.
isPresent
()){
FireStation
fireStation
=
data
.
get
();
fireStation
.
setUe4Location
(
pointBo
.
getUe4Location
());
fireStation
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
String
ue4Location
=
pointBo
.
getUe4Location
();
String
ue4Rotation
=
pointBo
.
getUe4Rotation
();
String
position3d
=
pointBo
.
getPosition3d
();
if
(
ue4Location
!=
null
)
fireStation
.
setUe4Location
(
ue4Location
);
if
(
ue4Rotation
!=
null
)
fireStation
.
setUe4Rotation
(
ue4Rotation
);
if
(
position3d
!=
null
)
fireStation
.
setPosition3d
(
position3d
);
iFireStationDao
.
save
(
fireStation
);
}
}
...
...
@@ -185,8 +201,12 @@ public class View3dServiceImpl implements IView3dService {
Optional
<
FireEquipment
>
data
=
iFireEquipmentDao
.
findById
(
pointBo
.
getPointId
());
if
(
data
.
isPresent
()){
FireEquipment
fireEquipment
=
data
.
get
();
fireEquipment
.
setUe4Location
(
pointBo
.
getUe4Location
());
fireEquipment
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
String
ue4Location
=
pointBo
.
getUe4Location
();
String
ue4Rotation
=
pointBo
.
getUe4Rotation
();
String
position3d
=
pointBo
.
getPosition3d
();
if
(
ue4Location
!=
null
)
fireEquipment
.
setUe4Location
(
ue4Location
);
if
(
ue4Rotation
!=
null
)
fireEquipment
.
setUe4Rotation
(
ue4Rotation
);
if
(
position3d
!=
null
)
fireEquipment
.
setPosition3d
(
position3d
);
iFireEquipmentDao
.
save
(
fireEquipment
);
}
}
...
...
@@ -196,8 +216,12 @@ public class View3dServiceImpl implements IView3dService {
Equipment
equipment
=
null
;
if
(
data
.
isPresent
()){
equipment
=
data
.
get
();
equipment
.
setUe4Location
(
pointBo
.
getUe4Location
());
equipment
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
String
ue4Location
=
pointBo
.
getUe4Location
();
String
ue4Rotation
=
pointBo
.
getUe4Rotation
();
String
position3d
=
pointBo
.
getPosition3d
();
if
(
ue4Location
!=
null
)
equipment
.
setUe4Location
(
ue4Location
);
if
(
ue4Rotation
!=
null
)
equipment
.
setUe4Rotation
(
ue4Rotation
);
if
(
position3d
!=
null
)
equipment
.
setPosition3d
(
position3d
);
iEquipmentDao
.
save
(
equipment
);
}
}
...
...
@@ -210,8 +234,12 @@ public class View3dServiceImpl implements IView3dService {
Optional
<
RiskSource
>
data
=
iRiskSourceDao
.
findById
(
pointBo
.
getPointId
());
if
(
data
.
isPresent
()){
RiskSource
riskSource
=
data
.
get
();
riskSource
.
setUe4Location
(
pointBo
.
getUe4Location
());
riskSource
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
String
ue4Location
=
pointBo
.
getUe4Location
();
String
ue4Rotation
=
pointBo
.
getUe4Rotation
();
String
position3d
=
pointBo
.
getPosition3d
();
if
(
ue4Location
!=
null
)
riskSource
.
setUe4Location
(
ue4Location
);
if
(
ue4Rotation
!=
null
)
riskSource
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
if
(
position3d
!=
null
)
riskSource
.
setPosition3d
(
position3d
);
iRiskSourceDao
.
save
(
riskSource
);
}
}
...
...
@@ -222,8 +250,8 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
)
{
List
<
RegionTreeResponse
>
pointTreeByType
=
view3dMapper
.
getPointTreeByType
(
type
,
orgCode
);
public
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
,
String
channelType
)
{
List
<
RegionTreeResponse
>
pointTreeByType
=
view3dMapper
.
getPointTreeByType
(
type
,
orgCode
,
channelType
);
return
convertPointTree
(
pointTreeByType
);
}
...
...
@@ -543,4 +571,18 @@ public class View3dServiceImpl implements IView3dService {
e
.
printStackTrace
();
}
}
@Override
public
List
<
Node3DVoResponse
>
find3dViewDataByType
(
String
type
)
{
return
view3dMapper
.
findViewDataByType
(
type
);
}
@Override
public
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
)
{
CommonPageable
pageable
=
new
CommonPageable
(
current
,
pageSize
);
Long
count
=
view3dMapper
.
retrieveAllCount
(
type
,
inputText
,
orgCode
);
List
<
HashMap
<
String
,
Object
>>
retrieveAll
=
view3dMapper
.
retrieveAll
(
type
,
inputText
,
pageable
.
getOffset
(),
pageable
.
getPageSize
(),
orgCode
);
Page
result
=
new
PageImpl
(
retrieveAll
,
pageable
,
count
);
return
CommonResponseUtil
.
success
(
result
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
60155ad9
...
...
@@ -121,7 +121,7 @@ public interface IRiskSourceService {
* @param orgCode 机构
* @return 树
*/
List
<
RegionTreeResponse
>
findRegionTree
(
String
orgCode
);
List
<
RegionTreeResponse
>
findRegionTree
(
String
channelType
,
String
orgCode
);
/**
* 区域详情重新
...
...
@@ -129,7 +129,7 @@ public interface IRiskSourceService {
* @param orgCode 机构
* @return map
*/
HashMap
<
String
,
Object
>
findRegionById
(
Long
id
,
String
orgCode
);
HashMap
<
String
,
Object
>
findRegionById
(
Long
id
,
String
orgCode
,
String
channelType
);
/**
* 批量保存区域信息
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
60155ad9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.SafetyExecuteBo
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.business.vo.View3dNodeVo
;
import
com.yeejoin.amos.fas.core.common.response.Node3DVoResponse
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author DELL
...
...
@@ -37,7 +39,7 @@ public interface IView3dService {
* @param orgCode 登陆机构
* @return list
*/
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
);
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
,
String
channelType
);
/**
* 获取点详情
...
...
@@ -131,4 +133,8 @@ public interface IView3dService {
* 刷新安全指数
*/
void
safetyIndexRefresh
();
List
<
Node3DVoResponse
>
find3dViewDataByType
(
String
type
);
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
);
}
YeeAmosFireAutoSysStart/src/main/java/com/yeejoin/amos/filter/CrossDomainFilter.java
View file @
60155ad9
...
...
@@ -41,7 +41,7 @@ public class CrossDomainFilter implements Filter
// 允许的方法
response
.
setHeader
(
"Access-Control-Allow-Methods"
,
"GET,POST,DELETE,OPTIONS,PUT"
);
response
.
setHeader
(
"Access-Control-Max-Age"
,
"3600"
);
response
.
setHeader
(
"Access-Control-Allow-Headers"
,
"Origin, X-Requested-With, X-Access-Token, X-Api-Key, Content-Type, Accept, Cache-Control,appKey, product, token"
);
response
.
setHeader
(
"Access-Control-Allow-Headers"
,
"Origin, X-Requested-With, X-Access-Token, X-Api-Key, Content-Type, Accept, Cache-Control,appKey, product, token
, channelType
"
);
chain
.
doFilter
(
req
,
res
);
}
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
60155ad9
...
...
@@ -182,4 +182,16 @@
<column
name=
"type"
/>
</createIndex>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1588067351000-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_risk_source"
columnName=
"route_path"
/>
</not>
</preConditions>
<comment>
f_risk_source add column route_path
</comment>
<sql>
alter table f_risk_source add column `route_path` varchar(2000) DEFAULT NULL COMMENT '路径坐标' after `position3d`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_patrol.xml
View file @
60155ad9
...
...
@@ -2,11 +2,13 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper"
>
<update
id=
"updatePoint3dPosition"
>
update p_point
set
ue4_location = #{ue4Location},
ue4_rotation = #{ue4Rotation}
where id = #{pointId}
</update>
<update
id=
"updatePoint3dPosition"
>
update p_point
<trim
prefix=
"set"
suffixOverrides=
","
>
<if
test=
"ue4Location != null"
>
ue4_location = #{ue4Location},
</if>
<if
test=
"ue4Rotation != null"
>
ue4_rotation = #{ue4Rotation},
</if>
<if
test=
"position3d != null"
>
coordinates = #{position3d},
</if>
</trim>
where id = #{pointId}
</update>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
60155ad9
...
...
@@ -678,19 +678,37 @@
<select
id=
"getRegionList"
parameterType=
"string"
resultType=
"com.yeejoin.amos.fas.core.common.response.RegionTreeResponse"
>
select
id,name,code,parent_id,ue4_location,ue4_rotation,ue4_extent,
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as is_bind,
IF(is_region = 'TRUE',1,0) as is_region
from f_risk_source
where is_region = 'TRUE' AND org_code like CONCAT(#{orgCode},'%')
rs.id,rs.name,rs.code,rs.parent_id,rs.ue4_location,rs.ue4_rotation,rs.ue4_extent,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(rs.route_path) || LENGTH(trim(rs.route_path))
<![CDATA[ <]]>
1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(rs.ue4_rotation),'[]','')='',NULL,rs.ue4_rotation))
AND ISNULL(IF(replace(trim(rs.ue4_location),'[]','')='',NULL,rs.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
IF(rs.is_region = 'TRUE',1,0) as is_region,
rs.route_path,
rl.level,
CONCAT('level_',rl.level) as level_str
from f_risk_source rs
left join f_risk_level rl ON rs.risk_level_id = rl.id
where is_region = 'TRUE' AND rs.org_code like CONCAT(#{orgCode},'%')
</select>
<select
id=
"findRegionById"
resultType=
"java.util.HashMap"
>
select
id,name,code,parent_id as parentId,ue4_location as ue4Location,ue4_rotation as ue4Rotation,ue4_extent as ue4Extent,
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as isBind,
id,name,code,parent_id as parentId,ue4_location as ue4Location,ue4_rotation as ue4Rotation,ue4_extent as ue4Extent,route_path as routePath,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(route_path) || LENGTH(trim(route_path))
<![CDATA[ <]]>
1,0,1) as isBind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as isBind,
</otherwise>
</choose>
IF(is_region = 'TRUE',1,0) as isRegion,
(select name from f_risk_level where level = r.risk_level_id) as riskLevel
from f_risk_source r
...
...
@@ -711,7 +729,7 @@
ue4_extent = #{item.ue4Extent,jdbcType=VARCHAR},
</if>
<if
test=
"item.position3d != null"
>
position3d
= #{item.position3d,jdbcType=VARCHAR},
route_path
= #{item.position3d,jdbcType=VARCHAR},
</if>
</set>
where id = #{item.riskSourceId,jdbcType=BIGINT}
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
60155ad9
...
...
@@ -8,21 +8,42 @@
<when
test=
"type == 'riskSource'"
>
select
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,R.ue4_location)),0,1) as is_bind,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(route_path) || LENGTH(trim(route_path))
<![CDATA[ <]]>
1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,R.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
route_path,
rl.level,
CONCAT('level_',rl.level) as level_str,
IF(is_region = 'TRUE',1,0) as is_region
from f_risk_source R
left join f_risk_level rl on rl.id = R.risk_level_id
where 1=1
</when>
<when
test=
"type == 'patrol'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(B.coordinates) || LENGTH(trim(B.coordinates))
<![CDATA[ <]]>
1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name as name,B.point_no,B.ue4_location,B.ue4_rotation,
1 as is_region
1 as is_region,
B.coordinates as position3d,
B.status as level,
CONCAT('level_',B.status) as level_str
from f_risk_source R
left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1
...
...
@@ -31,11 +52,19 @@
<when
test=
"type == 'impEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d))
<![CDATA[ <]]>
1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation,
1 as is_region
1 as is_region,
B.position3d
from f_risk_source R
left join f_equipment B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1
...
...
@@ -44,11 +73,19 @@
<when
test=
"type == 'monitorEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d))
<![CDATA[ <]]>
1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region
0 as is_region,
B.position3d
from f_risk_source R
left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 0
where 1=1
...
...
@@ -57,11 +94,19 @@
<when
test=
"type == 'video'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
<choose>
<when
test=
"channelType == '3dpage'"
>
IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d))
<![CDATA[ <]]>
1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region
0 as is_region,
B.position3d
from f_risk_source R
left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 2
where 1=1
...
...
@@ -70,16 +115,29 @@
<when
test=
"type == 'fireEquipment'"
>
select
R.id,R.parent_id,
CASE
WHEN ISNULL(C.id) = 0 then IF(ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_rotation))
AND ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_location)),0,1)
WHEN ISNULL(E.id) = 0 then IF(ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_rotation))
AND ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_location)),0,1)
WHEN ISNULL(S.id) = 0 then IF(ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_rotation))
AND ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_location)),0,1)
WHEN ISNULL(W.id) = 0 then IF(ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_rotation))
AND ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_location)),0,1)
END as is_bind,
<choose>
<when
test=
"channelType == '3dpage'"
>
CASE
WHEN ISNULL(C.id) = 0 AND ISNULL(C.position3d) OR LENGTH(trim(C.position3d))
<![CDATA[ <]]>
1 then 0
WHEN ISNULL(E.id) = 0 AND ISNULL(E.position3d) OR LENGTH(trim(E.position3d))
<![CDATA[ <]]>
1 then 0
WHEN ISNULL(S.id) = 0 AND ISNULL(S.position3d) OR LENGTH(trim(S.position3d))
<![CDATA[ <]]>
1 then 0
WHEN ISNULL(W.id) = 0 AND ISNULL(W.position3d) OR LENGTH(trim(W.position3d))
<![CDATA[ <]]>
1 then 0
ELSE 1
END as is_bind,
</when>
<otherwise>
CASE
WHEN ISNULL(C.id) = 0 then IF(ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_rotation))
AND ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_location)),0,1)
WHEN ISNULL(E.id) = 0 then IF(ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_rotation))
AND ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_location)),0,1)
WHEN ISNULL(S.id) = 0 then IF(ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_rotation))
AND ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_location)),0,1)
WHEN ISNULL(W.id) = 0 then IF(ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_rotation))
AND ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_location)),0,1)
END as is_bind,
</otherwise>
</choose>
CASE
WHEN ISNULL(C.id) = 0 then 'fireCar'
WHEN ISNULL(E.id) = 0 then 'fireEquipment'
...
...
@@ -112,7 +170,20 @@
WHEN ISNULL(S.id) = 0 then S.ue4_rotation
WHEN ISNULL(W.id) = 0 then W.ue4_rotation
END as ue4_rotation,
0 as is_region
0 as is_region,
CASE
WHEN ISNULL(C.id) = 0 then C.ue4_rotation
WHEN ISNULL(E.id) = 0 then E.ue4_rotation
WHEN ISNULL(S.id) = 0 then S.ue4_rotation
WHEN ISNULL(W.id) = 0 then W.ue4_rotation
END as ue4_rotation,
0 as is_region,
CASE
WHEN ISNULL(C.id) = 0 then C.position3d
WHEN ISNULL(E.id) = 0 then E.position3d
WHEN ISNULL(S.id) = 0 then S.position3d
WHEN ISNULL(W.id) = 0 then W.position3d
END as position3d
from f_risk_source R
left join f_fire_car C on C.risk_source_id = R.id
left join f_fire_equipment E on E.risk_source_id = R.id AND equip_classify = 3
...
...
@@ -131,67 +202,139 @@
<select
id=
"getPointDetailByTypeAndId"
resultType=
"java.util.HashMap"
>
<choose>
<when
test=
"type == 'riskSource'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d
from f_risk_source
select rs.id,rs.name,rs.code,rs.ue4_location as ue4Location,rs.ue4_rotation as ue4Rotation,rs.position3d,
rl.level,rl.name as levelStr,rs.floor3d ,rs.is_indoor as isIndoor
from f_risk_source rs
left join f_risk_level rl ON rl.id = rs.risk_level_id
where 1=1
<if
test=
"pointId != null"
>
AND rs.id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND rs.org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'patrol'"
>
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d,
status,floor as floor3d,is_indoor as isIndoor
from p_point
where 1=1 and is_delete = 0
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'impEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_equipment
where 1=1
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'monitorEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_fire_equipment
where equip_classify = 0
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'video'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_fire_equipment
where equip_classify = 2
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'hydrant'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_water_resource
where type = 1
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'pool'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_water_resource
where type = 2
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'fireCar'"
>
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_fire_car
where 1=1
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'fireEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_fire_equipment
where equip_classify = 3
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'fireChamber'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_fire_station
where type = 1
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
<when
test=
"type == 'fireFoamRoom'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor
from f_fire_station
where type = 2
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</when>
</choose>
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</select>
<select
id=
"getSafetyIndexWeek"
resultType=
"java.util.HashMap"
>
...
...
@@ -428,4 +571,477 @@
</choose>
</select>
<select
id=
"findViewDataByType"
resultType=
"com.yeejoin.amos.fas.core.common.response.Node3DVoResponse"
>
SELECT
*
FROM
(
SELECT
rs.id,
rs.is_indoor inDoor,
CONCAT('riskSource-', rs.id) 'key',
rs.`name` label,
rl.`level` 'level',
CONCAT('level_', rl.`level`) levelStr,
CONCAT('floor_1', floor3d) objKey,
CASE
WHEN (
ISNULL(rs.position3d) || LENGTH(trim(rs.position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(rs.position3d, ',', 1),
',"y":',
substring_index(
substring_index(rs.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(rs.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
false showInfo,
rs. CODE title,
'riskSource' type
FROM
f_risk_source rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE
rs.position3d IS NOT NULL
AND rs.position3d != ''
AND rs.risk_level_id is not null
AND rs.status = 'ANOMALY'
UNION ALL
SELECT
id,
is_indoor inDoor,
CONCAT('impEquipment-', id) 'key',
`name` label,
'0' LEVEL,
'level_0' levelStr,
CONCAT('floor_1', floor3d) objKey,
CASE
WHEN (
ISNULL(eq.position3d) || LENGTH(trim(eq.position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(eq.position3d, ',', 1),
',"y":',
substring_index(
substring_index(eq.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(eq.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
FALSE showInfo,
CODE title,
'impEquipment' type
FROM
f_equipment eq
WHERE
position3d IS NOT NULL
AND eq.risk_source_id in (select id from f_risk_source where is_region='TRUE')
AND position3d != ''
AND eq.id in
(select equipment_id from f_equipment_fire_equipment fefe
left join f_fire_equipment fe ON fe.id = fefe.fire_equipment_id
where fe.equip_status = 1)
UNION ALL
select
p.id,
p.is_indoor as inDoor,
CONCAT('patrol',p.id) as `key`,
p.name,
p.status as LEVEL,
CONCAT('level_',p.status) as levelStr,
CONCAT('floor',p.floor) as objKey,
CASE
WHEN (
ISNULL(p.coordinates) || LENGTH(trim(p.coordinates))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(p.coordinates, ',', 1),
',"y":',
substring_index(
substring_index(p.coordinates, ',', - 2),
',',
1
),
',"z":',
substring_index(p.coordinates, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
FALSE showInfo,
p.point_no title,
'patrol' as type
from
p_point p
left join f_risk_source rs on p.risk_source_id = rs.id AND rs.is_region='TRUE'
where rs.id is not null
AND p.status in ('2','3')
AND p.coordinates != '' AND p.coordinates is not null
) temp
WHERE temp.type = #{type}
</select>
<select
id=
"retrieveAllCount"
resultType=
"long"
>
select count(1)
from (
select r.name,r.code,'riskSource' as typeCode,r.org_code as orgCode
from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE'
UNION all
select p.name,p.point_no as code,'patrol' as typeCode,p.org_code as orgCode
from p_point p
WHERE is_delete = FALSE
UNION all
select name,code,'impEquipment' as typeCode,org_code as orgCode
from f_equipment e
UNION all
select name,code,'monitorEquipment' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 0
UNION all
select name,code,'video' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 2
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
from f_water_resource where type = 1
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
from f_water_resource where type = 2
UNION all
select name,car_num as code,'fireEquipment' as typeCode,org_code as orgCode
from f_fire_car
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 3
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
from f_fire_station where type = 2
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
from f_fire_station where type = 1
) as tmp
where 1=1
<if
test=
"inputText!=null"
>
AND (
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if
test=
"type!=null"
>
AND tmp.typeCode = #{type}
</if>
<if
test=
"orgCode!=null"
>
AND tmp.orgCode = #{orgCode}
</if>
</select>
<select
id=
"retrieveAll"
resultType=
"java.util.HashMap"
>
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level,CONCAT('level_',rl.level) as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE
WHEN (
ISNULL(r.position3d) || LENGTH(trim(r.position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(r.position3d, ',', 1),
',"y":',
substring_index(
substring_index(r.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(r.position3d, ',', - 1),
'}'
)
END positionDTO
from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE'
UNION all
select p.id,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode,
CASE
WHEN (
ISNULL(p.coordinates) || LENGTH(trim(p.coordinates))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(p.coordinates, ',', 1),
',"y":',
substring_index(
substring_index(p.coordinates, ',', - 2),
',',
1
),
',"z":',
substring_index(p.coordinates, ',', - 1),
'}'
)
END positionDTO
from p_point p
WHERE is_delete = FALSE
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,
0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode,
CASE
WHEN (
ISNULL(e.position3d) || LENGTH(trim(e.position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(e.position3d, ',', 1),
',"y":',
substring_index(
substring_index(e.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(e.position3d, ',', - 1),
'}'
)
END positionDTO
from f_equipment e
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 0
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_water_resource where type = 1
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防水池' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_water_resource where type = 2
UNION all
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_car
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 3
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_station where type = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_station where type = 1
) as tmp
where 1=1
<if
test=
"inputText!=null"
>
AND (
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if
test=
"type!=null"
>
AND tmp.typeCode = #{type}
</if>
<if
test=
"orgCode!=null"
>
AND tmp.orgCode = #{orgCode}
</if>
LIMIT ${start},${length}
</select>
</mapper>
\ 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