|
@@ -1,12 +1,23 @@
|
|
package com.xjrsoft.module.personnel.service.impl;
|
|
package com.xjrsoft.module.personnel.service.impl;
|
|
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
|
+import com.google.gson.JsonObject;
|
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
|
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
|
|
+import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
|
|
+import com.xjrsoft.module.personnel.entity.FaceManagement;
|
|
import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
|
|
import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
|
|
import com.xjrsoft.module.personnel.mapper.StundentFaceProcessMapper;
|
|
import com.xjrsoft.module.personnel.mapper.StundentFaceProcessMapper;
|
|
|
|
+import com.xjrsoft.module.personnel.service.IFaceManagementService;
|
|
import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
|
|
import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @title: 学生人脸信息审核
|
|
* @title: 学生人脸信息审核
|
|
* @Author dzx
|
|
* @Author dzx
|
|
@@ -16,4 +27,41 @@ import org.springframework.stereotype.Service;
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class StundentFaceProcessServiceImpl extends MPJBaseServiceImpl<StundentFaceProcessMapper, StundentFaceProcess> implements IStundentFaceProcessService {
|
|
public class StundentFaceProcessServiceImpl extends MPJBaseServiceImpl<StundentFaceProcessMapper, StundentFaceProcess> implements IStundentFaceProcessService {
|
|
|
|
+
|
|
|
|
+ private final HikvisionDataMapper hikvisionDataMapper;
|
|
|
|
+
|
|
|
|
+ private final IFaceManagementService faceManagementService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //删除人脸后,移除海康那边的人脸
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean removeByIds(List<Long> ids) {
|
|
|
|
+ List<StundentFaceProcess> list = this.baseMapper.selectBatchIds(ids);
|
|
|
|
+ ApiUtil apiUtil = new ApiUtil();
|
|
|
|
+ String apiPath = "/api/resource/v1/face/single/delete";
|
|
|
|
+ for (StundentFaceProcess process : list) {
|
|
|
|
+ String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(process.getUserId());
|
|
|
|
+
|
|
|
|
+ JsonObject paramJson = new JsonObject();
|
|
|
|
+ paramJson.addProperty("faceId", studentHikvisionId);
|
|
|
|
+
|
|
|
|
+ String result = apiUtil.doPost(apiPath, paramJson.toString(), null);
|
|
|
|
+ process.setExamStatus(2);
|
|
|
|
+ process.setHikvisionResult(result);
|
|
|
|
+ process.setDeleteMark(DeleteMark.DELETED.getCode());
|
|
|
|
+ process.setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
|
+ process.setModifyDate(new Date());
|
|
|
|
+ this.baseMapper.updateById(process);
|
|
|
|
+
|
|
|
|
+ FaceManagement faceManagement = faceManagementService.getOne(
|
|
|
|
+ new QueryWrapper<FaceManagement>().lambda()
|
|
|
|
+ .eq(FaceManagement::getUserId, process.getUserId())
|
|
|
|
+ .eq(FaceManagement::getFileId, process.getFacePhoto())
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ faceManagement.setRegisterBase64(null);
|
|
|
|
+ faceManagementService.update(faceManagement);
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|