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
83213b63
Commit
83213b63
authored
Apr 26, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口,调试接口
parent
0376c9e1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
150 additions
and
15 deletions
+150
-15
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+24
-1
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+3
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+28
-6
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+5
-0
View3dNodeVo.java
...n/java/com/yeejoin/amos/fas/business/vo/View3dNodeVo.java
+52
-0
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+38
-8
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
83213b63
...
...
@@ -38,6 +38,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
));
}
...
...
@@ -46,6 +47,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
));
}
...
...
@@ -72,6 +74,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
+
" 类型不存在"
);
...
...
@@ -82,6 +85,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getPointDetail
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
));
}
...
...
@@ -90,6 +94,7 @@ public class View3dController extends BaseController {
public
CommonResponse
safetyIndexWeek
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexWeek
(
orgCode
));
}
...
...
@@ -98,6 +103,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyIndexInfoByDate
(
@RequestParam
(
name
=
"date"
,
required
=
false
)
String
date
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexInfoByDate
(
orgCode
,
date
));
}
...
...
@@ -131,6 +137,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyExecuteListTop5
(
@PathVariable
(
"type"
)
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyExecuteListTop5
(
type
,
orgCode
));
}
...
...
@@ -150,5 +157,21 @@ public class View3dController extends BaseController {
List
<
ExceptionRegionVo
>
exceptionRegionVoList
=
view3dService
.
getExceptionRegion
(
orgCode
);
return
CommonResponseUtil
.
success
(
exceptionRegionVoList
);
}
@ApiOperation
(
value
=
"异常区域信息查询"
,
notes
=
"异常区域信息查询"
)
@GetMapping
(
value
=
"equipStatus/list"
)
public
CommonResponse
getEquipStatusList
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getEquipStatusList
(
orgCode
));
}
@ApiOperation
(
value
=
"资源显示"
,
notes
=
"资源显示"
)
@GetMapping
(
value
=
"initViewNode"
)
public
CommonResponse
initViewNode
(
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
initViewNode
(
type
,
orgCode
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
83213b63
...
...
@@ -7,6 +7,7 @@ import java.util.Map;
import
com.yeejoin.amos.fas.business.bo.CheckErrorBo
;
import
com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo
;
import
com.yeejoin.amos.fas.business.bo.SafetyExecuteBo
;
import
com.yeejoin.amos.fas.business.vo.View3dNodeVo
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -86,4 +87,6 @@ public interface View3dMapper extends BaseMapper{
*/
List
<
SafetyExecuteBo
>
getCheckErrorTop5
(
String
orgCode
);
List
<
View3dNodeVo
>
initViewImpEquipmentNode
(
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
83213b63
...
...
@@ -16,6 +16,8 @@ import java.math.BigDecimal;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.persistence.criteria.CriteriaBuilder.Case
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.google.common.collect.Lists
;
...
...
@@ -30,6 +32,7 @@ import com.yeejoin.amos.fas.business.vo.ErrorContentVo;
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.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanTaskDetailStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum
;
...
...
@@ -229,12 +232,14 @@ public class View3dServiceImpl implements IView3dService {
@Override
public
HashMap
<
String
,
Object
>
getPointDetailByTypeAndId
(
String
type
,
Long
pointId
,
String
orgCode
)
{
HashMap
<
String
,
Object
>
detail
=
view3dMapper
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
);
String
ue4Location
=
(
String
)
detail
.
get
(
"ue4Location"
);
detail
.
put
(
"ue4Location"
,
ue4Location
==
null
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Location
));
String
ue4Rotation
=
(
String
)
detail
.
get
(
"ue4Rotation"
);
detail
.
put
(
"ue4Rotation"
,
ue4Rotation
==
null
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Rotation
));
String
ue4Extent
=
(
String
)
detail
.
get
(
"ue4Extent"
);
detail
.
put
(
"ue4Extent"
,
ue4Location
==
null
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Extent
));
if
(
detail
!=
null
)
{
String
ue4Location
=
(
String
)
detail
.
get
(
"ue4Location"
);
detail
.
put
(
"ue4Location"
,
ue4Location
==
null
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Location
));
String
ue4Rotation
=
(
String
)
detail
.
get
(
"ue4Rotation"
);
detail
.
put
(
"ue4Rotation"
,
ue4Rotation
==
null
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Rotation
));
String
ue4Extent
=
(
String
)
detail
.
get
(
"ue4Extent"
);
detail
.
put
(
"ue4Extent"
,
ue4Location
==
null
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Extent
));
}
return
detail
;
}
...
...
@@ -444,4 +449,21 @@ public class View3dServiceImpl implements IView3dService {
" \"securityPersonNumber\": 20,\r\n"
+
" }"
);
}
@Override
public
Object
getEquipStatusList
(
String
orgCode
)
{
return
JSON
.
parseArray
(
"[{\"id\":1,\"label\":\"设备1 label\",\"changeDate\":\"2020-04-26 10:00:00\"}"
+
",{\"id\":2,\"label\":\"设备2 label\",\"changeDate\":\"2020-04-25 10:00:00\"}]"
);
}
@Override
public
List
<
View3dNodeVo
>
initViewNode
(
String
type
,
String
orgCode
)
{
switch
(
type
)
{
case
"impEquipment"
:
return
view3dMapper
.
initViewImpEquipmentNode
(
orgCode
);
default
:
break
;
}
return
null
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
83213b63
...
...
@@ -6,6 +6,7 @@ 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.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
java.util.HashMap
;
...
...
@@ -93,4 +94,8 @@ public interface IView3dService {
List
<
SafetyExecuteBo
>
getSafetyExecuteListTop5
(
String
type
,
String
orgCode
);
Object
getStatisticsDuty
();
Object
getEquipStatusList
(
String
orgCode
);
List
<
View3dNodeVo
>
initViewNode
(
String
type
,
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/View3dNodeVo.java
0 → 100644
View file @
83213b63
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
public
class
View3dNodeVo
{
private
Long
id
;
private
String
name
;
private
String
code
;
private
JSONArray
ue4Location
=
new
JSONArray
();
private
JSONArray
ue4Rotation
=
new
JSONArray
();
private
String
type
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
JSONArray
getUe4Location
()
{
return
ue4Location
;
}
public
void
setUe4Location
(
String
ue4Location
)
{
this
.
ue4Location
=
StringUtils
.
isEmpty
(
ue4Location
)
?
new
JSONArray
()
:
JSONArray
.
parseArray
(
ue4Location
);
}
public
JSONArray
getUe4Rotation
()
{
return
ue4Rotation
;
}
public
void
setUe4Rotation
(
String
ue4Rotation
)
{
this
.
ue4Rotation
=
StringUtils
.
isEmpty
(
ue4Rotation
)
?
new
JSONArray
()
:
JSON
.
parseArray
(
ue4Rotation
);
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
83213b63
...
...
@@ -26,7 +26,7 @@
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
AND B.id is not null
AND B.id is not null
AND B.is_delete = 0
</when>
<when
test=
"type == 'impEquipment'"
>
select
...
...
@@ -140,7 +140,7 @@
<when
test=
"type == 'patrol'"
>
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from p_point
where 1=1
where 1=1
and is_delete = 0
</when>
<when
test=
"type == 'impEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
...
...
@@ -180,12 +180,12 @@
<when
test=
"type == 'fireChamber'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_station
where type =
2
where type =
1
</when>
<when
test=
"type == 'fireFoamRoom'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_station
where type =
1
where type =
2
</when>
</choose>
<if
test=
"pointId != null"
>
...
...
@@ -198,14 +198,13 @@
<select
id=
"getSafetyIndexWeek"
resultType=
"java.util.HashMap"
>
<![CDATA[
SELECT temp1.*,
S.safety_index
as value
SELECT temp1.*,
IFNULL(S.safety_index,0)
as value
FROM (
SELECT @s :=@s + 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date
FROM mysql.help_topic,(SELECT @s := 0) temp
WHERE @s < 7
) temp1
left join f_safety_index_change_log S on s.collect_date = temp1.date
WHERE S.org_code = #{orgCode}
left join f_safety_index_change_log S on s.collect_date = temp1.date AND S.org_code = #{orgCode}
ORDER BY temp1.date
]]>
</select>
...
...
@@ -299,9 +298,39 @@
SELECT p.id,I.point_no as code,I.name as label,p.point_id,'check' as type,p.check_time as changeDate
FROM p_check p
left join p_point I ON I.id = p.point_id
where p.org_code = #{org_code} or p.org_code like CONCAT(#{orgCode},'-','%')
where p.is_ok IN ('2', '3')
AND I.is_delete = 0
AND p.org_code = #{org_code} or p.org_code like CONCAT(#{orgCode},'-','%')
ORDER BY p.check_time desc
limit 0,5
</select>
<select
id=
"initViewImpEquipmentNode"
resultType=
"com.yeejoin.amos.fas.business.vo.View3dNodeVo"
>
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type
FROM f_fire_equipment fe
WHERE fe.id IN (
select fire_equipment_id from f_equipment_fire_equipment
) AND org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'impEquipment' as type
FROM f_equipment
WHERE org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,
case type
when 1 then 'hydrant'
when 2 then 'pool'
end as type
FROM f_water_resource
WHERE org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type
FROM f_fire_station
WHERE type = 1 AND org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type
FROM f_fire_car
WHERE org_code like CONCAT(#{orgCode},'%')
</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