|
|
@@ -0,0 +1,127 @@
|
|
|
+package com.xjrsoft.module.personnel.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
+import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
+import com.xjrsoft.module.personnel.dto.AddStundentFaceProcessDto;
|
|
|
+import com.xjrsoft.module.personnel.dto.UpdateStundentFaceProcessDto;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+
|
|
|
+import com.xjrsoft.module.personnel.dto.StundentFaceProcessPageDto;
|
|
|
+import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
|
|
|
+import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
|
|
|
+import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
|
|
|
+import com.xjrsoft.module.personnel.vo.StundentFaceProcessPageVo;
|
|
|
+
|
|
|
+import com.xjrsoft.module.personnel.vo.StundentFaceProcessVo;
|
|
|
+import com.xjrsoft.module.personnel.vo.TeacherFaceProcessPageVo;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
+import com.xjrsoft.module.system.entity.File;
|
|
|
+import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+* @title: 学生人脸信息审核
|
|
|
+* @Author dzx
|
|
|
+* @Date: 2024-05-10
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/personnel" + "/stundentFaceProcess")
|
|
|
+@Api(value = "/personnel" + "/stundentFaceProcess",tags = "学生人脸信息审核代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class StundentFaceProcessController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IStundentFaceProcessService stundentFaceProcessService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="学生人脸信息审核列表(分页)")
|
|
|
+ @SaCheckPermission("stundentfaceprocess:detail")
|
|
|
+ public RT<PageOutput<StundentFaceProcessPageVo>> page(@Valid StundentFaceProcessPageDto dto){
|
|
|
+
|
|
|
+ IPage<StundentFaceProcessPageVo> page=stundentFaceProcessService.selectJoinListPage(ConventPage.getPage(dto),StundentFaceProcessPageVo.class,
|
|
|
+ MPJWrappers.<StundentFaceProcess>lambdaJoin()
|
|
|
+ .orderByDesc(StundentFaceProcess::getId)
|
|
|
+ .disableSubLogicDel()
|
|
|
+ .like(StrUtil.isNotBlank(dto.getName()), XjrUser::getName,dto.getName())
|
|
|
+ .eq(StrUtil.isNotBlank(dto.getStduyStatus()),BaseStudentSchoolRoll::getStduyStatus,dto.getStduyStatus())
|
|
|
+ .like(StrUtil.isNotBlank(dto.getMobile()),XjrUser::getMobile,dto.getMobile())
|
|
|
+ .like(StrUtil.isNotBlank(dto.getStudentId()),BaseStudent::getStudentId,dto.getStudentId())
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getClassId())&&dto.getClassId()!=0,StundentFaceProcess::getClassId,dto.getClassId())
|
|
|
+ .select(StundentFaceProcess::getId,StundentFaceProcess::getUserId,StundentFaceProcess::getClassId,StundentFaceProcess::getFacePhoto)
|
|
|
+ .innerJoin(XjrUser.class,XjrUser::getId, StundentFaceProcess::getUserId)
|
|
|
+ .leftJoin(File.class,File::getFolderId,StundentFaceProcess::getFacePhoto)
|
|
|
+ .leftJoin(DictionaryDetail.class,DictionaryDetail::getCode,StundentFaceProcess::getGender, ext->ext.selectAs(DictionaryDetail::getName, StundentFaceProcessPageVo::getGender))
|
|
|
+ .leftJoin(BaseStudentSchoolRoll.class,BaseStudentSchoolRoll::getUserId,StundentFaceProcess::getUserId)
|
|
|
+ .leftJoin(DictionaryDetail.class,DictionaryDetail::getCode,BaseStudentSchoolRoll::getStduyStatus, ext->ext.selectAs(DictionaryDetail::getName, StundentFaceProcessPageVo::getStduyStatus))
|
|
|
+ .leftJoin(BaseClass.class,BaseClass::getId,BaseStudentSchoolRoll::getClassId,ext->ext.selectAs(BaseClass::getName,StundentFaceProcessPageVo::getClassCn))
|
|
|
+ .leftJoin(XjrUser.class,XjrUser::getId,StundentFaceProcess::getTeacherId, ext->ext.selectAs(XjrUser::getName, StundentFaceProcessPageVo::getTeacherCn))
|
|
|
+ .selectAs(XjrUser::getName,StundentFaceProcess::getName)
|
|
|
+ .select("t2.file_url AS face_photo_url,t1.user_name AS user_name,t1.mobile")
|
|
|
+ .leftJoin(BaseStudent.class,BaseStudent::getUserId,StundentFaceProcess::getUserId, ext->ext.selectAs(BaseStudent::getStudentId, StundentFaceProcessPageVo::getStudentId))
|
|
|
+ );
|
|
|
+ PageOutput<StundentFaceProcessPageVo> pageOutput = ConventPage.getPageOutput(page, StundentFaceProcessPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询学生人脸信息审核信息")
|
|
|
+ @SaCheckPermission("stundentfaceprocess:detail")
|
|
|
+ public RT<StundentFaceProcessVo> info(@RequestParam Long id){
|
|
|
+ StundentFaceProcess stundentFaceProcess = stundentFaceProcessService.getById(id);
|
|
|
+ if (stundentFaceProcess == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(stundentFaceProcess, StundentFaceProcessVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增学生人脸信息审核")
|
|
|
+ @SaCheckPermission("stundentfaceprocess:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddStundentFaceProcessDto dto){
|
|
|
+ StundentFaceProcess stundentFaceProcess = BeanUtil.toBean(dto, StundentFaceProcess.class);
|
|
|
+ boolean isSuccess = stundentFaceProcessService.save(stundentFaceProcess);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改学生人脸信息审核")
|
|
|
+ @SaCheckPermission("stundentfaceprocess:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateStundentFaceProcessDto dto){
|
|
|
+
|
|
|
+ StundentFaceProcess stundentFaceProcess = BeanUtil.toBean(dto, StundentFaceProcess.class);
|
|
|
+ return RT.ok(stundentFaceProcessService.updateById(stundentFaceProcess));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除学生人脸信息审核")
|
|
|
+ @SaCheckPermission("stundentfaceprocess:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(stundentFaceProcessService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|