Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
refined-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
refined-platform
Commits
fa3d27ac
Commit
fa3d27ac
authored
Apr 16, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加同步预约和注册用户类
parent
d83cebef
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2032 additions
and
1393 deletions
+2032
-1393
db/module.sql
db/module.sql
+5
-0
doc/精细化管理系统.docx
doc/精细化管理系统.docx
+0
-0
refined-manager/src/main/java/com/mortals/xhx/common/code/HikAbilityEnum.java
...main/java/com/mortals/xhx/common/code/HikAbilityEnum.java
+64
-0
refined-manager/src/main/java/com/mortals/xhx/common/code/HikEventTypeEnum.java
...in/java/com/mortals/xhx/common/code/HikEventTypeEnum.java
+12
-11
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java
...ortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java
+2
-3
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java
.../mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserTaskImpl.java
...com/mortals/xhx/daemon/task/SyncRegisterUserTaskImpl.java
+6
-5
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserToHikTaskImpl.java
...va/com/mortals/xhx/daemon/task/SyncUserToHikTaskImpl.java
+3
-1
refined-manager/src/main/java/com/mortals/xhx/module/hik/AbstractHikService.java
...n/java/com/mortals/xhx/module/hik/AbstractHikService.java
+0
-1
refined-manager/src/main/java/com/mortals/xhx/module/hik/event/service/impl/HikEventServiceImpl.java
...hx/module/hik/event/service/impl/HikEventServiceImpl.java
+21
-28
refined-manager/src/main/java/com/mortals/xhx/module/monitor/web/MonitorAlarmController.java
...ortals/xhx/module/monitor/web/MonitorAlarmController.java
+0
-2
refined-manager/src/main/java/com/mortals/xhx/module/realtime/model/RealtimeDataflowEntity.java
...als/xhx/module/realtime/model/RealtimeDataflowEntity.java
+200
-115
refined-manager/src/main/java/com/mortals/xhx/module/realtime/model/RealtimeDataflowQuery.java
...tals/xhx/module/realtime/model/RealtimeDataflowQuery.java
+930
-612
refined-manager/src/main/resources/sqlmap/module/realtime/RealtimeDataflowMapper.xml
...sources/sqlmap/module/realtime/RealtimeDataflowMapper.xml
+787
-613
No files found.
db/module.sql
View file @
fa3d27ac
...
...
@@ -16,12 +16,17 @@ CREATE TABLE mortals_xhx_realtime_dataflow(
`queueNum`
varchar
(
255
)
NOT
NULL
COMMENT
'排队编码'
,
`location`
varchar
(
255
)
NOT
NULL
COMMENT
'办理位置'
,
`picture`
varchar
(
255
)
COMMENT
'识别截图'
,
`picUri`
varchar
(
255
)
COMMENT
'相对图片pic'
,
`serverIndexCode`
varchar
(
255
)
COMMENT
'图片资源唯一标识'
,
`eventId`
varchar
(
255
)
COMMENT
'事件id'
,
`eventType`
bigint
(
20
)
NOT
NULL
COMMENT
'事件类型'
,
`createTime`
datetime
COMMENT
'创建时间'
,
`createUserId`
bigint
(
20
)
COMMENT
'创建人id'
,
`updateTime`
datetime
COMMENT
'更新时间'
,
`updateUserId`
bigint
(
20
)
COMMENT
'更新人id'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'人员发现记录'
;
-- ----------------------------
-- 预约签到记录表
-- ----------------------------
...
...
doc/精细化管理系统.docx
View file @
fa3d27ac
No preview for this file type
refined-manager/src/main/java/com/mortals/xhx/common/code/HikAbilityEnum.java
0 → 100644
View file @
fa3d27ac
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 海康事件类型
*
* @author zxfei
*/
public
enum
HikAbilityEnum
{
人脸识别事件
(
"event_face_recognition"
,
"人脸识别事件"
);
private
String
value
;
private
String
desc
;
HikAbilityEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
HikAbilityEnum
getByValue
(
String
value
)
{
for
(
HikAbilityEnum
recognitionPlanTypeEnum
:
HikAbilityEnum
.
values
())
{
if
(
recognitionPlanTypeEnum
.
getValue
()
==
value
)
{
return
recognitionPlanTypeEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
HikAbilityEnum
item
:
HikAbilityEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
refined-manager/src/main/java/com/mortals/xhx/common/code/HikEventTypeEnum.java
View file @
fa3d27ac
...
...
@@ -4,21 +4,22 @@ import java.util.LinkedHashMap;
import
java.util.Map
;
/**
*
海康事件类型
*
周五是否监测(0.否,1.是)枚举类
*
* @author zxfei
*/
public
enum
HikEventTypeEnum
{
重点人员识别事件
(
"event_face_recognition"
,
"重点人员识别事件"
);
private
String
value
;
重点人员识别事件
(
1644175361
,
"重点人员识别事件"
),
陌生人员识别事件
(
1644171265
,
"陌生人员识别事件"
);
private
Integer
value
;
private
String
desc
;
HikEventTypeEnum
(
String
value
,
String
desc
)
{
HikEventTypeEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
public
Integer
getValue
()
{
return
this
.
value
;
}
...
...
@@ -26,10 +27,10 @@ public enum HikEventTypeEnum {
return
this
.
desc
;
}
public
static
HikEventTypeEnum
getByValue
(
String
value
)
{
for
(
HikEventTypeEnum
recognitionPlanType
Enum
:
HikEventTypeEnum
.
values
())
{
if
(
recognitionPlanType
Enum
.
getValue
()
==
value
)
{
return
recognitionPlanType
Enum
;
public
static
HikEventTypeEnum
getByValue
(
Integer
value
)
{
for
(
HikEventTypeEnum
friday
Enum
:
HikEventTypeEnum
.
values
())
{
if
(
friday
Enum
.
getValue
()
==
value
)
{
return
friday
Enum
;
}
}
return
null
;
...
...
@@ -41,12 +42,12 @@ public enum HikEventTypeEnum {
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
HikEventTypeEnum
item
:
HikEventTypeEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java
View file @
fa3d27ac
...
...
@@ -44,6 +44,7 @@ import java.util.stream.Collectors;
/**
* 同步预约人数。
* 定时每日执行,执行前删除当天已经同步的预约人
*/
@Slf4j
@Service
(
"SyncAppointmentPersonTask"
)
...
...
@@ -93,7 +94,6 @@ public class SyncAppointmentPersonTaskImpl implements ITaskExcuteService {
if
(
restTotal
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
//同步今天预约用户
List
<
AppointmentDataItem
>
appointUserList
=
restTotal
.
getData
().
getData
();
log
.
info
(
"预约用户总数量:{}"
,
appointUserList
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
appointUserList
))
{
//查询今天添加的预约 并删除
...
...
@@ -124,9 +124,8 @@ public class SyncAppointmentPersonTaskImpl implements ITaskExcuteService {
return
appointmentPersonEntity
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
newUserList
))
{
log
.
info
(
"
注册
用户新增,size:{}"
,
newUserList
.
size
());
log
.
info
(
"
预约
用户新增,size:{}"
,
newUserList
.
size
());
appointmentPersonService
.
save
(
newUserList
);
}
}
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java
View file @
fa3d27ac
...
...
@@ -29,7 +29,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
/**
* 同步注册用户
与预约人数
。
* 同步注册用户
的证件照片
。
*/
@Slf4j
@Service
(
"SyncRegisterUserPicTask"
)
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserTaskImpl.java
View file @
fa3d27ac
...
...
@@ -57,7 +57,8 @@ import java.util.Map;
import
java.util.stream.Collectors
;
/**
* 同步注册用户与预约人数。
* 同步注册用户。
* 定时以一定时间间隔进行人员获取 定时时间要早于每日预约人数的同步时间
*/
@Slf4j
@Service
(
"SyncRegisterUserTask"
)
...
...
@@ -181,10 +182,10 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
personService
.
save
(
saveUserList
);
}
if
(!
ObjectUtils
.
isEmpty
(
delUserList
))
{
log
.
info
(
"注册用户删除,size:{}"
,
delUserList
.
size
());
personService
.
remove
(
delUserList
,
null
);
}
//
if (!ObjectUtils.isEmpty(delUserList)) {
//
log.info("注册用户删除,size:{}", delUserList.size());
//
personService.remove(delUserList, null);
//
}
}
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
fa3d27ac
...
...
@@ -22,7 +22,7 @@ import org.springframework.util.ObjectUtils;
import
java.util.List
;
/**
* 同步用户,唯一标识为用户名。
* 同步
门户
用户,唯一标识为用户名。
*/
@Slf4j
@Service
(
"SyncUserTask"
)
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserToHikTaskImpl.java
View file @
fa3d27ac
...
...
@@ -41,7 +41,9 @@ import java.util.Date;
import
java.util.List
;
/**
* 同步用户到海康指定库。
* 同步用户人脸数据到海康指定库。
* 时间间隔以同步注册用户之后
* 默认同步到一个人脸用户组,如要其它用户组 则页面上进行添加
*/
@Slf4j
@Service
(
"SyncUserToHikTask"
)
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/AbstractHikService.java
View file @
fa3d27ac
...
...
@@ -17,7 +17,6 @@ public abstract class AbstractHikService {
@Value
(
"${hik.appSecret:''}"
)
protected
String
appSecret
;
@Value
(
"${hik.protocol:http://}"
)
protected
String
protocol
;
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/event/service/impl/HikEventServiceImpl.java
View file @
fa3d27ac
...
...
@@ -7,6 +7,7 @@ import com.hikvision.artemis.sdk.config.ArtemisConfig;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.xhx.common.code.HikAbilityEnum
;
import
com.mortals.xhx.common.code.HikEventTypeEnum
;
import
com.mortals.xhx.common.key.ParamKey
;
import
com.mortals.xhx.module.hik.AbstractHikService
;
...
...
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 海康人员接口类
...
...
@@ -111,35 +113,34 @@ public class HikEventServiceImpl extends AbstractHikService implements IHikEvent
//String similarity = GlobalSysInfo.getParamValue(ParamKey.PARAM_FACE_SIMILARITY, "0.8");
Params
params
=
req
.
getParams
();
if
(
HikEventTypeEnum
.
重点人员识别事件
.
getValue
().
equals
(
params
.
getAbility
()))
{
params
.
getEvents
();
if
(
HikAbilityEnum
.
人脸识别事件
.
getValue
().
equals
(
params
.
getAbility
()))
{
for
(
EventsItem
event
:
params
.
getEvents
())
{
//事件详细
String
eventId
=
event
.
getEventId
();
int
eventType
=
event
.
getEventType
();
EventData
eventData
=
event
.
getData
();
//识别结果
FaceRecognitionResult
faceRecognitionResult
=
eventData
.
getFaceRecognitionResult
();
//抓拍信息
Snap
snap
=
faceRecognitionResult
.
getSnap
();
//匹配的结果
List
<
FaceMatchItem
>
faceMatchs
=
faceRecognitionResult
.
getFaceMatch
();
for
(
FaceMatchItem
faceMatch
:
faceMatchs
)
{
if
(
HikEventTypeEnum
.
重点人员识别事件
.
getValue
()
==
event
.
getEventType
())
{
//处理重点人员事件
//匹配的结果
List
<
FaceMatchItem
>
faceMatchs
=
faceRecognitionResult
.
getFaceMatch
();
for
(
FaceMatchItem
faceMatch
:
faceMatchs
)
{
//根据匹配结果 保存业务数据 todo
if
(
faceMatch
.
getSimilarity
()
>
similarity
)
{
//保存当前识别结果到记录表中
}
}
}
else
if
(
HikEventTypeEnum
.
陌生人员识别事件
.
getValue
()
==
event
.
getEventType
())
{
//不论识别结果 保存流量数据
RealtimeDataflowEntity
realtimeDataflowEntity
=
new
RealtimeDataflowEntity
();
realtimeDataflowEntity
.
setDetectTime
(
event
.
getHappenTime
());
String
resIndexCodes
=
eventData
.
getResInfo
().
stream
().
map
(
i
->
i
.
getIndexCode
()).
collect
(
Collectors
.
joining
(
","
));
realtimeDataflowEntity
.
setDevice
(
resIndexCodes
);
realtimeDataflowEntity
.
setPicUri
(
eventData
.
getFaceRecognitionResult
().
getSnap
().
getFaceUrl
());
realtimeDataflowEntity
.
setEventId
(
event
.
getEventId
());
realtimeDataflowEntity
.
setEventType
(
HikEventTypeEnum
.
陌生人员识别事件
.
getValue
().
longValue
());
// realtimeDataflowEntity.setPersonId();
// realtimeDataflowEntity.setName();
// realtimeDataflowEntity.setDevice();
// realtimeDataflowEntity.setDetectTime();
// realtimeDataflowEntity.setContact();
// realtimeDataflowEntity.setIdNumber();
// realtimeDataflowEntity.setIsBooking();
// realtimeDataflowEntity.setQueueNum();
// realtimeDataflowEntity.setLocation();
// realtimeDataflowEntity.setPicture();
// realtimeDataflowEntity.setOrderCols();
// realtimeDataflowEntity.setOrderColList();
realtimeDataflowEntity
.
setCreateUserId
(
1L
);
realtimeDataflowEntity
.
setCreateTime
(
new
Date
());
...
...
@@ -149,14 +150,6 @@ public class HikEventServiceImpl extends AbstractHikService implements IHikEvent
realtimeDataflowEntity
.
initAttrValue
();
//dataflowService.save()
//根据匹配结果 保存业务数据 todo
if
(
faceMatch
.
getSimilarity
()>
similarity
){
//保存当前识别结果到记录表中
}
else
{
//识别为陌生人 保存
}
}
...
...
refined-manager/src/main/java/com/mortals/xhx/module/monitor/web/MonitorAlarmController.java
View file @
fa3d27ac
...
...
@@ -33,8 +33,6 @@ import static com.mortals.framework.ap.SysConstains.*;
@RequestMapping
(
"monitor/alarm"
)
public
class
MonitorAlarmController
extends
BaseCRUDJsonBodyMappingController
<
MonitorAlarmService
,
MonitorAlarmEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
public
MonitorAlarmController
(){
super
.
setModuleDesc
(
"监测预警记录"
);
...
...
refined-manager/src/main/java/com/mortals/xhx/module/realtime/model/RealtimeDataflowEntity.java
View file @
fa3d27ac
This diff is collapsed.
Click to expand it.
refined-manager/src/main/java/com/mortals/xhx/module/realtime/model/RealtimeDataflowQuery.java
View file @
fa3d27ac
This diff is collapsed.
Click to expand it.
refined-manager/src/main/resources/sqlmap/module/realtime/RealtimeDataflowMapper.xml
View file @
fa3d27ac
This diff is collapsed.
Click to expand it.
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