Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
72d1f1ff
提交
72d1f1ff
authored
5月 26, 2022
作者:
涂茂林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:风险预警管理导入
上级
427753dc
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
227 行增加
和
25 行删除
+227
-25
TemplateList.java
.../main/java/com/yiring/app/constant/risk/TemplateList.java
+4
-1
AllowEntranceStrategy.java
...iring/app/design/strategy/rule/AllowEntranceStrategy.java
+36
-3
NotAllowLeaveStrategy.java
...iring/app/design/strategy/rule/NotAllowLeaveStrategy.java
+35
-4
RiskWarn.java
app/src/main/java/com/yiring/app/domain/risk/RiskWarn.java
+3
-2
Threshold.java
app/src/main/java/com/yiring/app/domain/risk/Threshold.java
+2
-2
RiskWarnExcel.java
...rc/main/java/com/yiring/app/excel/risk/RiskWarnExcel.java
+25
-6
LocationFenceService.java
...ring/app/service/location/fence/LocationFenceService.java
+8
-0
LocationFenceServiceImpl.java
...service/location/fence/impl/LocationFenceServiceImpl.java
+24
-6
LocationFenceRuleServiceImpl.java
...vice/location/rule/impl/LocationFenceRuleServiceImpl.java
+6
-0
RiskWarnServiceImpl.java
...com/yiring/app/service/risk/impl/RiskWarnServiceImpl.java
+0
-0
DistrictVo.java
app/src/main/java/com/yiring/app/vo/district/DistrictVo.java
+5
-0
LocationFenceGeoVo.java
.../com/yiring/app/vo/location/fence/LocationFenceGeoVo.java
+66
-0
RiskWarnDetailVo.java
...rc/main/java/com/yiring/app/vo/risk/RiskWarnDetailVo.java
+5
-0
LocationFenceController.java
...iring/app/web/location/fence/LocationFenceController.java
+8
-1
没有找到文件。
app/src/main/java/com/yiring/app/constant/risk/TemplateList.java
浏览文件 @
72d1f1ff
...
...
@@ -19,6 +19,7 @@ public class TemplateList {
RiskWarnExcel
.
builder
()
.
workAreaName
(
"BTC产品库房"
)
.
point
(
"112.863173604639,30.4786075211555,0"
)
.
install
(
"产品库房北侧中间立柱东1"
)
.
monitoring
(
"有毒气体报警器"
)
.
locationNum
(
"AT-4736"
)
...
...
@@ -36,6 +37,7 @@ public class TemplateList {
RiskWarnExcel
.
builder
()
.
workAreaName
(
"计量槽"
)
.
point
(
"112.863173604639,30.4786075211555,0"
)
.
install
(
"1号槽液位"
)
.
monitoring
(
"液位"
)
.
locationNum
(
"PI-2107A"
)
...
...
@@ -53,6 +55,7 @@ public class TemplateList {
RiskWarnExcel
.
builder
()
.
workAreaName
(
"合成盐酸"
)
.
point
(
"112.863173604639,30.4786075211555,0"
)
.
install
(
"1号炉一楼"
)
.
monitoring
(
"火焰检测"
)
.
locationNum
(
"BSA-1401A"
)
...
...
@@ -63,7 +66,7 @@ public class TemplateList {
.
high
(
""
)
.
highHigh
(
""
)
.
flame
(
"1"
)
.
remark
(
"注意:火焰检测在报警值(熄灭)这里添加预警值"
)
.
remark
(
"注意:火焰检测在报警值(熄灭)这里添加预警值
,等于这个数值时显示熄灭
"
)
.
build
()
);
}
...
...
app/src/main/java/com/yiring/app/design/strategy/rule/AllowEntranceStrategy.java
浏览文件 @
72d1f1ff
...
...
@@ -12,13 +12,16 @@ import com.yiring.app.param.location.fence.LocationFenceJobParam;
import
com.yiring.app.param.location.rule.*
;
import
com.yiring.app.util.TimeUtil
;
import
com.yiring.app.vo.location.fence.LocationFenceJobVo
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -31,6 +34,9 @@ import org.springframework.util.CollectionUtils;
@Component
public
class
AllowEntranceStrategy
implements
IParamInitStrategy
<
LocationFenceRuleAddParam
>,
IScanAlarmStrategy
{
@Resource
private
UserRepository
userRepository
;
public
AllowEntranceStrategy
()
{
Integer
relevanceParam
=
RelevanceParamEnum
.
ALLOW_ENTRANCE
.
getCode
();
LocationFenceRuleContext
.
register
(
relevanceParam
,
this
);
...
...
@@ -62,6 +68,33 @@ public class AllowEntranceStrategy implements IParamInitStrategy<LocationFenceRu
}
}
}
//检查配置的员工是否存在
Specification
<
User
>
specification
=
(
root
,
query
,
criteriaBuilder
)
->
{
CriteriaBuilder
.
In
<
Object
>
in
=
criteriaBuilder
.
in
(
root
.
get
(
User
.
Fields
.
uuid
));
HashSet
<
String
>
ids
=
new
HashSet
<>();
for
(
TimeAndUserParam
item
:
timeAndUser
)
{
for
(
RelevanceUserParam
userParam
:
item
.
getUser
())
{
ids
.
add
(
userParam
.
getUuid
());
}
}
for
(
String
uuid
:
ids
)
{
in
.
value
(
uuid
);
}
return
criteriaBuilder
.
and
(
in
);
};
Map
<
String
,
List
<
User
>>
map
=
userRepository
.
findAll
(
specification
)
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
User:
:
getUuid
));
for
(
TimeAndUserParam
item
:
timeAndUser
)
{
for
(
RelevanceUserParam
userParam
:
item
.
getUser
())
{
List
<
User
>
list
=
map
.
get
(
userParam
.
getUuid
());
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"工号为:"
+
userParam
.
getUuid
()
+
"员工不存在"
);
}
userParam
.
setRealName
(
list
.
get
(
0
).
getRealName
());
}
}
ruleParam
.
setDuration
(
null
);
ruleParam
.
setDistance
(
null
);
ruleParam
.
setTimeAndNumber
(
new
ArrayList
<>());
...
...
app/src/main/java/com/yiring/app/design/strategy/rule/NotAllowLeaveStrategy.java
浏览文件 @
72d1f1ff
...
...
@@ -10,15 +10,16 @@ import com.yiring.app.param.location.fence.LocationFenceJobParam;
import
com.yiring.app.param.location.rule.*
;
import
com.yiring.app.util.TimeUtil
;
import
com.yiring.app.vo.location.fence.LocationFenceJobVo
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -34,6 +35,9 @@ public class NotAllowLeaveStrategy implements IParamInitStrategy<LocationFenceRu
@Resource
private
LocationTurnoverRepository
locationTurnoverRepository
;
@Resource
private
UserRepository
userRepository
;
public
NotAllowLeaveStrategy
()
{
Integer
relevanceParam
=
RelevanceParamEnum
.
NOT_ALLOW_LEAVE
.
getCode
();
LocationFenceRuleContext
.
register
(
relevanceParam
,
this
);
...
...
@@ -65,6 +69,33 @@ public class NotAllowLeaveStrategy implements IParamInitStrategy<LocationFenceRu
}
}
}
//检查配置的员工是否存在
Specification
<
User
>
specification
=
(
root
,
query
,
criteriaBuilder
)
->
{
CriteriaBuilder
.
In
<
Object
>
in
=
criteriaBuilder
.
in
(
root
.
get
(
User
.
Fields
.
uuid
));
HashSet
<
String
>
ids
=
new
HashSet
<>();
for
(
TimeAndUserParam
item
:
timeAndUser
)
{
for
(
RelevanceUserParam
userParam
:
item
.
getUser
())
{
ids
.
add
(
userParam
.
getUuid
());
}
}
for
(
String
uuid
:
ids
)
{
in
.
value
(
uuid
);
}
return
criteriaBuilder
.
and
(
in
);
};
Map
<
String
,
List
<
User
>>
map
=
userRepository
.
findAll
(
specification
)
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
User:
:
getUuid
));
for
(
TimeAndUserParam
item
:
timeAndUser
)
{
for
(
RelevanceUserParam
userParam
:
item
.
getUser
())
{
List
<
User
>
list
=
map
.
get
(
userParam
.
getUuid
());
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"工号为:"
+
userParam
.
getUuid
()
+
"员工不存在"
);
}
userParam
.
setRealName
(
list
.
get
(
0
).
getRealName
());
}
}
ruleParam
.
setDuration
(
null
);
ruleParam
.
setDistance
(
null
);
ruleParam
.
setTimeAndNumber
(
new
ArrayList
<>());
...
...
app/src/main/java/com/yiring/app/domain/risk/RiskWarn.java
浏览文件 @
72d1f1ff
...
...
@@ -44,7 +44,7 @@ public class RiskWarn extends BasicEntity implements Serializable {
private
String
install
;
@Comment
(
"经纬度"
)
@Column
(
columnDefinition
=
"geometry(Point,4326)"
)
@Column
(
columnDefinition
=
"geometry(Point
Z
,4326)"
)
private
Point
point
;
@Comment
(
"监控参数"
)
...
...
@@ -68,6 +68,7 @@ public class RiskWarn extends BasicEntity implements Serializable {
@ToString
.
Exclude
@Comment
(
"阈值区间信息"
)
@Builder
.
Default
@OneToMany
(
mappedBy
=
"riskWarn"
)
@OneToMany
(
cascade
=
{
CascadeType
.
PERSIST
,
CascadeType
.
REFRESH
})
@JoinColumn
(
name
=
"risk_warn_id"
)
private
List
<
Threshold
>
thresholds
=
new
ArrayList
<>();
}
app/src/main/java/com/yiring/app/domain/risk/Threshold.java
浏览文件 @
72d1f1ff
...
...
@@ -30,10 +30,10 @@ public class Threshold extends BasicEntity implements Serializable {
@Serial
private
static
final
long
serialVersionUID
=
3115736944401082777L
;
@ManyToOne
/*
@ManyToOne
@JoinColumn(name = "risk_warn_id")
@Comment("对应的风险预警信息")
private
RiskWarn
riskWarn
;
private RiskWarn riskWarn;
*/
@Comment
(
"阈值区间起始值"
)
private
String
min
;
...
...
app/src/main/java/com/yiring/app/excel/risk/RiskWarnExcel.java
浏览文件 @
72d1f1ff
...
...
@@ -15,6 +15,7 @@ import lombok.AllArgsConstructor;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.util.CollectionUtils
;
/**
* @author tml
...
...
@@ -37,6 +38,9 @@ public class RiskWarnExcel implements Serializable {
@ExcelColumn
(
title
=
"安装位置"
,
width
=
15
)
private
String
install
;
@ExcelColumn
(
title
=
"经纬度"
,
width
=
30
)
private
String
point
;
@ExcelColumn
(
title
=
"监控参数"
,
width
=
15
)
private
String
monitoring
;
...
...
@@ -68,19 +72,34 @@ public class RiskWarnExcel implements Serializable {
private
String
remark
;
public
static
RiskWarnExcel
transform
(
RiskWarn
riskWarn
)
{
String
range
=
riskWarn
.
getMin
()
+
" - "
+
riskWarn
.
getMax
();
String
range
=
""
;
if
(
riskWarn
.
getMin
()
!=
null
&&
riskWarn
.
getMax
()
!=
null
)
{
range
=
riskWarn
.
getMin
()
+
"-"
+
riskWarn
.
getMax
();
}
String
point
=
riskWarn
.
getPoint
().
getCoordinate
().
getX
()
+
","
+
riskWarn
.
getPoint
().
getCoordinate
().
getY
()
+
","
+
riskWarn
.
getPoint
().
getCoordinate
().
getZ
();
Map
<
Integer
,
List
<
Threshold
>>
map
=
riskWarn
.
getThresholds
()
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
Threshold:
:
getStatus
));
String
lowLow
=
map
.
get
(
ThresholdStatusEnum
.
LOW_LOW
.
getCode
()).
get
(
0
).
getMin
();
String
low
=
map
.
get
(
ThresholdStatusEnum
.
LOW
.
getCode
()).
get
(
0
).
getMin
();
String
high
=
map
.
get
(
ThresholdStatusEnum
.
HIGH
.
getCode
()).
get
(
0
).
getMin
();
String
highHigh
=
map
.
get
(
ThresholdStatusEnum
.
HIGH_HIGH
.
getCode
()).
get
(
0
).
getMin
();
String
flame
=
map
.
get
(
ThresholdStatusEnum
.
FLAME_EXTINGUISH
.
getCode
()).
get
(
0
).
getMin
();
List
<
Threshold
>
lowLowList
=
map
.
get
(
ThresholdStatusEnum
.
LOW_LOW
.
getCode
());
List
<
Threshold
>
lowList
=
map
.
get
(
ThresholdStatusEnum
.
LOW
.
getCode
());
List
<
Threshold
>
highList
=
map
.
get
(
ThresholdStatusEnum
.
HIGH
.
getCode
());
List
<
Threshold
>
highHighList
=
map
.
get
(
ThresholdStatusEnum
.
HIGH_HIGH
.
getCode
());
List
<
Threshold
>
flameList
=
map
.
get
(
ThresholdStatusEnum
.
FLAME_EXTINGUISH
.
getCode
());
String
lowLow
=
CollectionUtils
.
isEmpty
(
lowLowList
)
?
""
:
lowLowList
.
get
(
0
).
getMin
();
String
low
=
CollectionUtils
.
isEmpty
(
lowList
)
?
""
:
lowList
.
get
(
0
).
getMin
();
String
high
=
CollectionUtils
.
isEmpty
(
highList
)
?
""
:
highList
.
get
(
0
).
getMin
();
String
highHigh
=
CollectionUtils
.
isEmpty
(
highHighList
)
?
""
:
highHighList
.
get
(
0
).
getMin
();
String
flame
=
CollectionUtils
.
isEmpty
(
flameList
)
?
""
:
flameList
.
get
(
0
).
getMin
();
return
RiskWarnExcel
.
builder
()
.
workAreaName
(
riskWarn
.
getWorkArea
().
getWorkAreaName
())
.
point
(
point
)
.
install
(
riskWarn
.
getInstall
())
.
monitoring
(
riskWarn
.
getMonitoring
())
.
locationNum
(
riskWarn
.
getLocationNum
())
...
...
app/src/main/java/com/yiring/app/service/location/fence/LocationFenceService.java
浏览文件 @
72d1f1ff
...
...
@@ -7,6 +7,7 @@ import com.yiring.app.param.location.fence.LocationFenceConditionParam;
import
com.yiring.app.param.location.fence.LocationFenceModifyParam
;
import
com.yiring.app.vo.CodeNameVo
;
import
com.yiring.app.vo.location.fence.FenceRealtimeVo
;
import
com.yiring.app.vo.location.fence.LocationFenceGeoVo
;
import
com.yiring.app.vo.location.fence.LocationFenceSearchVo
;
import
com.yiring.app.vo.location.fence.LocationFenceVo
;
import
com.yiring.auth.param.IdsParam
;
...
...
@@ -52,6 +53,13 @@ public interface LocationFenceService {
Result
<
PageVo
<
LocationFenceVo
>>
findList
(
LocationFenceConditionParam
conditionParam
,
PageParam
pageParam
);
/**
* 查询围栏的位置信息列表
* @param conditionParam 条件
* @return 是否成功
*/
Result
<
PageVo
<
LocationFenceGeoVo
>>
findGeoList
(
LocationFenceConditionParam
conditionParam
);
/**
* 根据id查询围栏信息
* @param param id
* @return 详细信息
...
...
app/src/main/java/com/yiring/app/service/location/fence/impl/LocationFenceServiceImpl.java
浏览文件 @
72d1f1ff
...
...
@@ -13,6 +13,7 @@ import com.yiring.app.service.location.fence.LocationFenceService;
import
com.yiring.app.util.JpaUtil
;
import
com.yiring.app.vo.CodeNameVo
;
import
com.yiring.app.vo.location.fence.FenceRealtimeVo
;
import
com.yiring.app.vo.location.fence.LocationFenceGeoVo
;
import
com.yiring.app.vo.location.fence.LocationFenceSearchVo
;
import
com.yiring.app.vo.location.fence.LocationFenceVo
;
import
com.yiring.app.vo.map.MapVo
;
...
...
@@ -36,6 +37,7 @@ import org.springframework.data.domain.Pageable;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
/**
* 围栏信息service
...
...
@@ -96,13 +98,34 @@ public class LocationFenceServiceImpl implements LocationFenceService {
if
(
optional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"要删除的围栏信息不存在"
);
}
if
(!
CollectionUtils
.
isEmpty
(
optional
.
get
().
getRules
()))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"要删除的围栏已经配置了规则,不能删除"
);
}
optional
.
get
().
setDeleted
(
true
);
return
Result
.
ok
();
}
@Override
public
Result
<
PageVo
<
LocationFenceVo
>>
findList
(
LocationFenceConditionParam
conditionParam
,
PageParam
pageParam
)
{
Specification
<
LocationFence
>
specification
=
(
root
,
query
,
criteriaBuilder
)
->
{
Specification
<
LocationFence
>
specification
=
getSpecification
(
conditionParam
);
Pageable
pageable
=
PageParam
.
toPageable
(
pageParam
);
Page
<
LocationFence
>
fencePage
=
locationFenceRepository
.
findAll
(
specification
,
pageable
);
List
<
LocationFenceVo
>
voList
=
fencePage
.
get
().
map
(
LocationFenceVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
LocationFenceVo
>
pageVo
=
PageVo
.
build
(
voList
,
fencePage
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
@Override
public
Result
<
PageVo
<
LocationFenceGeoVo
>>
findGeoList
(
LocationFenceConditionParam
conditionParam
)
{
Specification
<
LocationFence
>
specification
=
getSpecification
(
conditionParam
);
List
<
LocationFence
>
list
=
locationFenceRepository
.
findAll
(
specification
);
List
<
LocationFenceGeoVo
>
voList
=
list
.
stream
().
map
(
LocationFenceGeoVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
LocationFenceGeoVo
>
pageVo
=
PageVo
.
build
(
voList
,
voList
.
size
());
return
Result
.
ok
(
pageVo
);
}
private
Specification
<
LocationFence
>
getSpecification
(
LocationFenceConditionParam
conditionParam
)
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
ArrayList
<
Predicate
>
list
=
new
ArrayList
<>();
if
(
conditionParam
.
getMapId
()
!=
null
)
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"mapId"
),
conditionParam
.
getMapId
()));
...
...
@@ -113,11 +136,6 @@ public class LocationFenceServiceImpl implements LocationFenceService {
Predicate
[]
array
=
list
.
toArray
(
new
Predicate
[
0
]);
return
criteriaBuilder
.
and
(
array
);
};
Pageable
pageable
=
PageParam
.
toPageable
(
pageParam
);
Page
<
LocationFence
>
fencePage
=
locationFenceRepository
.
findAll
(
specification
,
pageable
);
List
<
LocationFenceVo
>
voList
=
fencePage
.
get
().
map
(
LocationFenceVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
LocationFenceVo
>
pageVo
=
PageVo
.
build
(
voList
,
fencePage
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
@Override
...
...
app/src/main/java/com/yiring/app/service/location/rule/impl/LocationFenceRuleServiceImpl.java
浏览文件 @
72d1f1ff
...
...
@@ -13,6 +13,7 @@ import com.yiring.common.core.Result;
import
com.yiring.common.core.Status
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
...
...
@@ -79,6 +80,11 @@ public class LocationFenceRuleServiceImpl implements LocationFenceRuleService {
List
<
LocationFenceRuleVo
>
voList
=
ruleList
.
stream
()
.
map
(
LocationFenceRuleVo:
:
transform
)
.
sorted
(
Comparator
.
comparing
(
LocationFenceRuleVo:
:
getRelevanceParamType
)
.
thenComparing
(
LocationFenceRuleVo:
:
getId
)
)
.
collect
(
Collectors
.
toList
());
PageVo
<
LocationFenceRuleVo
>
pageVo
=
PageVo
.
build
(
voList
,
voList
.
size
());
return
Result
.
ok
(
pageVo
);
...
...
app/src/main/java/com/yiring/app/service/risk/impl/RiskWarnServiceImpl.java
浏览文件 @
72d1f1ff
差异被折叠。
点击展开。
app/src/main/java/com/yiring/app/vo/district/DistrictVo.java
浏览文件 @
72d1f1ff
...
...
@@ -12,6 +12,7 @@ import lombok.AllArgsConstructor;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.locationtech.jts.geom.Geometry
;
/**
* 区域信息VO
...
...
@@ -39,12 +40,16 @@ public class DistrictVo implements Serializable {
@ApiModelProperty
(
value
=
"风险等级(区域颜色)"
,
example
=
"f##0000"
)
private
String
riskGrade
;
@ApiModelProperty
(
value
=
"区域位置信息"
,
dataType
=
"java.lang.String"
)
private
Geometry
geometry
;
public
static
DistrictVo
transform
(
District
district
)
{
return
DistrictVo
.
builder
()
.
id
(
district
.
getId
())
.
name
(
district
.
getName
())
.
riskGrade
(
district
.
getRiskGrade
())
.
geometry
(
district
.
getGeometry
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/location/fence/LocationFenceGeoVo.java
0 → 100644
浏览文件 @
72d1f1ff
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
fence
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.location.LocationFence
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.locationtech.jts.geom.Geometry
;
/**
* @author tml
* @version 1.0
* @date 2022/5/26 9:08
*/
@ApiModel
(
"电子围栏地图信息"
)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
LocationFenceGeoVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
7736396772271720214L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"type"
)
private
String
type
;
@ApiModelProperty
(
"properties"
)
private
Properties
properties
;
@ApiModelProperty
(
value
=
"位置信息"
)
private
Geometry
geometry
;
public
static
LocationFenceGeoVo
transform
(
LocationFence
locationFence
)
{
return
LocationFenceGeoVo
.
builder
()
.
id
(
locationFence
.
getId
())
.
type
(
"Feature"
)
.
properties
(
new
Properties
(
locationFence
.
getName
(),
locationFence
.
getGeometry
().
getGeometryType
()))
.
geometry
(
locationFence
.
getGeometry
())
.
build
();
}
@Data
@AllArgsConstructor
@NoArgsConstructor
static
class
Properties
{
@ApiModelProperty
(
value
=
"围栏名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"位置类型"
)
private
String
type
;
}
}
app/src/main/java/com/yiring/app/vo/risk/RiskWarnDetailVo.java
浏览文件 @
72d1f1ff
...
...
@@ -14,6 +14,7 @@ import lombok.AllArgsConstructor;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.locationtech.jts.geom.Point
;
/**
* @author tml
...
...
@@ -37,6 +38,9 @@ public class RiskWarnDetailVo implements Serializable {
@ApiModelProperty
(
value
=
"工区名称"
,
example
=
"组装工区"
)
private
String
workAreaName
;
@ApiModelProperty
(
value
=
"经纬度"
,
dataType
=
"java.lang.String"
)
private
Point
point
;
@ApiModelProperty
(
value
=
"安装位置"
,
example
=
"组装厂区二楼"
)
private
String
install
;
...
...
@@ -68,6 +72,7 @@ public class RiskWarnDetailVo implements Serializable {
.
builder
()
.
id
(
riskWarn
.
getId
())
.
workAreaName
(
riskWarn
.
getWorkArea
().
getWorkAreaName
())
.
point
(
riskWarn
.
getPoint
())
.
install
(
riskWarn
.
getInstall
())
.
monitoring
(
riskWarn
.
getMonitoring
())
.
locationNum
(
riskWarn
.
getLocationNum
())
...
...
app/src/main/java/com/yiring/app/web/location/fence/LocationFenceController.java
浏览文件 @
72d1f1ff
...
...
@@ -10,6 +10,7 @@ import com.yiring.app.param.location.fence.LocationFenceModifyParam;
import
com.yiring.app.service.location.fence.LocationFenceService
;
import
com.yiring.app.vo.CodeNameVo
;
import
com.yiring.app.vo.location.fence.FenceRealtimeVo
;
import
com.yiring.app.vo.location.fence.LocationFenceGeoVo
;
import
com.yiring.app.vo.location.fence.LocationFenceSearchVo
;
import
com.yiring.app.vo.location.fence.LocationFenceVo
;
import
com.yiring.auth.param.IdsParam
;
...
...
@@ -63,7 +64,7 @@ public class LocationFenceController {
}
@ApiOperation
(
"根据条件分页查询围栏信息"
)
@PostMapping
(
"/
LocationFenceVo
"
)
@PostMapping
(
"/
findList
"
)
public
Result
<
PageVo
<
LocationFenceVo
>>
findList
(
@Valid
LocationFenceConditionParam
conditionParam
,
@Valid
PageParam
pageParam
...
...
@@ -75,6 +76,12 @@ public class LocationFenceController {
return
locationFenceService
.
findList
(
conditionParam
,
pageParam
);
}
@ApiOperation
(
"根据条件查询围栏地图位置信息"
)
@GetMapping
(
"/findGeoList"
)
public
Result
<
PageVo
<
LocationFenceGeoVo
>>
findGeoList
(
@Valid
LocationFenceConditionParam
conditionParam
)
{
return
locationFenceService
.
findGeoList
(
conditionParam
);
}
@ApiOperation
(
"根据id查询围栏信息"
)
@PostMapping
(
"/findById"
)
public
Result
<
LocationFenceVo
>
findById
(
@Valid
IdParam
param
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论