|
|
@@ -6,22 +6,31 @@ 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;
|
|
|
@@ -51,11 +60,27 @@ public class StundentFaceProcessController {
|
|
|
@SaCheckPermission("stundentfaceprocess:detail")
|
|
|
public RT<PageOutput<StundentFaceProcessPageVo>> page(@Valid StundentFaceProcessPageDto dto){
|
|
|
|
|
|
- LambdaQueryWrapper<StundentFaceProcess> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper
|
|
|
- .orderByDesc(StundentFaceProcess::getId)
|
|
|
- .select(StundentFaceProcess.class,x -> VoToColumnUtil.fieldsToColumns(StundentFaceProcessPageVo.class).contains(x.getProperty()));
|
|
|
- IPage<StundentFaceProcess> page = stundentFaceProcessService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
+ 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);
|
|
|
}
|