|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
@@ -27,6 +28,7 @@ import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
|
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo;
|
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
|
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassVo;
|
|
|
+import com.xjrsoft.module.room.entity.RoomBed;
|
|
|
import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@@ -138,6 +140,8 @@ public class BandingTaskClassController {
|
|
|
public RT<Boolean> update(@Valid @RequestBody List<UpdateBandingClassDto> dtoList){
|
|
|
List<BandingTaskClass> insList = new ArrayList<>();
|
|
|
List<BandingTaskClass> updList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<BandingTaskClass> updNullList = new ArrayList<>();
|
|
|
List<String> errorList = new ArrayList<>();
|
|
|
for (UpdateBandingClassDto dto : dtoList) {
|
|
|
if(dto.getSortCode() != null){
|
|
|
@@ -155,16 +159,24 @@ public class BandingTaskClassController {
|
|
|
BandingTaskClass bandingTask = BeanUtil.toBean(dto, BandingTaskClass.class);
|
|
|
if(bandingTask.getId() != null){
|
|
|
bandingTask.setModifyDate(new Date());
|
|
|
- updList.add(bandingTask);
|
|
|
+ if(bandingTask.getSortCode() == null){
|
|
|
+ updNullList.add(bandingTask);
|
|
|
+ }else{
|
|
|
+ updList.add(bandingTask);
|
|
|
+ }
|
|
|
}else{
|
|
|
bandingTask.setCreateDate(new Date());
|
|
|
insList.add(bandingTask);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
if(!errorList.isEmpty()){
|
|
|
return RT.error(errorList.toString().replace("[", "").replace("]", "") + ",分班排序重复");
|
|
|
}
|
|
|
+
|
|
|
+ if(!updNullList.isEmpty()){
|
|
|
+ bandingTaskClassService.updateNull(updNullList);
|
|
|
+ }
|
|
|
+
|
|
|
boolean saveBatch = bandingTaskClassService.saveBatch(insList);
|
|
|
boolean isSuccess = bandingTaskClassService.updateBatchById(updList);
|
|
|
return RT.ok(isSuccess);
|