|
@@ -4,11 +4,13 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
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.github.yulichang.toolkit.MPJWrappers;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseSemester;
|
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentPunishmentInfoDto;
|
|
@@ -16,13 +18,12 @@ import com.xjrsoft.module.student.dto.BaseStudentPunishmentInfoPageDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentPunishmentInfoDto;
|
|
|
import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
|
|
|
import com.xjrsoft.module.student.entity.BasePunishmentType;
|
|
|
-import com.xjrsoft.module.student.entity.BaseStudentCadre;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentPunishmentInfo;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
+import com.xjrsoft.module.student.mapper.BasePunishmentStudentRelationMapper;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentPunishmentInfoService;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoPageVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoVo;
|
|
|
-import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -52,6 +53,7 @@ public class BaseStudentPunishmentInfoController {
|
|
|
|
|
|
|
|
|
private final IBaseStudentPunishmentInfoService baseStudentPunishmentInfoService;
|
|
|
+ private final BasePunishmentStudentRelationMapper basePunishmentStudentRelationMapper;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="学生处分信息管理列表(分页)")
|
|
@@ -60,42 +62,24 @@ public class BaseStudentPunishmentInfoController {
|
|
|
|
|
|
IPage<BaseStudentPunishmentInfoPageVo> page = baseStudentPunishmentInfoService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentPunishmentInfoPageVo.class,
|
|
|
MPJWrappers.<BaseStudentPunishmentInfo>lambdaJoin()
|
|
|
- .like(StrUtil.isNotBlank(dto.getUserName()), BasePunishmentStudentRelation::getName, dto.getUserName())
|
|
|
- .like(StrUtil.isNotBlank(dto.getStudentId()), BasePunishmentStudentRelation::getStudentId, dto.getStudentId())
|
|
|
- .like(StrUtil.isNotBlank(dto.getCredentialNumber()), XjrUser::getCredentialNumber, dto.getCredentialNumber())
|
|
|
.eq(StrUtil.isNotBlank(dto.getArchivesStatus()), BaseStudentSchoolRoll::getArchivesStatus, dto.getArchivesStatus())
|
|
|
.eq(StrUtil.isNotBlank(dto.getSemesterId()), BaseStudentPunishmentInfo::getBaseSemesterId, dto.getSemesterId())
|
|
|
.eq(ObjectUtil.isNotNull(dto.getClassId()), BaseStudentPunishmentInfo::getClassId, dto.getClassId())
|
|
|
.eq(ObjectUtil.isNotNull(dto.getGradeId()), BaseStudentSchoolRoll::getGradeId, dto.getGradeId())
|
|
|
- .eq(ObjectUtil.isNotNull(dto.getAdjustType()), BasePunishmentStudentRelation::getAdjustType, dto.getAdjustType())
|
|
|
- .eq(ObjectUtil.isNotNull(dto.getIsPublicity()), BaseStudentPunishmentInfo::getIsPublicity, dto.getIsPublicity())
|
|
|
+ .eq(BaseStudentPunishmentInfo::getStatus, 1)
|
|
|
.in(ObjectUtil.isNotNull(dto.getOrgIds()), BaseClass::getOrgId, dto.getOrgIds())
|
|
|
.between(ObjectUtil.isNotNull(dto.getStartTimeStart()) && ObjectUtil.isNotNull(dto.getStartTimeEnd()), BaseStudentPunishmentInfo::getStartTime,dto.getStartTimeStart(),dto.getStartTimeEnd())
|
|
|
.between(ObjectUtil.isNotNull(dto.getEndTimeStart()) && ObjectUtil.isNotNull(dto.getEndTimeEnd()), BaseStudentPunishmentInfo::getEndTime,dto.getEndTimeStart(),dto.getEndTimeEnd())
|
|
|
- .between(ObjectUtil.isNotNull(dto.getAdjustDateStart()) && ObjectUtil.isNotNull(dto.getAdjustDateEnd()), BasePunishmentStudentRelation::getAdjustDate,dto.getAdjustDateStart(),dto.getAdjustDateEnd())
|
|
|
- .between(ObjectUtil.isNotNull(dto.getModifyDateStart()) && ObjectUtil.isNotNull(dto.getModifyDateEnd()), BasePunishmentStudentRelation::getModifyDate,dto.getModifyDateStart(),dto.getModifyDateEnd())
|
|
|
- .select(BasePunishmentStudentRelation::getId)
|
|
|
- .select(BasePunishmentStudentRelation::getStudentId)
|
|
|
- .select(BasePunishmentStudentRelation::getName)
|
|
|
- .select(BasePunishmentStudentRelation::getGender)
|
|
|
- .select(BasePunishmentStudentRelation::getClassName)
|
|
|
- .select(BasePunishmentStudentRelation::getMajor)
|
|
|
+ .select(BaseStudentPunishmentInfo::getId)
|
|
|
.selectAs(BaseSemester::getName, BaseStudentPunishmentInfoPageVo::getSemesterName)
|
|
|
.select(BasePunishmentType::getPunishmentType)
|
|
|
.select(BaseStudentPunishmentInfo::getStartTime)
|
|
|
.select(BaseStudentPunishmentInfo::getEndTime)
|
|
|
.select(BaseStudentPunishmentInfo::getIsPublicity)
|
|
|
.select(BaseStudentPunishmentInfo::getReason)
|
|
|
- .select(BasePunishmentStudentRelation::getAdjustType)
|
|
|
- .select(BasePunishmentStudentRelation::getAdjustDate)
|
|
|
- .select(BasePunishmentStudentRelation::getModifyDate)
|
|
|
- .orderByDesc(BaseStudentCadre::getId)
|
|
|
- .innerJoin(BasePunishmentStudentRelation.class, BasePunishmentStudentRelation::getPunishmentInfoId, BaseStudentPunishmentInfo::getId)
|
|
|
+ .orderByDesc(BaseStudentPunishmentInfo::getId)
|
|
|
.innerJoin(BasePunishmentType.class, BasePunishmentType::getId, BaseStudentPunishmentInfo::getPunishmentTypeId)
|
|
|
- .innerJoin(XjrUser.class, XjrUser::getId, BasePunishmentStudentRelation::getUserId)
|
|
|
.innerJoin(BaseSemester.class, BaseSemester::getId, BaseStudentPunishmentInfo::getBaseSemesterId)
|
|
|
- .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BasePunishmentStudentRelation::getUserId)
|
|
|
- .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentPunishmentInfo::getClassId)
|
|
|
);
|
|
|
|
|
|
|
|
@@ -111,6 +95,16 @@ public class BaseStudentPunishmentInfoController {
|
|
|
if (baseStudentPunishmentInfo == null) {
|
|
|
return RT.error("找不到此数据!");
|
|
|
}
|
|
|
+
|
|
|
+ //查询班级
|
|
|
+ LambdaQueryWrapper<BasePunishmentStudentRelation> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .eq(BasePunishmentStudentRelation::getPunishmentInfoId, id)
|
|
|
+ .select(BasePunishmentStudentRelation.class, x -> VoToColumnUtil.fieldsToColumns(BasePunishmentStudentRelation.class).contains(x.getProperty()));
|
|
|
+ List<BasePunishmentStudentRelation> studentRelationList = basePunishmentStudentRelationMapper.selectList(queryWrapper);
|
|
|
+
|
|
|
+ baseStudentPunishmentInfo.setBasePunishmentStudentRelationList(studentRelationList);
|
|
|
+
|
|
|
return RT.ok(BeanUtil.toBean(baseStudentPunishmentInfo, BaseStudentPunishmentInfoVo.class));
|
|
|
}
|
|
|
|