|
@@ -2,21 +2,18 @@ package com.xjrsoft.module.internship.controller;
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xjrsoft.common.annotation.XjrLog;
|
|
import com.xjrsoft.common.annotation.XjrLog;
|
|
|
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;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
-import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
|
|
import com.xjrsoft.module.internship.dto.AddInternshipPlanManageParticipantDto;
|
|
import com.xjrsoft.module.internship.dto.AddInternshipPlanManageParticipantDto;
|
|
|
import com.xjrsoft.module.internship.dto.InternshipPlanManageParticipantPageDto;
|
|
import com.xjrsoft.module.internship.dto.InternshipPlanManageParticipantPageDto;
|
|
|
import com.xjrsoft.module.internship.dto.UpdateInternshipPlanManageParticipantDto;
|
|
import com.xjrsoft.module.internship.dto.UpdateInternshipPlanManageParticipantDto;
|
|
|
import com.xjrsoft.module.internship.entity.InternshipPlanManageParticipant;
|
|
import com.xjrsoft.module.internship.entity.InternshipPlanManageParticipant;
|
|
|
import com.xjrsoft.module.internship.service.IInternshipPlanManageParticipantService;
|
|
import com.xjrsoft.module.internship.service.IInternshipPlanManageParticipantService;
|
|
|
-import com.xjrsoft.module.internship.vo.InternshipPlanManageParticipantPageVo;
|
|
|
|
|
import com.xjrsoft.module.internship.vo.InternshipPlanManageParticipantVo;
|
|
import com.xjrsoft.module.internship.vo.InternshipPlanManageParticipantVo;
|
|
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
@@ -47,33 +44,23 @@ public class InternshipPlanManageParticipantController {
|
|
|
|
|
|
|
|
private final IInternshipPlanManageParticipantService internshipPlanManageParticipantService;
|
|
private final IInternshipPlanManageParticipantService internshipPlanManageParticipantService;
|
|
|
|
|
|
|
|
- @GetMapping(value = "/page")
|
|
|
|
|
|
|
+ @GetMapping(value = "/team-student-page")
|
|
|
@ApiOperation(value="实习计划参与人表列表(分页)")
|
|
@ApiOperation(value="实习计划参与人表列表(分页)")
|
|
|
@SaCheckPermission("internshipplanmanageparticipant:detail")
|
|
@SaCheckPermission("internshipplanmanageparticipant:detail")
|
|
|
@XjrLog(value = "实习计划参与人表列表(分页)")
|
|
@XjrLog(value = "实习计划参与人表列表(分页)")
|
|
|
- public RT<PageOutput<InternshipPlanManageParticipantPageVo>> page(@Valid InternshipPlanManageParticipantPageDto dto){
|
|
|
|
|
-
|
|
|
|
|
- MPJLambdaWrapper<InternshipPlanManageParticipant> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
|
|
- queryWrapper
|
|
|
|
|
- .orderByDesc(InternshipPlanManageParticipant::getId)
|
|
|
|
|
- .select(InternshipPlanManageParticipant.class,x -> VoToColumnUtil.fieldsToColumns(InternshipPlanManageParticipantPageVo.class).contains(x.getProperty()));
|
|
|
|
|
- IPage<InternshipPlanManageParticipant> page = internshipPlanManageParticipantService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
|
|
- PageOutput<InternshipPlanManageParticipantPageVo> pageOutput = ConventPage.getPageOutput(page, InternshipPlanManageParticipantPageVo.class);
|
|
|
|
|
|
|
+ public RT<PageOutput<BaseStudentInfoPageVo>> page(@Valid InternshipPlanManageParticipantPageDto dto){
|
|
|
|
|
+ Page<BaseStudentInfoPageVo> teamStudentPage = internshipPlanManageParticipantService.getTeamStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
|
|
+ PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(teamStudentPage, BaseStudentInfoPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping(value = "/student-page")
|
|
|
|
|
|
|
+ @GetMapping(value = "/choose-student-page")
|
|
|
@ApiOperation(value="实习学生选择列表(分页)")
|
|
@ApiOperation(value="实习学生选择列表(分页)")
|
|
|
@SaCheckPermission("internshipplanmanageparticipant:detail")
|
|
@SaCheckPermission("internshipplanmanageparticipant:detail")
|
|
|
@XjrLog(value = "实习学生选择列表(分页)")
|
|
@XjrLog(value = "实习学生选择列表(分页)")
|
|
|
- public RT<PageOutput<InternshipPlanManageParticipantPageVo>> studentPage(@Valid InternshipPlanManageParticipantPageDto dto){
|
|
|
|
|
-
|
|
|
|
|
- MPJLambdaWrapper<InternshipPlanManageParticipant> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
|
|
- queryWrapper
|
|
|
|
|
- .orderByDesc(InternshipPlanManageParticipant::getId)
|
|
|
|
|
- .select(InternshipPlanManageParticipant.class,x -> VoToColumnUtil.fieldsToColumns(InternshipPlanManageParticipantPageVo.class).contains(x.getProperty()));
|
|
|
|
|
- IPage<InternshipPlanManageParticipant> page = internshipPlanManageParticipantService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
|
|
- PageOutput<InternshipPlanManageParticipantPageVo> pageOutput = ConventPage.getPageOutput(page, InternshipPlanManageParticipantPageVo.class);
|
|
|
|
|
|
|
+ public RT<PageOutput<BaseStudentInfoPageVo>> studentPage(@Valid InternshipPlanManageParticipantPageDto dto){
|
|
|
|
|
+ Page<BaseStudentInfoPageVo> page = internshipPlanManageParticipantService.getChooseStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
|
|
+ PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentInfoPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -95,9 +82,17 @@ public class InternshipPlanManageParticipantController {
|
|
|
@SaCheckPermission("internshipplanmanageparticipant:add")
|
|
@SaCheckPermission("internshipplanmanageparticipant:add")
|
|
|
@XjrLog(value = "新增实习计划参与人表")
|
|
@XjrLog(value = "新增实习计划参与人表")
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddInternshipPlanManageParticipantDto dto){
|
|
public RT<Boolean> add(@Valid @RequestBody AddInternshipPlanManageParticipantDto dto){
|
|
|
- InternshipPlanManageParticipant internshipPlanManageParticipant = BeanUtil.toBean(dto, InternshipPlanManageParticipant.class);
|
|
|
|
|
- boolean isSuccess = internshipPlanManageParticipantService.save(internshipPlanManageParticipant);
|
|
|
|
|
- return RT.ok(isSuccess);
|
|
|
|
|
|
|
+ boolean isSuccess = internshipPlanManageParticipantService.add(dto);
|
|
|
|
|
+ return RT.ok(isSuccess);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping(value = "/remove")
|
|
|
|
|
+ @ApiOperation(value = "移除实习参与学生")
|
|
|
|
|
+ @SaCheckPermission("internshipplanmanageparticipant:remove")
|
|
|
|
|
+ @XjrLog(value = "移除实习参与学生")
|
|
|
|
|
+ public RT<Boolean> remove(@Valid @RequestBody AddInternshipPlanManageParticipantDto dto){
|
|
|
|
|
+ boolean isSuccess = internshipPlanManageParticipantService.removeStudent(dto);
|
|
|
|
|
+ return RT.ok(isSuccess);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PutMapping
|
|
@PutMapping
|
|
@@ -117,7 +112,6 @@ public class InternshipPlanManageParticipantController {
|
|
|
@XjrLog(value = "删除实习计划参与人表")
|
|
@XjrLog(value = "删除实习计划参与人表")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
return RT.ok(internshipPlanManageParticipantService.removeBatchByIds(ids));
|
|
return RT.ok(internshipPlanManageParticipantService.removeBatchByIds(ids));
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|