|
@@ -9,7 +9,10 @@ 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.service.IBandingTaskClassStudentService;
|
|
|
+import com.xjrsoft.module.banding.service.IBandingTaskService;
|
|
|
import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
|
|
|
+import com.xjrsoft.module.student.entity.BaseNewStudent;
|
|
|
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -17,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @title: 新生分班任务
|
|
@@ -28,6 +32,8 @@ import java.util.List;
|
|
|
@AllArgsConstructor
|
|
|
public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<BandingTaskClassStudentMapper, BandingTaskClassStudent> implements IBandingTaskClassStudentService {
|
|
|
private final BandingTaskClassMapper taskClassMapper;
|
|
|
+ private final IBandingTaskService bandingTaskService;
|
|
|
+ private final IBaseNewStudentService newStudentService;
|
|
|
@Override
|
|
|
public Boolean add(BandingTaskClassStudent bandingTaskClass) {
|
|
|
bandingTaskClass.setCreateDate(new Date());
|
|
@@ -64,12 +70,32 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
setNewStudentId(newStudentId);
|
|
|
setBandingTaskClassId(dto.getBandingTaskClassId());
|
|
|
setCreateUserId(createUserId);
|
|
|
+ if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
+ setStatus(1);
|
|
|
+ }
|
|
|
}}
|
|
|
);
|
|
|
}
|
|
|
if(!dataList.isEmpty()){
|
|
|
this.saveBatch(dataList);
|
|
|
}
|
|
|
+ if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
+ BandingTaskClass taskClass = taskClassMapper.selectById(dto.getBandingTaskClassId());
|
|
|
+ List<Long> studentIds = dataList.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
|
+ List<BaseNewStudent> list = newStudentService.list(
|
|
|
+ new QueryWrapper<BaseNewStudent>().lambda()
|
|
|
+ .in(BaseNewStudent::getId, studentIds)
|
|
|
+ );
|
|
|
+ List<BaseNewStudent> updateList = new ArrayList<>();
|
|
|
+ for (BaseNewStudent student : list) {
|
|
|
+ student.setStatus(1);
|
|
|
+ updateList.add(student);
|
|
|
+ }
|
|
|
+ if(!updateList.isEmpty()){
|
|
|
+ newStudentService.updateBatchById(updateList);
|
|
|
+ }
|
|
|
+ bandingTaskService.createStudentData(taskClass.getBandingTaskId(), dataList, updateList);
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -111,6 +137,8 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
if(!dataList.isEmpty()){
|
|
|
this.saveBatch(dataList);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|