|
|
@@ -0,0 +1,117 @@
|
|
|
+package com.xjrsoft.module.internship.controller;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.xjrsoft.common.annotation.XjrLog;
|
|
|
+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.internship.dto.AddStudentInternshipRecordDto;
|
|
|
+import com.xjrsoft.module.internship.dto.StudentInternshipRecordPageDto;
|
|
|
+import com.xjrsoft.module.internship.dto.UpdateStudentInternshipRecordDto;
|
|
|
+import com.xjrsoft.module.internship.entity.StudentInternshipRecord;
|
|
|
+import com.xjrsoft.module.internship.service.IStudentInternshipRecordService;
|
|
|
+import com.xjrsoft.module.internship.vo.StudentInternshipRecordPageVo;
|
|
|
+import com.xjrsoft.module.internship.vo.StudentInternshipRecordVo;
|
|
|
+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: 2025-07-01
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/internship" + "/studentInternshipRecord")
|
|
|
+@Api(value = "/internship" + "/studentInternshipRecord",tags = "学生实习记录表代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class StudentInternshipRecordController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IStudentInternshipRecordService studentInternshipRecordService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="学生实习记录表列表(分页)")
|
|
|
+ @SaCheckPermission("studentinternshiprecord:detail")
|
|
|
+ @XjrLog(value = "学生实习记录表列表(分页)")
|
|
|
+ public RT<PageOutput<StudentInternshipRecordPageVo>> page(@Valid StudentInternshipRecordPageDto dto){
|
|
|
+
|
|
|
+ LambdaQueryWrapper<StudentInternshipRecord> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .orderByDesc(StudentInternshipRecord::getId)
|
|
|
+ .select(StudentInternshipRecord.class,x -> VoToColumnUtil.fieldsToColumns(StudentInternshipRecordPageVo.class).contains(x.getProperty()));
|
|
|
+ IPage<StudentInternshipRecord> page = studentInternshipRecordService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
+ PageOutput<StudentInternshipRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentInternshipRecordPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询学生实习记录表信息")
|
|
|
+ @SaCheckPermission("studentinternshiprecord:detail")
|
|
|
+ @XjrLog(value = "根据id查询学生实习记录表信息")
|
|
|
+ public RT<StudentInternshipRecordVo> info(@RequestParam Long id){
|
|
|
+ StudentInternshipRecord studentInternshipRecord = studentInternshipRecordService.getById(id);
|
|
|
+ if (studentInternshipRecord == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(studentInternshipRecord, StudentInternshipRecordVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增学生实习记录表")
|
|
|
+ @SaCheckPermission("studentinternshiprecord:add")
|
|
|
+ @XjrLog(value = "新增学生实习记录表")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddStudentInternshipRecordDto dto){
|
|
|
+ StudentInternshipRecord studentInternshipRecord = BeanUtil.toBean(dto, StudentInternshipRecord.class);
|
|
|
+ boolean isSuccess = studentInternshipRecordService.save(studentInternshipRecord);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改学生实习记录表")
|
|
|
+ @SaCheckPermission("studentinternshiprecord:edit")
|
|
|
+ @XjrLog(value = "修改学生实习记录表")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateStudentInternshipRecordDto dto){
|
|
|
+
|
|
|
+ StudentInternshipRecord studentInternshipRecord = BeanUtil.toBean(dto, StudentInternshipRecord.class);
|
|
|
+ return RT.ok(studentInternshipRecordService.updateById(studentInternshipRecord));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除学生实习记录表")
|
|
|
+ @SaCheckPermission("studentinternshiprecord:delete")
|
|
|
+ @XjrLog(value = "删除学生实习记录表")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(studentInternshipRecordService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "alone-material-submit")
|
|
|
+ @ApiOperation(value = "自主实习材料提交")
|
|
|
+ @SaCheckPermission("studentinternshiprecord:add")
|
|
|
+ @XjrLog(value = "自主实习材料提交")
|
|
|
+ public RT<Boolean> aloneMaterialSubmit(@Valid @RequestBody AddStudentInternshipRecordDto dto){
|
|
|
+ StudentInternshipRecord studentInternshipRecord = BeanUtil.toBean(dto, StudentInternshipRecord.class);
|
|
|
+ boolean isSuccess = studentInternshipRecordService.save(studentInternshipRecord);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|