Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
703bb79cc1
|
|
@ -0,0 +1,31 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 38083
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: Bonus@admin123!
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.58:18849
|
||||
namespace: huadong_realname_prod
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.58:18849
|
||||
namespace: huadong_realname_prod
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
face:
|
||||
path: http://112.29.103.165:1616/faceIdentification
|
||||
|
|
@ -5,7 +5,7 @@ spring:
|
|||
name: bonus-bmw
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: prod
|
||||
task:
|
||||
scheduling:
|
||||
pool:
|
||||
|
|
|
|||
|
|
@ -464,7 +464,8 @@ public class FileUtilsServiceImpl {
|
|||
if(StringHelper.isNullOrEmptyString(bucketName)){
|
||||
bucketName=minioConfig.getBucketName();
|
||||
}
|
||||
return minioUtils.getFileUrl(bucketName,filePath,60*60*12);
|
||||
String url= minioUtils.getFileUrl(bucketName,filePath,60*60*12);
|
||||
return url.replace(minioConfig.getEndpoint(),minioConfig.getUrl());
|
||||
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -31,10 +31,21 @@ public class UserFaceHandle {
|
|||
public static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
public static SimpleDateFormat YMD_SDF=new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
public static SimpleDateFormat MM_SDF=new SimpleDateFormat("MM");
|
||||
@Autowired
|
||||
private UserFaceHandleService service;
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String month="2025-12-12 13:26:00";
|
||||
DateTime datetime= DateUtil.parse(month);
|
||||
System.out.println(YMD_SDF.format(datetime));
|
||||
System.out.println(MM_SDF.format(datetime));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员数据处理
|
||||
* @param deviceVo
|
||||
|
|
@ -58,6 +69,8 @@ public class UserFaceHandle {
|
|||
String devCode= deviceVo.getDevCode();
|
||||
DateTime datetime= DateUtil.parse(jsonObject.getString("time"), DatePattern.PURE_DATETIME_FORMAT);
|
||||
String time=sdf.format(datetime);
|
||||
String attDay= YMD_SDF.format(datetime);
|
||||
String month=MM_SDF.format(datetime);
|
||||
String bast64 = "";
|
||||
if(jsonObject.getString("logPhoto")!=null) {
|
||||
//文件图片
|
||||
|
|
@ -72,8 +85,12 @@ public class UserFaceHandle {
|
|||
BmWorkerEinUserVo vo=service.getOnUserInfo(userId,proId);
|
||||
if(vo==null){
|
||||
vo=createAttendanceVo(deviceVo,userId,devCode,time,bast64);
|
||||
vo.setAttDay(attDay);
|
||||
vo.setAttMonth(month);
|
||||
service.addWrcUser(vo);
|
||||
}else {
|
||||
vo.setAttDay(attDay);
|
||||
vo.setAttMonth(month);
|
||||
vo.setAttPhoto(bast64);
|
||||
vo.setAttTime(time);
|
||||
vo.setDevCode(devCode);
|
||||
|
|
@ -96,6 +113,7 @@ public class UserFaceHandle {
|
|||
private BmWorkerEinUserVo createAttendanceVo(DeviceVo deviceVo, String userId, String devCode,
|
||||
String time, String base64Photo) {
|
||||
BmWorkerEinUserVo vo = new BmWorkerEinUserVo();
|
||||
|
||||
vo.setAttPhoto(base64Photo);
|
||||
vo.setAttTime(time);
|
||||
vo.setDevCode(devCode);
|
||||
|
|
|
|||
|
|
@ -185,7 +185,9 @@ public class ResultService {
|
|||
List<String> faceList=mapper.getFaceList(taskVo.getDeviceCode());
|
||||
if(faceList!=null&& !faceList.isEmpty()){
|
||||
for (String face : faceList) {
|
||||
fileService.remoteFile(face);
|
||||
if(StringUtils.isNotBlank(face)) {
|
||||
fileService.remoteFile(face);
|
||||
}
|
||||
}
|
||||
}
|
||||
mapper.delAllDeviceUserId(taskVo.getDeviceCode());
|
||||
|
|
@ -196,9 +198,11 @@ public class ResultService {
|
|||
DevUserVo dto=new DevUserVo();
|
||||
String face=users.getJSONObject(i).getString("photo");
|
||||
String id=deviceCode+"-"+userId;
|
||||
UploadFileVo uploadFileVo=fileService.upload("kq_user_list",id,"考勤机照片","face",face,null);
|
||||
if(uploadFileVo!=null){
|
||||
dto.setImagePath(uploadFileVo.getPath());
|
||||
if(StringUtils.isNotBlank(face)){
|
||||
UploadFileVo uploadFileVo=fileService.upload("kq_user_list",id,"考勤机照片","face",face,null);
|
||||
if(uploadFileVo!=null){
|
||||
dto.setImagePath(uploadFileVo.getPath());
|
||||
}
|
||||
}
|
||||
String name=users.getJSONObject(i).getString("name");
|
||||
dto.setUserId(userId);
|
||||
|
|
|
|||
|
|
@ -59,8 +59,6 @@ public class UserFaceHandleService {
|
|||
try{
|
||||
String id=StringUtils.randomUUID();
|
||||
vo.setId(id);
|
||||
vo.setAttMonth(DateUtils.getCurrentMonth());
|
||||
vo.setAttDay(DateUtils.getDate());
|
||||
vo.setCreateTime(DateUtils.getTime());
|
||||
Integer num=mapper.getTodayIsExit(vo);
|
||||
//每日新增一条考勤信息
|
||||
|
|
@ -84,12 +82,11 @@ public class UserFaceHandleService {
|
|||
|
||||
|
||||
|
||||
|
||||
public void addWrcUser(BmWorkerEinUserVo vo) {
|
||||
try{
|
||||
String id=StringUtils.randomUUID();
|
||||
vo.setId(id);
|
||||
vo.setAttMonth(DateUtils.getCurrentMonth());
|
||||
vo.setAttDay(DateUtils.getDate());
|
||||
vo.setCreateTime(DateUtils.getTime());
|
||||
Integer num=mapper.getTodayNoRootIsExit(vo);
|
||||
//每日新增一条考勤信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue