|
@@ -4,9 +4,12 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.xjrsoft.module.banding.dto.ChangeClassDto;
|
|
import com.xjrsoft.module.banding.dto.ChangeClassDto;
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTaskClass;
|
|
|
import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
|
|
import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
|
|
|
|
|
+import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
|
|
|
import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper;
|
|
import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper;
|
|
|
import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
|
|
import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
|
|
|
|
|
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -24,7 +27,7 @@ import java.util.List;
|
|
|
@Service
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
|
public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<BandingTaskClassStudentMapper, BandingTaskClassStudent> implements IBandingTaskClassStudentService {
|
|
public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<BandingTaskClassStudentMapper, BandingTaskClassStudent> implements IBandingTaskClassStudentService {
|
|
|
-
|
|
|
|
|
|
|
+ private final BandingTaskClassMapper taskClassMapper;
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean add(BandingTaskClassStudent bandingTaskClass) {
|
|
public Boolean add(BandingTaskClassStudent bandingTaskClass) {
|
|
|
bandingTaskClass.setCreateDate(new Date());
|
|
bandingTaskClass.setCreateDate(new Date());
|
|
@@ -70,4 +73,45 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean removeStudent(ChangeClassDto dto) {
|
|
|
|
|
+ this.baseMapper.delete(
|
|
|
|
|
+ new QueryWrapper<BandingTaskClassStudent>().lambda()
|
|
|
|
|
+ .in(BandingTaskClassStudent::getNewStudentId, dto.getNewStudentIds())
|
|
|
|
|
+ .eq(BandingTaskClassStudent::getBandingTaskClassId, dto.getBandingTaskClassId())
|
|
|
|
|
+ );
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<BaseNewStudentPageDto> satisfyStudent(Long bandingTaskClassId) {
|
|
|
|
|
+ return this.baseMapper.satisfyStudent(bandingTaskClassId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<BaseNewStudentPageDto> surplusStudent(Long bandingTaskClassId) {
|
|
|
|
|
+ BandingTaskClass taskClass = taskClassMapper.selectById(bandingTaskClassId);
|
|
|
|
|
+ return this.baseMapper.surplusStudent(taskClass);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean insertStudent(ChangeClassDto dto) {
|
|
|
|
|
+ List<BandingTaskClassStudent> dataList = new ArrayList<>();
|
|
|
|
|
+ Date createDate = new Date();
|
|
|
|
|
+ for (Long newStudentId : dto.getNewStudentIds()) {
|
|
|
|
|
+ dataList.add(
|
|
|
|
|
+ new BandingTaskClassStudent(){{
|
|
|
|
|
+ setNewStudentId(newStudentId);
|
|
|
|
|
+ setCreateDate(createDate);
|
|
|
|
|
+ setStatus(0);
|
|
|
|
|
+ setBandingTaskClassId(dto.getBandingTaskClassId());
|
|
|
|
|
+ }}
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!dataList.isEmpty()){
|
|
|
|
|
+ this.saveBatch(dataList);
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|