|
@@ -117,36 +117,36 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
.in(BandingTaskClassStudent::getNewStudentId, dto.getNewStudentIds())
|
|
|
);
|
|
|
|
|
|
- BaseClass aClass = classService.getById(dto.getBandingTaskClassId());
|
|
|
+ List<BaseNewStudent> list = newStudentService.list(
|
|
|
+ new QueryWrapper<BaseNewStudent>().lambda()
|
|
|
+ .in(BaseNewStudent::getId, dto.getNewStudentIds())
|
|
|
+ );
|
|
|
|
|
|
List<BandingTaskClassStudent> dataList = new ArrayList<>();
|
|
|
long createUserId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
|
- for (Long newStudentId : dto.getNewStudentIds()) {
|
|
|
- dataList.add(
|
|
|
- new BandingTaskClassStudent(){{
|
|
|
- setCreateDate(new Date());
|
|
|
- setNewStudentId(newStudentId);
|
|
|
- setBandingTaskClassId(dto.getBandingTaskClassId());
|
|
|
- setCreateUserId(createUserId);
|
|
|
- setStatus(0);
|
|
|
- if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
- setStatus(1);
|
|
|
- }
|
|
|
- }}
|
|
|
- );
|
|
|
- }
|
|
|
- if(!dataList.isEmpty()){
|
|
|
- this.saveBatch(dataList);
|
|
|
- }
|
|
|
+ if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
+ BaseClass aClass = classService.getById(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)
|
|
|
- );
|
|
|
+ BandingTaskClass taskClass = taskClassMapper.selectOne(
|
|
|
+ new QueryWrapper<BandingTaskClass>().lambda()
|
|
|
+ .eq(BandingTaskClass::getBaseClassId, aClass.getId())
|
|
|
+ );
|
|
|
|
|
|
- if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
+ for (Long newStudentId : dto.getNewStudentIds()) {
|
|
|
+ dataList.add(
|
|
|
+ new BandingTaskClassStudent(){{
|
|
|
+ setCreateDate(new Date());
|
|
|
+ setNewStudentId(newStudentId);
|
|
|
+ setBandingTaskClassId(taskClass.getId());
|
|
|
+ setCreateUserId(createUserId);
|
|
|
+ setStatus(0);
|
|
|
+ if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
+ setStatus(1);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
BaseSemester semester = semesterService.getCurrentSemester();
|
|
|
List<StudentReportPlan> planList = reportPlanService.list(
|
|
@@ -158,7 +158,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
);
|
|
|
|
|
|
for (StudentReportPlan plan : planList) {
|
|
|
- for (Long newStudentId : studentIds) {
|
|
|
+ for (Long newStudentId : dto.getNewStudentIds()) {
|
|
|
StudentReportRecord record = new StudentReportRecord();
|
|
|
record.setCreateDate(new Date());
|
|
|
record.setCreateUserId(StpUtil.getLoginIdAsLong());
|
|
@@ -291,6 +291,24 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
if(!updateList.isEmpty()){
|
|
|
newStudentService.updateBatchById(updateList);
|
|
|
}
|
|
|
+ for (Long newStudentId : dto.getNewStudentIds()) {
|
|
|
+ dataList.add(
|
|
|
+ new BandingTaskClassStudent(){{
|
|
|
+ setCreateDate(new Date());
|
|
|
+ setNewStudentId(newStudentId);
|
|
|
+ setBandingTaskClassId(dto.getBandingTaskClassId());
|
|
|
+ setCreateUserId(createUserId);
|
|
|
+ setStatus(0);
|
|
|
+ if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
|
|
|
+ setStatus(1);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!dataList.isEmpty()){
|
|
|
+ this.saveBatch(dataList);
|
|
|
}
|
|
|
return true;
|
|
|
}
|