|
|
@@ -1,6 +1,7 @@
|
|
|
package com.xjrsoft.module.internship.service.impl;
|
|
|
|
|
|
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;
|
|
|
@@ -11,9 +12,11 @@ import com.xjrsoft.module.internship.dto.InternshipPlanManagePageDto;
|
|
|
import com.xjrsoft.module.internship.entity.InternshipPlanClass;
|
|
|
import com.xjrsoft.module.internship.entity.InternshipPlanManage;
|
|
|
import com.xjrsoft.module.internship.entity.InternshipPlanTeacher;
|
|
|
+import com.xjrsoft.module.internship.entity.StudentInternshipAloneApply;
|
|
|
import com.xjrsoft.module.internship.mapper.InternshipPlanClassMapper;
|
|
|
import com.xjrsoft.module.internship.mapper.InternshipPlanManageMapper;
|
|
|
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.veb.entity.CompanyCoop;
|
|
|
@@ -27,6 +30,8 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @title: 实习计划管理表
|
|
|
@@ -46,6 +51,7 @@ public class InternshipPlanManageServiceImpl extends MPJBaseServiceImpl<Internsh
|
|
|
private final TrainingOutsideMapper trainingOutsideMapper;
|
|
|
private final TrainingSchoolMapper trainingSchoolMapper;
|
|
|
private final CompanyCoopMapper companyCoopMapper;
|
|
|
+ private final StudentInternshipAloneApplyMapper internshipAloneApplyMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -113,6 +119,21 @@ public class InternshipPlanManageServiceImpl extends MPJBaseServiceImpl<Internsh
|
|
|
|
|
|
@Override
|
|
|
public Page<InternshipPlanManagePageVo> getPage(Page<InternshipPlanManagePageVo> page, InternshipPlanManagePageDto dto) {
|
|
|
- return internshipPlanManageMapper.getPage(page, dto);
|
|
|
+ Page<InternshipPlanManagePageVo> mapperPage = internshipPlanManageMapper.getPage(page, dto);
|
|
|
+ if(dto.getStudentUserId() != null){
|
|
|
+ List<StudentInternshipAloneApply> aloneApplyList = internshipAloneApplyMapper.selectList(
|
|
|
+ new QueryWrapper<StudentInternshipAloneApply>().lambda()
|
|
|
+ .eq(StudentInternshipAloneApply::getStudentUserId, dto.getStudentUserId())
|
|
|
+ );
|
|
|
+ Set<Long> collect = aloneApplyList.stream().map(StudentInternshipAloneApply::getInternshipPlanManageId).collect(Collectors.toSet());
|
|
|
+ for (InternshipPlanManagePageVo record : mapperPage.getRecords()) {
|
|
|
+ if(collect.contains(Long.parseLong(record.getId()))){
|
|
|
+ record.setIsInternshipAlone(1);
|
|
|
+ }else {
|
|
|
+ record.setIsInternshipAlone(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mapperPage;
|
|
|
}
|
|
|
}
|