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
f98c6d80
Commit
f98c6d80
authored
Apr 21, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口
parent
bb374985
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
255 additions
and
68 deletions
+255
-68
ResourceTypeDefEnum.java
...om/yeejoin/amos/fas/common/enums/ResourceTypeDefEnum.java
+48
-12
BindRegionBo.java
...n/java/com/yeejoin/amos/fas/business/bo/BindRegionBo.java
+25
-0
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+22
-2
RiskSourceMapper.java
...eejoin/amos/fas/business/dao/mapper/RiskSourceMapper.java
+10
-6
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+13
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+42
-38
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+25
-5
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+9
-5
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+6
-0
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+19
-0
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+36
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/ResourceTypeDefEnum.java
View file @
f98c6d80
...
...
@@ -7,17 +7,17 @@ import java.util.Map;
public
enum
ResourceTypeDefEnum
{
riskSource
(
"风险点"
,
"riskSource"
),
patrol
(
"巡检点"
,
"patrol"
),
impEquipment
(
"重点设备"
,
"impEquipment"
),
monitorEquipment
(
"探测器"
,
"monitorEquipment"
),
hydrant
(
"消火栓"
,
"hydrant"
),
pool
(
"消防水池"
,
"pool"
),
fireCar
(
"消防车"
,
"fireCar"
),
fireEquipment
(
"灭火器材"
,
"fireEquipment"
),
fireChamber
(
"消防小室"
,
"fireChamber"
),
fireFoamRoom
(
"消防泡沫间"
,
"fireFoamRoom"
),
video
(
"视频设备"
,
"video"
);
riskSource
(
"风险点"
,
"riskSource"
,
"风险点"
,
"riskSource"
),
patrol
(
"巡检点"
,
"patrol"
,
"巡检点"
,
"patrol"
),
impEquipment
(
"重点设备"
,
"impEquipment"
,
"重点设备"
,
"impEquipment"
),
monitorEquipment
(
"探测器"
,
"monitorEquipment"
,
"探测器"
,
"monitorEquipment"
),
hydrant
(
"消火栓"
,
"hydrant"
,
"消防设备"
,
"fireEquipment"
),
pool
(
"消防水池"
,
"pool"
,
"消防设备"
,
"fireEquipment"
),
fireCar
(
"消防车"
,
"fireCar"
,
"消防设备"
,
"fireEquipment"
),
fireEquipment
(
"灭火器材"
,
"fireEquipment"
,
"消防设备"
,
"fireEquipment"
),
fireChamber
(
"消防小室"
,
"fireChamber"
,
"消防设备"
,
"fireEquipment"
),
fireFoamRoom
(
"消防泡沫间"
,
"fireFoamRoom"
,
"消防设备"
,
"fireEquipment"
),
video
(
"视频设备"
,
"video"
,
"摄像头"
,
"video"
);
/**
* 名称,描述
...
...
@@ -28,9 +28,15 @@ public enum ResourceTypeDefEnum {
*/
private
String
code
;
private
ResourceTypeDefEnum
(
String
name
,
String
code
){
private
String
typeName
;
private
String
typeCode
;
private
ResourceTypeDefEnum
(
String
name
,
String
code
,
String
typeName
,
String
typeCode
){
this
.
name
=
name
;
this
.
code
=
code
;
this
.
typeName
=
typeName
;
this
.
typeCode
=
typeCode
;
}
public
static
ResourceTypeDefEnum
getEnum
(
String
code
)
{
...
...
@@ -54,6 +60,19 @@ public enum ResourceTypeDefEnum {
}
return
list
;
}
public
static
List
<
Map
<
String
,
String
>>
getTypeList
()
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
ResourceTypeDefEnum
e
:
ResourceTypeDefEnum
.
values
())
{
Map
<
String
,
String
>
reso
=
new
HashMap
<>();
reso
.
put
(
"name"
,
e
.
getTypeName
());
reso
.
put
(
"code"
,
e
.
getTypeCode
());
if
(!
list
.
contains
(
reso
)){
list
.
add
(
reso
);
}
}
return
list
;
}
public
String
getName
()
{
return
name
;
...
...
@@ -70,5 +89,22 @@ public enum ResourceTypeDefEnum {
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getTypeName
()
{
return
typeName
;
}
public
void
setTypeName
(
String
typeName
)
{
this
.
typeName
=
typeName
;
}
public
String
getTypeCode
()
{
return
typeCode
;
}
public
void
setTypeCode
(
String
typeCode
)
{
this
.
typeCode
=
typeCode
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/BindRegionBo.java
0 → 100644
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
import
javax.validation.constraints.NotNull
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
@ApiModel
(
description
=
"绑定区域参数实体"
)
public
class
BindRegionBo
extends
BasePointPositionBo
{
/**
* 区域id
*/
@NotNull
@ApiModelProperty
(
"区域id"
)
private
Long
riskSourceId
;
public
Long
getRiskSourceId
()
{
return
riskSourceId
;
}
public
void
setRiskSourceId
(
Long
riskSourceId
)
{
this
.
riskSourceId
=
riskSourceId
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -52,11 +53,30 @@ public class View3dController extends BaseController{
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
id
,
orgCode
));
}
@ApiOperation
(
value
=
"区域
详情查询"
,
notes
=
"区域详情查询
"
)
@ApiOperation
(
value
=
"区域
绑定"
,
notes
=
"区域绑定
"
)
@PostMapping
(
value
=
"region/bind"
)
public
CommonResponse
getRegionBind
()
{
public
CommonResponse
batchSaveRegionUe4
(
@ApiParam
(
name
=
"区域参数列表"
,
required
=
true
)
@RequestBody
List
<
BindRegionBo
>
regionBoList
)
{
try
{
riskSourceService
.
batchSaveRegionUe4
(
regionBoList
);
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
return
CommonResponseUtil
.
success
();
}
@ApiOperation
(
value
=
"点类型查询"
,
notes
=
"点类型查询"
)
@GetMapping
(
value
=
"point/type"
)
public
CommonResponse
getPointType
()
{
return
CommonResponseUtil
.
success
(
view3dService
.
getPointType
());
}
@ApiOperation
(
value
=
"按照分类查询点树"
,
notes
=
"按照分类查询点树"
)
@GetMapping
(
value
=
"point/type/{type}"
)
public
CommonResponse
getPointTreeByType
(
@PathVariable
(
"type"
)
String
type
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/RiskSourceMapper.java
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
public
interface
RiskSourceMapper
extends
BaseMapper
{
/**
...
...
@@ -100,4 +102,6 @@ public interface RiskSourceMapper extends BaseMapper {
List
<
RegionTreeResponse
>
getRegionList
(
String
orgCode
);
HashMap
<
String
,
Object
>
findRegionById
(
@Param
(
"id"
)
Long
id
,
@Param
(
"orgCode"
)
String
orgCode
);
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
0 → 100644
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
public
interface
View3dMapper
extends
BaseMapper
{
List
<
RegionTreeResponse
>
getPointTreeByType
(
@Param
(
"type"
)
String
type
,
@Param
(
"orgCode"
)
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.cache.enumeration.CacheType
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
...
...
@@ -72,42 +110,6 @@ import com.yeejoin.amos.fas.dao.entity.RpnChangeLog;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.cache.enumeration.CacheType
;
import
javax.annotation.PostConstruct
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
@Service
(
"riskSourceService"
)
public
class
RiskSourceServiceImpl
implements
IRiskSourceService
{
...
...
@@ -1779,7 +1781,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
regionDetail
;
}
@Override
public
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
)
{
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.dao.mapper.View3dMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
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
;
/**
* @author DELL
*/
@Service
(
"view3dService"
)
public
class
View3dServiceImpl
implements
IView3dService
{
@Autowired
private
View3dMapper
view3dMapper
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
CommonResponse
setPoint3dPosition
(
List
<
BindPointBo
>
pointBoList
)
{
...
...
@@ -30,4 +40,14 @@ public class View3dServiceImpl implements IView3dService {
public
void
savePointPositionByType
(
String
pointType
,
BindPointBo
pointBo
){
}
@Override
public
List
<
Map
<
String
,
String
>>
getPointType
()
{
return
ResourceTypeDefEnum
.
getTypeList
();
}
@Override
public
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
)
{
return
view3dMapper
.
getPointTreeByType
(
type
,
orgCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.data.domain.Page
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.param.AlarmParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.FmeaBindParam
;
...
...
@@ -12,11 +19,6 @@ import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
org.springframework.data.domain.Page
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
interface
IRiskSourceService
{
...
...
@@ -118,4 +120,6 @@ public interface IRiskSourceService {
HashMap
<
String
,
Object
>
findRegionById
(
Long
id
,
String
orgCode
);
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
f98c6d80
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author DELL
...
...
@@ -11,4 +13,8 @@ import java.util.List;
public
interface
IView3dService
{
CommonResponse
setPoint3dPosition
(
List
<
BindPointBo
>
pointBoList
);
List
<
Map
<
String
,
String
>>
getPointType
();
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
);
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
f98c6d80
...
...
@@ -691,5 +691,23 @@
from f_risk_source
where id=#{id} AND org_code like CONCAT(#{orgCode},'%')
</select>
<update
id=
"batchSaveRegionUe4"
parameterType=
"java.util.List"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
""
close=
""
separator=
";"
>
update f_risk_source
<set
>
<if
test=
"item.ue4Location != null"
>
ue4_location = #{item.ue4Location,jdbcType=VARCHAR},
</if>
<if
test=
"item.ue4Rotation != null"
>
ue4_rotation = #{item.ue4Rotation,jdbcType=VARCHAR},
</if>
<if
test=
"item.ue4Extent != null"
>
ue4_extent = #{item.ue4Extent,jdbcType=VARCHAR},
</if>
</set>
where id = #{item.riskSourceId,jdbcType=BIGINT}
</foreach>
</update>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
0 → 100644
View file @
f98c6d80
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
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.View3dMapper"
>
<select
id=
"getPointTreeByType"
resultType=
"com.yeejoin.amos.fas.core.common.response.RegionTreeResponse"
>
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
from f_risk_source R
where 1=1
<if
test=
"type == 'riskSource'"
>
</if>
<if
test=
"type == 'patrol'"
>
</if>
<if
test=
"type == 'impEquipment'"
>
</if>
<if
test=
"type == 'monitorEquipment'"
>
</if>
<if
test=
"type == 'fireEquipment'"
>
</if>
<if
test=
"type == 'video'"
>
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
</if>
</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