Explorar o código

学生实习记录

dzx hai 5 meses
pai
achega
a301d7d608

+ 2 - 5
src/main/java/com/xjrsoft/module/internship/controller/InternshipPlanManageController.java

@@ -89,11 +89,8 @@ public class InternshipPlanManageController {
     @SaCheckPermission("internshipplanmanage:detail")
     @XjrLog(value = "根据id查询实习计划管理表信息")
     public RT<InternshipPlanManageVo> info(@RequestParam Long id){
-        InternshipPlanManage internshipPlanManage = internshipPlanManageService.getByIdDeep(id);
-        if (internshipPlanManage == null) {
-           return RT.error("找不到此数据!");
-        }
-        return RT.ok(BeanUtil.toBean(internshipPlanManage, InternshipPlanManageVo.class));
+        InternshipPlanManageVo internshipPlanManage = internshipPlanManageService.getInfoById(id);
+        return RT.ok(internshipPlanManage);
     }
 
 

+ 3 - 0
src/main/java/com/xjrsoft/module/internship/service/IInternshipPlanManageService.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.internship.dto.AddInternshipPlanManageDto;
 import com.xjrsoft.module.internship.dto.InternshipPlanManagePageDto;
 import com.xjrsoft.module.internship.entity.InternshipPlanManage;
 import com.xjrsoft.module.internship.vo.InternshipPlanManagePageVo;
+import com.xjrsoft.module.internship.vo.InternshipPlanManageVo;
 
 import java.util.List;
 
@@ -45,4 +46,6 @@ public interface IInternshipPlanManageService extends MPJBaseService<InternshipP
 
     Page<InternshipPlanManagePageVo> getPage(Page<InternshipPlanManagePageVo> page, InternshipPlanManagePageDto dto);
 
+    InternshipPlanManageVo getInfoById(Long id);
+
 }

+ 25 - 0
src/main/java/com/xjrsoft/module/internship/service/impl/InternshipPlanManageServiceImpl.java

@@ -1,10 +1,13 @@
 package com.xjrsoft.module.internship.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.mapper.BaseSemesterMapper;
 import com.xjrsoft.module.internship.dto.AddInternshipPlanManageDto;
@@ -19,6 +22,7 @@ import com.xjrsoft.module.internship.mapper.InternshipPlanTeacherMapper;
 import com.xjrsoft.module.internship.mapper.StudentInternshipAloneApplyMapper;
 import com.xjrsoft.module.internship.service.IInternshipPlanManageService;
 import com.xjrsoft.module.internship.vo.InternshipPlanManagePageVo;
+import com.xjrsoft.module.internship.vo.InternshipPlanManageVo;
 import com.xjrsoft.module.veb.entity.CompanyCoop;
 import com.xjrsoft.module.veb.entity.TrainingOutside;
 import com.xjrsoft.module.veb.entity.TrainingSchool;
@@ -136,4 +140,25 @@ public class InternshipPlanManageServiceImpl extends MPJBaseServiceImpl<Internsh
         }
         return mapperPage;
     }
+
+    @Override
+    public InternshipPlanManageVo getInfoById(Long id) {
+        InternshipPlanManage internshipPlanManage = this.getById(id);
+        if (internshipPlanManage == null) {
+            throw new MyException("找不到此数据!");
+        }
+        InternshipPlanManageVo manageVo = BeanUtil.toBean(internshipPlanManage, InternshipPlanManageVo.class);
+
+        StudentInternshipAloneApply aloneApply = internshipAloneApplyMapper.selectOne(
+                new QueryWrapper<StudentInternshipAloneApply>().lambda()
+                        .eq(StudentInternshipAloneApply::getStudentUserId, StpUtil.getLoginIdAsLong())
+                        .eq(StudentInternshipAloneApply::getInternshipPlanManageId, id)
+        );
+        if(aloneApply != null){
+            manageVo.setIsInternshipAlone(1);
+        }else{
+            manageVo.setIsInternshipAlone(0);
+        }
+        return manageVo;
+    }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/internship/vo/InternshipPlanManageVo.java

@@ -151,4 +151,7 @@ public class InternshipPlanManageVo {
     @ApiModelProperty("合作企业id")
     private String internshipUnitId;
 
+    @ApiModelProperty("是否自主实习(1:是 0:否)")
+    private Integer isInternshipAlone;
+
 }