Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_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
赵啸非
smart_gov_platform
Commits
0db6e9d4
Commit
0db6e9d4
authored
Jan 28, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加站点主题事项
parent
b31a792f
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1221 additions
and
884 deletions
+1221
-884
base-manager-ui/admin/vue.config.js
base-manager-ui/admin/vue.config.js
+19
-0
base-manager/doc/api.md
base-manager/doc/api.md
+269
-0
base-manager/pom.xml
base-manager/pom.xml
+6
-5
base-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java
.../xhx/base/system/param/service/impl/ParamServiceImpl.java
+16
-0
base-manager/src/main/java/com/mortals/xhx/common/utils/FaceUtil.java
.../src/main/java/com/mortals/xhx/common/utils/FaceUtil.java
+110
-110
base-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartedService.java
...als/xhx/daemon/applicationservice/DemoStartedService.java
+12
-4
base-manager/src/main/java/com/mortals/xhx/face/ArcsoftFaceUtil.java
...r/src/main/java/com/mortals/xhx/face/ArcsoftFaceUtil.java
+236
-236
base-manager/src/main/java/com/mortals/xhx/face/factory/FaceEnginePoolFactory.java
...a/com/mortals/xhx/face/factory/FaceEnginePoolFactory.java
+121
-121
base-manager/src/main/java/com/mortals/xhx/module/identity/service/impl/SysFaceServiceImpl.java
.../xhx/module/identity/service/impl/SysFaceServiceImpl.java
+248
-248
base-manager/src/main/java/com/mortals/xhx/module/identity/web/SysFaceController.java
...om/mortals/xhx/module/identity/web/SysFaceController.java
+140
-140
base-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinBaseServiceImpl.java
...als/xhx/module/skin/service/impl/SkinBaseServiceImpl.java
+4
-3
base-manager/src/main/java/com/mortals/xhx/module/skin/web/SkinBaseController.java
...a/com/mortals/xhx/module/skin/web/SkinBaseController.java
+2
-1
pom.xml
pom.xml
+19
-0
portal-manager-ui/admin/package-lock.json
portal-manager-ui/admin/package-lock.json
+3
-1
portal-manager-ui/admin/package.json
portal-manager-ui/admin/package.json
+2
-1
portal-manager/pom.xml
portal-manager/pom.xml
+11
-11
smart-gateway/pom.xml
smart-gateway/pom.xml
+3
-3
No files found.
base-manager-ui/admin/vue.config.js
View file @
0db6e9d4
...
...
@@ -8,6 +8,7 @@ const CompressionWebpackPlugin = require("compression-webpack-plugin");
const
productionGzipExtensions
=
[
"
js
"
,
"
css
"
];
const
isProd
=
process
.
env
.
NODE_ENV
===
"
production
"
;
const
assetsCDN
=
{
// webpack build externals
// externals: {
...
...
@@ -33,6 +34,17 @@ const assetsCDN = {
],
};
const
HardSourceWebpackPlugin
=
require
(
'
hard-source-webpack-plugin
'
);
const
devPlugins
=
[
new
HardSourceWebpackPlugin
(),
new
HardSourceWebpackPlugin
.
ExcludeModulePlugin
([
{
test
:
/mini-css-extract-plugin
[\\/]
dist
[\\/]
loader/
}
])
];
const
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
module
.
exports
=
{
devServer
:
{
disableHostCheck
:
true
,
...
...
@@ -56,6 +68,13 @@ module.exports = {
},
},
configureWebpack
:
(
config
)
=>
{
config
.
plugin
(
'
webpack-report
'
).
use
(
BundleAnalyzerPlugin
,
[
{
analyzerMode
:
'
static
'
}
])
plugins
:
process
.
env
.
NODE_ENV
===
"
production
"
?
[]
:
[...
devPlugins
];
config
.
entry
.
app
=
[
"
babel-polyfill
"
,
"
whatwg-fetch
"
,
"
./src/main.js
"
];
config
.
performance
=
{
hints
:
false
,
...
...
base-manager/doc/api.md
View file @
0db6e9d4
...
...
@@ -1577,6 +1577,275 @@ msg|String|消息|-
```
## 主题
### 查询主题列表
**请求URL:**
site/theme/list
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查询主题
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
page|Integer|否|当前页
size|Integer|否|每页条数,值为-1,查询所有记录
siteId|Long|否|站点id
userType|String|否|服务类型编号,字段前后添加%%模糊查询
themeCode|String|否|主题编号,字段前后添加%%模糊查询
themeName|String|否|主题名称,字段前后添加%%模糊查询
**请求样例:**
```
{
"siteId":9425,
"userType":"6mu82c",
"themeCode":"w7vxfs",
"themeName":"a9jq7j",
"page":1,
"size":10
}
```
**响应参数:**
参数名称|参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 
per_page|Integer|每页条数
 
total|Integer|总条数
 
last_page|Integer|总页数
 
current_page|Integer|当前页
 
data|array|结果集列表|数组
  
id|Long|id号
  
siteId|Long|站点id
  
userType|String|服务类型编号
  
themeCode|String|主题编号
  
themeName|String|主题名称
  
createTime|Date|创建时间
  
createUserId|Long|创建用户id
  
updateTime|Date|更新时间
dict|object|字典对象
**响应消息样例:**
```
{
"code":1,
"data":{
}
}
```
### 查看主题
**请求URL:**
site/theme/info
**请求方式:**
GET
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查看主题,返回实例详细信息
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
id|Long|是|ID
**请求样例:**
```
http://localhost/site/theme/info?id=549
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:-------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 
id|Long|id号
 
siteId|Long|站点id
 
userType|String|服务类型编号
 
themeCode|String|主题编号
 
themeName|String|主题名称
 
createTime|Date|创建时间
 
createUserId|Long|创建用户id
 
updateTime|Date|更新时间
dict|object|字典对象
**响应消息样例:**
```
{
"code": 1,
"data": {
"id":539,
"siteId":4859,
"userType":"ewybhk",
"themeCode":"27cygo",
"themeName":"qu6dep",
"createTime":"2023-01-28",
"createUserId":1565,
"updateTime":"2023-01-28"
}
}
```
## 站点主题事项
### 查询站点主题事项列表
**请求URL:**
site/theme/matter/list
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查询站点主题事项
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
page|Integer|否|当前页
size|Integer|否|每页条数,值为-1,查询所有记录
siteId|Long|否|站点ID
siteName|String|否|站点名称,字段前后添加%%模糊查询
matterId|Long|否|事项ID
matterName|String|否|事项名称,字段前后添加%%模糊查询
matterCode|String|否|事项编码,字段前后添加%%模糊查询
userType|String|否|服务类型(1.公共服务,2.个人服务,3.法人服务),字段前后添加%%模糊查询
themeCode|String|否|主题编码,字段前后添加%%模糊查询
themeName|String|否|主题名称,字段前后添加%%模糊查询
source|Integer|否|事项来源
**请求样例:**
```
{
"siteId":2334,
"siteName":"j1sn8h",
"matterId":5032,
"matterName":"xnn17d",
"matterCode":"5c6fxz",
"userType":"9c8tar",
"themeCode":"ztkpff",
"themeName":"hyfa7h",
"source":3642,
"page":1,
"size":10
}
```
**响应参数:**
参数名称|参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 
per_page|Integer|每页条数
 
total|Integer|总条数
 
last_page|Integer|总页数
 
current_page|Integer|当前页
 
data|array|结果集列表|数组
  
id|Long|序号,主键,自增长
  
siteId|Long|站点ID
  
siteName|String|站点名称
  
matterId|Long|事项ID
  
matterName|String|事项名称
  
matterCode|String|事项编码
  
userType|String|服务类型(1.公共服务,2.个人服务,3.法人服务)
  
themeCode|String|主题编码
  
themeName|String|主题名称
  
source|Integer|事项来源
  
createTime|Date|创建时间
  
createUserId|Long|创建用户
  
updateTime|Date|修改时间
dict|object|字典对象
 
userType|object|字典属性对象,详见附录
**响应消息样例:**
```
{
"code":1,
"data":{
}
}
```
### 查看站点主题事项
**请求URL:**
site/theme/matter/info
**请求方式:**
GET
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查看站点主题事项,返回实例详细信息
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
id|Long|是|ID
**请求样例:**
```
http://localhost/site/theme/matter/info?id=549
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:-------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 
id|Long|序号,主键,自增长
 
siteId|Long|站点ID
 
siteName|String|站点名称
 
matterId|Long|事项ID
 
matterName|String|事项名称
 
matterCode|String|事项编码
 
userType|String|服务类型(1.公共服务,2.个人服务,3.法人服务)
 
themeCode|String|主题编码
 
themeName|String|主题名称
 
source|Integer|事项来源
 
createTime|Date|创建时间
 
createUserId|Long|创建用户
 
updateTime|Date|修改时间
dict|object|字典对象
 
userType|object|字典属性对象,详见附录
**响应消息样例:**
```
{
"code": 1,
"data": {
"id":6517,
"siteId":8377,
"siteName":"wnnjis",
"matterId":5970,
"matterName":"b5c0l3",
"matterCode":"y3yyz4",
"userType":"sr07tk",
"themeCode":"s1az2z",
"themeName":"isyo83",
"source":7309,
"createTime":"2023-01-28",
"createUserId":2157,
"updateTime":"2023-01-28"
}
}
```
## 业务
### 查询站点业务列表
...
...
base-manager/pom.xml
View file @
0db6e9d4
...
...
@@ -88,21 +88,22 @@
<profiles.active>
yibin
</profiles.active>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
1
27.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
1
72.15.28.115
</profiles.rabbitmq.host>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.username>
taxi_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.password>
admin@2020
</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>
/
</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>
1
27.0.0.1
:8848
</profiles.nacos.server-addr>
<profiles.nacos.server-addr>
1
72.15.28.120
:8848
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.filepath>
/home/mortals/app/data
</profiles.filepath>
<profiles.log.level>
INFO
</profiles.log.level>
<package.environment>
yibin
</package.environment>
<skipDeploy>
fals
e
</skipDeploy>
<skipDeploy>
tru
e
</skipDeploy>
</properties>
</profile>
</profiles>
<dependencies>
...
...
@@ -190,11 +191,11 @@
</dependency>
<!-- 虹软人脸解析 -->
<dependency>
<!--
<dependency>
<groupId>com.arcsoft.face</groupId>
<artifactId>arcsoft-sdk-face</artifactId>
<version>3.0.0.0</version>
</dependency>
</dependency>
-->
<dependency>
<groupId>
net.coobird
</groupId>
<artifactId>
thumbnailator
</artifactId>
...
...
base-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java
View file @
0db6e9d4
package
com.mortals.xhx.base.system.param.service.impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.IParam
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.framework.util.DataUtil
;
...
...
@@ -32,6 +34,20 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
return
"ParamEntity.paramKey"
;
}
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected
void
saveBefore
(
ParamEntity
entity
,
Context
context
)
throws
AppException
{
//过滤换行符
entity
.
setParamKey
(
StrUtil
.
removeAllLineBreaks
(
entity
.
getParamKey
()));
entity
.
setParamValue
(
StrUtil
.
removeAllLineBreaks
(
entity
.
getParamValue
()));
super
.
saveBefore
(
entity
,
context
);
}
@Override
public
String
getValueByKey
(
String
key
)
{
List
<
ParamEntity
>
list
=
this
.
getCacheList
();
...
...
base-manager/src/main/java/com/mortals/xhx/common/utils/FaceUtil.java
View file @
0db6e9d4
package
com.mortals.xhx.common.utils
;
import
com.arcsoft.face.*
;
import
com.arcsoft.face.enums.DetectMode
;
import
com.arcsoft.face.enums.DetectOrient
;
import
com.arcsoft.face.enums.ErrorInfo
;
import
com.arcsoft.face.toolkit.ImageInfo
;
import
com.mortals.framework.exception.AppException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
com
.
arcsoft
.
face
.
toolkit
.
ImageFactory
.
getRGBData
;
@Slf4j
@Component
public
class
FaceUtil
{
public
FaceEngine
initFace
(
String
appId
,
String
sdkKey
)
{
FaceEngine
faceEngine
=
new
FaceEngine
(
getClass
().
getResource
(
getOsName
()).
getPath
());
//激活引擎
int
errorCode
=
faceEngine
.
activeOnline
(
appId
,
sdkKey
);
isTrue
(!(
errorCode
!=
ErrorInfo
.
MOK
.
getValue
()
&&
errorCode
!=
ErrorInfo
.
MERR_ASF_ALREADY_ACTIVATED
.
getValue
()),
"引擎激活失败"
);
ActiveFileInfo
activeFileInfo
=
new
ActiveFileInfo
();
errorCode
=
faceEngine
.
getActiveFileInfo
(
activeFileInfo
);
isTrue
(!(
errorCode
!=
ErrorInfo
.
MOK
.
getValue
()
&&
errorCode
!=
ErrorInfo
.
MERR_ASF_ALREADY_ACTIVATED
.
getValue
()),
"获取激活文件信息失败"
);
//引擎配置
EngineConfiguration
engineConfiguration
=
new
EngineConfiguration
();
engineConfiguration
.
setDetectMode
(
DetectMode
.
ASF_DETECT_MODE_IMAGE
);
engineConfiguration
.
setDetectFaceOrientPriority
(
DetectOrient
.
ASF_OP_ALL_OUT
);
engineConfiguration
.
setDetectFaceMaxNum
(
10
);
engineConfiguration
.
setDetectFaceScaleVal
(
16
);
//功能配置
FunctionConfiguration
functionConfiguration
=
new
FunctionConfiguration
();
functionConfiguration
.
setSupportAge
(
true
);
functionConfiguration
.
setSupportFace3dAngle
(
true
);
functionConfiguration
.
setSupportFaceDetect
(
true
);
functionConfiguration
.
setSupportFaceRecognition
(
true
);
functionConfiguration
.
setSupportGender
(
true
);
functionConfiguration
.
setSupportLiveness
(
true
);
functionConfiguration
.
setSupportIRLiveness
(
true
);
engineConfiguration
.
setFunctionConfiguration
(
functionConfiguration
);
//初始化引擎
errorCode
=
faceEngine
.
init
(
engineConfiguration
);
isTrue
(
errorCode
==
ErrorInfo
.
MOK
.
getValue
(),
"初始化引擎失败"
);
return
faceEngine
;
}
/**
* 人脸检测、特征提取
*
* @param faceEngine
* @param bytes
* @return
*/
public
byte
[]
featureData
(
FaceEngine
faceEngine
,
byte
[]
bytes
)
{
//人脸检测
ImageInfo
imageInfo
=
getRGBData
(
bytes
);
List
<
FaceInfo
>
faceInfoList
=
new
ArrayList
<
FaceInfo
>();
faceEngine
.
detectFaces
(
imageInfo
.
getImageData
(),
imageInfo
.
getWidth
(),
imageInfo
.
getHeight
(),
imageInfo
.
getImageFormat
(),
faceInfoList
);
//特征提取
FaceFeature
faceFeature
=
new
FaceFeature
();
faceEngine
.
extractFaceFeature
(
imageInfo
.
getImageData
(),
imageInfo
.
getWidth
(),
imageInfo
.
getHeight
(),
imageInfo
.
getImageFormat
(),
faceInfoList
.
get
(
0
),
faceFeature
);
return
faceFeature
.
getFeatureData
();
}
/**
* 特征比对
*
* @param targeFace
* @param sourceFace
* @return
*/
public
boolean
featureComparison
(
FaceEngine
faceEngine
,
byte
[]
targeFace
,
byte
[]
sourceFace
)
{
//特征比对
FaceFeature
targetFaceFeature
=
new
FaceFeature
();
targetFaceFeature
.
setFeatureData
(
targeFace
);
FaceFeature
sourceFaceFeature
=
new
FaceFeature
();
sourceFaceFeature
.
setFeatureData
(
sourceFace
);
FaceSimilar
faceSimilar
=
new
FaceSimilar
();
faceEngine
.
compareFaceFeature
(
targetFaceFeature
,
sourceFaceFeature
,
faceSimilar
);
float
score
=
faceSimilar
.
getScore
();
if
(
score
>
0.8
)
{
return
true
;
}
return
false
;
}
public
void
unInit
(
FaceEngine
faceEngine
)
{
faceEngine
.
unInit
();
}
public
String
getOsName
()
{
String
os
=
System
.
getProperty
(
"os.name"
);
String
osName
=
os
.
toLowerCase
().
startsWith
(
"win"
)
?
"/face_lib/win64"
:
"/face_lib/linux"
;
return
osName
;
}
private
void
isTrue
(
boolean
b
,
String
errorMsg
)
{
if
(!
b
)
{
throw
new
AppException
(
errorMsg
);
}
}
}
//
package com.mortals.xhx.common.utils;
//
//
import com.arcsoft.face.*;
//
import com.arcsoft.face.enums.DetectMode;
//
import com.arcsoft.face.enums.DetectOrient;
//
import com.arcsoft.face.enums.ErrorInfo;
//
import com.arcsoft.face.toolkit.ImageInfo;
//
import com.mortals.framework.exception.AppException;
//
import lombok.extern.slf4j.Slf4j;
//
import org.springframework.stereotype.Component;
//
//
import java.util.ArrayList;
//
import java.util.List;
//
//
import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
//
//
@Slf4j
//
@Component
//
public class FaceUtil {
//
//
public FaceEngine initFace(String appId, String sdkKey) {
//
FaceEngine faceEngine = new FaceEngine(getClass().getResource(getOsName()).getPath());
//
//激活引擎
//
int errorCode = faceEngine.activeOnline(appId, sdkKey);
//
isTrue(!(errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()), "引擎激活失败");
//
ActiveFileInfo activeFileInfo = new ActiveFileInfo();
//
errorCode = faceEngine.getActiveFileInfo(activeFileInfo);
//
isTrue(!(errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()), "获取激活文件信息失败");
//
//引擎配置
//
EngineConfiguration engineConfiguration = new EngineConfiguration();
//
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
//
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT);
//
engineConfiguration.setDetectFaceMaxNum(10);
//
engineConfiguration.setDetectFaceScaleVal(16);
//
//功能配置
//
FunctionConfiguration functionConfiguration = new FunctionConfiguration();
//
functionConfiguration.setSupportAge(true);
//
functionConfiguration.setSupportFace3dAngle(true);
//
functionConfiguration.setSupportFaceDetect(true);
//
functionConfiguration.setSupportFaceRecognition(true);
//
functionConfiguration.setSupportGender(true);
//
functionConfiguration.setSupportLiveness(true);
//
functionConfiguration.setSupportIRLiveness(true);
//
engineConfiguration.setFunctionConfiguration(functionConfiguration);
//
//初始化引擎
//
errorCode = faceEngine.init(engineConfiguration);
//
isTrue(errorCode == ErrorInfo.MOK.getValue(), "初始化引擎失败");
//
return faceEngine;
//
}
//
//
//
/**
//
* 人脸检测、特征提取
//
*
//
* @param faceEngine
//
* @param bytes
//
* @return
//
*/
//
public byte[] featureData(FaceEngine faceEngine, byte[] bytes) {
//
//人脸检测
//
ImageInfo imageInfo = getRGBData(bytes);
//
List<FaceInfo> faceInfoList = new ArrayList<FaceInfo>();
//
faceEngine.detectFaces(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList);
//
//特征提取
//
FaceFeature faceFeature = new FaceFeature();
//
faceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), faceFeature);
//
return faceFeature.getFeatureData();
//
}
//
//
//
/**
//
* 特征比对
//
*
//
* @param targeFace
//
* @param sourceFace
//
* @return
//
*/
//
public boolean featureComparison(FaceEngine faceEngine, byte[] targeFace, byte[] sourceFace) {
//
//特征比对
//
FaceFeature targetFaceFeature = new FaceFeature();
//
targetFaceFeature.setFeatureData(targeFace);
//
FaceFeature sourceFaceFeature = new FaceFeature();
//
sourceFaceFeature.setFeatureData(sourceFace);
//
FaceSimilar faceSimilar = new FaceSimilar();
//
faceEngine.compareFaceFeature(targetFaceFeature, sourceFaceFeature, faceSimilar);
//
float score = faceSimilar.getScore();
//
if (score > 0.8) {
//
return true;
//
}
//
return false;
//
}
//
//
public void unInit(FaceEngine faceEngine) {
//
faceEngine.unInit();
//
}
//
//
public String getOsName() {
//
String os = System.getProperty("os.name");
//
String osName = os.toLowerCase().startsWith("win") ? "/face_lib/win64" : "/face_lib/linux";
//
return osName;
//
}
//
//
//
private void isTrue(boolean b, String errorMsg) {
//
if (!b) {
//
throw new AppException(errorMsg);
//
}
//
}
//
//
}
base-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartedService.java
View file @
0db6e9d4
...
...
@@ -55,7 +55,15 @@ public class DemoStartedService implements IApplicationStartedService {
SyncTreeSiteThread
syncTreeSiteThread
=
new
SyncTreeSiteThread
(
contextTemp
);
ThreadPool
.
getInstance
().
execute
(
syncTreeSiteThread
);
if
(
ObjectUtils
.
isEmpty
(
userFeign
)){
userService
.
find
(
new
UserQuery
()).
forEach
(
user
->{
Context
context
=
new
Context
();
context
.
setUser
(
user
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
context
));
});
/* if(ObjectUtils.isEmpty(userFeign)){
logger.info("userFeign未加载,加载本地用户");
userService.find(new UserQuery()).forEach(user->{
Context context = new Context();
...
...
@@ -64,9 +72,9 @@ public class DemoStartedService implements IApplicationStartedService {
});
return;
}
}
*/
userFeign
.
list
(
new
UserPdu
()).
getData
().
getData
().
stream
().
forEach
(
userPdu
->{
/*
userFeign.list(new UserPdu()).getData().getData().stream().forEach(userPdu->{
Context context = new Context();
UserEntity entity = new UserEntity();
...
...
@@ -75,7 +83,7 @@ public class DemoStartedService implements IApplicationStartedService {
context.setUser(entity);
ThreadPool.getInstance().execute(new SyncTreeSiteThread(context));
});
});
*/
}
@Override
...
...
base-manager/src/main/java/com/mortals/xhx/face/ArcsoftFaceUtil.java
View file @
0db6e9d4
This diff is collapsed.
Click to expand it.
base-manager/src/main/java/com/mortals/xhx/face/factory/FaceEnginePoolFactory.java
View file @
0db6e9d4
package
com.mortals.xhx.face.factory
;
import
com.arcsoft.face.ActiveFileInfo
;
import
com.arcsoft.face.EngineConfiguration
;
import
com.arcsoft.face.FaceEngine
;
import
com.arcsoft.face.FunctionConfiguration
;
import
com.arcsoft.face.enums.DetectMode
;
import
com.arcsoft.face.enums.DetectOrient
;
import
com.arcsoft.face.enums.ErrorInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.pool2.BasePooledObjectFactory
;
import
org.apache.commons.pool2.PooledObject
;
import
org.apache.commons.pool2.impl.DefaultPooledObject
;
@Slf4j
public
class
FaceEnginePoolFactory
extends
BasePooledObjectFactory
<
FaceEngine
>
{
private
String
appId
;
private
String
sdkKey
;
private
String
sdkLibPath
;
public
FaceEnginePoolFactory
(
String
appId
,
String
sdkKey
,
String
sdkLibPath
)
{
this
.
appId
=
appId
;
this
.
sdkKey
=
sdkKey
;
this
.
sdkLibPath
=
sdkLibPath
;
//this.sdkLibPath = "D:\\face\\win64";
}
/**
* 在对象池中创建对象
* @return
* @throws Exception
*/
@Override
public
FaceEngine
create
()
throws
Exception
{
FaceEngine
faceEngine
=
new
FaceEngine
(
sdkLibPath
);
//激活引擎
int
errorCode
=
faceEngine
.
activeOnline
(
appId
,
sdkKey
);
if
(
errorCode
!=
ErrorInfo
.
MOK
.
getValue
()
&&
errorCode
!=
ErrorInfo
.
MERR_ASF_ALREADY_ACTIVATED
.
getValue
())
{
log
.
warn
(
"引擎激活失败"
);
}
ActiveFileInfo
activeFileInfo
=
new
ActiveFileInfo
();
errorCode
=
faceEngine
.
getActiveFileInfo
(
activeFileInfo
);
if
(
errorCode
!=
ErrorInfo
.
MOK
.
getValue
()
&&
errorCode
!=
ErrorInfo
.
MERR_ASF_ALREADY_ACTIVATED
.
getValue
())
{
log
.
warn
(
"获取激活文件信息失败"
);
}
//引擎配置
EngineConfiguration
engineConfiguration
=
new
EngineConfiguration
();
engineConfiguration
.
setDetectMode
(
DetectMode
.
ASF_DETECT_MODE_IMAGE
);
engineConfiguration
.
setDetectFaceOrientPriority
(
DetectOrient
.
ASF_OP_ALL_OUT
);
engineConfiguration
.
setDetectFaceMaxNum
(
10
);
engineConfiguration
.
setDetectFaceScaleVal
(
16
);
//功能配置
FunctionConfiguration
functionConfiguration
=
new
FunctionConfiguration
();
functionConfiguration
.
setSupportAge
(
true
);
functionConfiguration
.
setSupportFace3dAngle
(
true
);
functionConfiguration
.
setSupportFaceDetect
(
true
);
functionConfiguration
.
setSupportFaceRecognition
(
true
);
functionConfiguration
.
setSupportGender
(
true
);
functionConfiguration
.
setSupportLiveness
(
true
);
functionConfiguration
.
setSupportIRLiveness
(
true
);
engineConfiguration
.
setFunctionConfiguration
(
functionConfiguration
);
//初始化引擎
errorCode
=
faceEngine
.
init
(
engineConfiguration
);
if
(
errorCode
!=
ErrorInfo
.
MOK
.
getValue
())
{
log
.
error
(
"初始化引擎失败"
);
}
return
faceEngine
;
}
/**
* 包装对象
* @param faceEngine
* @return
*/
@Override
public
PooledObject
<
FaceEngine
>
wrap
(
FaceEngine
faceEngine
)
{
return
new
DefaultPooledObject
<>(
faceEngine
);
}
/**
* 销毁对象
* @param faceEngine 对象池
* @throws Exception 异常
*/
@Override
public
void
destroyObject
(
PooledObject
<
FaceEngine
>
faceEngine
)
throws
Exception
{
super
.
destroyObject
(
faceEngine
);
}
/**
* 校验对象是否可用
* @param faceEngine 对象池
* @return 对象是否可用结果,boolean
*/
@Override
public
boolean
validateObject
(
PooledObject
<
FaceEngine
>
faceEngine
)
{
return
super
.
validateObject
(
faceEngine
);
}
/**
* 激活钝化的对象系列操作
* @param faceEngine 对象池
* @throws Exception 异常信息
*/
@Override
public
void
activateObject
(
PooledObject
<
FaceEngine
>
faceEngine
)
throws
Exception
{
super
.
activateObject
(
faceEngine
);
}
/**
* 钝化未使用的对象
* @param faceEngine 对象池
* @throws Exception 异常信息
*/
@Override
public
void
passivateObject
(
PooledObject
<
FaceEngine
>
faceEngine
)
throws
Exception
{
super
.
passivateObject
(
faceEngine
);
}
}
//
package com.mortals.xhx.face.factory;
//
//
import com.arcsoft.face.ActiveFileInfo;
//
import com.arcsoft.face.EngineConfiguration;
//
import com.arcsoft.face.FaceEngine;
//
import com.arcsoft.face.FunctionConfiguration;
//
import com.arcsoft.face.enums.DetectMode;
//
import com.arcsoft.face.enums.DetectOrient;
//
import com.arcsoft.face.enums.ErrorInfo;
//
import lombok.extern.slf4j.Slf4j;
//
import org.apache.commons.pool2.BasePooledObjectFactory;
//
import org.apache.commons.pool2.PooledObject;
//
import org.apache.commons.pool2.impl.DefaultPooledObject;
//
//
@Slf4j
//
public class FaceEnginePoolFactory extends BasePooledObjectFactory<FaceEngine> {
//
//
private String appId;
//
private String sdkKey;
//
private String sdkLibPath;
//
//
public FaceEnginePoolFactory(String appId, String sdkKey, String sdkLibPath) {
//
this.appId = appId;
//
this.sdkKey = sdkKey;
//
this.sdkLibPath = sdkLibPath;
//
//this.sdkLibPath = "D:\\face\\win64";
//
}
//
//
/**
//
* 在对象池中创建对象
//
* @return
//
* @throws Exception
//
*/
//
@Override
//
public FaceEngine create() throws Exception {
//
FaceEngine faceEngine = new FaceEngine(sdkLibPath);
//
//激活引擎
//
int errorCode = faceEngine.activeOnline(appId, sdkKey);
//
if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
//
log.warn("引擎激活失败");
//
}
//
ActiveFileInfo activeFileInfo=new ActiveFileInfo();
//
errorCode = faceEngine.getActiveFileInfo(activeFileInfo);
//
if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
//
log.warn("获取激活文件信息失败");
//
}
//
//引擎配置
//
EngineConfiguration engineConfiguration = new EngineConfiguration();
//
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
//
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT);
//
engineConfiguration.setDetectFaceMaxNum(10);
//
engineConfiguration.setDetectFaceScaleVal(16);
//
//功能配置
//
FunctionConfiguration functionConfiguration = new FunctionConfiguration();
//
functionConfiguration.setSupportAge(true);
//
functionConfiguration.setSupportFace3dAngle(true);
//
functionConfiguration.setSupportFaceDetect(true);
//
functionConfiguration.setSupportFaceRecognition(true);
//
functionConfiguration.setSupportGender(true);
//
functionConfiguration.setSupportLiveness(true);
//
functionConfiguration.setSupportIRLiveness(true);
//
engineConfiguration.setFunctionConfiguration(functionConfiguration);
//
//初始化引擎
//
errorCode = faceEngine.init(engineConfiguration);
//
//
if (errorCode != ErrorInfo.MOK.getValue()) {
//
log.error("初始化引擎失败");
//
}
//
return faceEngine;
//
}
//
//
/**
//
* 包装对象
//
* @param faceEngine
//
* @return
//
*/
//
@Override
//
public PooledObject<FaceEngine> wrap(FaceEngine faceEngine) {
//
return new DefaultPooledObject<>(faceEngine);
//
}
//
/**
//
* 销毁对象
//
* @param faceEngine 对象池
//
* @throws Exception 异常
//
*/
//
@Override
//
public void destroyObject(PooledObject<FaceEngine> faceEngine) throws Exception {
//
super.destroyObject(faceEngine);
//
}
//
//
/**
//
* 校验对象是否可用
//
* @param faceEngine 对象池
//
* @return 对象是否可用结果,boolean
//
*/
//
@Override
//
public boolean validateObject(PooledObject<FaceEngine> faceEngine) {
//
return super.validateObject(faceEngine);
//
}
//
//
/**
//
* 激活钝化的对象系列操作
//
* @param faceEngine 对象池
//
* @throws Exception 异常信息
//
*/
//
@Override
//
public void activateObject(PooledObject<FaceEngine> faceEngine) throws Exception {
//
super.activateObject(faceEngine);
//
}
//
//
/**
//
* 钝化未使用的对象
//
* @param faceEngine 对象池
//
* @throws Exception 异常信息
//
*/
//
@Override
//
public void passivateObject(PooledObject<FaceEngine> faceEngine) throws Exception {
//
super.passivateObject(faceEngine);
//
}
//
//
}
base-manager/src/main/java/com/mortals/xhx/module/identity/service/impl/SysFaceServiceImpl.java
View file @
0db6e9d4
This diff is collapsed.
Click to expand it.
base-manager/src/main/java/com/mortals/xhx/module/identity/web/SysFaceController.java
View file @
0db6e9d4
This diff is collapsed.
Click to expand it.
base-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinBaseServiceImpl.java
View file @
0db6e9d4
package
com.mortals.xhx.module.skin.service.impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
...
...
@@ -81,10 +82,10 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
item
.
setSkinFieldList
(
skinFieldEntities
);
if
(!
ObjectUtils
.
isEmpty
(
item
.
getPreviewImagePath
()))
{
item
.
setPreviewImagePath
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
+
item
.
getPreviewImagePath
());
item
.
setPreviewImagePath
(
StrUtil
.
removeAllLineBreaks
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
)
+
item
.
getPreviewImagePath
());
}
if
(!
ObjectUtils
.
isEmpty
(
item
.
getCssFilePath
()))
{
item
.
setCssFilePath
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
+
item
.
getCssFilePath
());
item
.
setCssFilePath
(
StrUtil
.
removeAllLineBreaks
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
)
+
item
.
getCssFilePath
());
}
});
super
.
findAfter
(
entity
,
pageInfo
,
context
,
list
);
...
...
@@ -92,7 +93,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
private
void
updateUrl
(
SkinFieldEntity
field
)
{
if
(
"2"
.
equals
(
field
.
getFieldType
()))
{
field
.
setFieldValue
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
+
field
.
getFieldValue
());
field
.
setFieldValue
(
StrUtil
.
removeAllLineBreaks
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
)
+
field
.
getFieldValue
());
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/skin/web/SkinBaseController.java
View file @
0db6e9d4
package
com.mortals.xhx.module.skin.web
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
...
...
@@ -89,7 +90,7 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa
private
void
updateUrl
(
SkinFieldEntity
field
)
{
if
(
"2"
.
equals
(
field
.
getFieldType
()))
{
field
.
setFieldValue
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
+
field
.
getFieldValue
());
field
.
setFieldValue
(
StrUtil
.
removeAllLineBreaks
(
GlobalSysInfo
.
getParamValue
(
Constant
.
DOMAIN
,
"http://192.168.0.98:11071/"
)
)
+
field
.
getFieldValue
());
}
}
...
...
pom.xml
View file @
0db6e9d4
...
...
@@ -25,6 +25,16 @@
<common-lib.version>
0.0.1-SNAPSHOT
</common-lib.version>
</properties>
<repositories>
<repository>
<id>
aliyun
</id>
<name>
aliyun Repository
</name>
<url>
https://maven.aliyun.com/repository/public
</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
...
...
@@ -93,6 +103,15 @@
<useDefaultDelimiters>
false
</useDefaultDelimiters>
</configuration>
</plugin>
<!-- 打包跳过测试 -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<configuration>
<skipTests>
true
</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
portal-manager-ui/admin/package-lock.json
View file @
0db6e9d4
...
...
@@ -19,6 +19,7 @@
"highlight.js"
:
"^11.5.1"
,
"js-export-excel"
:
"^1.1.4"
,
"lodash"
:
"^4.17.21"
,
"moment"
:
"^2.29.4"
,
"qs"
:
"^6.10.3"
,
"vue"
:
"^2.6.14"
,
"vue-highlightjs"
:
"^1.3.3"
,
...
...
@@ -35,7 +36,8 @@
"less"
:
"^4.0.0"
,
"less-loader"
:
"^8.0.0"
,
"postcss"
:
"^8.4.12"
,
"vue-template-compiler"
:
"^2.6.14"
"vue-template-compiler"
:
"^2.6.14"
,
"webpack-bundle-analyzer"
:
"^4.7.0"
}
},
"node_modules/@achrinza/node-ipc"
:
{
...
...
portal-manager-ui/admin/package.json
View file @
0db6e9d4
...
...
@@ -38,7 +38,8 @@
"less"
:
"^4.0.0"
,
"less-loader"
:
"^8.0.0"
,
"postcss"
:
"^8.4.12"
,
"vue-template-compiler"
:
"^2.6.14"
"vue-template-compiler"
:
"^2.6.14"
,
"webpack-bundle-analyzer"
:
"^4.7.0"
},
"browserslist"
:
[
"> 1%"
,
...
...
portal-manager/pom.xml
View file @
0db6e9d4
...
...
@@ -34,7 +34,7 @@
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
<package.environment>
test
</package.environment>
<skip
Deploy>
false
</skipDeploy
>
<skip
Ui>
false
</skipUi
>
</properties>
</profile>
<profile>
...
...
@@ -54,7 +54,7 @@
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<package.environment>
test
</package.environment>
<skip
Deploy>
false
</skipDeploy
>
<skip
Ui>
false
</skipUi
>
</properties>
</profile>
<profile>
...
...
@@ -74,30 +74,30 @@
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<package.environment>
build
</package.environment>
<skip
Deploy>
false
</skipDeploy
>
<skip
Ui>
true
</skipUi
>
</properties>
</profile>
<profile>
<id>
yibin
</id>
<properties>
<profiles.active>
yibin
</profiles.active>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
1
27.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
1
72.15.28.115
</profiles.rabbitmq.host>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.username>
root
_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.password>
xhx@2022
</profiles.rabbitmq.password>
<profiles.rabbitmq.username>
taxi
_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.password>
admin@2020
</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>
/
</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>
1
27.0.0.1
:8848
</profiles.nacos.server-addr>
<profiles.nacos.server-addr>
1
72.15.28.120
:8848
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<package.environment>
yibin
</package.environment>
<skip
Deploy>
false
</skipDeploy
>
<skip
Ui>
false
</skipUi
>
</properties>
</profile>
</profiles>
<properties>
</properties>
...
...
@@ -246,7 +246,7 @@
<artifactId>
exec-maven-plugin
</artifactId>
<version>
1.6.0
</version>
<configuration>
<skip>
${skip
Deploy
}
</skip>
<skip>
${skip
Ui
}
</skip>
</configuration>
<executions>
<execution>
...
...
@@ -309,7 +309,7 @@
<goal>
single
</goal>
</goals>
<configuration>
<skipAssembly>
${skip
Deploy
}
</skipAssembly>
<skipAssembly>
${skip
Ui
}
</skipAssembly>
<finalName>
${project.artifactId}-ui
</finalName>
<appendAssemblyId>
false
</appendAssemblyId>
<descriptors>
...
...
smart-gateway/pom.xml
View file @
0db6e9d4
...
...
@@ -88,20 +88,20 @@
<profiles.server.ip>
192.168.2.144
</profiles.server.ip>
<profiles.server.port>
17214
</profiles.server.port>
<profiles.nginx.port>
11078
</profiles.nginx.port>
<profiles.rabbitmq.host>
1
27.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
1
72.15.28.115
</profiles.rabbitmq.host>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.username>
taxi_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.password>
admin@2020
</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>
/
</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>
1
27.0.0.1
:8848
</profiles.nacos.server-addr>
<profiles.nacos.server-addr>
1
72.15.28.120
:8848
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
</properties>
</profile>
</profiles>
<properties>
...
...
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