|
@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
|
|
+import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
@@ -20,7 +22,11 @@ import com.xjrsoft.module.personnel.dto.FaceManagementPageDto;
|
|
|
import com.xjrsoft.module.personnel.dto.UpdateFaceManagementDto;
|
|
import com.xjrsoft.module.personnel.dto.UpdateFaceManagementDto;
|
|
|
import com.xjrsoft.module.personnel.dto.UpdateFaceManagementStatusDto;
|
|
import com.xjrsoft.module.personnel.dto.UpdateFaceManagementStatusDto;
|
|
|
import com.xjrsoft.module.personnel.entity.FaceManagement;
|
|
import com.xjrsoft.module.personnel.entity.FaceManagement;
|
|
|
|
|
+import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
|
|
|
|
|
+import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
|
|
|
import com.xjrsoft.module.personnel.service.IFaceManagementService;
|
|
import com.xjrsoft.module.personnel.service.IFaceManagementService;
|
|
|
|
|
+import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
|
|
|
|
|
+import com.xjrsoft.module.personnel.service.ITeacherFaceProcessService;
|
|
|
import com.xjrsoft.module.personnel.vo.FaceManagementVo;
|
|
import com.xjrsoft.module.personnel.vo.FaceManagementVo;
|
|
|
import com.xjrsoft.module.system.service.ICodeRuleService;
|
|
import com.xjrsoft.module.system.service.ICodeRuleService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -52,6 +58,8 @@ import java.util.Map;
|
|
|
public class FaceManagementController {
|
|
public class FaceManagementController {
|
|
|
private final IFaceManagementService faceManagementService;
|
|
private final IFaceManagementService faceManagementService;
|
|
|
private ICodeRuleService codeRuleService;
|
|
private ICodeRuleService codeRuleService;
|
|
|
|
|
+ private final ITeacherFaceProcessService teacherFaceProcessService;
|
|
|
|
|
+ private final IStundentFaceProcessService stundentFaceProcessService;
|
|
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value = "人脸列表(分页)")
|
|
@ApiOperation(value = "人脸列表(分页)")
|
|
@@ -77,6 +85,7 @@ public class FaceManagementController {
|
|
|
if (faceManagement == null) {
|
|
if (faceManagement == null) {
|
|
|
return RT.error("找不到此数据!");
|
|
return RT.error("找不到此数据!");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
return RT.ok(BeanUtil.toBean(faceManagement, FaceManagementVo.class));
|
|
return RT.ok(BeanUtil.toBean(faceManagement, FaceManagementVo.class));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -84,10 +93,30 @@ public class FaceManagementController {
|
|
|
@ApiOperation(value = "根据当前用户查询人脸信息")
|
|
@ApiOperation(value = "根据当前用户查询人脸信息")
|
|
|
@SaCheckPermission("facemanager:detail")
|
|
@SaCheckPermission("facemanager:detail")
|
|
|
public RT<FaceManagementVo> detail() {
|
|
public RT<FaceManagementVo> detail() {
|
|
|
- FaceManagement faceManagement = faceManagementService.getOneDeep(Wrappers.lambdaQuery(FaceManagement.class).eq(FaceManagement::getUserId, StpUtil.getLoginIdAsLong()));
|
|
|
|
|
|
|
+ FaceManagement faceManagement = faceManagementService.getOneDeep(Wrappers.lambdaQuery(FaceManagement.class).eq(FaceManagement::getDeleteMark, DeleteMark.NODELETE.getCode()).eq(FaceManagement::getUserId, StpUtil.getLoginIdAsLong()));
|
|
|
if (faceManagement == null) {
|
|
if (faceManagement == null) {
|
|
|
return RT.error("找不到此数据!");
|
|
return RT.error("找不到此数据!");
|
|
|
}
|
|
}
|
|
|
|
|
+ faceManagement.setVerifyStatus(1);
|
|
|
|
|
+ if(faceManagement.getUserType()==1) {
|
|
|
|
|
+ // 查询 teacher_face_process 审核通过
|
|
|
|
|
+ MPJLambdaWrapper<TeacherFaceProcess> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(TeacherFaceProcess::getUserId, faceManagement.getUserId())
|
|
|
|
|
+ .eq(TeacherFaceProcess::getFacePhoto, faceManagement.getFileId());
|
|
|
|
|
+ if (teacherFaceProcessService.count(queryWrapper) > 0) {
|
|
|
|
|
+ faceManagement.setVerifyStatus(2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(faceManagement.getUserType()==2){
|
|
|
|
|
+ // 查询 teacher_face_process 审核通过
|
|
|
|
|
+ MPJLambdaWrapper<StundentFaceProcess> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(StundentFaceProcess::getUserId, faceManagement.getUserId())
|
|
|
|
|
+ .eq(StundentFaceProcess::getFacePhoto, faceManagement.getFileId());
|
|
|
|
|
+ if (stundentFaceProcessService.count(queryWrapper) > 0) {
|
|
|
|
|
+ faceManagement.setVerifyStatus(2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return RT.ok(BeanUtil.toBean(faceManagement, FaceManagementVo.class));
|
|
return RT.ok(BeanUtil.toBean(faceManagement, FaceManagementVo.class));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -138,6 +167,13 @@ public class FaceManagementController {
|
|
|
return RT.ok(faceManagementService.delete(ids));
|
|
return RT.ok(faceManagementService.delete(ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @DeleteMapping("/delete")
|
|
|
|
|
+ @ApiOperation(value = "删除")
|
|
|
|
|
+ @SaCheckPermission("facemanager:delete-current")
|
|
|
|
|
+ public RT<Boolean> delete() {
|
|
|
|
|
+ return RT.ok(faceManagementService.remove(Wrappers.<FaceManagement>query().lambda().eq(FaceManagement::getUserId,StpUtil.getLoginIdAsLong())));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 图片处理
|
|
// 图片处理
|
|
|
public String ImageHandler(@NotNull MultipartFile file) throws IOException {
|
|
public String ImageHandler(@NotNull MultipartFile file) throws IOException {
|
|
|
String filename = file.getOriginalFilename();
|
|
String filename = file.getOriginalFilename();
|