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
a930110a
Commit
a930110a
authored
Apr 23, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调接口
parent
f72c369e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
24 deletions
+79
-24
RegionTreeResponse.java
...oin/amos/fas/core/common/response/RegionTreeResponse.java
+22
-10
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+11
-0
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+7
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+5
-0
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+7
-0
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+4
-2
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+23
-12
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/response/RegionTreeResponse.java
View file @
a930110a
...
...
@@ -3,18 +3,24 @@ package com.yeejoin.amos.fas.core.common.response;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
public
class
RegionTreeResponse
{
private
Long
id
;
private
String
name
;
private
String
code
;
private
Long
parentId
;
private
String
ue4Location
;
private
String
ue4Rotation
;
private
String
ue4Extent
;
private
JSONArray
ue4Location
=
new
JSONArray
()
;
private
JSONArray
ue4Rotation
=
new
JSONArray
()
;
private
JSONArray
ue4Extent
=
new
JSONArray
()
;
private
Boolean
isBind
;
private
List
<
RegionTreeResponse
>
children
=
new
ArrayList
<>();
private
String
type
;
private
Boolean
isRegion
;
private
List
<
RegionTreeResponse
>
children
=
new
ArrayList
<>();
public
Long
getId
()
{
return
id
;
...
...
@@ -40,23 +46,23 @@ public class RegionTreeResponse {
public
void
setParentId
(
Long
parentId
)
{
this
.
parentId
=
parentId
;
}
public
String
getUe4Location
()
{
public
JSONArray
getUe4Location
()
{
return
ue4Location
;
}
public
void
setUe4Location
(
String
ue4Location
)
{
this
.
ue4Location
=
ue4Location
;
this
.
ue4Location
=
StringUtils
.
isEmpty
(
ue4Location
)
?
new
JSONArray
()
:
JSONArray
.
parseArray
(
ue4Location
)
;
}
public
String
getUe4Rotation
()
{
public
JSONArray
getUe4Rotation
()
{
return
ue4Rotation
;
}
public
void
setUe4Rotation
(
String
ue4Rotation
)
{
this
.
ue4Rotation
=
ue4Rotation
;
this
.
ue4Rotation
=
StringUtils
.
isEmpty
(
ue4Rotation
)
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Rotation
)
;
}
public
String
getUe4Extent
()
{
public
JSONArray
getUe4Extent
()
{
return
ue4Extent
;
}
public
void
setUe4Extent
(
String
ue4Extent
)
{
this
.
ue4Extent
=
ue4Extent
;
this
.
ue4Extent
=
StringUtils
.
isEmpty
(
ue4Extent
)
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Extent
)
;
}
public
Boolean
getIsBind
()
{
return
isBind
;
...
...
@@ -76,6 +82,12 @@ public class RegionTreeResponse {
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Boolean
getIsRegion
()
{
return
isRegion
;
}
public
void
setIsRegion
(
Boolean
isRegion
)
{
this
.
isRegion
=
isRegion
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
a930110a
...
...
@@ -37,6 +37,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getRegionTree
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
orgCode
));
}
...
...
@@ -45,6 +46,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"riskSourceId"
)
Long
riskSourceId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
));
}
...
...
@@ -71,6 +73,7 @@ public class View3dController extends BaseController {
if
(
ResourceTypeDefEnum
.
containsTypeCode
(
type
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
));
}
return
CommonResponseUtil
.
failure
(
type
+
" 类型不存在"
);
...
...
@@ -83,6 +86,14 @@ public class View3dController extends BaseController {
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
));
}
@ApiOperation
(
value
=
"一周安全指数趋势查询"
,
notes
=
"一周安全指数趋势查询"
)
@GetMapping
(
value
=
"safetyIndex/week"
)
public
CommonResponse
safetyIndexWeek
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexWeek
(
orgCode
));
}
@ApiOperation
(
value
=
"今日安全指数查询"
,
notes
=
"按照日期查询安全指数及分类数据"
)
@GetMapping
(
value
=
"/statistics/safetyIndex"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
a930110a
...
...
@@ -48,5 +48,12 @@ public interface View3dMapper extends BaseMapper{
* @return list
*/
List
<
RiskPointRpnChangeBo
>
getAllErrorRiskPoint
(
Map
<
String
,
Object
>
params
);
/**
* 一周安全指数趋势查询
* @param orgCode
* @return
*/
HashMap
<
String
,
Object
>
getSafetyIndexWeek
(
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
a930110a
...
...
@@ -292,4 +292,9 @@ public class View3dServiceImpl implements IView3dService {
//计算规则:除10 减100 求绝对值,结果保留1位小数
return
rpn
.
divide
(
new
BigDecimal
(
"10"
)).
subtract
(
new
BigDecimal
(
"100"
)).
abs
().
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
@Override
public
HashMap
<
String
,
Object
>
getSafetyIndexWeek
(
String
orgCode
)
{
return
view3dMapper
.
getSafetyIndexWeek
(
orgCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
a930110a
...
...
@@ -60,4 +60,11 @@ public interface IView3dService {
*/
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
,
String
orgCode
);
/**
* 一周安全指数趋势查询
* @param orgCode
* @return
*/
HashMap
<
String
,
Object
>
getSafetyIndexWeek
(
String
orgCode
);
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
a930110a
...
...
@@ -679,7 +679,8 @@
<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(trim(ue4_rotation)='',NULL,ue4_rotation)) OR ISNULL(IF(trim(ue4_location)='',NULL,ue4_location)),0,1) as is_bind
IF(ISNULL(IF(trim(ue4_rotation)='',NULL,ue4_rotation)) OR ISNULL(IF(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},'%')
</select>
...
...
@@ -687,7 +688,8 @@
<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(trim(ue4_rotation)='',NULL,ue4_rotation)) OR ISNULL(IF(trim(ue4_location)='',NULL,ue4_location)),0,1) as isBind
IF(ISNULL(IF(trim(ue4_rotation)='',NULL,ue4_rotation)) OR ISNULL(IF(trim(ue4_location)='',NULL,ue4_location)),0,1) as isBind,
IF(is_region = 'TRUE',1,0) as isRegion
from f_risk_source
where id=#{id} AND org_code like CONCAT(#{orgCode},'%')
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
a930110a
...
...
@@ -8,17 +8,19 @@
<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(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) AND ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
IF(is_region = 'TRUE',1,0) as is_region
from f_risk_source R
where 1=1
</when>
<when
test=
"type == 'patrol'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
OR
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
AND
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name as name,B.point_no,B.ue4_location,B.ue4_rotation
B.name as name,B.point_no,B.ue4_location,B.ue4_rotation,
1 as is_region
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
...
...
@@ -27,9 +29,10 @@
<when
test=
"type == 'impEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
OR
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
AND
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation
B.name,B.code,B.ue4_location,B.ue4_rotation,
1 as is_region
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
...
...
@@ -38,9 +41,10 @@
<when
test=
"type == 'monitorEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
OR
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
AND
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region
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
...
...
@@ -49,9 +53,10 @@
<when
test=
"type == 'video'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
OR
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
AND
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region
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
...
...
@@ -60,7 +65,7 @@
<when
test=
"type == 'fireEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
OR
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation))
AND
ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
CASE
WHEN ISNULL(C.id) = 0 then 'fireCar'
WHEN ISNULL(E.id) = 0 then 'fireEquipment'
...
...
@@ -92,7 +97,8 @@
WHEN ISNULL(E.name) = 0 then E.ue4_rotation
WHEN ISNULL(S.name) = 0 then S.ue4_rotation
WHEN ISNULL(W.name) = 0 then W.ue4_rotation
END as code
END as code,
0 as is_region
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
...
...
@@ -173,6 +179,11 @@
AND org_code like CONCAT(#{orgCode},'%')
</if>
</select>
<select
id=
"getSafetyIndexWeek"
resultType=
"java.util.HashMap"
>
</select>
<select
id=
"countUpperRiskPoint"
resultType=
"long"
>
SELECT
count(DISTINCT frcl.id)
...
...
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