1.修改
This commit is contained in:
parent
11537e79a3
commit
210a4cfaa5
|
|
@ -34,28 +34,30 @@ public class ArcFaceHelper {
|
||||||
|
|
||||||
public static final float STANDARD_SCORE = 0.85F;
|
public static final float STANDARD_SCORE = 0.85F;
|
||||||
|
|
||||||
|
public static int errorCode = 0;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try{
|
try{
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
|
|
||||||
if(StringUtils.startsWith(os.toLowerCase(), "win")){
|
if(StringUtils.startsWith(os.toLowerCase(), "win")){
|
||||||
faceEngine = new FaceEngine("D:\\arcsoft_lib_64");
|
faceEngine = new FaceEngine("D:\\arcsoft_lib_64");
|
||||||
//激活引擎
|
//激活引擎
|
||||||
faceEngine.activeOnline(APP_ID, WIN64_SDK_KEY);
|
errorCode = faceEngine.activeOnline(APP_ID, WIN64_SDK_KEY);
|
||||||
} else {
|
} else {
|
||||||
faceEngine = new FaceEngine("/data/arcsoft_lib_64");
|
faceEngine = new FaceEngine("/data/arcsoft_lib_64");
|
||||||
//激活引擎
|
//激活引擎
|
||||||
faceEngine.activeOnline(APP_ID, LINUX64_SDK_KEY);
|
errorCode = faceEngine.activeOnline(APP_ID, LINUX64_SDK_KEY);
|
||||||
|
}
|
||||||
|
if(errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()){
|
||||||
|
System.out.println("引擎激活失败:" + errorCode);
|
||||||
}
|
}
|
||||||
}catch (Throwable e){
|
}catch (Throwable e){
|
||||||
System.out.println("加载人脸识别引擎异常:" + e.getMessage());
|
System.out.println("加载人脸识别引擎异常:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FaceEngine getFaceEngine() {
|
public FaceResult getFaceFeatures(String imgSrc) {
|
||||||
return faceEngine;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FaceResult getFaceFeatures(String imgSrc) {
|
|
||||||
if(imgSrc.contains("http")){
|
if(imgSrc.contains("http")){
|
||||||
return getFaceFeatures(getNetUrlHttp(imgSrc));
|
return getFaceFeatures(getNetUrlHttp(imgSrc));
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -63,22 +65,47 @@ public class ArcFaceHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIsFaceImage(String imgSrc) {
|
||||||
|
if(imgSrc.contains("http")){
|
||||||
|
return getIsFaceImage(getNetUrlHttp(imgSrc));
|
||||||
|
}else{
|
||||||
|
return getIsFaceImage(new File(imgSrc));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取人脸特征
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static FaceResult getFaceFeatures(File file) {
|
public static FaceResult getFaceFeatures(File file) {
|
||||||
ImageInfo imageInfo = getRGBData(file);
|
ImageInfo imageInfo = getRGBData(file);
|
||||||
if (imageInfo == null){
|
if (imageInfo == null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
EngineConfiguration engineConfiguration = EngineConfiguration.builder().functionConfiguration(
|
//引擎配置
|
||||||
FunctionConfiguration.builder()
|
EngineConfiguration engineConfiguration = new EngineConfiguration();
|
||||||
.supportFaceDetect(true)
|
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
|
||||||
.supportAge(true)
|
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_0_ONLY);
|
||||||
.supportFace3dAngle(true)
|
engineConfiguration.setDetectFaceMaxNum(10);
|
||||||
.supportFaceDetect(true)
|
engineConfiguration.setDetectFaceScaleVal(16);
|
||||||
.supportFaceRecognition(true)
|
//功能配置
|
||||||
.supportGender(true)
|
FunctionConfiguration functionConfiguration = new FunctionConfiguration();
|
||||||
.build()).build();
|
//是否支持人脸检测功能
|
||||||
|
functionConfiguration.setSupportFaceDetect(true);
|
||||||
|
//是否支持3D检测功能
|
||||||
|
functionConfiguration.setSupportFace3dAngle(true);
|
||||||
|
functionConfiguration.setSupportAge(true);
|
||||||
|
functionConfiguration.setSupportFaceRecognition(true);
|
||||||
|
functionConfiguration.setSupportGender(true);
|
||||||
|
functionConfiguration.setSupportLiveness(true);
|
||||||
|
functionConfiguration.setSupportIRLiveness(true);
|
||||||
|
engineConfiguration.setFunctionConfiguration(functionConfiguration);
|
||||||
//初始化引擎
|
//初始化引擎
|
||||||
faceEngine.init(engineConfiguration);
|
errorCode = faceEngine.init(engineConfiguration);
|
||||||
|
if (errorCode != ErrorInfo.MOK.getValue()) {
|
||||||
|
System.out.println("初始化引擎失败:"+errorCode);
|
||||||
|
}
|
||||||
//人脸检测
|
//人脸检测
|
||||||
List<FaceInfo> lstFaceInfo = new ArrayList<>();
|
List<FaceInfo> lstFaceInfo = new ArrayList<>();
|
||||||
faceEngine.detectFaces(imageInfo.getRgbData(), imageInfo.getWidth(), imageInfo.getHeight(),
|
faceEngine.detectFaces(imageInfo.getRgbData(), imageInfo.getWidth(), imageInfo.getHeight(),
|
||||||
|
|
@ -118,11 +145,44 @@ public class ArcFaceHelper {
|
||||||
List<Face3DAngle> face3DAngleList = new ArrayList<Face3DAngle>();
|
List<Face3DAngle> face3DAngleList = new ArrayList<Face3DAngle>();
|
||||||
int face3dCode = faceEngine.getFace3DAngle(face3DAngleList);
|
int face3dCode = faceEngine.getFace3DAngle(face3DAngleList);
|
||||||
System.out.println("3D信息:" + face3DAngleList + ",3D信息提取码:" + face3dCode);
|
System.out.println("3D信息:" + face3DAngleList + ",3D信息提取码:" + face3dCode);
|
||||||
unInintEngine();
|
unInitEngine();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void unInintEngine() {
|
public static String getIsFaceImage(File file) {
|
||||||
|
ImageInfo imageInfo = getRGBData(file);
|
||||||
|
if (imageInfo == null){
|
||||||
|
return "500,无图片";
|
||||||
|
}
|
||||||
|
//引擎配置
|
||||||
|
EngineConfiguration engineConfiguration = new EngineConfiguration();
|
||||||
|
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
|
||||||
|
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_0_ONLY);
|
||||||
|
engineConfiguration.setDetectFaceMaxNum(10);
|
||||||
|
engineConfiguration.setDetectFaceScaleVal(16);
|
||||||
|
//功能配置
|
||||||
|
FunctionConfiguration functionConfiguration = new FunctionConfiguration();
|
||||||
|
//是否支持人脸检测功能
|
||||||
|
functionConfiguration.setSupportFaceDetect(true);
|
||||||
|
engineConfiguration.setFunctionConfiguration(functionConfiguration);
|
||||||
|
//初始化引擎
|
||||||
|
errorCode = faceEngine.init(engineConfiguration);
|
||||||
|
if (errorCode != ErrorInfo.MOK.getValue()) {
|
||||||
|
System.out.println("初始化引擎失败:"+errorCode);
|
||||||
|
if(errorCode == 28678) {
|
||||||
|
return "200,人脸SDK过期--请更换jar包和Dll文件";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//人脸检测
|
||||||
|
List<FaceInfo> lstFaceInfo = new ArrayList<>();
|
||||||
|
faceEngine.detectFaces(imageInfo.getRgbData(), imageInfo.getWidth(), imageInfo.getHeight(),
|
||||||
|
ImageFormat.CP_PAF_BGR24, lstFaceInfo);
|
||||||
|
System.out.println("检测到人脸数:" + lstFaceInfo.size());
|
||||||
|
unInitEngine();
|
||||||
|
return lstFaceInfo.size() == 1?"200,检测成功" : "500,未检测到人脸";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void unInitEngine() {
|
||||||
int code = faceEngine.unInit();
|
int code = faceEngine.unInit();
|
||||||
System.out.println("销毁引擎:" + code);
|
System.out.println("销毁引擎:" + code);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.bonus.bmw.controller;
|
||||||
|
|
||||||
|
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||||
|
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||||
|
import com.bonus.bmw.domain.po.BmSubContract;
|
||||||
|
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||||
|
import com.bonus.bmw.service.AppService;
|
||||||
|
import com.bonus.bmw.service.BmSubContractService;
|
||||||
|
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||||
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.common.security.annotation.InnerAuth;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app部分接口
|
||||||
|
* @author fly
|
||||||
|
* @date 2025/8/23
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app")
|
||||||
|
public class AppController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AppService service;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -156,7 +156,7 @@ public class HomePageSubController extends BaseController {
|
||||||
* @param o
|
* @param o
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||||
@GetMapping("/getWorkerMsgById")
|
@GetMapping("/getWorkerMsgById")
|
||||||
@SysLog(title = "单人详情页面", businessType = OperaType.QUERY, logType = 0, module = "首页->二级页面", details = "单人详情页面")
|
@SysLog(title = "单人详情页面", businessType = OperaType.QUERY, logType = 0, module = "首页->二级页面", details = "单人详情页面")
|
||||||
public AjaxResult getWorkerMsgById(HomePagePo o) {
|
public AjaxResult getWorkerMsgById(HomePagePo o) {
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ public class PmWorkerController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PmWorker o = FastJsonHelper.jsonStrToBean(params, PmWorker.class);
|
PmWorker o = FastJsonHelper.jsonStrToBean(params, PmWorker.class);
|
||||||
return toAjax(service.updateByPrimaryKey(o,listFile));
|
return service.updateByPrimaryKey(o,listFile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
|
|
@ -166,22 +166,18 @@ public class PmWorkerController extends BaseController {
|
||||||
suffix = originalFilename.substring(originalFilename.lastIndexOf("."));
|
suffix = originalFilename.substring(originalFilename.lastIndexOf("."));
|
||||||
}
|
}
|
||||||
// 创建临时文件
|
// 创建临时文件
|
||||||
// tempFile = Files.createTempFile("temp-image-", suffix).toFile();
|
tempFile = Files.createTempFile("temp-image-", suffix).toFile();
|
||||||
File customTempDir = new File("D:\\temp");
|
|
||||||
if (!customTempDir.exists()) {
|
|
||||||
customTempDir.mkdirs();
|
|
||||||
}
|
|
||||||
tempFile = File.createTempFile("temp-image-", suffix, customTempDir);
|
|
||||||
tempFile.deleteOnExit(); // JVM退出时自动删除
|
tempFile.deleteOnExit(); // JVM退出时自动删除
|
||||||
// 将 MultipartFile 写入临时文件
|
// 将 MultipartFile 写入临时文件
|
||||||
file.transferTo(tempFile);
|
file.transferTo(tempFile);
|
||||||
ArcFaceHelper arcFaceHelper = new ArcFaceHelper();
|
ArcFaceHelper arcFaceHelper = new ArcFaceHelper();
|
||||||
// 调用原方法,传入临时文件的路径
|
// 调用原方法,传入临时文件的路径
|
||||||
FaceResult faceFeatures = arcFaceHelper.getFaceFeatures(tempFile.getAbsolutePath());
|
String faceFeatures = arcFaceHelper.getIsFaceImage(tempFile.getAbsolutePath());
|
||||||
if (faceFeatures == null){
|
String[] split = faceFeatures.split(",");
|
||||||
return AjaxResult.error("人脸检测失败");
|
if ("200".equals(split[0])){
|
||||||
|
return AjaxResult.success(split[1]);
|
||||||
}else{
|
}else{
|
||||||
return AjaxResult.success(faceFeatures);
|
return AjaxResult.error(split[1]);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// 处理异常(如磁盘满、权限不足等)
|
// 处理异常(如磁盘满、权限不足等)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
package com.bonus.bmw.domain.vo;
|
||||||
|
|
||||||
|
import com.bonus.system.api.model.UploadFileVo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员基础信息表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class HomePagePmWorkerVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证
|
||||||
|
*/
|
||||||
|
private String idNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人脸照片
|
||||||
|
*/
|
||||||
|
private String facePhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入场状态 0未入场 1 已入场
|
||||||
|
*/
|
||||||
|
private Integer einStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 默认 1 黄灯 2 绿灯 3 失信人员
|
||||||
|
*/
|
||||||
|
private Integer lightStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String proName;
|
||||||
|
/**
|
||||||
|
* 分包名称
|
||||||
|
*/
|
||||||
|
private String subName;
|
||||||
|
/**
|
||||||
|
* 班组名称
|
||||||
|
*/
|
||||||
|
private String teamName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位名称
|
||||||
|
*/
|
||||||
|
private String postName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入场时间
|
||||||
|
*/
|
||||||
|
private String einTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
private String attTime;
|
||||||
|
|
||||||
|
private String deviceProName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Integer contractId;
|
||||||
|
|
||||||
|
private String contractCode;
|
||||||
|
private String contractTermType;
|
||||||
|
private String contractStartDate;
|
||||||
|
private String contractStopDate;
|
||||||
|
private String wageApprovedWay;
|
||||||
|
private String wageCriterion;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人脸照片
|
||||||
|
*/
|
||||||
|
private List<UploadFileVo> files;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -69,3 +69,4 @@ public class HomePageWorkerVo {
|
||||||
List<MapBeanVo> ageMsg;
|
List<MapBeanVo> ageMsg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.bonus.bmw.mapper;
|
||||||
|
|
||||||
|
import com.bonus.bmw.domain.po.BmSubContract;
|
||||||
|
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||||
|
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AppMapper {
|
||||||
|
/**
|
||||||
|
* 分包商合同信息列表
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
package com.bonus.bmw.mapper;
|
package com.bonus.bmw.mapper;
|
||||||
|
|
||||||
import com.bonus.bmw.domain.po.HomePagePo;
|
import com.bonus.bmw.domain.po.HomePagePo;
|
||||||
import com.bonus.bmw.domain.vo.HomePageProVo;
|
import com.bonus.bmw.domain.vo.*;
|
||||||
import com.bonus.bmw.domain.vo.HomePageVo;
|
|
||||||
import com.bonus.bmw.domain.vo.HomePageWorkerVo;
|
|
||||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@ package com.bonus.bmw.mapper;
|
||||||
|
|
||||||
import com.bonus.bmw.domain.po.HomePagePo;
|
import com.bonus.bmw.domain.po.HomePagePo;
|
||||||
import com.bonus.bmw.domain.vo.*;
|
import com.bonus.bmw.domain.vo.*;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -58,7 +56,7 @@ public interface HomePageSubMapper {
|
||||||
* @param o
|
* @param o
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PmWorker getWorkerMsgById(HomePagePo o);
|
HomePagePmWorkerVo getWorkerMsgById(HomePagePo o);
|
||||||
|
|
||||||
List<MapBeanVo> getWorkerLightMsg(HomePagePo o);
|
List<MapBeanVo> getWorkerLightMsg(HomePagePo o);
|
||||||
}
|
}
|
||||||
|
|
@ -102,4 +102,12 @@ public interface PmWorkerMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void updateBasicWorkerData(PmWorker worker);
|
void updateBasicWorkerData(PmWorker worker);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询黑名单人员
|
||||||
|
*
|
||||||
|
* @param idNumber
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PmWorker getBlackWorkerByNumber(String idNumber);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.bonus.bmw.service;
|
||||||
|
|
||||||
|
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||||
|
import com.bonus.bmw.domain.po.BmSubContract;
|
||||||
|
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface AppService {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -17,7 +17,7 @@ public interface PmWorkerService{
|
||||||
|
|
||||||
PmWorker selectByPrimaryKey(Integer id);
|
PmWorker selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
int updateByPrimaryKey(PmWorker record,List<WebFileDto> listFile) throws Exception;
|
AjaxResult updateByPrimaryKey(PmWorker record,List<WebFileDto> listFile) throws Exception;
|
||||||
|
|
||||||
List<PmWorker> selectWorkList(PmWorkerDto o);
|
List<PmWorker> selectWorkList(PmWorkerDto o);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.bonus.bmw.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||||
|
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||||
|
import com.bonus.bmw.domain.po.BmSubContract;
|
||||||
|
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||||
|
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||||
|
import com.bonus.bmw.mapper.AppMapper;
|
||||||
|
import com.bonus.bmw.mapper.BmSubContractMapper;
|
||||||
|
import com.bonus.bmw.service.AppService;
|
||||||
|
import com.bonus.bmw.service.BmSubContractService;
|
||||||
|
import com.bonus.common.core.constant.Constants;
|
||||||
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.system.api.model.UploadFileVo;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 马三炮
|
||||||
|
* @date 2025/8/14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class AppServiceImpl implements AppService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AppMapper appMapper;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,10 +2,7 @@ package com.bonus.bmw.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.bonus.bmw.domain.po.HomePagePo;
|
import com.bonus.bmw.domain.po.HomePagePo;
|
||||||
import com.bonus.bmw.domain.vo.HomePageProVo;
|
import com.bonus.bmw.domain.vo.*;
|
||||||
import com.bonus.bmw.domain.vo.HomePageVo;
|
|
||||||
import com.bonus.bmw.domain.vo.HomePageWorkerVo;
|
|
||||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
|
||||||
import com.bonus.bmw.mapper.HomePageMapper;
|
import com.bonus.bmw.mapper.HomePageMapper;
|
||||||
import com.bonus.bmw.service.HomePageService;
|
import com.bonus.bmw.service.HomePageService;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.bmw.service.impl;
|
package com.bonus.bmw.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.bonus.bmw.domain.po.HomePagePo;
|
import com.bonus.bmw.domain.po.HomePagePo;
|
||||||
import com.bonus.bmw.domain.vo.*;
|
import com.bonus.bmw.domain.vo.*;
|
||||||
import com.bonus.bmw.mapper.HomePageSubMapper;
|
import com.bonus.bmw.mapper.HomePageSubMapper;
|
||||||
|
|
@ -29,21 +30,25 @@ public class HomePageSubServiceImpl implements HomePageSubService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HomePageSubProVo> getProMsg(HomePagePo o) {
|
public List<HomePageSubProVo> getProMsg(HomePagePo o) {
|
||||||
|
o.setCurrentDay(DateUtil.today());
|
||||||
return mapper.getProMsg(o);
|
return mapper.getProMsg(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HomePageSubProVo> getSubMsg(HomePagePo o) {
|
public List<HomePageSubProVo> getSubMsg(HomePagePo o) {
|
||||||
|
o.setCurrentDay(DateUtil.today());
|
||||||
return mapper.getSubMsg(o);
|
return mapper.getSubMsg(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HomePageSubProVo> getTeamMsg(HomePagePo o) {
|
public List<HomePageSubProVo> getTeamMsg(HomePagePo o) {
|
||||||
|
|
||||||
return mapper.getTeamMsg(o);
|
return mapper.getTeamMsg(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HomePageSubProVo> getWorkerMsg(HomePagePo o) {
|
public List<HomePageSubProVo> getWorkerMsg(HomePagePo o) {
|
||||||
|
o.setCurrentDay(DateUtil.today());
|
||||||
return mapper.getWorkerMsg(o);
|
return mapper.getWorkerMsg(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -54,7 +59,11 @@ public class HomePageSubServiceImpl implements HomePageSubService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getWorkerMsgById(HomePagePo o) {
|
public AjaxResult getWorkerMsgById(HomePagePo o) {
|
||||||
PmWorker worker = mapper.getWorkerMsgById(o);
|
HomePagePmWorkerVo worker = mapper.getWorkerMsgById(o);
|
||||||
|
if (worker.getId() != null) {
|
||||||
|
List<UploadFileVo> faceFile = fileUploadUtils.getFileList("", worker.getId().toString(), Constants.FILE_UPLOAD_WORKER, "");
|
||||||
|
worker.setFacePhoto(faceFile.get(0).getLsUrl());
|
||||||
|
}
|
||||||
if (worker.getContractId() != null) {
|
if (worker.getContractId() != null) {
|
||||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", worker.getContractId().toString(), Constants.FILE_UPLOAD_CONTRACT, "");
|
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", worker.getContractId().toString(), Constants.FILE_UPLOAD_CONTRACT, "");
|
||||||
worker.setFiles(contractFile);
|
worker.setFiles(contractFile);
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,11 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
||||||
if(worker != null && worker.getId() != null){
|
if(worker != null && worker.getId() != null){
|
||||||
return new AjaxResult(500, "施工人员身份证已存在,当前系统姓名为"+worker.getName()+"如果想入场请去修改数据即可");
|
return new AjaxResult(500, "施工人员身份证已存在,当前系统姓名为"+worker.getName()+"如果想入场请去修改数据即可");
|
||||||
}
|
}
|
||||||
|
//是否失信人员名单
|
||||||
|
PmWorker worker2 = mapper.getBlackWorkerByNumber(record.getIdNumber());
|
||||||
|
if(worker2 != null && worker2.getId() != null){
|
||||||
|
return new AjaxResult(500, worker2.getName()+"施工人员在失信人员名单,无法入场");
|
||||||
|
}
|
||||||
record.setCreateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
record.setCreateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||||
int insert = mapper.insert(record);
|
int insert = mapper.insert(record);
|
||||||
if(insert > 0){
|
if(insert > 0){
|
||||||
|
|
@ -161,7 +166,12 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int updateByPrimaryKey(PmWorker record,List<WebFileDto> fileMsg) throws Exception {
|
public AjaxResult updateByPrimaryKey(PmWorker record,List<WebFileDto> fileMsg) throws Exception {
|
||||||
|
//是否失信人员名单
|
||||||
|
PmWorker worker2 = mapper.getBlackWorkerByNumber(record.getIdNumber());
|
||||||
|
if(worker2 != null && worker2.getId() != null){
|
||||||
|
return new AjaxResult(500, worker2.getName()+"施工人员在失信人员名单,无法入场");
|
||||||
|
}
|
||||||
//更新基础数据
|
//更新基础数据
|
||||||
record.setUpdateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
record.setUpdateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||||
int update = mapper.updateByPrimaryKey(record);
|
int update = mapper.updateByPrimaryKey(record);
|
||||||
|
|
@ -197,7 +207,7 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
||||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
||||||
addWorkerEinData(record,fileMsg);
|
addWorkerEinData(record,fileMsg);
|
||||||
}
|
}
|
||||||
return 1;
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bonus.bmw.mapper.AppMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -47,10 +47,10 @@
|
||||||
COUNT(DISTINCT pst.id) AS teamNum
|
COUNT(DISTINCT pst.id) AS teamNum
|
||||||
FROM pm_sub_team pst
|
FROM pm_sub_team pst
|
||||||
INNER JOIN pm_sub_team_contract pstc on pst.id = pstc.team_id and pstc.is_active = 1 and pstc.team_ein_status = 1
|
INNER JOIN pm_sub_team_contract pstc on pst.id = pstc.team_id and pstc.is_active = 1 and pstc.team_ein_status = 1
|
||||||
INNER JOIN pm_sub ps on pst.sub_id = ps.id and ps.is_active = 1
|
INNER JOIN pm_sub ps on pstc.sub_id = ps.id and ps.is_active = 1
|
||||||
INNER JOIN bm_sub_contract psc
|
INNER JOIN bm_sub_contract psc
|
||||||
ON ps.id = psc.sub_id and psc.is_active = 1 and psc.sub_ein_status = 1
|
ON ps.id = psc.sub_id and psc.is_active = 1 and psc.sub_ein_status = 1
|
||||||
INNER JOIN pm_project pp on pp.id = psc.pro_id
|
INNER JOIN pm_project pp on pp.id = psc.pro_id and pp.is_active = 1
|
||||||
WHERE
|
WHERE
|
||||||
pst.is_active = 1
|
pst.is_active = 1
|
||||||
<if test="subComId != null">
|
<if test="subComId != null">
|
||||||
|
|
|
||||||
|
|
@ -131,10 +131,10 @@
|
||||||
count(DISTINCT IF(bwem.light_status = 2, bwem.worker_id, NULL)) AS greenNum
|
count(DISTINCT IF(bwem.light_status = 2, bwem.worker_id, NULL)) AS greenNum
|
||||||
FROM
|
FROM
|
||||||
pm_sub ps
|
pm_sub ps
|
||||||
LEFT JOIN bm_sub_contract bsc ON ps.id = bsc.sub_id
|
INNER JOIN bm_sub_contract bsc ON ps.id = bsc.sub_id
|
||||||
AND bsc.is_active = 1
|
AND bsc.is_active = 1
|
||||||
AND bsc.sub_ein_status = 1
|
AND bsc.sub_ein_status = 1
|
||||||
LEFT JOIN pm_project pp ON pp.id = bsc.pro_id
|
INNER JOIN pm_project pp ON pp.id = bsc.pro_id
|
||||||
AND pp.is_active = 1
|
AND pp.is_active = 1
|
||||||
LEFT JOIN pm_sub_company psc ON pp.sub_com_id = psc.id
|
LEFT JOIN pm_sub_company psc ON pp.sub_com_id = psc.id
|
||||||
LEFT JOIN pm_sub_team_contract pstc ON ps.id = pstc.sub_id
|
LEFT JOIN pm_sub_team_contract pstc ON ps.id = pstc.sub_id
|
||||||
|
|
@ -189,14 +189,14 @@
|
||||||
count(DISTINCT IF(bwem.light_status = 2, bwem.worker_id, NULL)) AS greenNum
|
count(DISTINCT IF(bwem.light_status = 2, bwem.worker_id, NULL)) AS greenNum
|
||||||
FROM
|
FROM
|
||||||
pm_sub_team pst
|
pm_sub_team pst
|
||||||
LEFT JOIN pm_sub_team_contract pstc ON pst.id = pst.sub_id
|
INNER JOIN pm_sub_team_contract pstc ON pst.id = pstc.team_id
|
||||||
AND pstc.is_active = 1
|
AND pstc.is_active = 1
|
||||||
AND pstc.team_ein_status = 1
|
AND pstc.team_ein_status = 1
|
||||||
LEFT JOIN pm_sub ps ON ps.id = pstc.sub_id and ps.is_active = 1
|
INNER JOIN pm_sub ps ON ps.id = pstc.sub_id and ps.is_active = 1
|
||||||
LEFT JOIN bm_sub_contract bsc ON ps.id = bsc.sub_id
|
INNER JOIN bm_sub_contract bsc ON ps.id = bsc.sub_id
|
||||||
AND bsc.is_active = 1
|
AND bsc.is_active = 1
|
||||||
AND bsc.sub_ein_status = 1
|
AND bsc.sub_ein_status = 1
|
||||||
LEFT JOIN pm_project pp ON pp.id = bsc.pro_id
|
INNER JOIN pm_project pp ON pp.id = bsc.pro_id
|
||||||
AND pp.is_active = 1
|
AND pp.is_active = 1
|
||||||
LEFT JOIN pm_sub_company psc ON pp.sub_com_id = psc.id
|
LEFT JOIN pm_sub_company psc ON pp.sub_com_id = psc.id
|
||||||
LEFT JOIN bm_worker_ein_msg bwem ON pp.id = bwem.pro_id
|
LEFT JOIN bm_worker_ein_msg bwem ON pp.id = bwem.pro_id
|
||||||
|
|
@ -232,7 +232,6 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getWorkerMsg" resultMap="BaseResultMap">
|
<select id="getWorkerMsg" resultMap="BaseResultMap">
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
pw.id as worker_id,
|
pw.id as worker_id,
|
||||||
pw.name as worker_name,
|
pw.name as worker_name,
|
||||||
|
|
@ -246,11 +245,10 @@
|
||||||
psc.sub_company_name,
|
psc.sub_company_name,
|
||||||
bwem.light_status,
|
bwem.light_status,
|
||||||
if(bap.att_day is null ,0,1) as isAtt
|
if(bap.att_day is null ,0,1) as isAtt
|
||||||
|
|
||||||
from pm_worker pw
|
from pm_worker pw
|
||||||
inner JOIN bm_worker_ein_msg bwem ON pw.id = bwem.worker_id and bwem.is_active = 1
|
inner JOIN bm_worker_ein_msg bwem ON pw.id = bwem.worker_id and bwem.is_active = 1
|
||||||
left join bm_att_person bap ON pw.id = bap.worker_id and bap.is_active = 1 and bap.att_day = #{currentDay}
|
left join bm_att_person bap ON pw.id = bap.worker_id and bap.is_active = 1 and bap.att_day = #{currentDay}
|
||||||
left join pm_project pp ON bwem.pro_id = pp.id
|
inner join pm_project pp ON bwem.pro_id = pp.id and pp.is_active = 1
|
||||||
left join pm_sub_company psc ON pp.sub_com_id = psc.id
|
left join pm_sub_company psc ON pp.sub_com_id = psc.id
|
||||||
WHERE
|
WHERE
|
||||||
pw.is_active = 1
|
pw.is_active = 1
|
||||||
|
|
@ -315,9 +313,10 @@
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getWorkerMsgById" resultType="com.bonus.bmw.domain.vo.PmWorker">
|
<select id="getWorkerMsgById" resultType="com.bonus.bmw.domain.vo.HomePagePmWorkerVo">
|
||||||
SELECT
|
SELECT
|
||||||
pw.NAME,
|
pw.id,
|
||||||
|
pw.name,
|
||||||
pw.phone,
|
pw.phone,
|
||||||
bwem.light_status,
|
bwem.light_status,
|
||||||
bwem.ein_time,
|
bwem.ein_time,
|
||||||
|
|
@ -331,7 +330,6 @@
|
||||||
bap.pro_name AS device_pro_name,
|
bap.pro_name AS device_pro_name,
|
||||||
bwem.contract_id,
|
bwem.contract_id,
|
||||||
bwc.contract_code,
|
bwc.contract_code,
|
||||||
bwc.contract_code,
|
|
||||||
bwc.contract_term_type,
|
bwc.contract_term_type,
|
||||||
bwc.contract_start_date,
|
bwc.contract_start_date,
|
||||||
bwc.contract_stop_date,
|
bwc.contract_stop_date,
|
||||||
|
|
|
||||||
|
|
@ -236,4 +236,13 @@
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getBlackWorkerByNumber" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
bwb.`name`
|
||||||
|
FROM
|
||||||
|
bm_worker_black bwb
|
||||||
|
WHERE
|
||||||
|
bwb.id_number = #{idNumber} and bwb.is_remove = 0 and bwb.is_active = 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue