配置文件路径调整: 10.59.235.137 六厂现在的固定ip
更新人脸特征码功能: 根据本地图片重新获取人脸特征码 更新数据
This commit is contained in:
+10
@@ -322,6 +322,16 @@ public class SwUserFaceimgController extends JeecgController<SwUserFaceimg, ISwU
|
||||
return Result.OK().success("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人脸特征数据
|
||||
* @param type 0 子表 1 主表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/updateAllUserFaceImg")
|
||||
public Result<String> updateAllUserFaceImg(@RequestParam(name = "type", required = false,defaultValue = "0") Integer type){
|
||||
return Result.OK(swUserFaceimgService.updateAllUserFaceImg(type));
|
||||
}
|
||||
|
||||
public Result<?> saveFaceImgSubLocalUpload(@RequestBody Map map) {
|
||||
String userId = map.get("userId").toString();
|
||||
String img = map.get("imgSrc").toString();
|
||||
|
||||
+2
@@ -45,4 +45,6 @@ public interface ISwUserFaceimgService extends IService<SwUserFaceimg> {
|
||||
* @param userId isConfirm= true需要确认 ,根据userId确认
|
||||
*/
|
||||
void sendPaymentGateUserInfo(UserFaceInfo userFaceInfo, Integer type, Boolean isConfirm, String userId) ;
|
||||
|
||||
String updateAllUserFaceImg(Integer type);
|
||||
}
|
||||
|
||||
+67
-4
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.arcsoft.face.FaceInfo;
|
||||
import com.arcsoft.face.toolkit.ImageFactory;
|
||||
import com.arcsoft.face.toolkit.ImageInfo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -19,11 +20,9 @@ import org.jeecg.face.service.FaceEngineService;
|
||||
import org.jeecg.system.mapper.SwUserFaceimgMapper;
|
||||
import org.jeecg.system.service.IStUserFaceimgSubIncremInfoService;
|
||||
import org.jeecg.system.service.ISwUserFaceimgService;
|
||||
import org.jeecg.system.service.ISwUserFaceimgSubService;
|
||||
import org.jeecg.system.service.UserFaceCacheService;
|
||||
import org.jeecg.user.entity.StUserFaceimgSubIncremInfo;
|
||||
import org.jeecg.user.entity.SwUserFaceimg;
|
||||
import org.jeecg.user.entity.SysUser;
|
||||
import org.jeecg.user.entity.SysUserSub;
|
||||
import org.jeecg.user.entity.*;
|
||||
import org.jeecg.user.vo.UserCompareInfo;
|
||||
import org.jeecg.user.vo.UserFaceInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -66,6 +65,8 @@ public class SwUserFaceimgServiceImpl extends ServiceImpl<SwUserFaceimgMapper, S
|
||||
private FaceEngineService faceEngineService;
|
||||
@Resource
|
||||
private IStUserFaceimgSubIncremInfoService iStUserFaceimgSubIncremInfoService;
|
||||
@Resource
|
||||
private ISwUserFaceimgSubService swUserFaceimgSubService;
|
||||
@Override
|
||||
public void reputUserFaceDataToRedis() {
|
||||
log.info("重新获取人脸数据,注册到内存---开始");
|
||||
@@ -408,4 +409,66 @@ public class SwUserFaceimgServiceImpl extends ServiceImpl<SwUserFaceimgMapper, S
|
||||
});
|
||||
|
||||
}
|
||||
//此方法是为了更新人脸特征数据 , 因为初始化数据 进去的人脸特征识别有问题, 现通过程序重新识别生成特征码并更新
|
||||
@Override
|
||||
public String updateAllUserFaceImg(Integer type){
|
||||
|
||||
if(type == 1){
|
||||
//正式员工人脸表
|
||||
QueryWrapper<SwUserFaceimg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.isNotNull("face_img");
|
||||
queryWrapper.ne("face_img","");
|
||||
queryWrapper.isNotNull("face_feature_data");
|
||||
queryWrapper.eq("face_status","1");
|
||||
List<SwUserFaceimg> list = this.list(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (SwUserFaceimg swUserFaceimg : list) {
|
||||
String img = FileShowUtil.getShowUrl(swUserFaceimg.getFaceImg());
|
||||
log.error(img);
|
||||
String imgSrc = "data:image/png;base64," + Base64Util.netImageToBase64(img);
|
||||
//图片转base64
|
||||
ImageInfo rgbData = ImageFactory.getRGBData(Base64Util.base64ToBytes(imgSrc));
|
||||
//生成人脸特征码
|
||||
List<FaceInfo> faceInfoList = faceEngineService.detectFaces(rgbData);
|
||||
if (CollectionUtils.isNotEmpty(faceInfoList)) {
|
||||
for (FaceInfo faceInfo : faceInfoList) {
|
||||
byte[] feature = faceEngineService.extractFaceFeature(rgbData, faceInfo);
|
||||
swUserFaceimg.setFaceFeatureData(feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateBatchById(list);
|
||||
}
|
||||
return "此次操作更新人脸主表数据"+ list.size()+"条数据";
|
||||
}else {
|
||||
//子用户
|
||||
//正式员工人脸表
|
||||
QueryWrapper<SwUserFaceimgSub> subQueryWrapper = new QueryWrapper<>();
|
||||
subQueryWrapper.isNotNull("face_img");
|
||||
subQueryWrapper.ne("face_img","");
|
||||
subQueryWrapper.isNotNull("face_feature_data");
|
||||
subQueryWrapper.eq("face_status","1");
|
||||
List<SwUserFaceimgSub> subList = swUserFaceimgSubService.list(subQueryWrapper);
|
||||
if(CollectionUtils.isNotEmpty(subList)){
|
||||
for (SwUserFaceimgSub faceimgSub : subList) {
|
||||
String img = FileShowUtil.getShowUrl(faceimgSub.getFaceImg());
|
||||
log.error(img);
|
||||
String imgSrc = "data:image/png;base64," + Base64Util.netImageToBase64(img);
|
||||
//图片转base64
|
||||
ImageInfo rgbData = ImageFactory.getRGBData(Base64Util.base64ToBytes(imgSrc));
|
||||
//生成人脸特征码
|
||||
List<FaceInfo> faceInfoList = faceEngineService.detectFaces(rgbData);
|
||||
if (CollectionUtils.isNotEmpty(faceInfoList)) {
|
||||
for (FaceInfo faceInfo : faceInfoList) {
|
||||
byte[] feature = faceEngineService.extractFaceFeature(rgbData, faceInfo);
|
||||
faceimgSub.setFaceFeatureData(feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
swUserFaceimgSubService.updateBatchById(subList);
|
||||
}
|
||||
return "此次操作更新人脸子表数据"+subList.size()+"条数据";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ spring:
|
||||
downloadPath:
|
||||
#内网
|
||||
# intranet: http://192.168.10.223:8888/
|
||||
intranet: http://192.168.10.6:8888/
|
||||
intranet: http://10.59.235.137:8888/
|
||||
#外网 == 暂时没有用
|
||||
outernet: https://vip.shuziweidao.com/appPackage/
|
||||
#配置freemarker
|
||||
@@ -97,7 +97,7 @@ spring:
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://192.168.10.6:3306/zhst_finance?Unicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://10.59.235.137:3306/zhst_finance?Unicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123qwe!@#P@ssw0rd
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@@ -110,7 +110,7 @@ spring:
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 2
|
||||
host: 192.168.10.6
|
||||
host: 10.59.235.137
|
||||
port: 6379
|
||||
password: 123qwe!@#P@ssw0rd
|
||||
#mybatis plus 设置
|
||||
@@ -132,7 +132,7 @@ mybatis-plus:
|
||||
#消息队列配置
|
||||
activemq:
|
||||
device:
|
||||
brokerUrl: failover:(tcp://device.shuziweidao.com:1883,tcp://192.168.10.6:61616)?randomize=false&priorityBackup=true&maxReconnectDelay=1000&startupMaxReconnectAttempts=3
|
||||
brokerUrl: failover:(tcp://device.shuziweidao.com:1883,tcp://10.59.235.137:61616)?randomize=false&priorityBackup=true&maxReconnectDelay=1000&startupMaxReconnectAttempts=3
|
||||
username: sw_mqtt
|
||||
password: 150326sw@
|
||||
|
||||
@@ -159,7 +159,7 @@ jeecg:
|
||||
#服务部署的外网ip端口、域名地址:用于下载文件
|
||||
serverPublicIp:
|
||||
# 文件访问地址 需配置
|
||||
ip: http://192.168.10.6:2333
|
||||
ip: http://10.59.235.137:2333
|
||||
path:
|
||||
#文件上传根目录 设置 需配置
|
||||
upload: /opt/upFiles
|
||||
@@ -176,10 +176,10 @@ jeecg:
|
||||
# ElasticSearch 6设置
|
||||
elasticsearch:
|
||||
cluster-name: jeecg-ES
|
||||
cluster-nodes: 192.168.10.6:9200
|
||||
cluster-nodes: 10.59.235.137:9200
|
||||
check-enabled: false
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: 192.168.10.6:8012
|
||||
file-view-domain: 10.59.235.137:8012
|
||||
# minio文件上传
|
||||
minio:
|
||||
minio_url: http://minio.jeecg.com
|
||||
@@ -198,11 +198,11 @@ jeecg:
|
||||
#xxl-job配置
|
||||
xxljob:
|
||||
enabled: false
|
||||
adminAddresses: http://192.168.10.6:9080/xxl-job-admin
|
||||
adminAddresses: http://10.59.235.137:9080/xxl-job-admin
|
||||
appname: ${spring.application.name}
|
||||
accessToken: ''
|
||||
address: 192.168.10.6:30007
|
||||
ip: 192.168.10.6
|
||||
address: 10.59.235.137:30007
|
||||
ip: 10.59.235.137
|
||||
port: 30007
|
||||
logPath: logs/jeecg/job/jobhandler/
|
||||
logRetentionDays: 30
|
||||
|
||||
Reference in New Issue
Block a user