|
|
@@ -0,0 +1,133 @@
|
|
|
+package com.xjrsoft.module.student.controller;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+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.module.base.entity.BaseSemester;
|
|
|
+import com.xjrsoft.module.student.dto.AddBaseStudentPunishmentInfoDto;
|
|
|
+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.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;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+* @title: 学生处分信息管理
|
|
|
+* @Author dzx
|
|
|
+* @Date: 2023-11-15
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/student" + "/basestudentpunishmentinfo")
|
|
|
+@Api(value = "/student" + "/basestudentpunishmentinfo",tags = "学生处分信息管理代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class BaseStudentPunishmentInfoController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IBaseStudentPunishmentInfoService baseStudentPunishmentInfoService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="学生处分信息管理列表(分页)")
|
|
|
+ @SaCheckPermission("basestudentpunishmentinfo:detail")
|
|
|
+ public RT<PageOutput<BaseStudentPunishmentInfoPageVo>> page(@Valid BaseStudentPunishmentInfoPageDto dto){
|
|
|
+
|
|
|
+ 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())
|
|
|
+ .like(StrUtil.isNotBlank(dto.getArchivesStatus()), BaseStudentSchoolRoll::getArchivesStatus, dto.getArchivesStatus())
|
|
|
+ .like(StrUtil.isNotBlank(dto.getSemesterId()), BaseStudentPunishmentInfo::getBaseSemesterId, dto.getSemesterId())
|
|
|
+ .select(BasePunishmentStudentRelation::getId)
|
|
|
+ .select(BasePunishmentStudentRelation::getStudentId)
|
|
|
+ .select(BasePunishmentStudentRelation::getName)
|
|
|
+ .select(BasePunishmentStudentRelation::getGender)
|
|
|
+ .select(BasePunishmentStudentRelation::getClassName)
|
|
|
+ .select(BasePunishmentStudentRelation::getMajor)
|
|
|
+ .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)
|
|
|
+ .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)
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+ PageOutput<BaseStudentPunishmentInfoPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentPunishmentInfoPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询学生处分信息管理信息")
|
|
|
+ @SaCheckPermission("basestudentpunishmentinfo:detail")
|
|
|
+ public RT<BaseStudentPunishmentInfoVo> info(@RequestParam Long id){
|
|
|
+ BaseStudentPunishmentInfo baseStudentPunishmentInfo = baseStudentPunishmentInfoService.getByIdDeep(id);
|
|
|
+ if (baseStudentPunishmentInfo == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(baseStudentPunishmentInfo, BaseStudentPunishmentInfoVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增学生处分信息管理")
|
|
|
+ @SaCheckPermission("basestudentpunishmentinfo:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddBaseStudentPunishmentInfoDto dto){
|
|
|
+ BaseStudentPunishmentInfo baseStudentPunishmentInfo = BeanUtil.toBean(dto, BaseStudentPunishmentInfo.class);
|
|
|
+ boolean isSuccess = baseStudentPunishmentInfoService.add(baseStudentPunishmentInfo);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改学生处分信息管理")
|
|
|
+ @SaCheckPermission("basestudentpunishmentinfo:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentPunishmentInfoDto dto){
|
|
|
+
|
|
|
+ BaseStudentPunishmentInfo baseStudentPunishmentInfo = BeanUtil.toBean(dto, BaseStudentPunishmentInfo.class);
|
|
|
+ return RT.ok(baseStudentPunishmentInfoService.update(baseStudentPunishmentInfo));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除学生处分信息管理")
|
|
|
+ @SaCheckPermission("basestudentpunishmentinfo:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(baseStudentPunishmentInfoService.delete(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|