Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
b10b3086
提交
b10b3086
authored
5月 23, 2022
作者:
涂茂林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:围栏报警规则
上级
c2d0aaa0
隐藏空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
402 行增加
和
79 行删除
+402
-79
AllowEntranceStrategy.java
...iring/app/design/strategy/rule/AllowEntranceStrategy.java
+11
-7
MaxPeopleNumberStrategy.java
...ing/app/design/strategy/rule/MaxPeopleNumberStrategy.java
+17
-15
MinPeopleNumberStrategy.java
...ing/app/design/strategy/rule/MinPeopleNumberStrategy.java
+18
-16
NotAllowLeaveStrategy.java
...iring/app/design/strategy/rule/NotAllowLeaveStrategy.java
+16
-10
LocationFenceRule.java
...ava/com/yiring/app/domain/location/LocationFenceRule.java
+1
-0
LocationFenceRuleRepository.java
...ring/app/domain/location/LocationFenceRuleRepository.java
+9
-1
RiskWarn.java
app/src/main/java/com/yiring/app/domain/risk/RiskWarn.java
+65
-0
Threshold.java
app/src/main/java/com/yiring/app/domain/risk/Threshold.java
+44
-0
LocationFenceRuleAddParam.java
...ng/app/param/location/rule/LocationFenceRuleAddParam.java
+5
-1
RuleParam.java
...in/java/com/yiring/app/param/location/rule/RuleParam.java
+29
-0
TimeAndNumberParam.java
...om/yiring/app/param/location/rule/TimeAndNumberParam.java
+4
-5
TimeAndUserParam.java
.../com/yiring/app/param/location/rule/TimeAndUserParam.java
+3
-5
TimeParam.java
...in/java/com/yiring/app/param/location/rule/TimeParam.java
+37
-0
LocationFenceRuleService.java
...g/app/service/location/rule/LocationFenceRuleService.java
+8
-0
LocationFenceRuleServiceImpl.java
...vice/location/rule/impl/LocationFenceRuleServiceImpl.java
+17
-1
TimeUtil.java
app/src/main/java/com/yiring/app/util/TimeUtil.java
+52
-2
LocationFenceVo.java
...ava/com/yiring/app/vo/location/fence/LocationFenceVo.java
+5
-0
LocationFenceRuleVo.java
.../com/yiring/app/vo/location/rule/LocationFenceRuleVo.java
+5
-1
TimeAndNumberVo.java
...java/com/yiring/app/vo/location/rule/TimeAndNumberVo.java
+7
-4
TimeAndUserVo.java
...n/java/com/yiring/app/vo/location/rule/TimeAndUserVo.java
+3
-6
TimeVo.java
...src/main/java/com/yiring/app/vo/location/rule/TimeVo.java
+33
-0
LocationFenceRuleController.java
...ng/app/web/location/rule/LocationFenceRuleController.java
+8
-4
RegEx.java
.../core/src/main/java/com/yiring/common/constant/RegEx.java
+5
-1
没有找到文件。
app/src/main/java/com/yiring/app/design/strategy/rule/AllowEntranceStrategy.java
浏览文件 @
b10b3086
...
...
@@ -9,10 +9,7 @@ import com.yiring.app.domain.location.LocationFence;
import
com.yiring.app.domain.location.LocationFenceAlarm
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.param.location.fence.LocationFenceJobParam
;
import
com.yiring.app.param.location.rule.LocationFenceRuleAddParam
;
import
com.yiring.app.param.location.rule.RelevanceUserParam
;
import
com.yiring.app.param.location.rule.RuleParam
;
import
com.yiring.app.param.location.rule.TimeAndUserParam
;
import
com.yiring.app.param.location.rule.*
;
import
com.yiring.app.util.TimeUtil
;
import
com.yiring.app.vo.location.fence.LocationFenceJobVo
;
import
com.yiring.common.core.Result
;
...
...
@@ -47,6 +44,9 @@ public class AllowEntranceStrategy implements IParamInitStrategy<LocationFenceRu
if
(
CollectionUtils
.
isEmpty
(
timeAndUser
))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一条允许进入人员的规则"
);
}
if
(
timeAndUser
.
size
()
==
1
&&
CollectionUtils
.
isEmpty
(
timeAndUser
.
get
(
0
).
getTime
()))
{
param
.
getRuleParam
().
setTimeAndUserAll
();
}
for
(
TimeAndUserParam
item
:
timeAndUser
)
{
if
(
CollectionUtils
.
isEmpty
(
item
.
getUser
()))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一个允许进入的人员"
);
...
...
@@ -71,9 +71,13 @@ public class AllowEntranceStrategy implements IParamInitStrategy<LocationFenceRu
TimeAndUserParam
timeAndUserParam
=
null
;
//筛选在当前时间生效的配置
for
(
TimeAndUserParam
item
:
timeAndUserParamList
)
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
item
.
getBeginTime
(),
item
.
getEndTime
()))
{
timeAndUserParam
=
item
;
break
;
if
(
TimeUtil
.
judgeWeek
(
LocalDateTime
.
now
(),
item
.
getWeek
()))
{
for
(
TimeParam
time
:
item
.
getTime
())
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
time
.
getBeginTime
(),
time
.
getEndTome
()))
{
timeAndUserParam
=
item
;
break
;
}
}
}
}
//如果不在配置的时间内,则将报警记录中的状态刷新为结束,并且需要添加的报警为空
...
...
app/src/main/java/com/yiring/app/design/strategy/rule/MaxPeopleNumberStrategy.java
浏览文件 @
b10b3086
...
...
@@ -7,10 +7,7 @@ import com.yiring.app.design.strategy.IScanAlarmStrategy;
import
com.yiring.app.domain.alarm.AlarmType
;
import
com.yiring.app.domain.location.*
;
import
com.yiring.app.param.location.fence.LocationFenceJobParam
;
import
com.yiring.app.param.location.rule.LocationFenceRuleAddParam
;
import
com.yiring.app.param.location.rule.RuleParam
;
import
com.yiring.app.param.location.rule.TimeAndNumberParam
;
import
com.yiring.app.param.location.rule.TimeAndUserParam
;
import
com.yiring.app.param.location.rule.*
;
import
com.yiring.app.util.TimeUtil
;
import
com.yiring.app.vo.location.fence.LocationFenceJobVo
;
import
com.yiring.common.core.Result
;
...
...
@@ -50,13 +47,12 @@ public class MaxPeopleNumberStrategy implements IParamInitStrategy<LocationFence
if
(
CollectionUtils
.
isEmpty
(
timeAndNumber
))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一条最多人数的规则"
);
}
if
(
timeAndNumber
.
size
()
==
1
&&
CollectionUtils
.
isEmpty
(
timeAndNumber
.
get
(
0
).
getTime
()))
{
param
.
getRuleParam
().
setTimeAndNumberAll
();
}
for
(
TimeAndNumberParam
item
:
timeAndNumber
)
{
if
(
item
.
getNumber
()
==
null
||
item
.
getNumber
()
<
0
)
{
item
.
setNumber
(
0
);
}
if
(
item
.
getBeginTime
()
==
null
||
item
.
getEndTime
()
==
null
)
{
item
.
setBeginTime
(
null
);
item
.
setEndTime
(
null
);
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"最大人数不能空或小于零"
);
}
}
//将时间和距离都设为-1
...
...
@@ -78,11 +74,19 @@ public class MaxPeopleNumberStrategy implements IParamInitStrategy<LocationFence
LocationFenceJobVo
jobVo
=
new
LocationFenceJobVo
();
List
<
TimeAndNumberParam
>
timeAndNumberParamList
=
rule
.
getTimeAndNumber
();
TimeAndNumberParam
timeAndNumberParam
=
null
;
StringBuilder
begin
=
new
StringBuilder
();
StringBuilder
end
=
new
StringBuilder
();
//筛选在当前时间生效的配置
for
(
TimeAndNumberParam
item
:
timeAndNumberParamList
)
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
item
.
getBeginTime
(),
item
.
getEndTime
()))
{
timeAndNumberParam
=
item
;
break
;
if
(
TimeUtil
.
judgeWeek
(
LocalDateTime
.
now
(),
item
.
getWeek
()))
{
for
(
TimeParam
time
:
item
.
getTime
())
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
time
.
getBeginTime
(),
time
.
getEndTome
()))
{
begin
.
append
(
item
.
getWeek
()).
append
(
" "
).
append
(
time
.
getBeginTime
());
end
.
append
(
item
.
getWeek
()).
append
(
" "
).
append
(
time
.
getEndTome
());
timeAndNumberParam
=
item
;
break
;
}
}
}
}
//如果现在不在配置的时间内,或围栏中的人少于配置的最大人数,则将报警记录中的状态刷新为结束,并且需要添加的报警为空
...
...
@@ -94,14 +98,12 @@ public class MaxPeopleNumberStrategy implements IParamInitStrategy<LocationFence
int
exceed
=
tagSet
.
size
()
-
timeAndNumberParam
.
getNumber
();
List
<
LocationFenceAlarm
>
newAlarms
=
new
ArrayList
<>();
//查询围栏内人员进入时的信息
String
beginTime
=
timeAndNumberParam
.
getBeginTime
();
String
endTime
=
timeAndNumberParam
.
getEndTime
();
List
<
LocationTurnover
>
turnoverList
=
locationTurnoverRepository
.
withinFence
(
fenceId
,
true
);
//筛选出在配置时间段内进入的进出信息
turnoverList
=
turnoverList
.
stream
()
.
filter
(
e
->
TimeUtil
.
judge
Time
(
e
.
getTime
(),
beginTime
,
endTime
))
.
filter
(
e
->
TimeUtil
.
judge
WeekTime
(
e
.
getTime
(),
begin
.
toString
(),
end
.
toString
()
))
.
sorted
(
Comparator
.
comparing
(
LocationTurnover:
:
getTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
//记录触发报警的信息(例如最大人数是3,那么前三个员工进入的不会记录)
...
...
app/src/main/java/com/yiring/app/design/strategy/rule/MinPeopleNumberStrategy.java
浏览文件 @
b10b3086
...
...
@@ -7,10 +7,7 @@ import com.yiring.app.design.strategy.IScanAlarmStrategy;
import
com.yiring.app.domain.alarm.AlarmType
;
import
com.yiring.app.domain.location.*
;
import
com.yiring.app.param.location.fence.LocationFenceJobParam
;
import
com.yiring.app.param.location.rule.LocationFenceRuleAddParam
;
import
com.yiring.app.param.location.rule.RuleParam
;
import
com.yiring.app.param.location.rule.TimeAndNumberParam
;
import
com.yiring.app.param.location.rule.TimeAndUserParam
;
import
com.yiring.app.param.location.rule.*
;
import
com.yiring.app.util.TimeUtil
;
import
com.yiring.app.vo.location.fence.LocationFenceJobVo
;
import
com.yiring.common.core.Result
;
...
...
@@ -48,15 +45,14 @@ public class MinPeopleNumberStrategy implements IParamInitStrategy<LocationFence
RuleParam
ruleParam
=
param
.
getRuleParam
();
List
<
TimeAndNumberParam
>
timeAndNumber
=
ruleParam
.
getTimeAndNumber
();
if
(
CollectionUtils
.
isEmpty
(
timeAndNumber
))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一条最小人数的规则"
);
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一条最少人数的规则"
);
}
if
(
timeAndNumber
.
size
()
==
1
&&
CollectionUtils
.
isEmpty
(
timeAndNumber
.
get
(
0
).
getTime
()))
{
param
.
getRuleParam
().
setTimeAndNumberAll
();
}
for
(
TimeAndNumberParam
item
:
timeAndNumber
)
{
if
(
item
.
getNumber
()
==
null
||
item
.
getNumber
()
<
0
)
{
item
.
setNumber
(
0
);
}
if
(
item
.
getBeginTime
()
==
null
||
item
.
getEndTime
()
==
null
)
{
item
.
setBeginTime
(
null
);
item
.
setEndTime
(
null
);
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"最大人数不能空或小于零"
);
}
}
//将时间和距离都设为-1
...
...
@@ -78,11 +74,19 @@ public class MinPeopleNumberStrategy implements IParamInitStrategy<LocationFence
LocationFenceJobVo
jobVo
=
new
LocationFenceJobVo
();
List
<
TimeAndNumberParam
>
timeAndNumberParamList
=
rule
.
getTimeAndNumber
();
TimeAndNumberParam
timeAndNumberParam
=
null
;
StringBuilder
begin
=
new
StringBuilder
();
StringBuilder
end
=
new
StringBuilder
();
//筛选在当前时间生效的配置
for
(
TimeAndNumberParam
item
:
timeAndNumberParamList
)
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
item
.
getBeginTime
(),
item
.
getEndTime
()))
{
timeAndNumberParam
=
item
;
break
;
if
(
TimeUtil
.
judgeWeek
(
LocalDateTime
.
now
(),
item
.
getWeek
()))
{
for
(
TimeParam
time
:
item
.
getTime
())
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
time
.
getBeginTime
(),
time
.
getEndTome
()))
{
begin
.
append
(
item
.
getWeek
()).
append
(
" "
).
append
(
time
.
getBeginTime
());
end
.
append
(
item
.
getWeek
()).
append
(
" "
).
append
(
time
.
getEndTome
());
timeAndNumberParam
=
item
;
break
;
}
}
}
}
//如果现在不在配置的时间内,或围栏中的人大于配置的最小人数,则将报警记录中的状态刷新为结束,并且需要添加的报警为空
...
...
@@ -94,14 +98,12 @@ public class MinPeopleNumberStrategy implements IParamInitStrategy<LocationFence
int
missing
=
timeAndNumberParam
.
getNumber
()
-
tagSet
.
size
();
List
<
LocationFenceAlarm
>
newAlarms
=
new
ArrayList
<>();
//查询员工’出‘这个围栏的进出信息
String
beginTime
=
timeAndNumberParam
.
getBeginTime
();
String
endTime
=
timeAndNumberParam
.
getEndTime
();
List
<
LocationTurnover
>
turnoverList
=
locationTurnoverRepository
.
withinFence
(
fenceId
,
false
);
//筛选出在配置时间段内’出‘这个围栏的进出信息
turnoverList
=
turnoverList
.
stream
()
.
filter
(
e
->
TimeUtil
.
judge
Time
(
e
.
getTime
(),
beginTime
,
endTime
))
.
filter
(
e
->
TimeUtil
.
judge
WeekTime
(
e
.
getTime
(),
begin
.
toString
(),
end
.
toString
()
))
.
sorted
(
Comparator
.
comparing
(
LocationTurnover:
:
getTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
//记录触发报警的信息(例如最小人数是3,这段时间一开始有6个人在围栏,然后出去的4个,那么只有第四个人出去才会记录)
...
...
app/src/main/java/com/yiring/app/design/strategy/rule/NotAllowLeaveStrategy.java
浏览文件 @
b10b3086
...
...
@@ -7,10 +7,7 @@ import com.yiring.app.design.strategy.IScanAlarmStrategy;
import
com.yiring.app.domain.alarm.AlarmType
;
import
com.yiring.app.domain.location.*
;
import
com.yiring.app.param.location.fence.LocationFenceJobParam
;
import
com.yiring.app.param.location.rule.LocationFenceRuleAddParam
;
import
com.yiring.app.param.location.rule.RelevanceUserParam
;
import
com.yiring.app.param.location.rule.RuleParam
;
import
com.yiring.app.param.location.rule.TimeAndUserParam
;
import
com.yiring.app.param.location.rule.*
;
import
com.yiring.app.util.TimeUtil
;
import
com.yiring.app.vo.location.fence.LocationFenceJobVo
;
import
com.yiring.common.core.Result
;
...
...
@@ -50,6 +47,9 @@ public class NotAllowLeaveStrategy implements IParamInitStrategy<LocationFenceRu
if
(
CollectionUtils
.
isEmpty
(
timeAndUser
))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一条不允许离开人员的规则"
);
}
if
(
timeAndUser
.
size
()
==
1
&&
CollectionUtils
.
isEmpty
(
timeAndUser
.
get
(
0
).
getTime
()))
{
param
.
getRuleParam
().
setTimeAndUserAll
();
}
for
(
TimeAndUserParam
item
:
timeAndUser
)
{
if
(
CollectionUtils
.
isEmpty
(
item
.
getUser
()))
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"请至少配置一个不允许离开的人员"
);
...
...
@@ -72,11 +72,19 @@ public class NotAllowLeaveStrategy implements IParamInitStrategy<LocationFenceRu
LocationFenceJobVo
jobVo
=
new
LocationFenceJobVo
();
List
<
TimeAndUserParam
>
timeAndUserParamList
=
rule
.
getTimeAndUser
();
TimeAndUserParam
timeAndUserParam
=
null
;
StringBuilder
begin
=
new
StringBuilder
();
StringBuilder
end
=
new
StringBuilder
();
//筛选在当前时间生效的配置
for
(
TimeAndUserParam
item
:
timeAndUserParamList
)
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
item
.
getBeginTime
(),
item
.
getEndTime
()))
{
timeAndUserParam
=
item
;
break
;
if
(
TimeUtil
.
judgeWeek
(
LocalDateTime
.
now
(),
item
.
getWeek
()))
{
for
(
TimeParam
time
:
item
.
getTime
())
{
if
(
TimeUtil
.
judgeTime
(
LocalDateTime
.
now
(),
time
.
getBeginTime
(),
time
.
getEndTome
()))
{
begin
.
append
(
item
.
getWeek
()).
append
(
" "
).
append
(
time
.
getBeginTime
());
end
.
append
(
item
.
getWeek
()).
append
(
" "
).
append
(
time
.
getEndTome
());
timeAndUserParam
=
item
;
break
;
}
}
}
}
//如果不在配置的时间内,则将报警记录中的状态刷新为结束,并且需要添加的报警为空
...
...
@@ -84,15 +92,13 @@ public class NotAllowLeaveStrategy implements IParamInitStrategy<LocationFenceRu
jobVo
.
setModifyAlarm
(
oldAlarms
);
return
jobVo
;
}
String
beginTime
=
timeAndUserParam
.
getBeginTime
();
String
endTime
=
timeAndUserParam
.
getEndTime
();
//筛选出在配置时间段内出这个围栏的进出信息
List
<
LocationTurnover
>
turnoverList
=
locationTurnoverRepository
.
withinFence
(
fenceId
,
false
);
//筛选出在配置时间段内出这个围栏的进出信息
turnoverList
=
turnoverList
.
stream
()
.
filter
(
e
->
TimeUtil
.
judgeTime
(
e
.
getTime
(),
begin
Time
,
endTime
))
.
filter
(
e
->
TimeUtil
.
judgeTime
(
e
.
getTime
(),
begin
.
toString
(),
end
.
toString
()
))
.
sorted
(
Comparator
.
comparing
(
LocationTurnover:
:
getTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
//筛选出离开围栏的人员是不允许离开的人员
...
...
app/src/main/java/com/yiring/app/domain/location/LocationFenceRule.java
浏览文件 @
b10b3086
...
...
@@ -53,6 +53,7 @@ public class LocationFenceRule extends BasicEntity implements Serializable {
private
Integer
relevanceParamType
;
@Comment
(
"规则,用json存入"
)
@Column
(
columnDefinition
=
"text"
)
private
String
rule
;
@Comment
(
value
=
"是否删除"
)
...
...
app/src/main/java/com/yiring/app/domain/location/LocationFenceRuleRepository.java
浏览文件 @
b10b3086
...
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
domain
.
location
;
import
java.io.Serializable
;
import
java.util.List
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -13,4 +14,11 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public
interface
LocationFenceRuleRepository
extends
JpaRepository
<
LocationFenceRule
,
Serializable
>,
JpaSpecificationExecutor
<
LocationFenceRule
>
{}
extends
JpaRepository
<
LocationFenceRule
,
Serializable
>,
JpaSpecificationExecutor
<
LocationFenceRule
>
{
/**
* 根据围栏id查询规则
* @param fence 围栏id
* @return 规则
*/
List
<
LocationFenceRule
>
findAllByFence
(
LocationFence
fence
);
}
app/src/main/java/com/yiring/app/domain/risk/RiskWarn.java
0 → 100644
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
risk
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.locationtech.jts.geom.Point
;
/**
* @author tml
* @version 1.0
* @date 2022/5/20 17:19
*/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_RISK_WARN"
,
uniqueConstraints
=
@UniqueConstraint
(
columnNames
=
{
"locationNum"
}))
@Comment
(
"风险预警"
)
public
class
RiskWarn
extends
BasicEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1345477064611048638L
;
//todo 工区
@Comment
(
"安装位置"
)
private
String
install
;
@Comment
(
"经纬度"
)
@Column
(
columnDefinition
=
"geometry(Point,4326)"
)
private
Point
point
;
@Comment
(
"监控参数"
)
private
String
monitoring
;
@Comment
(
"位号"
)
private
String
locationNum
;
@Comment
(
"量程起始值"
)
private
Integer
min
;
@Comment
(
"量程结束值"
)
private
Integer
max
;
@Comment
(
"量程单位"
)
private
String
unit
;
@Comment
(
"启用"
)
private
Boolean
enable
;
/*@Builder.Default
@OneToMany(mappedBy = "riskWarn")
@ToString.Exclude
private Set<Threshold> thresholds = new HashSet<>();*/
}
app/src/main/java/com/yiring/app/domain/risk/Threshold.java
0 → 100644
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
risk
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
/**
* @author tml
* @version 1.0
* @date 2022/5/20 17:42
*/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_THRESHOLD"
)
@Comment
(
"风险预警下的阈值设置"
)
public
class
Threshold
extends
BasicEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5075164198170220832L
;
@ManyToOne
@JoinColumn
(
name
=
"risk_warn_id"
)
@Comment
(
"风险预警"
)
private
RiskWarn
riskWarn
;
@Comment
(
"阈值区间起始值"
)
private
Integer
min
;
@Comment
(
"阈值区间结束值"
)
private
Integer
max
;
}
app/src/main/java/com/yiring/app/param/location/rule/LocationFenceRuleAddParam.java
浏览文件 @
b10b3086
...
...
@@ -45,7 +45,11 @@ public class LocationFenceRuleAddParam implements Serializable {
@NotNull
(
message
=
"所属的报警类别id不能为空"
)
private
Long
alarmTypeId
;
@ApiModelProperty
(
value
=
"设置的关联参数类型"
,
example
=
"1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"设置的关联参数类型:1-最多人数,2-最少人数,3-允许进入人员,4-不允许离开人员,5-静止时长,6-滞留时长,7-触发报警距离"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"所属的关联参数类别不能为空"
)
@Range
(
min
=
RelevanceParamEnum
.
MIN
,
max
=
RelevanceParamEnum
.
MAX
,
message
=
"关联参数类别异常"
)
private
Integer
relevanceParamType
;
...
...
app/src/main/java/com/yiring/app/param/location/rule/RuleParam.java
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
rule
;
import
com.yiring.app.util.TimeUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -48,4 +52,29 @@ public class RuleParam implements Serializable {
private
List
<
TimeAndNumberParam
>
timeAndNumber
;
private
List
<
TimeAndUserParam
>
timeAndUser
;
/**
* 设置全时间生效
*/
public
void
setTimeAndNumberAll
()
{
Integer
number
=
timeAndNumber
.
get
(
0
).
getNumber
();
HashSet
<
TimeParam
>
set
=
new
HashSet
<>();
TimeParam
timeParam
=
TimeParam
.
builder
().
beginTime
(
"00:00:00"
).
endTome
(
"23:59:59"
).
build
();
timeAndNumber
=
TimeUtil
.
WEEK
.
stream
()
.
map
(
e
->
TimeAndNumberParam
.
builder
().
week
(
e
).
number
(
number
).
time
(
set
).
build
())
.
collect
(
Collectors
.
toList
());
}
public
void
setTimeAndUserAll
()
{
Set
<
RelevanceUserParam
>
user
=
timeAndUser
.
get
(
0
).
getUser
();
HashSet
<
TimeParam
>
set
=
new
HashSet
<>();
TimeParam
timeParam
=
TimeParam
.
builder
().
beginTime
(
"00:00:00"
).
endTome
(
"23:59:59"
).
build
();
timeAndUser
=
TimeUtil
.
WEEK
.
stream
()
.
map
(
e
->
TimeAndUserParam
.
builder
().
week
(
e
).
user
(
user
).
time
(
set
).
build
())
.
collect
(
Collectors
.
toList
());
}
}
app/src/main/java/com/yiring/app/param/location/rule/TimeAndNumberParam.java
浏览文件 @
b10b3086
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.Set
;
import
javax.validation.constraints.Pattern
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -27,13 +28,11 @@ public class TimeAndNumberParam implements Serializable {
@Serial
private
static
final
long
serialVersionUID
=
-
6796977663003158881L
;
@ApiModelProperty
(
value
=
"
起始时间"
,
example
=
"星期一 08:00:00
"
)
@ApiModelProperty
(
value
=
"
星期"
,
example
=
"星期一
"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
beginTime
;
private
String
week
;
@ApiModelProperty
(
value
=
"终止时间"
,
example
=
"星期一 18:00:00"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
endTime
;
private
Set
<
TimeParam
>
time
;
@ApiModelProperty
(
value
=
"人数"
,
example
=
"100"
)
private
Integer
number
;
...
...
app/src/main/java/com/yiring/app/param/location/rule/TimeAndUserParam.java
浏览文件 @
b10b3086
...
...
@@ -28,13 +28,11 @@ public class TimeAndUserParam implements Serializable {
@Serial
private
static
final
long
serialVersionUID
=
-
7037620599825901175L
;
@ApiModelProperty
(
value
=
"
起始时间"
,
example
=
"星期一 08:00:00
"
)
@ApiModelProperty
(
value
=
"
星期"
,
example
=
"星期一
"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
beginTime
;
private
String
week
;
@ApiModelProperty
(
value
=
"终止时间"
,
example
=
"星期一 18:00:00"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
endTime
;
private
Set
<
TimeParam
>
time
;
private
Set
<
RelevanceUserParam
>
user
;
}
app/src/main/java/com/yiring/app/param/location/rule/TimeParam.java
0 → 100644
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
rule
;
import
com.yiring.common.constant.RegEx
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.Pattern
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author tml
* @version 1.0
* @date 2022/5/23 10:08
*/
@ApiModel
(
"TimeParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
TimeParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
3657642913058744140L
;
@ApiModelProperty
(
value
=
"起始时间"
,
example
=
"08:00:00"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
beginTime
;
@ApiModelProperty
(
value
=
"终止时间"
,
example
=
"18:00:00"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
endTome
;
}
app/src/main/java/com/yiring/app/service/location/rule/LocationFenceRuleService.java
浏览文件 @
b10b3086
...
...
@@ -6,6 +6,7 @@ import com.yiring.app.param.location.rule.LocationFenceRuleModifyParam;
import
com.yiring.app.vo.location.rule.LocationFenceRuleVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.vo.PageVo
;
/**
* @author tml
...
...
@@ -40,4 +41,11 @@ public interface LocationFenceRuleService {
* @return 规则信息
*/
Result
<
LocationFenceRuleVo
>
findRule
(
IdParam
idParam
);
/**
* 根据围栏id查询报警信息
* @param idParam 围栏id
* @return 规则信息
*/
Result
<
PageVo
<
LocationFenceRuleVo
>>
findByFenceId
(
IdParam
idParam
);
}
app/src/main/java/com/yiring/app/service/location/rule/impl/LocationFenceRuleServiceImpl.java
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
.
rule
.
impl
;
import
com.yiring.app.domain.location.LocationFence
;
import
com.yiring.app.domain.location.LocationFenceRule
;
import
com.yiring.app.domain.location.LocationFenceRuleRepository
;
import
com.yiring.app.param.location.rule.LocationFenceRuleAddParam
;
...
...
@@ -11,7 +12,10 @@ import com.yiring.app.vo.location.rule.LocationFenceRuleVo;
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.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -62,9 +66,21 @@ public class LocationFenceRuleServiceImpl implements LocationFenceRuleService {
public
Result
<
LocationFenceRuleVo
>
findRule
(
IdParam
idParam
)
{
Optional
<
LocationFenceRule
>
optional
=
locationFenceRuleRepository
.
findById
(
idParam
.
getId
());
if
(
optional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"要
删除
的规则不存在"
);
return
Result
.
no
(
Status
.
EXPECTATION_FAILED
,
"要
查询
的规则不存在"
);
}
LocationFenceRuleVo
ruleVo
=
LocationFenceRuleVo
.
transform
(
optional
.
get
());
return
Result
.
ok
(
ruleVo
);
}
@Override
public
Result
<
PageVo
<
LocationFenceRuleVo
>>
findByFenceId
(
IdParam
idParam
)
{
LocationFence
fence
=
LocationFence
.
builder
().
id
(
idParam
.
getId
()).
build
();
List
<
LocationFenceRule
>
ruleList
=
locationFenceRuleRepository
.
findAllByFence
(
fence
);
List
<
LocationFenceRuleVo
>
voList
=
ruleList
.
stream
()
.
map
(
LocationFenceRuleVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
LocationFenceRuleVo
>
pageVo
=
PageVo
.
build
(
voList
,
voList
.
size
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/util/TimeUtil.java
浏览文件 @
b10b3086
...
...
@@ -4,6 +4,8 @@ package com.yiring.app.util;
import
com.yiring.common.constant.RegEx
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author tml
...
...
@@ -12,6 +14,18 @@ import java.time.format.DateTimeFormatter;
*/
public
class
TimeUtil
{
public
static
final
List
<
String
>
WEEK
=
new
ArrayList
<>();
static
{
WEEK
.
add
(
"星期一"
);
WEEK
.
add
(
"星期二"
);
WEEK
.
add
(
"星期三"
);
WEEK
.
add
(
"星期四"
);
WEEK
.
add
(
"星期五"
);
WEEK
.
add
(
"星期六"
);
WEEK
.
add
(
"星期日"
);
}
/**
* 判断一个时间是否在配置的时间内
* @param time 判断的时间
...
...
@@ -19,8 +33,8 @@ public class TimeUtil {
* @param endTime 配置的结束时间
* @return true:在 false:不在
*/
public
static
boolean
judgeTime
(
LocalDateTime
time
,
String
beginTime
,
String
endTime
)
{
if
(!
beginTime
.
matches
(
RegEx
.
TIME_RULE
)
||
!
endTime
.
matches
(
RegEx
.
TIME_RULE
))
{
public
static
boolean
judge
Week
Time
(
LocalDateTime
time
,
String
beginTime
,
String
endTime
)
{
if
(!
beginTime
.
matches
(
RegEx
.
WEEK_TIME_RULE
)
||
!
endTime
.
matches
(
RegEx
.
WEEK_
TIME_RULE
))
{
throw
new
IllegalArgumentException
(
"时间格式不正确"
);
}
DateTimeFormatter
pattern
=
DateTimeFormatter
.
ofPattern
(
"E HH:mm:ss"
);
...
...
@@ -50,6 +64,42 @@ public class TimeUtil {
return
now
>=
begin
&&
now
<=
end
;
}
public
static
boolean
judgeWeek
(
LocalDateTime
time
,
String
week
)
{
if
(
week
.
matches
(
RegEx
.
WEEK_RULE
))
{
throw
new
IllegalArgumentException
(
"星期格式不正确"
);
}
DateTimeFormatter
pattern
=
DateTimeFormatter
.
ofPattern
(
"E"
);
String
timeFormat
=
time
.
format
(
pattern
);
char
a
=
timeFormat
.
charAt
(
1
);
char
b
=
week
.
charAt
(
2
);
return
a
==
b
;
}
public
static
boolean
judgeTime
(
LocalDateTime
time
,
String
beginTime
,
String
endTime
)
{
DateTimeFormatter
pattern
=
DateTimeFormatter
.
ofPattern
(
"HH:mm:ss"
);
String
source
=
time
.
format
(
pattern
);
String
beginHour
=
beginTime
.
substring
(
0
,
2
);
String
endHour
=
endTime
.
substring
(
0
,
2
);
String
nowHour
=
source
.
substring
(
0
,
2
);
String
beginMinute
=
beginTime
.
substring
(
3
,
5
);
String
endMinute
=
endTime
.
substring
(
3
,
5
);
String
nowMinute
=
source
.
substring
(
3
,
5
);
String
beginSecond
=
beginTime
.
substring
(
6
);
String
endSecond
=
endTime
.
substring
(
6
);
String
nowSecond
=
source
.
substring
(
6
);
String
beginString
=
beginHour
+
beginMinute
+
beginSecond
;
String
endString
=
endHour
+
endMinute
+
endSecond
;
String
nowString
=
nowHour
+
nowMinute
+
nowSecond
;
int
begin
=
Integer
.
parseInt
(
beginString
);
int
end
=
Integer
.
parseInt
(
endString
);
int
now
=
Integer
.
parseInt
(
nowString
);
return
now
>=
begin
&&
now
<=
end
;
}
private
static
int
transform
(
char
source
)
{
return
switch
(
source
)
{
case
'一'
->
1
;
...
...
app/src/main/java/com/yiring/app/vo/location/fence/LocationFenceVo.java
浏览文件 @
b10b3086
...
...
@@ -45,6 +45,10 @@ public class LocationFenceVo implements Serializable {
@ApiModelProperty
(
value
=
"地图名称"
)
private
String
mapName
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"摄像头id"
)
private
Long
videoId
;
@ApiModelProperty
(
value
=
"摄像头名称"
)
private
String
videoName
;
...
...
@@ -77,6 +81,7 @@ public class LocationFenceVo implements Serializable {
.
id
(
locationFence
.
getId
())
.
name
(
locationFence
.
getName
())
.
mapName
(
locationFence
.
getMapName
())
.
videoId
(
locationFence
.
getVideo
().
getId
())
.
videoName
(
locationFence
.
getVideo
().
getVideoName
())
.
fenceType
(
locationFence
.
getFenceType
())
.
fenceTypeName
(
FenceTypeEnum
.
getByCode
(
locationFence
.
getFenceType
()))
...
...
app/src/main/java/com/yiring/app/vo/location/rule/LocationFenceRuleVo.java
浏览文件 @
b10b3086
...
...
@@ -52,8 +52,11 @@ public class LocationFenceRuleVo implements Serializable {
@ApiModelProperty
(
value
=
"所属的报警类别id"
,
example
=
"1"
,
required
=
true
)
private
Long
alarmTypeId
;
@ApiModelProperty
(
value
=
"所属的报警类别名称"
,
example
=
"超员报警"
,
required
=
true
)
private
String
alarmTypeName
;
@ApiModelProperty
(
value
=
"设置的关联参数类型
(1:最大人数,2:最小人数,3:允许进入人员,4:不允许离开人员,5:静止时长(分钟),6:滞留时长(分钟),7:触发报警距离)
"
,
value
=
"设置的关联参数类型
:1-最多人数,2-最少人数,3-允许进入人员,4-不允许离开人员,5-静止时长,6-滞留时长,7-触发报警距离
"
,
example
=
"1"
,
required
=
true
)
...
...
@@ -75,6 +78,7 @@ public class LocationFenceRuleVo implements Serializable {
.
fenceType
(
locationFenceRule
.
getFence
().
getFenceType
())
.
fenceTypeName
(
FenceTypeEnum
.
getByCode
(
locationFenceRule
.
getFence
().
getFenceType
()))
.
alarmTypeId
(
locationFenceRule
.
getAlarmType
().
getId
())
.
alarmTypeName
(
locationFenceRule
.
getAlarmType
().
getName
())
.
relevanceParamType
(
locationFenceRule
.
getRelevanceParamType
())
.
relevanceParamTypeName
(
RelevanceParamEnum
.
getByCode
(
locationFenceRule
.
getRelevanceParamType
()))
.
ruleVo
(
ruleVo
)
...
...
app/src/main/java/com/yiring/app/vo/location/rule/TimeAndNumberVo.java
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
rule
;
import
com.yiring.common.constant.RegEx
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.Set
;
import
javax.validation.constraints.Pattern
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -25,11 +28,11 @@ public class TimeAndNumberVo implements Serializable {
@Serial
private
static
final
long
serialVersionUID
=
-
6796977663003158881L
;
@ApiModelProperty
(
value
=
"起始时间"
,
example
=
"星期一 08:00:00"
)
private
String
beginTime
;
@ApiModelProperty
(
value
=
"星期"
,
example
=
"星期一"
)
@Pattern
(
regexp
=
RegEx
.
TIME_RULE
,
message
=
"时间格式不正确"
)
private
String
week
;
@ApiModelProperty
(
value
=
"终止时间"
,
example
=
"星期一 18:00:00"
)
private
String
endTime
;
private
Set
<
TimeVo
>
time
;
@ApiModelProperty
(
value
=
"人数"
,
example
=
"100"
)
private
Integer
number
;
...
...
app/src/main/java/com/yiring/app/vo/location/rule/TimeAndUserVo.java
浏览文件 @
b10b3086
...
...
@@ -7,7 +7,6 @@ import java.io.Serial;
import
java.io.Serializable
;
import
java.util.Set
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.SuperBuilder
;
...
...
@@ -20,7 +19,6 @@ import lombok.experimental.SuperBuilder;
@ApiModel
(
"报警类型中的允许进入人员或不允许离开人员"
)
@Data
@SuperBuilder
(
toBuilder
=
true
)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
TimeAndUserVo
implements
Serializable
{
...
...
@@ -28,11 +26,10 @@ public class TimeAndUserVo implements Serializable {
@Serial
private
static
final
long
serialVersionUID
=
-
7037620599825901175L
;
@ApiModelProperty
(
value
=
"
起始时间"
,
example
=
"星期一 08:00:00
"
)
private
String
beginTime
;
@ApiModelProperty
(
value
=
"
星期"
,
example
=
"星期一
"
)
private
String
week
;
@ApiModelProperty
(
value
=
"终止时间"
,
example
=
"星期一 18:00:00"
)
private
String
endTime
;
private
Set
<
TimeVo
>
time
;
private
Set
<
RelevanceUserVo
>
user
;
}
app/src/main/java/com/yiring/app/vo/location/rule/TimeVo.java
0 → 100644
浏览文件 @
b10b3086
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
rule
;
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
;
/**
* @author tml
* @version 1.0
* @date 2022/5/23 11:53
*/
@ApiModel
(
"TimeVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
TimeVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
3275638425715878794L
;
@ApiModelProperty
(
value
=
"起始时间"
,
example
=
"08:00:00"
)
private
String
beginTime
;
@ApiModelProperty
(
value
=
"终止时间"
,
example
=
"18:00:00"
)
private
String
endTome
;
}
app/src/main/java/com/yiring/app/web/location/rule/LocationFenceRuleController.java
浏览文件 @
b10b3086
...
...
@@ -9,15 +9,13 @@ import com.yiring.app.vo.location.rule.LocationFenceRuleVo;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author tml
...
...
@@ -66,4 +64,10 @@ public class LocationFenceRuleController {
public
Result
<
LocationFenceRuleVo
>
findRule
(
@Valid
IdParam
idParam
)
{
return
locationFenceRuleService
.
findRule
(
idParam
);
}
@ApiOperation
(
"根据围栏id查询报警规则"
)
@GetMapping
(
"/findByFenceId"
)
public
Result
<
PageVo
<
LocationFenceRuleVo
>>
findByFenceId
(
@Valid
IdParam
idParam
)
{
return
locationFenceRuleService
.
findByFenceId
(
idParam
);
}
}
basic-common/core/src/main/java/com/yiring/common/constant/RegEx.java
浏览文件 @
b10b3086
...
...
@@ -26,7 +26,11 @@ public class RegEx {
/**
* 报警规则的时间格式
*/
public
static
final
String
TIME_RULE
=
"^星期[一二三四五六日]\\ (2[0-4]|[0-1]\\d)(\\:[0-5]\\d){2}$"
;
public
static
final
String
WEEK_TIME_RULE
=
"^星期[一二三四五六日]\\ (2[0-4]|[0-1]\\d)(\\:[0-5]\\d){2}$"
;
public
static
final
String
TIME_RULE
=
"^(2[0-4]|[0-1]\\d)(\\:[0-5]\\d){2}$"
;
public
static
final
String
WEEK_RULE
=
"^星期[一二三四五六日]$"
;
public
static
final
String
COLOUR_RGB
=
"^#(\\d|[A-F a-f]){6}$"
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论